Skip to content

Fix: Solution settings checksum final plan inconsistency#1140

Draft
AdamCoulterOz wants to merge 2 commits intomicrosoft:mainfrom
AdamCoulterOz:bug/solution_settings_inconsistent
Draft

Fix: Solution settings checksum final plan inconsistency#1140
AdamCoulterOz wants to merge 2 commits intomicrosoft:mainfrom
AdamCoulterOz:bug/solution_settings_inconsistent

Conversation

@AdamCoulterOz
Copy link
Copy Markdown
Contributor

@AdamCoulterOz AdamCoulterOz commented Apr 8, 2026

What changed

  • stop computing settings_file_checksum during planning when the resource has no prior state
  • leave the checksum unknown on create so Terraform does not lock in a stale file hash before apply
  • add regression coverage for create-time checksum behavior in the plan modifier tests
  • add an unreleased changelog fragment for the fix

Why it changed

powerplatform_solution.settings_file_checksum was being derived from the on-disk file during planning, even on create.

When settings_file points to a generated file that is created or updated earlier in the same apply, Terraform can plan against stale file contents and then apply against different contents. That causes Terraform to fail with an inconsistent final plan.

Impact

This fixes create-time plan/apply divergence for powerplatform_solution resources whose settings_file is produced dynamically during the same Terraform apply.

Fixes #1138.

Validation

  • go test ./internal/modifiers ./internal/services/solution
  • make precommit was run and currently fails on existing repo-wide lint findings already present outside this PR

Checklist

  • dto.go: not applicable, this fix does not change DTOs
  • model.go: not applicable, this fix does not change the resource model
  • api_{name}.go: not applicable, this fix does not change API client behavior
  • resource_{name}.go: not applicable, the bug is in the shared plan modifier used by the resource schema
  • Unit tests: completed in internal/modifiers/sync_attribute_plan_modifier_test.go
  • Acceptance tests: existing happy-path acceptance coverage remains in internal/services/solution/resource_solution_test.go; no new acceptance test was added for this shared modifier fix
  • provider.go and provider_test.go: not applicable, no provider registration changes
  • /examples: not applicable, no user-facing configuration shape changed
  • MarkdownDescription: not applicable, schema docs did not need changes
  • changelog entry: completed with a fixed unreleased changie fragment for #1138
  • make precommit: executed; blocked by existing lint issues outside this PR

@AdamCoulterOz AdamCoulterOz changed the title Fix powerplatform_solution settings checksum final plan inconsistency Fix: Solution settings checksum final plan inconsistency Apr 9, 2026
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.

Bug: powerplatform_solution.settings_file_checksum causes inconsistent final plan

1 participant