Skip to content

Fix ArgoTieredCaching state upgrade#1581

Merged
corymhall merged 1 commit into
masterfrom
triage-1575
May 19, 2026
Merged

Fix ArgoTieredCaching state upgrade#1581
corymhall merged 1 commit into
masterfrom
triage-1575

Conversation

@corymhall

@corymhall corymhall commented May 19, 2026

Copy link
Copy Markdown
Member

Summary

  • add a narrow pre-state upgrade hook for old Pulumi-shaped ArgoTieredCaching state
  • mark only {value, zoneId} schema-version-0 state as upstream schema version 500 so the legacy cloudflare_argo migration is skipped
  • add credential-free regression coverage for v6.12-shaped exported state plus a schema-version reminder test

Fixes #1575

Background

cloudflare_argo_tiered_caching has 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 legacy cloudflare_argo state and run a migration that expects the old tiered_caching field.

That is not the shape Pulumi wrote for cloudflare:index/argoTieredCaching:ArgoTieredCaching. Pulumi-created state from v6.12 already has the current resource shape, using value and zoneId, 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 for tiered_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 required failure. 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:

  • the prior schema version is 0
  • the state is already Pulumi/current-shaped, with value and zoneId
  • the state does not contain legacy tiered_caching

For 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_caching schema and avoids running the wrong legacy cloudflare_argo migration. 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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

@github-actions

Copy link
Copy Markdown

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

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>
@corymhall corymhall requested a review from a team May 19, 2026 16:51

@guineveresaenger guineveresaenger 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.

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...

@corymhall corymhall added the needs-release/minor When a PR with this label merges, it initiates a release of vX.Y+1.0 label May 19, 2026
@codecov

codecov Bot commented May 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (acd817d) to head (bbad9a8).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@      Coverage Diff       @@
##   master   #1581   +/-   ##
==============================
==============================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@corymhall corymhall merged commit fbd42ce into master May 19, 2026
23 checks passed
@corymhall corymhall deleted the triage-1575 branch May 19, 2026 17:37
@pulumi-bot

Copy link
Copy Markdown
Contributor

This PR has been shipped in release v6.16.0.

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.

ArgoTieredCaching: state migration rejects every pre-6.13 state with 'tiered_caching attribute is required'

3 participants