Skip to content

feat(terraform): migrate legacy utility module calls - #254

Merged
Jared Holgate (jaredfholgate) merged 7 commits into
mainfrom
jaredholgate-microsoft-utility-module-migration
Oct 17, 2026
Merged

Jared Holgate (jaredfholgate) merged 7 commits into
mainfrom
jaredholgate-microsoft-utility-module-migration

Conversation

@jaredfholgate

@jaredfholgate Jared Holgate (jaredfholgate) commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Summary

Add a fixed, one-off authored utility-module migration before telemetry updates. Upgrade older exact Regions pins to 0.13.0 and Interfaces pins to 0.9.0; equal/newer pins remain unchanged. Match registry sources rather than block labels, and do not rewrite downloaded dependencies or unrelated custom modules.

Convert Azure/naming/azurerm to Azure/avm-utl-naming/azure 0.2.0 in modern mode. Omit legacy_mode when absent, or set an existing old-source flag to false. Existing AVM naming calls keep their owner-selected versions and modes. Preserve labels and compatible inputs; the utility's supported named output aliases remain valid, so caller output references do not require rewriting. Generated names and random seeds may change: review plans for resource replacements. This is not a name/state-continuity guarantee or an automatic latest-release updater.

Migration and telemetry safeguards

  • Refresh dependency evidence before provider/mock cleanup. Remove obsolete ModTM bindings and mocks only when proven unused; preserve genuine ModTM dependencies, non-telemetry Random use, authored locations/opt-outs and intentional removed blocks with destroy = false.
  • Supply missing utility locations from an independent input, never from the same Regions call's outputs.
  • Generate deterministic telemetry bytes using native ordering mechanisms. Preserve owner-authored headers/helper locals and unrelated declarations.
  • Use the pinned MaPoTF 0.4.1; preserve checksum and package controls.

Test structure and mock boundary

Replace repeated fixture-native matrices with Unit/Component decision and filesystem coverage. Public Terraform acceptance now has 2 AzAPI cases and 1 AzureRM case, rather than 318/326 selected cases per fixture. Native compatibility runs once per OS, and 5 package/download/bootstrap cases run separately.

The initial retained Native set was 35; two approved deterministic-generation/owner-preservation regressions and one built-in mock capability case bring the final total to 38, not another exhaustive decision table.

Retained compatibility cluster Cases Contract requiring the real tool
Telemetry generation, retirement, source classification and bounds 15 Actual MaPoTF/HCL rendering, token preservation and Terraform evaluation; bounded clock/update composition
Built-in provider mock selection 1 Terraform mock inheritance through root and mapped local-child configurations, with fail-closed negatives
Provider constraints and schema selection 9 Native semver/transform behavior and selective loading of actual provider schemas
Module calls, test-file tokens and sibling-module linting 5 Native module/test parsing, exact edits and TFLint path resolution
Dependency-inspection cache 1 Real downloaded dependency reuse and native revalidation
Modern naming 1 Published utility renderer, deprecated named aliases and owner-selected AVM modes
Metadata and invalid configuration 2 Native reader/diagnostic behavior and unchanged provider-free plan semantics
Plan evidence and provider registration 4 Actual saved-plan data layout and AzureRM 3/4 plus AzAPI schema/validation behavior

Acceptance and qualification explicitly mock Terraform's built-in provider as well as every other required provider. Source/default-mock/complete-run-map proof runs immediately before the real test process, per selected target; provider-free setup targets do not receive unrelated bindings. Public initialization and test execution remain real. Runtime credentials are cleared and HTTP proxies/ModTM endpoints are loopback-only. Network isolation does not permit real-provider applies.

The repeat-update case is bounded compositional proof, not unmodified end-to-end or ALZ runtime qualification: guard the generated plantimestamp() expression and file hashes; obtain two ordered timestamps from provider-free native plans; override only that clock dependency; preserve the original name-stability/apply-ID assertions; require exact native update actions and no-op for other managed resources. No provisioner/local-exec or real-provider apply is used.

Validation for cec0fe928bdd1943be7ff9705d2e1123bcbd5f34

  • Full ./build.ps1 pre-commit: passed, 20m27s; Component 2,151 passed with two existing skips.
  • Eight pure clock-override/negative guards: passed separately after delivery of the clock slice.
  • Full ./build.ps1 qualification -QualificationGroup Native: 38 passed, zero failed/skipped, 6m49s locally.
  • Guarded local public acceptance: exact migration golden, two full public pre-commit byte checks per fixture, and 4/2/4 mocked consumer runs passed. Existing authored inputs/assertions were preserved.
  • Authenticated public pr-check was not reported as passed locally: OIDC credentials were unavailable. Exact-head Authoring CI, including mandatory Ubuntu coverage, Package qualification, Repos CI, and Workflow CI subsequently completed successfully.
  • Successful current-head Windows job wall times: AzAPI acceptance 4m37s, AzureRM acceptance 2m30s, Native compatibility 3m50s, and separate package qualification 1m55s. These are parallel job durations, not summed pipeline time.
  • The earlier Windows instrumentation-only coverage attempt was not a passing result and was not re-run; it is not the mandatory coverage leg or a substitute for Ubuntu CI evidence.

No deployments, real-provider applies, telemetry-collector calls, releases, or changes to user-owned module checkouts were performed for this correction. The pull request remains subject to normal review and explicit merge/release authorization.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Workflow test results

  1 files  ±0   32 suites  ±0   3s ⏱️ -2s
148 tests +1  148 ✅ +1  0 💤 ±0  0 ❌ ±0 
149 runs  +1  149 ✅ +1  0 💤 ±0  0 ❌ ±0 

Results for commit cec0fe9. ± Comparison against base commit 84d681e.

This pull request removes 1 and adds 2 tests. Note that renamed tests count towards both.
Independent CI workflows.preserves only the existing authoring unit, component and integration matrices
Independent CI workflows.preserves cross-platform acceptance and separates native compatibility from fixture matrices
Independent CI workflows.qualifies packages on relevant changes without Azure access or a module fixture matrix

♻️ This comment has been updated with latest results.

@github-code-quality

github-code-quality Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: PowerShell

PowerShell / code-coverage-agent

main 84d681e jaredholgate-microso... cec0fe9 +/-
76% 76% 0%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated October 16, 2026 20:53 UTC

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Repository test results

    8 files  ±0    376 suites  ±0   8m 51s ⏱️ -43s
1 725 tests ±0  1 723 ✅ ±0  2 💤 ±0  0 ❌ ±0 
1 824 runs  ±0  1 822 ✅ ±0  2 💤 ±0  0 ❌ ±0 

Results for commit cec0fe9. ± Comparison against base commit 84d681e.

This pull request removes 62 and adds 59 tests. Note that renamed tests count towards both.
Configured repository-sync bot identity.rejects missing or invalid configuration before it can be used("","configured-bot[bot]","*AVM_APP_BOT_USER_ID*")
Configured repository-sync bot identity.rejects missing or invalid configuration before it can be used("0","configured-bot[bot]","*AVM_APP_BOT_USER_ID*")
Configured repository-sync bot identity.rejects missing or invalid configuration before it can be used("12345","","*AVM_APP_BOT_LOGIN*")
Configured repository-sync bot identity.rejects missing or invalid configuration before it can be used("12345","configured
Configured repository-sync bot identity.rejects missing or invalid configuration before it can be used("abc","configured-bot[bot]","*AVM_APP_BOT_USER_ID*")
Error: Apply interrupted")
Get-AvmPrReviewerRoutingEligibility.rejects substituted and ambiguous team permission responses("Azure/other",True)
Get-AvmPrReviewerRoutingEligibility.rejects substituted and ambiguous team permission responses("Azure/terraform-azure-avm-res-storage-storageaccount","true")
Get-AvmPrReviewerRoutingEligibility.rejects substituted and ambiguous team permission responses("Azure/terraform-azure-avm-res-storage-storageaccount",null)
GraphQL: another error
…
Configured repository-sync bot identity.rejects missing or invalid configuration before it can be used("*AVM_APP_BOT_LOGIN*","12345","")
Configured repository-sync bot identity.rejects missing or invalid configuration before it can be used("*AVM_APP_BOT_LOGIN*","12345","configured
bot[bot]")
Configured repository-sync bot identity.rejects missing or invalid configuration before it can be used("*AVM_APP_BOT_USER_ID*","","configured-bot[bot]")
Configured repository-sync bot identity.rejects missing or invalid configuration before it can be used("*AVM_APP_BOT_USER_ID*","0","configured-bot[bot]")
Configured repository-sync bot identity.rejects missing or invalid configuration before it can be used("*AVM_APP_BOT_USER_ID*","abc","configured-bot[bot]")
Get-AvmPrReviewerRoutingEligibility.rejects substituted and ambiguous team permission responses("true","Azure/terraform-azure-avm-res-storage-storageaccount")
Get-AvmPrReviewerRoutingEligibility.rejects substituted and ambiguous team permission responses(True,"Azure/other")
Get-AvmPrReviewerRoutingEligibility.rejects substituted and ambiguous team permission responses(null,"Azure/terraform-azure-avm-res-storage-storageaccount")
Guarded nonsecret Bicep variable publication.detects drift at complete and final readback with or without preceding writes(0,2,"complete execution-value readback")
Guarded nonsecret Bicep variable publication.detects drift at complete and final readback with or without preceding writes(0,3,"final publication readback")
…

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Authoring test results

    31 files  + 12   2 541 suites  +243   1h 32m 0s ⏱️ + 31m 23s
 4 297 tests +178   4 291 ✅ +178   6 💤 ±0  0 ❌ ±0 
13 047 runs  +882  12 995 ✅ +882  52 💤 ±0  0 ❌ ±0 

Results for commit cec0fe9. ± Comparison against base commit 84d681e.

This pull request removes 330 and adds 493 tests. Note that renamed tests count towards both.

  - a
  - b
  module { source = "./setup" }
  providers = { modtm = modtm }
 length (
 random_uuid.telemetry 
")
"dependency"")
"dependency"","./unscanned-child")
…
Acceptance: packaged Terraform commands.terraform-azure-avm-res-mock.keeps canonical bytes unchanged on both public pre-commit runs and full pr-check
Acceptance: packaged Terraform commands.terraform-azurerm-avm-res-mock.keeps canonical bytes unchanged on both public pre-commit runs and full pr-check
Acceptance: packaged utility migration.produces reviewed legacy upgrades once, then keeps all bytes on the second public pre-commit and pr-check
Bicep PSRule policy checks.reports known compiler failures verbatim and hides unexpected ones("The pinned Bicep compiler could not be resolved.","other")
Bicep PSRule policy checks.reports known compiler failures verbatim and hides unexpected ones("bicep pin is missing","tool")
Bicep e2e static deployment isolation.rejects nested deployments with unsafe modes, scopes or parameters("*outside its resource group*","schema","foreign schema")
Bicep e2e static deployment isolation.rejects nested deployments with unsafe modes, scopes or parameters("*uninspectable nested deployment parameters*","parameters","linked parameters")
Bicep e2e static deployment isolation.rejects nested deployments with unsafe modes, scopes or parameters("*unsafe nested deployment mode or property*","rollback","unreviewed rollback")
Bicep e2e static deployment isolation.rejects nested deployments with unsafe modes, scopes or parameters("*unsafe nested deployment mode*","dynamic","dynamic mode")
Bicep e2e static deployment isolation.rejects nested deployments with unsafe modes, scopes or parameters("*unsafe nested deployment mode*","mode","complete mode")
…

♻️ This comment has been updated with latest results.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Package qualification results

 3 files  15 suites   2m 38s ⏱️
 5 tests  5 ✅ 0 💤 0 ❌
15 runs  15 ✅ 0 💤 0 ❌

Results for commit cec0fe9.

♻️ This comment has been updated with latest results.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Require source-proven provider mocks, including the built-in provider, before acceptance and native test execution. Preserve the real public initialization and test paths.

Replace provisioner timing with bounded compositional native clock proof and exact update-action, source-hash and output assertions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant