Fix config sync when nested node is added to non-existing parent#4378
Merged
ilyakuz-db merged 10 commits intomainfrom Jan 29, 2026
Merged
Fix config sync when nested node is added to non-existing parent#4378ilyakuz-db merged 10 commits intomainfrom
ilyakuz-db merged 10 commits intomainfrom
Conversation
Collaborator
|
Commit: 5091563
25 interesting tests: 9 KNOWN, 7 flaky, 5 SKIP, 4 RECOVERED
Top 50 slowest tests (at least 2 minutes):
|
ilyakuz-db
commented
Jan 28, 2026
| return "/" + strings.Join(parts, "/"), nil | ||
| } | ||
|
|
||
| // findResourceFileLocation finds the file where a resource is defined. |
Contributor
Author
There was a problem hiding this comment.
This is not needed as GetLocation always return the correct location for the file even if not queried with /targets/ prefix
ilyakuz-db
commented
Jan 28, 2026
| periodic: | ||
| interval: 1 | ||
| unit: DAYS | ||
| tags: |
Contributor
Author
There was a problem hiding this comment.
Removing this here to simulate situation where job has no tags in the config but new tag was added on the remote
denik
approved these changes
Jan 29, 2026
| // extractMissingPath extracts the missing path from error message like: | ||
| // "op add /a/b/c/d: parent path /a/b does not exist" | ||
| // Returns: "/a/b" | ||
| func extractMissingPath(err error) (yamlpatch.Path, error) { |
Contributor
There was a problem hiding this comment.
which package does this error come from originally? Can we use errors.Is to avoid string match?
Contributor
Author
There was a problem hiding this comment.
From yamlpatch itself, it is not exported unfortunatly https://github.com/palantir/pkg/blob/d1f32030e5b6d12d468dc8a29235952f2fb92509/yamlpatch/internal/yamlpatchcommon/patch.go#L72
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
Fix the missing parent issue when adding new tags on the remote. When we do the addition operation to the config, we look for the error trace and see what intermediate nodes we should create. We do string matching, which is less robust, but acceptance tests should cover potential issues
One potential caveat is that the created structure might be incomplete from a config perspective, but these should be filtered out early on the bundle plan level
Why
Example issue - add a tag when tags are not yet defined
Tests
Updated acceptance to capture the incorrect behavior