Skip to content

WIP new migration#5399

Draft
denik wants to merge 39 commits into
mainfrom
denik/new-migration
Draft

WIP new migration#5399
denik wants to merge 39 commits into
mainfrom
denik/new-migration

Conversation

@denik

@denik denik commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Changes

Why

Tests

@denik denik temporarily deployed to test-trigger-is June 1, 2026 15:27 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 1, 2026 15:27 — with GitHub Actions Inactive
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 64dfb18

Run: 27713977194

Env ❌​FAIL 🟨​KNOWN 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
🟨​ aws linux 7 14 264 1010 7:10
🟨​ aws windows 7 14 266 1008 12:13
💚​ aws-ucws linux 7 14 360 924 7:50
💚​ aws-ucws windows 7 14 362 922 7:55
❌​ azure linux 2 1 1 16 264 1008 8:29
💚​ azure windows 1 16 269 1006 9:17
💚​ azure-ucws linux 1 16 365 920 7:56
💚​ azure-ucws windows 1 16 367 918 9:25
💚​ gcp linux 1 16 263 1011 9:18
💚​ gcp windows 1 16 265 1009 8:24
24 interesting tests: 14 SKIP, 7 KNOWN, 2 FAIL, 1 flaky
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
🟨​ TestAccept 🟨​K 🟨​K 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/permissions 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions 🟨​K 🟨​K 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions 🟨​K 🟨​K 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K 💚​R 💚​R
🙈​ TestAccept/bundle/resources/postgres_branches/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/recreate 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/replace_existing 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/update_protected 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/without_branch_id 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_endpoints/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_endpoints/recreate 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_projects/update_display_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/synced_database_tables/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
❌​ TestFetchRepositoryInfoAPI_FromRepo ✅​p ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p ✅​p ✅​p ✅​p
🔄​ TestFetchRepositoryInfoAPI_FromRepo/root ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p
❌​ TestFetchRepositoryInfoAPI_FromRepo/subdir ✅​p ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p ✅​p ✅​p ✅​p
Top 24 slowest tests (at least 2 minutes):
duration env testname
7:23 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
5:01 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:39 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:20 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:44 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:39 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:19 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:16 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:14 azure windows TestAccept
3:11 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:11 azure-ucws windows TestAccept
3:09 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:07 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:04 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:51 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:48 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:46 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:37 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:37 gcp windows TestAccept
2:35 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:35 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:32 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:28 aws-ucws windows TestAccept
2:27 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct

@denik denik temporarily deployed to test-trigger-is June 2, 2026 12:12 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 2, 2026 12:12 — with GitHub Actions Inactive
@denik denik force-pushed the denik/new-migration branch from 13572c4 to 82112d7 Compare June 2, 2026 19:14
@denik denik temporarily deployed to test-trigger-is June 2, 2026 19:14 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 2, 2026 19:14 — with GitHub Actions Inactive
@denik denik force-pushed the denik/new-migration branch from 82112d7 to 969c201 Compare June 4, 2026 09:41
@denik denik temporarily deployed to test-trigger-is June 4, 2026 09:42 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 4, 2026 09:42 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 4, 2026 09:51 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 4, 2026 09:51 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 4, 2026 10:09 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 4, 2026 10:09 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 4, 2026 10:55 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 4, 2026 10:55 — with GitHub Actions Inactive
@denik denik force-pushed the denik/new-migration branch from d9d854f to f9471b6 Compare June 4, 2026 11:06
@denik denik temporarily deployed to test-trigger-is June 4, 2026 11:06 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 4, 2026 11:06 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 5, 2026 13:02 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 5, 2026 13:02 — with GitHub Actions Inactive
@denik denik force-pushed the denik/new-migration branch from fbe207c to 8a1ad59 Compare June 5, 2026 14:48
@denik denik temporarily deployed to test-trigger-is June 5, 2026 14:49 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 5, 2026 14:49 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 5, 2026 15:09 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 5, 2026 15:09 — with GitHub Actions Inactive
@denik denik force-pushed the denik/new-migration branch from 6cd9860 to c8f326f Compare June 5, 2026 15:49
@denik denik temporarily deployed to test-trigger-is June 5, 2026 15:49 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is June 5, 2026 15:49 — with GitHub Actions Inactive
denik added 22 commits June 17, 2026 09:42
The command now reads from the local TF state file without invoking the
Terraform binary, so there is nothing for the plan check to verify.
Also simplify getCommonArgs to return only the display string (the args
slice was only needed to forward to the plan subprocess).

Co-authored-by: Isaac
Remove --noplancheck from expected output after dropping that flag.

Co-authored-by: Isaac
… update outputs

TF state stores single-block fields (e.g. continuous, deployment) as
single-element arrays [{}], not plain objects. json.Unmarshal into the
generated Go schema structs fails with type mismatch. Switch LookupTFField
to navigate via map[string]any + custom navigateTFState that auto-unwraps
single-element lists when a string-key step follows.

Also:
- Restore --noplancheck as a no-op flag (backward compat; used by invariant
  tests for job_with_depends_on config).
- Remove the plan-check lines from acceptance test output.txt files.
- Update help output to include --noplancheck.

Co-authored-by: Isaac
…lancheck

The refs map is shared with sv.Refs and gets mutated (entries deleted) during
reference resolution. depends_on must be computed before that loop runs.

Also restore --noplancheck as a no-op flag kept for backward compatibility
(used by the invariant test suite for job_with_depends_on config).

