feat(iac): workflow#640 Phase 5 — remove legacy wfctlhelpers.ApplyPlan#743
Conversation
Per docs/migrations/2026-05-16-v2-lifecycle-phase1-inventory.md. Phase 1 (PR #691) + Phase 2 (PR #694) + Phase 2.5 (PR #697) + Phase 3 (per-plugin migration) all shipped. Production code has been on ApplyPlanWithHooks for weeks. This PR closes the loop by removing the deprecated symbol. Changes: iac/wfctlhelpers/apply.go: - Delete func ApplyPlan (the 2-line wrapper that delegated to applyPlanWithEnvProvider with nil hooks). - Keep applyPlanWithEnvProvider as the postcondition-test seam — retained for apply_postcondition_test.go's panicky-env injection. iac/wfctlhelpers/*_test.go: - 10 test files migrated from `ApplyPlan(ctx, p, plan)` to `ApplyPlanWithHooks(ctx, p, plan, ApplyPlanHooks{})`. Empty-hooks form is semantically identical to the pre-deletion ApplyPlan call. docs/migrations/2026-05-16-v2-lifecycle-phase1-inventory.md: - Phase 5 marker flipped to SHIPPED. Verification: GOWORK=off go test ./... -count=1 (all green) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Removes the legacy iac/wfctlhelpers.ApplyPlan wrapper as part of workflow#640 Phase 5, standardizing all in-repo callers on the v2 action lifecycle entry point (ApplyPlanWithHooks) so action-boundary hook semantics are the only supported apply path going forward.
Changes:
- Deleted deprecated
wfctlhelpers.ApplyPlanand retained only the v2 hook-based apply entry point. - Migrated 10 internal IaC apply test files from
ApplyPlan(...)toApplyPlanWithHooks(..., ApplyPlanHooks{}). - Updated the Phase 1 migration inventory doc to mark Phase 5 as shipped (but needs follow-up wording fixes for consistency).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
iac/wfctlhelpers/apply.go |
Removes legacy ApplyPlan; keeps unexported env-provider seam and updates nearby commentary. |
iac/wfctlhelpers/apply_update_delete_test.go |
Switches tests to ApplyPlanWithHooks(..., ApplyPlanHooks{}). |
iac/wfctlhelpers/apply_test.go |
Switches tests to ApplyPlanWithHooks; one failure message still references ApplyPlan. |
iac/wfctlhelpers/apply_replace_test.go |
Switches tests to ApplyPlanWithHooks; comments/messages still reference ApplyPlan. |
iac/wfctlhelpers/apply_replace_cascade_test.go |
Switches tests to ApplyPlanWithHooks(..., ApplyPlanHooks{}). |
iac/wfctlhelpers/apply_postcondition_test.go |
Switches tests to ApplyPlanWithHooks(..., ApplyPlanHooks{}). |
iac/wfctlhelpers/apply_jit_test.go |
Switches tests to ApplyPlanWithHooks(..., ApplyPlanHooks{}). |
iac/wfctlhelpers/apply_create_test.go |
Switches tests to ApplyPlanWithHooks(..., ApplyPlanHooks{}). |
docs/migrations/2026-05-16-v2-lifecycle-phase1-inventory.md |
Marks Phase 5 as shipped, but has internal wording inconsistencies to resolve. |
Comments suppressed due to low confidence (1)
iac/wfctlhelpers/apply_replace_test.go:241
- The test still refers to the removed ApplyPlan symbol in the explanatory comment and failure message. Please update these references to ApplyPlanWithHooks so future failures/debugging don’t point to a non-existent API.
// ApplyPlan's loop check catches the cancellation at the next
// iteration, but the per-action ctx check inside doReplace
// fires first. Either path yields a per-action error rather
// than a top-level error from this single-action plan.
t.Fatalf("ApplyPlan should not surface top-level error: %v", err)
|
Audit against workflow#640/BMW v2 verification: Follow-up audit items are now addressed on this PR. Verified fixes now present:
BMW consumer-side verification remains represented by the app pinning Workflow/wfctl v0.60-era behavior and using Local verification I ran after these fixes: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
⏱ Benchmark Results✅ No significant performance regressions detected. benchstat comparison (baseline → PR)
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
iac/wfctlhelpers/apply_replace_test.go:242
- This test now calls
ApplyPlanWithHooks, but the inline comment and failure message still refer toApplyPlan. Updating these strings will make failures easier to interpret and avoid confusion now thatApplyPlanno longer exists.
// ApplyPlan's loop check catches the cancellation at the next
// iteration, but the per-action ctx check inside doReplace
// fires first. Either path yields a per-action error rather
// than a top-level error from this single-action plan.
t.Fatalf("ApplyPlan should not surface top-level error: %v", err)
}
Phase 5 of #640. Removes the deprecated ApplyPlan wrapper; migrates 10 test files to ApplyPlanWithHooks. Full suite green.