bundle: route config sync edits to the block that defines them - #6117
Open
ilyakuz-db wants to merge 1 commit into
Open
bundle: route config sync edits to the block that defines them#6117ilyakuz-db wants to merge 1 commit into
ilyakuz-db wants to merge 1 commit into
Conversation
Contributor
Approval status: pending
|
Collaborator
Integration test reportCommit: f957e06
10 interesting tests: 4 SKIP, 3 KNOWN, 2 flaky, 1 RECOVERED
Top 3 slowest tests (at least 2 minutes):
|
ilyakuz-db
force-pushed
the
configsync/acc-split-list-baseline
branch
from
July 31, 2026 13:33
c6a5c96 to
711e1c7
Compare
ilyakuz-db
force-pushed
the
configsync/block-provenance
branch
from
July 31, 2026 13:33
12b54e7 to
ac0c041
Compare
ilyakuz-db
force-pushed
the
configsync/acc-split-list-baseline
branch
from
July 31, 2026 13:41
711e1c7 to
00635ac
Compare
ilyakuz-db
force-pushed
the
configsync/block-provenance
branch
from
July 31, 2026 13:41
ac0c041 to
388627d
Compare
ilyakuz-db
force-pushed
the
configsync/acc-split-list-baseline
branch
from
July 31, 2026 17:55
00635ac to
0d5de02
Compare
ilyakuz-db
force-pushed
the
configsync/block-provenance
branch
from
July 31, 2026 17:55
388627d to
0dec516
Compare
Co-authored-by: Isaac
ilyakuz-db
force-pushed
the
configsync/acc-split-list-baseline
branch
from
July 31, 2026 19:16
0d5de02 to
3854cff
Compare
ilyakuz-db
force-pushed
the
configsync/block-provenance
branch
from
July 31, 2026 19:16
0dec516 to
f957e06
Compare
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.
Changes
Routes each
config-remote-syncchange back to the YAML block that actually defines it, instead of using a merged-view position against a single file.New
bundle/configsync/blockindex.goreloads the bundle through the standard loader mutators without selecting a target, so the top-level andtargets.<target>regions are still separate and every value carries the location of the one place it was written. That gives a location → block mapping.resolveSelectorsnow records the sequence elements a change path traverses, and each merged index is rewritten into the index inside the chosen block.yamlFileIndexis deleted — it counted elements sharing a file, which cannot distinguish a top-level block from a target override in that same file.How a destination gets picked:
max_retriesandtimeout_secondson the same task go to different blocks);Index bookkeeping (
indicesToReplaceMap,indexOperations) is now scoped per block, so a removal in one block no longer shifts indices in another.Golden diffs in this PR, against the corruption recorded by the parent:
split_keyed_removeandsplit_positionalpreviously failed outright (remove index key out of bounds,parent path ... does not exist) and now apply. Removing a task defined in both blocks goes fromtask_key: bothcount 1 — half-deleted, the other half orphaned — to 0.Why
The merged list and the physical blocks disagree on both order and length, so a merged index addresses the wrong element — or no element — in any single block.
FieldCandidatesmade this worse by guessing: it emitted[path, targets.<t>.path]andpatch.gotried the top-level pointer first, falling back only on error, so a top-level block that happened to have an element at that index silently accepted the patch. Routing is now exact, and the candidate list holds the single resolved path.The sync is unattended, so leaving a change for the next run is acceptable; writing it to the wrong place is not.
Tests
The six split goldens flip from corrupted to correct. All 21 pre-existing directories are byte-for-byte unchanged — including
job_multiple_tasks, which covers edit/add/remove/rename on a single-block job and is the evidence that the common path is unaffected, andmultiple_files, which covers renames withdepends_onreferences across included files. Unit tests inblockindex_test.gocover per-field routing on a two-block element, removal spanning every defining block, and placement into the right included file.