Repository navigation
fix: build low models from immutable YAML merge views - #658
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #658 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 309 309
Lines 39213 39178 -35
=========================================
- Hits 39213 39178 -35
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
@daveshanley can I get a review? |
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.
Building a document with YAML merges can mutate a shared
yaml.Node.Contentwhile another model-building goroutine reads it, as reproduced in #657. Model construction now reads merge-expanded views without rewriting the published source graph.The existing merge-view helper is exposed as
utils.ResolveMergeNodesand used throughout low-level model construction. It preserves local-key and merge-sequence precedence, retains original key/value nodes and metadata, and preserves node identity when expansion is unnecessary. Low-level roots describe the effective mapping; source nodes retain their authored merges.CheckForMergeNodeskeeps its explicitly destructive public behavior.Typed map fields also consume effective contents directly. This removes the discriminator parser's dependency on an earlier validation call mutating its mapping, while retaining source nodes in field metadata.
Regression coverage checks source preservation, merged fields, original metadata pointers, alias/sequence precedence, mapping cycles, and render/reload behavior. Validation includes race-enabled helper and low/high model packages, the public-API reproduction, and merge/alias/sibling-reference/discriminator integration checks.
Fixes #657.