Conversation
When the direct engine is requested (the default) and the existing state uses terraform, convert it to a direct-engine state in memory before planning (OpenMigratedTerraformState) and deploy on direct. The deploy's normal Finalize commits resources.json only if it records changes; terraform.tfstate (local + remote) is backed up only then. The terraform engine is unchanged and still used for an explicit "engine: terraform" opt-in; the post-deploy dry-run migration is removed. Golden regeneration for the migrate tests is pending. Co-authored-by: Isaac <no-reply@databricks.com>
…gelog Co-authored-by: Isaac <no-reply@databricks.com>
Collaborator
Integration test reportCommit: 47ab384
Top 3 slowest tests (at least 2 minutes):
|
Plan-check the converted state before committing; on failure, warn and deploy on terraform this time (no commit). Update the auto-migrate-direct-only titles to the new behavior (plan/deploy now create the direct-only resource via the in-memory migration). Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Empty/direct env on a terraform state now migrates to direct before planning, so those steps run on the direct engine (not terraform). Update the user-agent assertions and comments, and ignore .databricks (migration writes state files). Co-authored-by: Isaac <no-reply@databricks.com>
…aformState Call MigrateToDirect before plan/deploy and re-resolve state afterwards, instead of a separate in-memory reimplementation. On a failed migration plan check it warns and leaves terraform state intact, so the run falls back to the terraform engine. Remove the //deadcode:allow markers (all helpers are reachable now) and regenerate the migrate/state/resource_deps/telemetry goldens. Co-authored-by: Isaac <no-reply@databricks.com>
The prior regen baked a script failure (rm of an already-backed-up terraform.tfstate) into the golden. state_present will be reworked once the bundle-plan migration behavior is decided. Co-authored-by: Isaac <no-reply@databricks.com>
…MigrateToDirect MigrateTerraformState converts terraform state to direct and opens the state DB: in memory for plan (no writes/pushes), and committing on deploy (resources.json written+pushed, terraform.tfstate backed up) after a plan check that falls back to terraform on failure. Delete the post-deploy MigrateToDirect and its dry-run telemetry helpers (no longer used); no deadcode markers. Co-authored-by: Isaac <no-reply@databricks.com>
…it migration Co-authored-by: Isaac <no-reply@databricks.com>
… for pre-deploy migration Empty/direct-env plan migrates in memory (no commit) so it runs on direct without backing up terraform.tfstate; deploy migrates and commits. Update state_present user-agent assertions/comments and ignore .databricks. Co-authored-by: Isaac <no-reply@databricks.com>
…igation The empty-env 'bundle plan' runs on terraform, not direct, contradicting the in-memory-migrate-on-plan design; -update baked that assertion failure into the golden. state_present is reverted to main pending a proper fix of the plan path. Co-authored-by: Isaac <no-reply@databricks.com>
…esent PullResourcesState set the user-agent engine tag from the terraform state file; after migrating in memory to direct, update it to engine/direct so requests reflect the engine actually running. Rework state_present: empty/direct-env plan now runs on direct (in-memory migration, no commit), the explicit terraform deploy stays on terraform, and the post-migration serial is 6 (one fewer write than the old post-deploy migration). Co-authored-by: Isaac <no-reply@databricks.com>
Migrating deploys/plans now report engine/direct in the user-agent (matching the engine actually running), so regenerate migrate/state/resource_deps/telemetry/ user_agent/snapshot-comparison goldens. Co-authored-by: Isaac <no-reply@databricks.com>
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.
Moves the terraform→direct state migration to run in memory before plan/deploy instead of after a terraform deploy. This makes the terraform engine unnecessary for the default path (it is still used for an explicit
engine: terraformopt-in). The terraform-engine removal is stacked on top of this PR.WIP: migrate-test golden regeneration pending.
This pull request and its description were written by Isaac.