Skip to content

feat(cmd/pipeline): Run all changesets support --all#999

Draft
graham-chainlink wants to merge 2 commits into
mainfrom
ggoh/cld-2430/run-all
Draft

feat(cmd/pipeline): Run all changesets support --all#999
graham-chainlink wants to merge 2 commits into
mainfrom
ggoh/cld-2430/run-all

Conversation

@graham-chainlink
Copy link
Copy Markdown
Collaborator

@graham-chainlink graham-chainlink commented May 20, 2026

Adding the ability to execute all changesets using the pipeline run command by introduing the --all flag.

		# Run all changesets sequentially defined in the input file
		chainlink-deployments pipeline run \
  		--environment testnet \
  		--input-file inputs.yaml \
  		--all

Docs: https://github.com/smartcontractkit/chainlink-deployments/pull/14400

JIRA: https://smartcontract-it.atlassian.net/browse/CLD-2430

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 20, 2026

🦋 Changeset detected

Latest commit: 2ab4d60

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

Copy link
Copy Markdown
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

Adds --all support to chainlink-deployments pipeline run to execute every changeset in an inputs YAML sequentially, reusing a single durable-pipelines artifact timestamp for the whole run.

Changes:

  • Add --all/-a flag and flag exclusivity rules for pipeline run.
  • Refactor execution flow into runSingleChangeset, runAllChangesets, and shared applyChangeset.
  • Add tests covering --all success, fail-fast behavior, mutual exclusivity, and invalid input file handling.

Reviewed changes

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

File Description
engine/cld/commands/pipeline/run.go Introduces --all flag, refactors execution into helpers, and implements sequential multi-changeset execution.
engine/cld/commands/pipeline/run_test.go Adds test coverage for --all behavior (success, fail-fast, exclusivity, invalid input).

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

Comment thread engine/cld/commands/pipeline/run.go
Comment thread engine/cld/commands/pipeline/run.go Outdated
@graham-chainlink graham-chainlink force-pushed the ggoh/cld-2430/run-all branch from 3ee6f30 to 88f1eef Compare May 20, 2026 05:56
@graham-chainlink graham-chainlink marked this pull request as ready for review May 20, 2026 06:05
@graham-chainlink graham-chainlink requested a review from a team as a code owner May 20, 2026 06:05
Copilot AI review requested due to automatic review settings May 20, 2026 06:05
data, ok := changesets.([]any)
if !ok {
return nil, errors.New("invalid 'changesets' format for index access, expected array format")
return nil, errors.New("invalid 'changesets' format, expected array format")
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

the "index access" may confuse users when using --all flag, so removing it

Copy link
Copy Markdown
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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comment thread engine/cld/commands/pipeline/run.go Outdated
Comment thread engine/cld/commands/pipeline/run.go Outdated
Comment thread engine/cld/commands/pipeline/run_test.go
@graham-chainlink graham-chainlink force-pushed the ggoh/cld-2430/run-all branch from 88f1eef to 628ce82 Compare May 20, 2026 07:54
Adding the ability to execute all changesets using the pipeline run command by introduing the --all flag.

```
		# Run all changesets sequentially defined in the input file
		chainlink-deployments pipeline run \
  		--environment testnet \
  		--input-file inputs.yaml \
  		--all
```

JIRA: https://smartcontract-it.atlassian.net/browse/CLD-2430
Copilot AI review requested due to automatic review settings May 20, 2026 11:08
@graham-chainlink graham-chainlink force-pushed the ggoh/cld-2430/run-all branch from 628ce82 to 129184e Compare May 20, 2026 11:08
Copy link
Copy Markdown
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

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

Comment on lines +192 to +197
for i, cs := range changesets {
cfg.Logger.Infof("[%d/%d] Applying changeset %s", i+1, len(changesets), cs.Name)

if err := artdir.SetDurablePipelines(strconv.FormatInt(time.Now().UnixNano(), 10)); err != nil {
return err
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

i wan this behaviour

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.

What will happen to datastore updates inside a loop? Currently we update catalog/datastore between each changeset execution and then we use the timestamp to merge the artifacts for the specific run using another cld command.

Here we are executing all changesets which means the env datastore will be out-of-date since it will not have information about what the previous changeset deployed.

Also, how this is going to work in CI? we will need a new merge logic to discover all new artifacts and merge them at the same time 🤔

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yeah good pick up

  • this will only be used locally for now
  • i will add the logic to perform the merge for datastore and addresbook after each changeset execution

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

but lets discuss this on thursday tech sync too!

@cl-sonarqube-production
Copy link
Copy Markdown

@graham-chainlink graham-chainlink marked this pull request as draft May 20, 2026 12:07
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