Repository navigation
acc: push replayed terraform state with API calls, not the CLI - #8193
Merged
Merged
Conversation
Co-authored-by: Isaac <no-reply@databricks.com>
There was a problem hiding this comment.
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.
Co-authored-by: Isaac <no-reply@databricks.com>
Collaborator
✅ Integration test reportCommit: 36ee722
Top 3 slowest tests (at least 2 minutes):
|
andrewnester
approved these changes
Nov 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
acceptance/bin/replay_tfstate.pynow pushes the remote copy of the replayed terraform state with its ownapi()helper (POST /api/2.0/workspace/mkdirsandPOST /api/2.0/workspace/import), instead of running$CLI workspace mkdirsand$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.