Co-authored-by: Isaac
…lias

Two categories of field lookup failures in LookupTFField:

1. Postgres resources (postgres_projects, postgres_branches, etc.) use a 'spec'
   wrapper via DABsToTerraformWrappers, but some fields like 'name' are at the
   TF state root, not under spec. When the spec-prefixed path fails, retry with
   the original unwrapped path.

2. Model permissions reference 'model_id' (the numeric model ID) which TF stores
   as 'registered_model_id'. Add a tfStateFieldAliases map for such state-only
   field name mismatches.

Also update acceptance output files:
- default-python: remove musterr/--noplancheck pattern; the plan check that made
  the first migrate call fail no longer exists, so just call migrate once.
- runas: remove plan-check output lines that appeared before 'Success!'.

Co-authored-by: Isaac
Tests cover:
- Basic job stored with correct ID
- Resource absent from TF state is skipped
- Cross-resource string ref: depends_on computed, field resolved from TF state
- Cross-resource numeric ref: int value stored as number not string
- Dashboard etag stored from etags map

Co-authored-by: Isaac
Both callers were reading and parsing the same .tfstate file twice —
once for resource IDs, once for full attributes. Now a single
ParseTFStateFull reads and unmarshals the file once, returning attrs,
IDs, and lineage/serial together.

Also drop the separate `etags map[string]string` parameter from
BuildStateFromTF. The dashboard etag is a regular attribute in the TF
state JSON ("etag" field), so LookupTFField finds it directly without
any special-case plumbing.

Implementation:
- terraform: expose ParseResourcesStateFromBytes so callers can pass
  already-read bytes
- migrate: add ParseTFStateFull / parseTFStateAttrsFromBytes
- migrate: remove etags param; look up "etag" via LookupTFField
- tests: etag test now puts the etag in the TF attributes JSON

Co-authored-by: Isaac
Still useful as a standalone API; suppress the dead-code checker.

Co-authored-by: Isaac
Co-authored-by: Isaac
Return (nil, nil, ...) when the state file doesn't exist, matching the
old parseResourcesState behaviour. Empty bundles with no resources
don't create a terraform.tfstate file.

Co-authored-by: Isaac
Remove the musterr + --noplancheck pattern; the plan check was removed
so migration succeeds on the first call. Regenerate output files.

Co-authored-by: Isaac
YAML + TF JSON as input, expected state fields as output.

Co-authored-by: Isaac
Replace the verbose LookupTFField call for etag with a direct JSON read
via TFStateAttrs.ETagFor(group, name).

Co-authored-by: Isaac
- Introduce rawTFState that captures lineage/serial alongside resources
  in one unmarshal, eliminating the separate meta struct parse.
- parseTFStateAttrsFromBytes and parseTFStateAttrsFromRaw now share the
  same struct instead of defining an anonymous one.
- Move Lineage/Serial after Attrs/IDs in TFState struct.

Co-authored-by: Isaac
DABsPathToTerraform now correctly handles root-level TF fields for
wrapped groups (e.g. postgres) via DABsToTerraformWrapperFields, so the
retry-with-unwrapped-path fallback is no longer needed.

Co-authored-by: Isaac
@denik denik force-pushed the denik/new-migration branch from 4932be2 to dcd1c2e Compare June 17, 2026 16:44
denik added 7 commits June 17, 2026 09:46
- Remove the unused `rest` variable in the alias resolution block
  (SkipPrefix(1) on a single-segment path always returns nil)
- Remove ParseTFStateAttrs which has no callers; the deadcode:allow
  annotation was papering over the linter

Co-authored-by: Isaac
BuildStateFromTF silently skips resources not in TF state (like
schema grants in terraform mode), so the old "state entry not found"
warning no longer fires. Remove the two spurious warning lines.

Co-authored-by: Isaac
The ETag field is no longer needed in the migration path — etags are
read directly from TFStateAttrs.ETagFor. Replace ExportedResourcesMap
with map[string]string throughout migrate, build_state, and callers.

Co-authored-by: Isaac
json.Unmarshal into map[string]any decodes all JSON numbers as float64.
Integers beyond 2^53 (~9e15) lose precision: 9007199254740993 becomes
9007199254740992. run_job_task.job_id is a JSON number in TF state and
realistic job IDs can exceed this threshold.

Fix: use json.NewDecoder.UseNumber() when parsing TF state attributes so
numbers are preserved as their original decimal string.

Add a unit test case with job_id = 2^53+1 that asserts the raw state JSON
contains the exact value, and an invariant config (job_run_job_ref.yml.tmpl)
that exercises the run_job_task.job_id cross-reference in cloud tests.

Co-authored-by: Isaac
Extend job_run_job_ref so watcher_job references trigger_job's
max_concurrent_runs literal of 2^53+1 (9007199254740993). This drives
the migration to resolve a large integer from TF state end-to-end; with
the json.Number fix the migrated state keeps the exact value, without it
the value is truncated to 2^53.

The value is out of range for the real backend, so the config is
local-only (no_run_job_ref_on_cloud).

Note: the unit test (TestBuildStateFromTF/large_integer) is the
deterministic regression guard, since the "no drift" plan check cannot
detect this — the plan diff also collapses ints to float64.

Co-authored-by: Isaac
The INPUT_CONFIG matrix is shared by all invariant test consumers;
continue_293's generated out.test.toml was missed in the prior commit.

Co-authored-by: Isaac
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.

2 participants