Skip to content

Add --select flag to bundle config-remote-sync#5579

Open
ilyakuz-db wants to merge 1 commit into
mainfrom
feat/config-remote-sync-select
Open

Add --select flag to bundle config-remote-sync#5579
ilyakuz-db wants to merge 1 commit into
mainfrom
feat/config-remote-sync-select

Conversation

@ilyakuz-db

@ilyakuz-db ilyakuz-db commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Changes

Add an opt-in --select flag to the experimental bundle config-remote-sync command (hidden; used by DABs in the Workspace). The flag restricts detected and saved changes to specific resources. Each selector is <type>:<id> (e.g. jobs:123456789) — the resource type plus its deployed resource ID. It is repeatable and/or comma-separated.

Default behavior without the flag is unchanged.

Implementation notes:

  • The command is invoked from a resource's page in the workspace, which knows the resource's type and ID but not its bundle type.name key. Selection is therefore by <type>:<id> and is intentionally independent from bundle deploy --select (which matches keys); no logic is shared with deploy.
  • The type is required: a resource ID is only unique within a type, so an ID that happens to collide across types (e.g. a job and a warehouse) would otherwise select the wrong resource. The type comes from the plan key (resources.<type>.<name>), so a selector can only ever match its own type.
  • Selectors are resolved to plan keys against the deployment state after planning. DetectChanges still plans the full resource set so ${resources.*} references resolve; only the emitted change set is then restricted. A selector that matches no deployed resource is an error.
  • Selection is at the resource level: a selected resource's permissions/grants sub-nodes (and any other synthesized child node) are grouped with it by prefix on the . path boundary, so syncing a resource never silently skips its permissions.

Why

A full sync diffs every resource in a bundle, so a drifted-but-unrelated resource (for example a dashboard whose etag changed remotely because someone opened the draft) can have unwanted changes written into its YAML while the user is syncing a different resource. Passing the edited resource's <type>:<id> via --select limits the blast radius of one sync run to that resource.

Tests

  • Unit test for change-map filtering in bundle/configsync.
  • Two focused acceptance directories under acceptance/bundle/config-remote-sync/, both run on the direct and terraform engines:
    • select_basic: two drifted jobs, select one by jobs:<id> — only that job's YAML changes, the other is left byte-identical (verified via backup + diff.py); re-selecting is idempotent; an unfiltered run still detects the other job's drift (no lost updates); a selector with an unknown ID, a selector with no type, and an ID under the wrong type are each rejected.
    • select_multiple: comma-separated selectors select two of three resources, a repeated selector dedupes, repeated --select flags combine, and the unselected resource is untouched.
  • The entire existing config-remote-sync acceptance tree and the bundle/select (deploy) tree pass unchanged on both engines — the flag is opt-in, no existing goldens changed, and the deploy selector code is untouched.
  • Verified locally and against a real Unity Catalog workspace (cloud acceptance run, both engines).

@ilyakuz-db ilyakuz-db marked this pull request as ready for review June 12, 2026 19:00
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

10 files changed
Suggested: @denik
Also eligible: @pietern, @andrewnester, @anton-107, @janniklasrose, @shreyas-goenka, @lennartkats-db

/bundle/ - needs approval

Files: bundle/configsync/diff.go, bundle/configsync/select.go, bundle/configsync/select_test.go
Suggested: @denik
Also eligible: @pietern, @andrewnester, @anton-107, @janniklasrose, @shreyas-goenka, @lennartkats-db

/cmd/bundle/ - needs approval

Files: cmd/bundle/config_remote_sync.go
Suggested: @denik
Also eligible: @pietern, @andrewnester, @anton-107, @janniklasrose, @shreyas-goenka, @lennartkats-db

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db) can approve all areas.
See OWNERS for ownership rules.

@ilyakuz-db ilyakuz-db force-pushed the feat/config-remote-sync-select branch from 7e6375b to 3701a7d Compare June 15, 2026 10:42
@ilyakuz-db ilyakuz-db temporarily deployed to test-trigger-is June 15, 2026 10:42 — with GitHub Actions Inactive
@ilyakuz-db ilyakuz-db temporarily deployed to test-trigger-is June 15, 2026 10:42 — with GitHub Actions Inactive
@eng-dev-ecosystem-bot

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

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: b6d6f85

Run: 27556815111

Env 🟨​KNOWN 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
🟨​ aws linux 7 15 264 982 7:53
🟨​ aws windows 7 15 266 980 14:17
💚​ aws-ucws linux 7 15 360 896 7:41
💚​ aws-ucws windows 7 15 362 894 7:57
💚​ azure linux 1 17 267 980 6:40
💚​ azure windows 1 17 269 978 9:20
💚​ azure-ucws linux 1 17 365 892 7:23
💚​ azure-ucws windows 1 17 367 890 9:50
💚​ gcp linux 1 17 263 983 6:43
🔄​ gcp windows 3 17 263 981 11:49
24 interesting tests: 15 SKIP, 7 KNOWN, 2 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 🔄​f
🙈​ 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/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/grants/select 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🔄​ TestAccept/selftest/record_cloud/pipeline-crud ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f
🔄​ TestAccept/selftest/record_cloud/pipeline-crud/DATABRICKS_BUNDLE_ENGINE=terraform ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
Top 23 slowest tests (at least 2 minutes):
duration env testname
4:38 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:26 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
4:15 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
4:06 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:38 azure windows TestAccept
3:32 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:24 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:11 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:04 azure-ucws windows TestAccept
3:03 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:59 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:53 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:52 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:52 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:48 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:47 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:41 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:38 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:36 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:33 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:31 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:25 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:25 aws-ucws windows TestAccept

@ilyakuz-db ilyakuz-db force-pushed the feat/config-remote-sync-select branch from 3701a7d to 4ad25ef Compare June 15, 2026 11:50
@ilyakuz-db ilyakuz-db temporarily deployed to test-trigger-is June 15, 2026 11:51 — with GitHub Actions Inactive
@ilyakuz-db ilyakuz-db temporarily deployed to test-trigger-is June 15, 2026 11:51 — with GitHub Actions Inactive
@ilyakuz-db ilyakuz-db force-pushed the feat/config-remote-sync-select branch from 4ad25ef to d17552e Compare June 15, 2026 13:57
@ilyakuz-db ilyakuz-db temporarily deployed to test-trigger-is June 15, 2026 13:58 — with GitHub Actions Inactive
@ilyakuz-db ilyakuz-db temporarily deployed to test-trigger-is June 15, 2026 13:58 — with GitHub Actions Inactive
@ilyakuz-db ilyakuz-db force-pushed the feat/config-remote-sync-select branch from d17552e to 49b2c08 Compare June 15, 2026 14:11
@ilyakuz-db ilyakuz-db temporarily deployed to test-trigger-is June 15, 2026 14:13 — with GitHub Actions Inactive
@ilyakuz-db ilyakuz-db temporarily deployed to test-trigger-is June 15, 2026 14:13 — with GitHub Actions Inactive
@ilyakuz-db ilyakuz-db force-pushed the feat/config-remote-sync-select branch from 49b2c08 to bfe0a58 Compare June 15, 2026 14:54
@ilyakuz-db ilyakuz-db temporarily deployed to test-trigger-is June 15, 2026 14:54 — with GitHub Actions Inactive
@ilyakuz-db ilyakuz-db temporarily deployed to test-trigger-is June 15, 2026 14:54 — with GitHub Actions Inactive
Add an opt-in --select flag to the experimental `bundle config-remote-sync`
command that restricts detected and saved changes to specific resources. Each
selector is "<type>:<id>" (e.g. jobs:123456789), using the resource type and
its deployed resource ID — the pair the workspace UI knows from a resource's
page, which has the ID but not the bundle "type.name" key. The type is required
because a resource ID is only unique within a type, so an ID that collides
across types would otherwise select the wrong resource. Selection is therefore
independent from `bundle deploy --select`, which matches keys.

Selectors are resolved to plan keys against the deployment state after planning,
so ${resources.*} references still resolve; only the emitted change set is
restricted. A selector that matches no deployed resource is an error. Default
behavior without the flag is unchanged.

This limits the blast radius of a sync run: syncing one resource can no longer
rewrite an unrelated drifted resource's configuration.
@ilyakuz-db ilyakuz-db force-pushed the feat/config-remote-sync-select branch from bfe0a58 to b6d6f85 Compare June 15, 2026 15:21
@ilyakuz-db ilyakuz-db temporarily deployed to test-trigger-is June 15, 2026 15:22 — with GitHub Actions Inactive
@ilyakuz-db ilyakuz-db temporarily deployed to test-trigger-is June 15, 2026 15:22 — with GitHub Actions Inactive
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