Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b09caf1
bundle: route config sync write-back to the block that defines each c…
ilyakuz-db Aug 3, 2026
c23e7ed
Pick the merge winner by load order when two files define the same field
ilyakuz-db Aug 3, 2026
90a8e6e
Treat an out-of-range positional index as a new element
ilyakuz-db Aug 3, 2026
c439bed
Keep variable references when writing to a target override block
ilyakuz-db Aug 3, 2026
8c81393
Fix three write-back defects around removals and rename pairing
ilyakuz-db Aug 3, 2026
8b3e0a8
Route a mutator-inserted field on a split element as an addition
ilyakuz-db Aug 3, 2026
f080114
Use if instead of switch for routing; drop unit tests covered by acce…
ilyakuz-db Aug 3, 2026
13a950a
Drop unit test for an unreachable case
ilyakuz-db Aug 3, 2026
6865e8d
Drop two unreachable branches in block routing
ilyakuz-db Aug 3, 2026
6f09c49
Simplify rename pairing and index scoping
ilyakuz-db Aug 3, 2026
4c00ff7
Require a forced pairing from both sides, and only refuse ambiguity a…
ilyakuz-db Aug 3, 2026
1544e89
Quote the target name when addressing an override block
ilyakuz-db Aug 3, 2026
a5b9de5
Rename mergedPath to preResolvedPath
ilyakuz-db Aug 3, 2026
72f83f7
Collapse duplicated field-stripping and match scanning in rename pairing
ilyakuz-db Aug 3, 2026
8addc15
Use structdiff.IsEqual instead of reflect.DeepEqual
ilyakuz-db Aug 3, 2026
21eef0c
Restore variables using the merged-index path, not the block-local one
ilyakuz-db Aug 3, 2026
8ca0df5
Translate enclosing indices when placing a nested new element
ilyakuz-db Aug 3, 2026
ffb1028
Drop unreachable zero-step branch in block routing
ilyakuz-db Aug 3, 2026
ecbad19
Add unit tests for block resolution and index translation
ilyakuz-db Aug 3, 2026
fa2140b
Simplify block routing: unify index translation, retire routed flag a…
ilyakuz-db Aug 3, 2026
e803e40
Move sequence and block routing into sequences.go
ilyakuz-db Aug 4, 2026
c81059b
Trim duplicated comments in configsync
ilyakuz-db Aug 4, 2026
48c6040
Drop blockindex unit tests
ilyakuz-db Aug 4, 2026
e187626
Inline the rename routing special case
ilyakuz-db Aug 4, 2026
0138f43
Extract rename key write and write-address selection
ilyakuz-db Aug 4, 2026
9d10f4e
Shorten hold-back reasons and collapse duplicated bookkeeping
ilyakuz-db Aug 4, 2026
20434a5
Merge keyed sequences when loading config for variable restoration
ilyakuz-db Aug 4, 2026
9b75e0b
Fix an assertion that never ran and an unreachable error path
ilyakuz-db Aug 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions acceptance/bundle/config-remote-sync/job_fields/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,14 @@ Resource: resources.jobs.my_job
+ - samples.nyctaxi.trips
environments:
- environment_key: default
@@ -25,14 +31,14 @@
@@ -25,5 +31,5 @@
- ./*.whl
job_clusters:
- - job_cluster_key: test_cluster
+ - job_cluster_key: test_cluster_renamed
new_cluster:
- spark_version: [[DEFAULT_SPARK_VERSION]]
node_type_id: [NODE_TYPE_ID]
num_workers: 1
+ spark_version: [[DEFAULT_SPARK_VERSION]]
tasks:
- task_key: main
spark_version: [[DEFAULT_SPARK_VERSION]]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an expected change, the only changed field is still "spark_version" but new diff is less noisy,

@@ -34,5 +40,5 @@
notebook_task:
notebook_path: /Users/{{workspace_user_name}}/notebook
- job_cluster_key: test_cluster
Expand Down
13 changes: 3 additions & 10 deletions acceptance/bundle/config-remote-sync/job_multiple_tasks/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,14 @@ Resource: resources.jobs.rename_task_job
>>> diff.py databricks.yml.backup2 databricks.yml
--- databricks.yml.backup2
+++ databricks.yml
@@ -52,14 +52,14 @@
@@ -52,5 +52,5 @@
rename_task_job:
tasks:
- - task_key: b_task
+ - new_cluster:
+ node_type_id: [NODE_TYPE_ID]
+ num_workers: 1
+ spark_version: 13.3.x-snapshot-scala2.12
+ - task_key: b_task_renamed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, no changes in fields but diff is less noisy because task renames are now handled better

notebook_task:
notebook_path: /Users/{{workspace_user_name}}/b_task
- new_cluster:
- spark_version: 13.3.x-snapshot-scala2.12
- node_type_id: [NODE_TYPE_ID]
- num_workers: 1
+ task_key: b_task_renamed
@@ -61,5 +61,5 @@
- task_key: d_task
depends_on:
- - task_key: b_task
Expand Down
32 changes: 4 additions & 28 deletions acceptance/bundle/config-remote-sync/multiple_files/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,13 @@ Resource: resources.jobs.job_two
>>> diff.py resources/job1.yml.backup resources/job1.yml
--- resources/job1.yml.backup
+++ resources/job1.yml
@@ -4,13 +4,13 @@
@@ -4,5 +4,5 @@
max_concurrent_runs: 1
tasks:
- - task_key: c_task
+ - depends_on:
+ - task_key: b_task
+ new_cluster:
+ node_type_id: [NODE_TYPE_ID]
+ num_workers: 1
+ spark_version: 13.3.x-snapshot-scala2.12
+ - task_key: c_task_renamed
notebook_task:
notebook_path: /Users/{{workspace_user_name}}/c_task
- new_cluster:
- spark_version: 13.3.x-snapshot-scala2.12
- node_type_id: [NODE_TYPE_ID]
- num_workers: 1
- depends_on:
- - task_key: b_task
+ task_key: c_task_renamed
- task_key: a_task
notebook_task:
@@ -21,3 +21,10 @@
num_workers: 1
depends_on:
Expand All @@ -71,26 +57,16 @@ Resource: resources.jobs.job_two
>>> diff.py resources/job2.yml.backup resources/job2.yml
--- resources/job2.yml.backup
+++ resources/job2.yml
@@ -2,13 +2,13 @@
@@ -2,7 +2,7 @@
jobs:
job_two:
- max_concurrent_runs: 2
+ max_concurrent_runs: 10
tasks:
- - task_key: run_pipeline
+ - new_cluster:
+ node_type_id: [NODE_TYPE_ID]
+ num_workers: 1
+ spark_version: 13.3.x-snapshot-scala2.12
+ - task_key: run_pipeline_renamed
notebook_task:
notebook_path: /Users/{{workspace_user_name}}/1
- new_cluster:
- spark_version: 13.3.x-snapshot-scala2.12
- node_type_id: [NODE_TYPE_ID]
- num_workers: 1
+ task_key: run_pipeline_renamed
- task_key: etl_pipeline
notebook_task:
@@ -18,5 +18,9 @@
node_type_id: [NODE_TYPE_ID]
num_workers: 2
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
bundle:
name: test-bundle-$UNIQUE_NAME

# cluster_id makes OverrideCompute replace each task's compute with
# existing_cluster_id. It builds that value in Go, so the leaf is present in the
# merged config but carries no source location -- unlike a field absent from the
# config, which has no value either. Routing by location therefore finds nothing, and
# on a task defined in both blocks there is no winning definition to fall back on. The
# field is not declared anywhere, so writing it is an addition.

resources:
jobs:
cli_default_job:
tasks:
- task_key: shared
max_retries: 1
new_cluster:
spark_version: 13.3.x-scala2.12
num_workers: 1
notebook_task:
notebook_path: /Users/{{workspace_user_name}}/nb

targets:
dev:
mode: development
cluster_id: 0101-000000-abcd1234
resources:
jobs:
cli_default_job:
tasks:
- task_key: shared
timeout_seconds: 45

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev/files...
Deploying resources...
Updating deployment state...
Deployment complete!

=== existing_cluster_id is injected by OverrideCompute; the YAML has none
>>> grep -c existing_cluster_id databricks.yml
1

=== Edit that locationless field remotely on a two-block task
=== Sync
Detected changes in 1 resource(s):

Resource: resources.jobs.cli_default_job
tasks[task_key='shared'].existing_cluster_id: add



=== The field is added to the block declaring the resource

>>> diff.py databricks.yml.backup databricks.yml
--- databricks.yml.backup
+++ databricks.yml
@@ -20,4 +20,5 @@
notebook_task:
notebook_path: /Users/{{workspace_user_name}}/nb
+ existing_cluster_id: 0101-000000-remote1

targets:

>>> grep -c existing_cluster_id: 0101-000000-remote1 databricks.yml
1

>>> [CLI] bundle destroy --auto-approve -t dev
The following resources will be deleted:
delete resources.jobs.cli_default_job

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev

Deleting files...
Destroy complete!
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
envsubst < databricks.yml.tmpl > databricks.yml
cleanup() { trace $CLI bundle destroy --auto-approve -t dev; }
trap cleanup EXIT
$CLI bundle deploy -t dev
job_id="$(read_id.py cli_default_job)"

title "existing_cluster_id is injected by OverrideCompute; the YAML has none"
errcode trace grep -c "existing_cluster_id" databricks.yml

title "Edit that locationless field remotely on a two-block task"
edit_resource.py jobs $job_id <<PYEDIT
for task in r["tasks"]:
if task["task_key"] == "shared":
task["existing_cluster_id"] = "0101-000000-remote1"
PYEDIT

title "Sync"
echo
cp databricks.yml databricks.yml.backup
errcode $CLI bundle config-remote-sync -t dev --save
title "The field is added to the block declaring the resource"
echo
trace diff.py databricks.yml.backup databricks.yml
errcode trace grep -c "existing_cluster_id: 0101-000000-remote1" databricks.yml
rm databricks.yml.backup
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
bundle:
name: test-bundle-$UNIQUE_NAME

# A target name may contain a dot. The write path to an override block is
# targets.<target>.<field>, which is parsed back into segments, so a dotted name has to
# be quoted or "dev.eu" becomes two keys and addresses a node that does not exist.
resources:
jobs:
dotted_job:
tasks:
- task_key: main
max_retries: 1
notebook_task:
notebook_path: /Users/{{workspace_user_name}}/nb

targets:
dev.eu:
mode: development
resources:
jobs:
dotted_job:
tasks:
- task_key: main
timeout_seconds: 45

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev.eu/files...
Deploying resources...
Updating deployment state...
Deployment complete!

=== Edit a field in the override block of a target whose name contains a dot
=== Sync
Detected changes in 1 resource(s):

Resource: resources.jobs.dotted_job
tasks[task_key='main'].timeout_seconds: replace



=== The override block is updated

>>> diff.py databricks.yml.backup databricks.yml
--- databricks.yml.backup
+++ databricks.yml
@@ -22,3 +22,3 @@
tasks:
- task_key: main
- timeout_seconds: 45
+ timeout_seconds: 900

>>> [CLI] bundle destroy --auto-approve -t dev.eu
The following resources will be deleted:
delete resources.jobs.dotted_job

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev.eu

Deleting files...
Destroy complete!
22 changes: 22 additions & 0 deletions acceptance/bundle/config-remote-sync/split/dotted_target/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
envsubst < databricks.yml.tmpl > databricks.yml
cleanup() { trace $CLI bundle destroy --auto-approve -t dev.eu; }
trap cleanup EXIT
$CLI bundle deploy -t dev.eu
job_id="$(read_id.py -t dev.eu dotted_job)"

title "Edit a field in the override block of a target whose name contains a dot"
edit_resource.py jobs $job_id <<PYEDIT
for task in r["tasks"]:
if task["task_key"] == "main":
task["timeout_seconds"] = 900
PYEDIT

title "Sync"
echo
cp databricks.yml databricks.yml.backup
errcode $CLI bundle config-remote-sync -t dev.eu --save
title "The override block is updated"
echo
trace diff.py databricks.yml.backup databricks.yml
rm databricks.yml.backup
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
bundle:
name: test-bundle-$UNIQUE_NAME

# job_a's task list is split across both blocks and one task, "shared", is defined
# in both. job_b is an ordinary single-block job.
#
# The point of the fixture: an unrelated resource's change must still be applied
# in the same run as a structural change to a split element. The sync is
# unattended, so one harder change must never stop the rest.
resources:
jobs:
job_a:
tasks:
- task_key: shared
max_retries: 1
notebook_task:
notebook_path: /Users/{{workspace_user_name}}/shared

job_b:
max_concurrent_runs: 1
tasks:
- task_key: simple
notebook_task:
notebook_path: /Users/{{workspace_user_name}}/simple

targets:
dev:
mode: development
resources:
jobs:
job_a:
tasks:
- task_key: shared
timeout_seconds: 45

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 59 additions & 0 deletions acceptance/bundle/config-remote-sync/split/isolation/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev/files...
Deploying resources...
Updating deployment state...
Deployment complete!

=== Rename the two-block task on job_a, and edit job_b in the same run
=== Sync
Detected changes in 2 resource(s):

Resource: resources.jobs.job_a
tasks[task_key='shared']: remove
tasks[task_key='shared_renamed']: add

Resource: resources.jobs.job_b
max_concurrent_runs: replace



=== job_b is updated, and job_a's rename is written in both blocks

>>> diff.py databricks.yml.backup databricks.yml
--- databricks.yml.backup
+++ databricks.yml
@@ -12,5 +12,5 @@
job_a:
tasks:
- - task_key: shared
+ - task_key: shared_renamed
max_retries: 1
notebook_task:
@@ -18,5 +18,5 @@

job_b:
- max_concurrent_runs: 1
+ max_concurrent_runs: 6
tasks:
- task_key: simple
@@ -31,4 +31,4 @@
job_a:
tasks:
- - task_key: shared
+ - task_key: shared_renamed
timeout_seconds: 45

>>> grep -c max_concurrent_runs: 6 databricks.yml
1

>>> grep -c task_key: shared_renamed databricks.yml
2

>>> [CLI] bundle destroy --auto-approve -t dev
The following resources will be deleted:
delete resources.jobs.job_a
delete resources.jobs.job_b

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev

Deleting files...
Destroy complete!
Loading
Loading