-
Notifications
You must be signed in to change notification settings - Fork 6
feat: add changeset tx type #189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
269dfa1 to
50cfb19
Compare
505c3b5 to
860ef4d
Compare
bf17e12 to
9084157
Compare
21c38d8 to
4095e5e
Compare
4095e5e to
fc0af95
Compare
6a1a1c8 to
4e1b37b
Compare
There was a problem hiding this 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 introduces support for a new "changeset" transaction type, enabling users to generate YAML changeset files for key linking, unlinking, secrets management, and workflow operations instead of executing transactions directly on-chain. This facilitates multi-stage, auditable changes that can be consumed by external deployment tooling (CLD).
Key changes:
- Added
Changesettransaction type alongside existingRegular,Raw, andLedgertypes - Implemented changeset generation logic across workflow commands (deploy, activate, pause, delete) and secrets operations
- Introduced CLD settings configuration for changeset file generation paths and MCMS parameters
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/types/changeset.go | Defines new changeset file structures and operation types |
| internal/settings/workflow_settings.go | Adds CLD settings configuration structure for changeset paths and MCMS parameters |
| internal/settings/settings_load.go | Adds changeset flag and consolidates transaction type flag handling |
| internal/settings/settings_get.go | Adds MCMS config getter and updates owner validation logic for changeset type |
| go.mod | Updates dependencies including chainlink deployment packages required for changeset support |
| cmd/workflow/*/*.go | Implements changeset generation for workflow operations (deploy, pause, activate, delete) |
| cmd/secrets/*/*.go | Implements changeset generation for secrets operations (list, create, update, delete, execute) |
| cmd/common/utils.go | Adds utility function to write changeset YAML files |
| cmd/client/workflow_registry_v2_client.go | Refactors AllowlistRequest to return TxOutput supporting changeset type |
| cmd/client/tx.go | Adds changeset transaction type handling |
| cmd/client/client_factory.go | Adds changeset type detection in transaction factory |
| cmd/account/link_key/link_key.go | Implements changeset generation for key linking |
| cmd/account/unlink_key/unlink_key.go | Implements changeset generation for key unlinking |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| func AddRawTxFlag(cmd *cobra.Command) { | ||
| cmd.Flags().Bool(Flags.RawTxFlag.Name, false, "If set, the command will either return the raw transaction instead of sending it to the network or execute the second step of secrets operations using a previously generated raw transaction") | ||
| cmd.Flags().Bool(Flags.Changeset.Name, false, "If set, the command will output a changeset YAML for use with CLD instead of sending the transaction to the network") | ||
| _ = cmd.LocalFlags().MarkHidden(Flags.Changeset.Name) // hide changeset flag as this is not a public feature |
Copilot
AI
Jan 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error from MarkHidden is silently discarded. Consider logging or handling this error, especially since hiding the flag is part of the feature's design (being non-public).
| _ = cmd.LocalFlags().MarkHidden(Flags.Changeset.Name) // hide changeset flag as this is not a public feature | |
| if err := cmd.LocalFlags().MarkHidden(Flags.Changeset.Name); err != nil { // hide changeset flag as this is not a public feature | |
| fmt.Fprintf(os.Stderr, "warning: failed to hide --%s flag: %v\n", Flags.Changeset.Name, err) | |
| } |
DEVSVCS-3460
This pull request introduces support for a new "changeset" transaction type across several CLI commands, enabling users to generate YAML changeset files for key linking, unlinking, and secrets management workflows. It also consolidates transaction type flag handling and adds utility functions for writing changeset files. The most significant changes are grouped below:
Support for "changeset" transaction type in CLI commands:
Changesettransaction type to theTxTypeenum and transaction execution logic incmd/client/tx.go, allowing commands to handle changeset workflows. [1] [2] [3]link_key,unlink_key, and secrets commands to support the new transaction type, generating and writing YAML changeset files when selected. This includes logic to build the changeset payloads and write them to the appropriate directory. [1] [2] [3] [4] [5]Flag handling and codebase consistency:
AddRawTxFlagwith a more generalAddTxnTypeFlagsin all affected commands, making transaction type selection more flexible and consistent. [1] [2] [3] [4]Utility and integration improvements:
WriteChangesetFileincmd/common/utils.goto handle YAML marshaling and file writing for changeset files.Workflow registry integration:
AllowlistRequestinworkflow_registry_v2_client.goto return aTxOutputand support the new transaction type, enabling the allowlist operation to participate in the changeset workflow.These changes collectively enable the CLI to support multi-stage, auditable changes via YAML changesets, improving workflow flexibility and external integration.