Allow key-based yaml anchoring#1051
Conversation
🦋 Changeset detectedLatest commit: 438c3aa The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Pull request overview
This PR improves YAML handling in the CLD pipeline input layer to correctly support YAML anchors/aliases and merge keys (<<), allowing more complex YAML inputs to be decoded into JSON-safe structures while preserving numeric fidelity (e.g., json.Number).
Changes:
- Added key stringification helper (
anyToJSONMapKey) and enhanced YAML node decoding to support alias keys and merge keys (<<) with error reporting. - Updated YAML parsing and config resolution paths to propagate decode errors from
YamlNodeToAny. - Expanded unit tests to cover alias keys, merge keys, and invalid merge values; added a changeset entry.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| engine/cld/pipeline/input/yaml.go | Implements YAML node-to-any decoding with merge key support and improved map-key handling. |
| engine/cld/pipeline/input/yaml_test.go | Adds tests for alias map keys, merge keys, invalid merge values, and JSON-safe key conversion. |
| engine/cld/pipeline/input/resolve.go | Propagates YAML decode errors when resolving changeset configs. |
| .changeset/loud-trams-jog.md | Declares a minor release entry for the YAML anchor/merge support feature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6c5c8c1 to
2e2d635
Compare
2e2d635 to
9b7a98d
Compare
Return errors for invalid <<: targets, support sequence merges, and propagate YamlNodeToAny decode failures through the parse path.
9b7a98d to
81945d9
Compare
|
|
||
| // YamlNodeToAny converts a yaml.Node to a generic any value. | ||
| // This is the stable exported API; decode errors are ignored and nil is returned. | ||
| func YamlNodeToAny(node *yaml.Node) any { |
There was a problem hiding this comment.
unfortunately this was suppose to be exported , but currently single usage in Chainlink repo so we have to maintain this signature for now.
|


This pull request enhances the Chainlink Deployments Framework's YAML parsing to provide robust support for YAML anchors and merge keys (<<), ensuring that complex YAML features are correctly handled when processing pipeline input files. The changes also improve error handling and extend test coverage for these YAML features.
eg