Skip to content

Remove disabled WhatIf ARM checker and its leftover config fields - #304

Merged
Mani Bindra (maniSbindra) merged 1 commit into
mainfrom
refactor/38-cleanup-armtemplateshared
Aug 6, 2026
Merged

Remove disabled WhatIf ARM checker and its leftover config fields#304
Mani Bindra (maniSbindra) merged 1 commit into
mainfrom
refactor/38-cleanup-armtemplateshared

Conversation

@bgdnext64

Copy link
Copy Markdown
Collaborator

Removes the legacy WhatIf authorization checker and the config it relied on, now that full deployment is the only supported mode for ARM and Bicep.

WhatIf mode was disabled some time ago (see the "whatif mode has been disabled" note in armCmd.go/bicepCmd.go), so ARMTemplateWhatIf/armTemplateWhatIfAuthorizationChecker.go is dead code — nothing in the active build path imports it, only commented-out blocks in the e2e tests referenced it.

Changes:

  • Deleted the ARMTemplateWhatIf package (the disabled checker).
  • Removed the SubscriptionScoped and Location fields from ArmTemplateAdditionalConfig. These were only ever read by the WhatIf path (subscription-scoped deployments and the WhatIf deployment location). The full-deployment checker derives the resource group location from MPFConfig.ResourceGroup, so nothing else depended on them.
  • Dropped the now-unused Location: flgLocation assignments in armCmd.go and bicepCmd.go (the --location flag still drives the resource group location as before).
  • Updated docs/mpf-design.md to point at ARMTemplateDeployment/armTemplateAuthorizationChecker.go, which is the checker that actually implements DeploymentAuthorizationCheckerCleaner for ARM/Bicep.

The shared ArmTemplateAdditionalConfig, ErrInvalidTemplate, and GetParametersInStandardFormat in ARMTemplateShared remain, since the full-deployment checker still uses them.

Verified with go build ./..., go vet ./... ./e2eTests/..., and go test ./cmd/... ./pkg/... (all green).

Fixes #38

Whatif mode was disabled a while back in favor of full deployment mode,
so the ARMTemplateWhatIf checker is dead code now. Drop it along with the
SubscriptionScoped and Location fields on ArmTemplateAdditionalConfig that
only the whatif path ever read, and point the design doc at the deployment
checker that actually implements the interface for ARM/Bicep.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the legacy (disabled) ARM/Bicep WhatIf authorization checker and trims the shared ARM template config down to only the fields used by the active full-deployment authorization checker.

Changes:

  • Deleted the unused ARMTemplateWhatIf authorization checker implementation.
  • Removed Location and SubscriptionScoped from ARMTemplateShared.ArmTemplateAdditionalConfig and updated command wiring accordingly.
  • Updated design documentation to reference the active ARM/Bicep deployment checker implementation.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/infrastructure/authorizationCheckers/ARMTemplateWhatIf/armTemplateWhatIfAuthorizationChecker.go Removes dead WhatIf checker code now that WhatIf mode is disabled.
pkg/infrastructure/ARMTemplateShared/armTemplateShared.go Simplifies ArmTemplateAdditionalConfig by removing fields only used by the removed WhatIf path.
docs/mpf-design.md Updates design doc to point to the active ARM/Bicep deployment checker implementation.
cmd/bicepCmd.go Stops populating removed ArmTemplateAdditionalConfig.Location; --location continues to drive RG location.
cmd/armCmd.go Stops populating removed ArmTemplateAdditionalConfig.Location; --location continues to drive RG location.

@maniSbindra
Mani Bindra (maniSbindra) added this pull request to the merge queue Aug 6, 2026
Merged via the queue into main with commit 20c45be Aug 6, 2026
18 checks passed
@maniSbindra
Mani Bindra (maniSbindra) deleted the refactor/38-cleanup-armtemplateshared branch August 6, 2026 07:08
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.

Cleanup legacy ARMTemplateShared package

3 participants