Skip to content

Allow key-based yaml anchoring#1051

Merged
graham-chainlink merged 3 commits into
mainfrom
allow-more-yaml-anchoring
Jun 18, 2026
Merged

Allow key-based yaml anchoring#1051
graham-chainlink merged 3 commits into
mainfrom
allow-more-yaml-anchoring

Conversation

@RensR

@RensR RensR commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

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

a: &a
  x: from_a
  only_a: 1
b: &b
  x: from_b
  only_b: 2
m:
  <<: [*a, *b]

@changeset-bot

changeset-bot Bot commented Jun 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 438c3aa

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
chainlink-deployments-framework Minor

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread engine/cld/pipeline/input/yaml.go
Comment thread engine/cld/pipeline/input/yaml.go
Comment thread .changeset/loud-trams-jog.md Outdated
@RensR RensR marked this pull request as ready for review June 17, 2026 09:43
@RensR RensR requested a review from a team as a code owner June 17, 2026 09:43
@graham-chainlink graham-chainlink force-pushed the allow-more-yaml-anchoring branch from 6c5c8c1 to 2e2d635 Compare June 18, 2026 04:00
@graham-chainlink graham-chainlink requested a review from Copilot June 18, 2026 04:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread engine/cld/pipeline/input/yaml.go
@graham-chainlink graham-chainlink force-pushed the allow-more-yaml-anchoring branch from 2e2d635 to 9b7a98d Compare June 18, 2026 04:06
Return errors for invalid <<: targets, support sequence merges, and
propagate YamlNodeToAny decode failures through the parse path.
@graham-chainlink graham-chainlink force-pushed the allow-more-yaml-anchoring branch from 9b7a98d to 81945d9 Compare June 18, 2026 04:10

// 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 {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

unfortunately this was suppose to be exported , but currently single usage in Chainlink repo so we have to maintain this signature for now.

@graham-chainlink graham-chainlink added this pull request to the merge queue Jun 18, 2026
@cl-sonarqube-production

Copy link
Copy Markdown

Quality Gate failed Quality Gate failed

Failed conditions
72.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube

Merged via the queue into main with commit f267cfc Jun 18, 2026
28 of 29 checks passed
@graham-chainlink graham-chainlink deleted the allow-more-yaml-anchoring branch June 18, 2026 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants