feat: delete DOProvider.Apply v1 wrapper; release v1.4.0 (Phase 3)#124
Conversation
DOProvider.Apply was dead code post-Phase-2.5 v2 cutover (DO declares ComputePlanVersion=v2; wfctl routes via wfctlhelpers.ApplyPlanWithHooks + IaCProviderFinalizer.FinalizeApply, bypassing this method). Method body replaced with sentinel-error stub returning ErrApplyV1Removed for diagnostic classification. interfaces.IaCProvider contract preserved per ADR 0024 — clean deletion not viable without breaking all 4 plugins simultaneously; interface segregation deferred to separate refactor design (filed as followup tracking issue). deferredUpdater interface relocated from provider.go to iacserver.go (sole consumer is FinalizeApply); preserves Go-level type clarity. provider_deferred_test.go deleted — regression coverage migrated to iacserver_finalize_test.go per Phase 2.5 T8 quality-review verdict. Eliminates FinalizeApply-vs-Apply deferred-flush loop duplication Copilot flagged on PR #123 (workflow#695 Phase 2.5). Scope extension (team-lead authorized): delete 11 pre-existing v1 Apply tests across provider_apply_test.go + provider_test.go that exercise the now-deleted v1 wrapper dispatch behavior. Equivalent coverage preserved at wfctlhelpers.ApplyPlan tests + internal/drivers/*_test.go per-driver tests + iacserver_finalize_test.go (Phase 2.5 T8). Helper types relocated to internal/deferred_test_helpers_test.go for use by remaining tests. Closes workflow#695 followup item 'Phase 3: delete DOProvider.Apply v1 wrapper'. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
iac-codemod refactor-apply reportMode: dry-run Missing action-switch — hand-port required
Full report (90-day retention) attached as workflow artifact. |
There was a problem hiding this comment.
Pull request overview
This PR completes the Phase 3 cleanup by removing the legacy v1 DOProvider.Apply implementation and replacing it with a sentinel-error stub while keeping v2 deferred-update finalization on the typed IaC server path.
Changes:
- Bumps plugin metadata and release URLs to v1.4.0.
- Replaces
DOProvider.ApplywithErrApplyV1Removed. - Moves deferred-update test fixtures into a shared test helper file and removes v1 Apply tests.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
plugin.json |
Updates plugin version and release asset URLs to v1.4.0. |
internal/provider.go |
Removes wfctlhelpers Apply wrapper and adds the v1-removed sentinel stub. |
internal/iacserver.go |
Relocates the deferredUpdater interface near FinalizeApply. |
internal/provider_test.go |
Removes legacy v1 Apply coverage and now-unused helpers/imports. |
internal/provider_deferred_test.go |
Deletes v1 deferred-flush Apply tests. |
internal/provider_apply_test.go |
Deletes legacy v1 Apply dispatch tests. |
internal/provider_apply_stub_test.go |
Adds sentinel-error coverage for the new Apply stub. |
internal/deferred_test_helpers_test.go |
Adds shared deferred-update fixtures for FinalizeApply tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // invariant: DOProvider.Apply is dead code post-Phase-2.5 v2 cutover; | ||
| // reaching it indicates a misconfigured caller. Method returns sentinel | ||
| // ErrApplyV1Removed; callers can errors.Is for diagnostic classification. | ||
| // Per workflow#695 Phase 3 cleanup + docs/plans/2026-05-17-phase2.5-cleanup-bundle.md. |
| // (docs/plans/2026-05-17-phase2.5-cleanup-bundle.md Task 5) — the | ||
| // fixtures themselves remain in-package so the v2-dispatch tests | ||
| // continue to exercise the canonical DatabaseDriver mock surface |
Copilot review acknowledgementBoth inline comments flag cross-repo doc-path references in test godocs ( Defensible cross-repo provenance pattern: Phase 2.5 cascade (PR #123) used the same cross-repo design-doc breadcrumb in iacserver_finalize_test.go. The path is stable because design docs are LOCKED at scope-lock time (this one sha256 19b0c80e0620 per workflow repo). Removing or qualifying the path loses the audit trail for why the test exists. Tracked + accepted by internal code-reviewer as advisory Minor (waivable). Per Phase 2.5 precedent, prefer cross-repo path with full provenance over symbol-only refs that lose the cascade context. CI green; admin-merging. |
Summary
Phase 3 of workflow#695 cascade closeout cleanup. Resolves Copilot's PR #123 finding about FinalizeApply-vs-Apply deferred-flush loop duplication.
Why minor (v1.4.0) not patch
Observable behavior change:
DOProvider.Applynow returnsErrApplyV1Removedsentinel instead of v1-dispatch result. No real-world callers exist (verified via grep post-Phase-2.5 closeout); semver convention treats behavioral change as minor.Design
Per docs/plans/2026-05-17-phase2.5-cleanup-bundle-design.md (in workflow repo): sentinel-error stub preserves interfaces.IaCProvider contract per ADR 0024. Clean deletion not viable without breaking interface for all 4 plugins simultaneously; interface segregation (split Apply off into LegacyApplier) deferred to separate workflow-side refactor design (followup tracking issue to be filed post-cascade).
Changes
internal/provider.go: delete deferredUpdater interface + v1 wrapper body; add ErrApplyV1Removed sentinel; replace Apply body with stub returning sentinelinternal/iacserver.go: relocate deferredUpdater named interface near FinalizeApply method (sole consumer)internal/provider_apply_stub_test.go(new): TestDOProvider_Apply_ReturnsRemovedError uses errors.Is for sentinel classificationinternal/deferred_test_helpers_test.go(new): helpers (minimalDBMock, fakeAppForDeferred, sequencedAppsForDeferred) relocated from deleted provider_deferred_test.go; consumed by iacserver_finalize_test.go (Phase 2.5 T8 regression)internal/provider_deferred_test.goDELETED: regression migrated to iacserver_finalize_test.go (Phase 2.5 T8)internal/provider_apply_test.go+internal/provider_test.go(team-lead-authorized scope extension): delete 11 pre-existing v1 Apply tests that exercise the now-deleted v1 wrapper. Equivalent coverage preserved at wfctlhelpers/apply*_test.go + internal/drivers/*_test.go + iacserver_finalize_test.go.plugin.json: version 1.3.0 → 1.4.0Test plan
go build ./...→ cleango vet ./...→ cleango test ./internal/ -run TestDOProvider_Apply_ReturnsRemovedError -v→ PASSgo test ./... -race -count=1→ 6 packages PASS race-cleanRollback
Revert PR. Restores v1.3.0 state (Apply v1 body + deferredUpdater in provider.go + provider_deferred_test.go + 11 v1 Apply tests). Cut v1.4.1 reverting whichever change broke. Per ADR 0024 hard-cutover discipline.
If real in-process embedder surfaces: cut v1.4.1 with deprecation warning instead of sentinel error.