Skip to content

acc: push replayed terraform state with API calls, not the CLI - #8193

Merged
denik merged 2 commits into
mainfrom
denik/replay-tfstate-api
Nov 30, 2026
Merged

denik merged 2 commits into
mainfrom
denik/replay-tfstate-api

Conversation

@denik

@denik denik commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Changes

acceptance/bin/replay_tfstate.py now pushes the remote copy of the replayed terraform state with its own api() helper (POST /api/2.0/workspace/mkdirs and POST /api/2.0/workspace/import), instead of running $CLI workspace mkdirs and $CLI workspace import. It sends the same two requests, so no goldens change.

Why

The script sets up state for a test; it isn't the CLI under test. All of its other calls already go to the API directly, and these two were the only ones that went through the CLI. This is a prep step for #8133, which injects backend errors into the CLI's requests. Setup that the CLI performs would get those faults too, and the script does not retry.

Tests

All 51 acceptance test dirs that use the script pass locally (bundle/migrate, bundle/invariant/{migrate,auto-migrate}, bundle/config-remote-sync/terraform_state, bundle/state/state_present), with unchanged goldens.

This pull request and its description were written by Isaac.

Co-authored-by: Isaac <no-reply@databricks.com>
@denik
denik requested a review from a team as a code owner November 30, 2026 10:24
@github-actions github-actions Bot added the test-only-fix PRs that update failing of flaky tests without changing CLI code. label Nov 30, 2026

@review-oss-bot review-oss-bot 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.

Automated review at 095490d. Each finding was verified against the code.

No blocking issues found. 2 non-blocking comment(s) below.

This PR swaps $CLI workspace mkdirs/import in replay_tfstate.py for direct api() calls, so setup doesn't pick up the backend faults that #8133 injects into the CLI's requests. The new calls match the old ones: parent mkdirs, base64 content, AUTO format and overwrite. The goal isn't fully reached, though. When no sync snapshot exists, print_state.get_remote_state_path still falls back to running $CLI bundle validate. It's also worth noting in a comment why these two calls bypass the CLI.

Comment thread acceptance/bin/replay_tfstate.py Resolved
Comment thread acceptance/bin/replay_tfstate.py Resolved
Co-authored-by: Isaac <no-reply@databricks.com>
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 36ee722

Run: 46401291347

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 173 17 2:30
💚​ aws-windows-latest-4core-16gb 1 173 17 2:24
💚​ azure linux-2core-8gb 1 172 17 2:41
💚​ azure-windows-latest-4core-16gb 1 172 17 2:38
💚​ gcp linux-2core-8gb 1 173 17 2:35
💚​ gcp-windows-latest-4core-16gb 1 173 17 3:04
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:02 gcp-windows-latest-4core-16gb TestAccept
2:36 azure-windows-latest-4core-16gb TestAccept
2:23 aws-windows-latest-4core-16gb TestAccept

@denik
denik added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit 622beea Nov 30, 2026
27 checks passed
@denik
denik deleted the denik/replay-tfstate-api branch November 30, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test-only-fix PRs that update failing of flaky tests without changing CLI code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants