Skip to content

Quote resource keys in bundle config sync paths - #7328

Open
ilyakuz-db wants to merge 2 commits into
mainfrom
ilyakuz-db/fix-config-sync-resource-keys
Open

ilyakuz-db wants to merge 2 commits into
mainfrom
ilyakuz-db/fix-config-sync-resource-keys

Conversation

@ilyakuz-db

Copy link
Copy Markdown
Contributor

Changes

Quote resource names when constructing config-sync field paths, keeping spaces, dots, and quotes within one key. Use structured paths for variable-reference lookups so edits and new sequence elements preserve their references.

Why

bundle config-remote-sync fails for resource keys such as daily job because it passes an unquoted path to the path parser. Quoting the resource key lets sync locate and update the intended YAML entry.

Tests

  • All 93 local config-sync acceptance cases passed, including new coverage for spaced and quoted resource keys, resource-ID selection, field edits, task additions, and variable preservation.
  • Extended the task rename/revert acceptance test to use spaces and both quote types; both acceptance regressions fail against the unchanged CLI with the original path-parser error.
  • All 83 config-sync package test cases passed, including the extended dotted-resource-key YAML rewrite test.
  • go vet ./bundle/configsync, formatting, shell syntax, and whitespace checks passed.

Local Go validation used a temporary YAML v3.0.5 override because the pinned v3.0.6 dependency was unavailable in the test environment. Dependency files are unchanged.

Dotted resource names are covered at the YAML rewrite layer; the separate existing deployment failure for dotted keys is outside this change.


This PR was created with GitHub MCP.

@github-actions github-actions Bot added the DABs DABs related issues label Nov 3, 2026
@ilyakuz-db
ilyakuz-db marked this pull request as ready for review November 3, 2026 16:00
@ilyakuz-db
ilyakuz-db requested review from a team as code owners November 3, 2026 16:00
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Commit: 8b391234b | Workflow run

Regression test report

Selected 2 changed tests (limit=20, 0 not selected)

4 tests: regression=4 unreleased=0 coverage=0 failing=0

test branch main (a11ca9f) latest (v1.23.0)
TestAccept/bundle/config-remote-sync/resource_keys/DMS= ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/resource_keys/DMS=true ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/task_rename_revert/DMS= ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/task_rename_revert/DMS=true ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/resource_keys/DMS=: branch ✅ | main (a11ca9f) ❌ | latest (v1.23.0) ❌

main (a11ca9f):

acceptance_test.go:1342: Diff:
        --- bundle/config-remote-sync/resource_keys/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-syncresource_keysDMS=1110247241/002/output.txt
        @@ -4,107 +4,8 @@
         === Edit job with spaces remotely
         === Sync only job with spaces
         >>> [CLI] bundle config-remote-sync --select-ids jobs:[JOB WITH SPACES_ID] --save
        -Detected changes in 1 resource(s):
        +Error: failed to resolve field changes: failed to resolve selectors in path resources.jobs.job with spaces.tasks[task_key='main'].notebook_task.notebook_path: failed to parse path resources.jobs.job with spaces.tasks[task_key='main'].notebook_task.notebook_path: invalid character ' ' in field name at position 18
         
        -Resource: resources.jobs.job with spaces
        -  description: add
        -  tasks[task_key='main'].notebook_task.notebook_path: replace
        -  tasks[task_key='main'].timeout_seconds: replace
        -
        -
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        ---- databricks.yml.backup
        -+++ databricks.yml
        -@@ -12,7 +12,8 @@
        -       tasks:
        -         - task_key: main
        --          timeout_seconds: 60
        -+          timeout_seconds: 900
        -           notebook_task:
        --            notebook_path: ${var.notebook_root}/notebook
        -+            notebook_path: ${var.notebook_root}/notebook_updated
        -+      description: Remote description
        -     "job's\"quotes":
        -       name: quoted-job
        -
        -=== Syncing job with spaces again is idempotent
        ->>> [CLI] bundle config-remote-sync --select-ids jobs:[JOB WITH SPACES_ID] --save
        -No changes detected.
        -
        -
        -=== Add a sibling task in job with spaces
        ->>> [CLI] bundle config-remote-sync --select-ids jobs:[JOB WITH SPACES_ID] --save
        -Detected changes in 1 resource(s):
        -
        -Resource: resources.jobs.job with spaces
        -  tasks[task_key='added']: add
        -
        -
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        ---- databricks.yml.backup
        -+++ databricks.yml
        -@@ -15,4 +15,7 @@
        -           notebook_task:
        -             notebook_path: ${var.notebook_root}/notebook_updated
        -+        - notebook_task:
        -+            notebook_path: ${var.notebook_root}/notebook_updated_sibling
        -+          task_key: added
        -       description: Remote description
        -     "job's\"quotes":
        -
        -=== Edit job's"quotes remotely
        -=== Sync only job's"quotes
        ->>> [CLI] bundle config-remote-sync --select-ids jobs:[JOB'S\"QUOTES_ID] --save
        -Detected changes in 1 resource(s):
        -
        -Resource: resources.jobs.job's"quotes
        -  description: add
        -  tasks[task_key='main'].notebook_task.notebook_path: replace
        -  tasks[task_key='main'].timeout_seconds: replace
        -
        -
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        ---- databricks.yml.backup
        -+++ databricks.yml
        -@@ -23,7 +23,8 @@
        -       tasks:
        -         - task_key: main
        --          timeout_seconds: 60
        -+          timeout_seconds: 900
        -           notebook_task:
        --            notebook_path: ${var.notebook_root}/notebook
        -+            notebook_path: ${var.notebook_root}/notebook_updated
        -+      description: Remote description
        -
        - targets:
        -
        -=== Syncing job's"quotes again is idempotent
        ->>> [CLI] bundle config-remote-sync --select-ids jobs:[JOB'S\"QUOTES_ID] --save
        -No changes detected.
        -
        -
        -=== Add a sibling task in job's"quotes
        ->>> [CLI] bundle config-remote-sync --select-ids jobs:[JOB'S\"QUOTES_ID] --save
        -Detected changes in 1 resource(s):
        -
        -Resource: resources.jobs.job's"quotes
        -  tasks[task_key='added']: add
        -
        -
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        ---- databricks.yml.backup
        -+++ databricks.yml
        -@@ -26,4 +26,7 @@
        -           notebook_task:
        -             notebook_path: ${var.notebook_root}/notebook_updated
        -+        - notebook_task:
        -+            notebook_path: ${var.notebook_root}/notebook_updated_sibling
        -+          task_key: added
        -       description: Remote description
        -
        -
         >>> [CLI] bundle destroy --auto-approve -qq
        +
        +Exit code: 1

latest (v1.23.0): same output as main (a11ca9f)

TestAccept/bundle/config-remote-sync/resource_keys/DMS=true: branch ✅ | main (a11ca9f) ❌ | latest (v1.23.0) ❌

main (a11ca9f):

acceptance_test.go:1342: Diff:
        --- bundle/config-remote-sync/resource_keys/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-syncresource_keysDMS=true600351195/002/output.txt
        @@ -4,107 +4,8 @@
         === Edit job with spaces remotely
         === Sync only job with spaces
         >>> [CLI] bundle config-remote-sync --select-ids jobs:[JOB WITH SPACES_ID] --save
        -Detected changes in 1 resource(s):
        +Error: failed to resolve field changes: failed to resolve selectors in path resources.jobs.job with spaces.tasks[task_key='main'].notebook_task.notebook_path: failed to parse path resources.jobs.job with spaces.tasks[task_key='main'].notebook_task.notebook_path: invalid character ' ' in field name at position 18
         
        -Resource: resources.jobs.job with spaces
        -  description: add
        -  tasks[task_key='main'].notebook_task.notebook_path: replace
        -  tasks[task_key='main'].timeout_seconds: replace
        -
        -
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        ---- databricks.yml.backup
        -+++ databricks.yml
        -@@ -12,7 +12,8 @@
        -       tasks:
        -         - task_key: main
        --          timeout_seconds: 60
        -+          timeout_seconds: 900
        -           notebook_task:
        --            notebook_path: ${var.notebook_root}/notebook
        -+            notebook_path: ${var.notebook_root}/notebook_updated
        -+      description: Remote description
        -     "job's\"quotes":
        -       name: quoted-job
        -
        -=== Syncing job with spaces again is idempotent
        ->>> [CLI] bundle config-remote-sync --select-ids jobs:[JOB WITH SPACES_ID] --save
        -No changes detected.
        -
        -
        -=== Add a sibling task in job with spaces
        ->>> [CLI] bundle config-remote-sync --select-ids jobs:[JOB WITH SPACES_ID] --save
        -Detected changes in 1 resource(s):
        -
        -Resource: resources.jobs.job with spaces
        -  tasks[task_key='added']: add
        -
        -
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        ---- databricks.yml.backup
        -+++ databricks.yml
        -@@ -15,4 +15,7 @@
        -           notebook_task:
        -             notebook_path: ${var.notebook_root}/notebook_updated
        -+        - notebook_task:
        -+            notebook_path: ${var.notebook_root}/notebook_updated_sibling
        -+          task_key: added
        -       description: Remote description
        -     "job's\"quotes":
        -
        -=== Edit job's"quotes remotely
        -=== Sync only job's"quotes
        ->>> [CLI] bundle config-remote-sync --select-ids jobs:[JOB'S\"QUOTES_ID] --save
        -Detected changes in 1 resource(s):
        -
        -Resource: resources.jobs.job's"quotes
        -  description: add
        -  tasks[task_key='main'].notebook_task.notebook_path: replace
        -  tasks[task_key='main'].timeout_seconds: replace
        -
        -
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        ---- databricks.yml.backup
        -+++ databricks.yml
        -@@ -23,7 +23,8 @@
        -       tasks:
        -         - task_key: main
        --          timeout_seconds: 60
        -+          timeout_seconds: 900
        -           notebook_task:
        --            notebook_path: ${var.notebook_root}/notebook
        -+            notebook_path: ${var.notebook_root}/notebook_updated
        -+      description: Remote description
        -
        - targets:
        -
        -=== Syncing job's"quotes again is idempotent
        ->>> [CLI] bundle config-remote-sync --select-ids jobs:[JOB'S\"QUOTES_ID] --save
        -No changes detected.
        -
        -
        -=== Add a sibling task in job's"quotes
        ->>> [CLI] bundle config-remote-sync --select-ids jobs:[JOB'S\"QUOTES_ID] --save
        -Detected changes in 1 resource(s):
        -
        -Resource: resources.jobs.job's"quotes
        -  tasks[task_key='added']: add
        -
        -
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        ---- databricks.yml.backup
        -+++ databricks.yml
        -@@ -26,4 +26,7 @@
        -           notebook_task:
        -             notebook_path: ${var.notebook_root}/notebook_updated
        -+        - notebook_task:
        -+            notebook_path: ${var.notebook_root}/notebook_updated_sibling
        -+          task_key: added
        -       description: Remote description
        -
        -
         >>> [CLI] bundle destroy --auto-approve -qq
        +
        +Exit code: 1

latest (v1.23.0): same output as main (a11ca9f)

TestAccept/bundle/config-remote-sync/task_rename_revert/DMS=: branch ✅ | main (a11ca9f) ❌ | latest (v1.23.0) ❌

main (a11ca9f):

acceptance_test.go:1342: Diff:
        --- bundle/config-remote-sync/task_rename_revert/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-synctask_rename_revertDMS=3978674772/002/output.txt
        @@ -6,47 +6,8 @@
         === Rename task to new_task_2 remotely
         
         === Sync the rename into config (no redeploy)
        -Detected changes in 1 resource(s):
        +Error: failed to resolve field changes: failed to resolve selectors in path resources.jobs.sample job's"quotes.tasks[task_key='new_task']: failed to parse path resources.jobs.sample job's"quotes.tasks[task_key='new_task']: invalid character ' ' in field name at position 21
         
        -Resource: resources.jobs.sample job's"quotes
        -  tasks[task_key='new_task']: remove
        -  tasks[task_key='new_task_2']: add
        -
        -
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        ---- databricks.yml.backup
        -+++ databricks.yml
        -@@ -6,5 +6,5 @@
        -     "sample job's\"quotes":
        -       tasks:
        --        - task_key: new_task
        -+        - task_key: new_task_2
        -           notebook_task:
        -             notebook_path: /Users/{{workspace_user_name}}/new_task
        -
        -=== Rename task back to new_task remotely
        -
        -=== Sync the revert into config
        -Detected changes in 1 resource(s):
        -
        -Resource: resources.jobs.sample job's"quotes
        -  tasks[task_key='new_task']: add
        -  tasks[task_key='new_task_2']: remove
        -
        -
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        ---- databricks.yml.backup
        -+++ databricks.yml
        -@@ -6,5 +6,5 @@
        -     "sample job's\"quotes":
        -       tasks:
        --        - task_key: new_task_2
        -+        - task_key: new_task
        -           notebook_task:
        -             notebook_path: /Users/{{workspace_user_name}}/new_task
        -
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
           delete resources.jobs.sample job's"quotes
        @@ -54,3 +14,5 @@
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default
         
         Destroy: 1 deleted
        +
        +Exit code: 1

latest (v1.23.0): same output as main (a11ca9f)

TestAccept/bundle/config-remote-sync/task_rename_revert/DMS=true: branch ✅ | main (a11ca9f) ❌ | latest (v1.23.0) ❌

main (a11ca9f):

acceptance_test.go:1342: Diff:
        --- bundle/config-remote-sync/task_rename_revert/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-synctask_rename_revertDMS=true210306717/002/output.txt
        @@ -6,47 +6,8 @@
         === Rename task to new_task_2 remotely
         
         === Sync the rename into config (no redeploy)
        -Detected changes in 1 resource(s):
        +Error: failed to resolve field changes: failed to resolve selectors in path resources.jobs.sample job's"quotes.tasks[task_key='new_task']: failed to parse path resources.jobs.sample job's"quotes.tasks[task_key='new_task']: invalid character ' ' in field name at position 21
         
        -Resource: resources.jobs.sample job's"quotes
        -  tasks[task_key='new_task']: remove
        -  tasks[task_key='new_task_2']: add
        -
        -
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        ---- databricks.yml.backup
        -+++ databricks.yml
        -@@ -6,5 +6,5 @@
        -     "sample job's\"quotes":
        -       tasks:
        --        - task_key: new_task
        -+        - task_key: new_task_2
        -           notebook_task:
        -             notebook_path: /Users/{{workspace_user_name}}/new_task
        -
        -=== Rename task back to new_task remotely
        -
        -=== Sync the revert into config
        -Detected changes in 1 resource(s):
        -
        -Resource: resources.jobs.sample job's"quotes
        -  tasks[task_key='new_task']: add
        -  tasks[task_key='new_task_2']: remove
        -
        -
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        ---- databricks.yml.backup
        -+++ databricks.yml
        -@@ -6,5 +6,5 @@
        -     "sample job's\"quotes":
        -       tasks:
        --        - task_key: new_task_2
        -+        - task_key: new_task
        -           notebook_task:
        -             notebook_path: /Users/{{workspace_user_name}}/new_task
        -
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
           delete resources.jobs.sample job's"quotes
        @@ -54,3 +14,5 @@
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default
         
         Destroy: 1 deleted
        +
        +Exit code: 1
        
FAIL

latest (v1.23.0): same output as main (a11ca9f)

@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 8b39123

Run: 41669734279

Env 🔄​flaky ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 274 16 10:53
✅​ aws-windows-latest-4core-16gb 273 15 5:05
✅​ azure linux-2core-8gb 273 16 8:42
✅​ azure-windows-latest-4core-16gb 272 15 4:59
✅​ gcp linux-2core-8gb 274 16 10:03
🔄​ gcp-windows-latest-4core-16gb 2 271 15 7:40
Test Name gcp-windows-latest-4core-16gb
🔄​ TestAccept 🔄​f
🔄​ TestSyncIncrementalFileSync 🔄​f
Top 4 slowest tests (at least 2 minutes):
duration env testname
4:11 azure linux-2core-8gb TestAccept
4:06 aws linux-2core-8gb TestAccept
3:08 gcp linux-2core-8gb TestAccept
2:16 gcp-windows-latest-4core-16gb TestWorkspaceFilesExtensions_ExportFormatIsPreserved/jupyter_sql

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted DABs DABs related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants