Skip to content

feat(utils): introduce ExecuteOnChainSequenceAndMerge#1041

Merged
graham-chainlink merged 1 commit into
mainfrom
ggoh/cld-2464/run-merge-seq
Jun 10, 2026
Merged

feat(utils): introduce ExecuteOnChainSequenceAndMerge#1041
graham-chainlink merged 1 commit into
mainfrom
ggoh/cld-2464/run-merge-seq

Conversation

@graham-chainlink

@graham-chainlink graham-chainlink commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Introduced ExecuteOnChainSequenceAndMerge util which originated from ccip tooling api here

This utils allows user to execute multiple sequence and accumulate their results into an object call OnChainOutput

import (
    "github.com/smartcontractkit/chainlink-deployments-framework/changeset/sequenceutils"
)
// Run multiple sequences and accumulate into one OnChainOutput.
var agg sequenceutils.OnChainOutput
agg, err = sequenceutils.ExecuteOnChainSequenceAndMerge(
    env.OperationsBundle, deps, deploySeq, deployInput, agg,
)
if err != nil {
    return agg, err
}
agg, err = sequenceutils.ExecuteOnChainSequenceAndMerge(
    env.OperationsBundle, deps, configureSeq, configureInput, agg,
)
if err != nil {
    return agg, err // prior merges preserved in agg
}

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

@changeset-bot

changeset-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d169a8e

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 introduces a small sequenceutils helper for running multiple operations.Sequence instances that return OnChainOutput and accumulating their results into a single OnChainOutput, along with unit tests validating key merge behaviors.

Changes:

  • Added ExecuteOnChainSequenceAndMerge utility to execute a sequence and merge its OnChainOutput into an accumulator.
  • Added tests covering success, execution failure preservation, non-deduping behavior, and env metadata conflict behavior.

Reviewed changes

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

File Description
changeset/sequenceutils/merge.go Adds the merge utility for aggregating OnChainOutput across multiple sequence executions.
changeset/sequenceutils/merge_test.go Adds unit tests for merge behavior and error handling.

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

Comment thread changeset/sequenceutils/merge.go
Comment thread changeset/sequenceutils/merge.go
Comment thread changeset/sequenceutils/merge_test.go Outdated

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 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread changeset/sequenceutils/merge.go
Comment thread changeset/sequenceutils/merge.go Outdated
@graham-chainlink graham-chainlink force-pushed the ggoh/cld-2464/run-merge-seq branch from 570e897 to 810c31a Compare June 10, 2026 06:36
@graham-chainlink graham-chainlink marked this pull request as ready for review June 10, 2026 06:37
@graham-chainlink graham-chainlink requested a review from a team as a code owner June 10, 2026 06:37
Copilot AI review requested due to automatic review settings June 10, 2026 06:37

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 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread .changeset/strong-spiders-end.md
Comment thread changeset/sequenceutils/merge.go Outdated
Comment thread changeset/sequenceutils/merge.go Outdated
Introduced ExecuteOnChainSequenceAndMerge util which originated from ccip tooling api [here](https://github.com/smartcontractkit/chainlink-ccip/blob/298ed1c38d5cda61a688beb2494a96a5409daf3d/deployment/utils/sequences/sequences.go#L46)

This utils allows user to execute multiple sequence and accumulate their results into an object call OnChainOutput

JIRA: https://smartcontract-it.atlassian.net/browse/CLD-2464
@graham-chainlink graham-chainlink force-pushed the ggoh/cld-2464/run-merge-seq branch from 810c31a to d169a8e Compare June 10, 2026 06:47
@graham-chainlink graham-chainlink changed the title feat(utils): introduce merge sequence feat(utils): introduce ExecuteOnChainSequenceAndMerge Jun 10, 2026
@cl-sonarqube-production

Copy link
Copy Markdown

Comment on lines +20 to +22
deps DEP,
seq *operations.Sequence[IN, OnChainOutput, DEP],
input IN,

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.

I'm finding the ordering of arguments here unintiutive (seq, deps, input would be better to me) but I assume that this keeps it backwards compatible.

Not a blocker though

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.

ah yes, the sequence generic type ordering has always been like this

type Sequence[IN, OUT, DEP any] struct {
	def     Definition
	handler SequenceHandler[IN, OUT, DEP]
}

@graham-chainlink graham-chainlink added this pull request to the merge queue Jun 10, 2026
Merged via the queue into main with commit 7ecc2db Jun 10, 2026
29 checks passed
@graham-chainlink graham-chainlink deleted the ggoh/cld-2464/run-merge-seq branch June 10, 2026 13:24
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