Skip to content

Conversation

@graham-chainlink
Copy link
Collaborator

@graham-chainlink graham-chainlink commented Jan 23, 2026

There is a bug where loading the network configs will load other yamls under .config/XXX instead of just .config/networks.

There are already tests that checks reading from .config/networks.

There is a bug where loading the network configs will load all yamls under `.config` instead of `.config/networks`.
@changeset-bot
Copy link

changeset-bot bot commented Jan 23, 2026

🦋 Changeset detected

Latest commit: 73fadc4

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 Patch

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

@graham-chainlink graham-chainlink marked this pull request as ready for review January 23, 2026 04:32
@graham-chainlink graham-chainlink requested a review from a team as a code owner January 23, 2026 04:33
Copilot AI review requested due to automatic review settings January 23, 2026 04:33
Copy link
Contributor

Copilot AI left a comment

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 fixes a bug where network configuration loading incorrectly scanned all YAML files under .config instead of limiting the scan to .config/networks. The fix ensures network configs are loaded only from the intended subdirectory.

Changes:

  • Updated loadNetworkConfig function to use .config/networks directory instead of .config
  • Removed recursive subdirectory scanning (** glob pattern) to prevent loading unrelated YAML files
  • Updated comments and error messages to reflect the corrected directory path

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
engine/cld/config/networks.go Changed directory path from .config to .config/networks and removed recursive glob patterns
.changeset/fuzzy-mice-arrive.md Added changelog entry documenting the bug fix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cl-sonarqube-production
Copy link

return nil, fmt.Errorf("cannot find config directory: %w", err)
}

// Find all yaml config files in the .config directory and any subdirectories
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we still retain the subdirectories here? Not sure if this will affect any domains

Copy link
Collaborator Author

@graham-chainlink graham-chainlink Jan 23, 2026

Choose a reason for hiding this comment

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

So what i learnt is that ** only matches 1 directory. Nested recursion never worked. ** is behaves exactly as *

If i have these files under .config/

   [0 level(s)] direct.yaml
   [1 level(s)] local/local.yaml
   [1 level(s)] networks/networks.yaml
   [3 level(s)] networks/sub1/sub2/deep.yaml
   [2 level(s)] networks/subdir/nested.yaml
   Total: 5 files

Files matched by ymlFiles, err := filepath.Glob(filepath.Join(configDir, "**", "*.yaml"))

   ✅ [1 level(s)] local/local.yaml
   ✅ [1 level(s)] networks/networks.yaml
   Total: 2 files
   ❌ [0 level(s)] direct.yaml
   ❌ [3 level(s)] networks/sub1/sub2/deep.yaml
   ❌ [2 level(s)] networks/subdir/nested.yaml
   Total: 3 files

My change basically just ensure instead of ** , we match networks

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Great thanks!I didn't know that

@graham-chainlink graham-chainlink changed the title fix(network): stop loading all yamls in .config fix(network): stop loading other yamls in .config on the same level Jan 23, 2026
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.

3 participants