Fix ArgoTieredCaching state upgrade#1581
Conversation
There was a problem hiding this comment.
No actionable issues found.
Reviewed by Internal Trusted PR Reviewer
To install this agentic workflow, run
gh aw add pulumi-labs/gh-aw-internal/.github/workflows/gh-aw-pr-review.md@8a92f53fac170563f7727cacab2dbedb5d5b9e29
Does the PR have any schema changes?Looking good! No breaking changes found. Maintainer note: consult the runbook for dealing with any breaking changes. |
Treat old Pulumi-shaped ArgoTieredCaching state as the current upstream schema version so the provider does not run the legacy Terraform cloudflare_argo migration path that expects tiered_caching. Add non-live regression coverage for v6.12-shaped state and guard the hardcoded schema-version workaround against future upstream bumps. Co-authored-by: Codex <noreply@openai.com>
guineveresaenger
left a comment
There was a problem hiding this comment.
This looks good to me. We've got a few other reminder-style tests so this is a good guard.
I am worried that there's other resources with the same or similar issue. :( would be nice if we could detect that sooner. Interesting it replicates upstream...
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1581 +/- ##
==============================
==============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This PR has been shipped in release v6.16.0. |
Summary
ArgoTieredCachingstate{value, zoneId}schema-version-0 state as upstream schema version 500 so the legacycloudflare_argomigration is skippedFixes #1575
Background
cloudflare_argo_tiered_cachinghas an upstream Terraform migration edge case across these provider versions. State created by the older v5 provider can remain at schema version 0. Newer upstream versions now interpret schema version 0 for this resource as legacycloudflare_argostate and run a migration that expects the oldtiered_cachingfield.That is not the shape Pulumi wrote for
cloudflare:index/argoTieredCaching:ArgoTieredCaching. Pulumi-created state from v6.12 already has the current resource shape, usingvalueandzoneId, but lacks the newer upstream schema-version marker. On a direct upgrade to newer provider versions, upstream's legacy migration sees schema version 0, looks fortiered_caching, and fails.We confirmed the same direct-upgrade issue exists in Terraform: the upstream acceptance harness succeeds when it steps through an intermediate provider version, but a direct published-provider upgrade reproduces the
tiered_caching attribute is requiredfailure. So this is not Pulumi failing to run a migration; it is the direct upstream upgrade path requiring an intermediate schema bump.Approach
This PR works around the issue locally for Pulumi-created state. The hook only applies when all of these are true:
valueandzoneIdtiered_cachingFor that narrow shape, the hook returns schema version 500 unchanged. That tells the Terraform Framework provider the state is already at the current
cloudflare_argo_tiered_cachingschema and avoids running the wrong legacycloudflare_argomigration. Legacy Terraform-shaped state is intentionally left alone.Risk
The main risk is future upstream drift. The hook hardcodes schema version 500 because that is the current upstream schema version for this resource. A reminder test fails if upstream bumps this resource's schema version so we revisit whether the hook should change or be removed.
Testing
cd provider && mise exec -- go test . -run 'TestArgoTieredCaching' -count=1