Skip to content

Conversation

@anirudhwarrier
Copy link
Collaborator

@anirudhwarrier anirudhwarrier commented Nov 21, 2025

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:

  • Added a new Changeset transaction type to the TxType enum and transaction execution logic in cmd/client/tx.go, allowing commands to handle changeset workflows. [1] [2] [3]
  • Updated 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:

  • Replaced AddRawTxFlag with a more general AddTxnTypeFlags in all affected commands, making transaction type selection more flexible and consistent. [1] [2] [3] [4]

Utility and integration improvements:

  • Added a utility function WriteChangesetFile in cmd/common/utils.go to handle YAML marshaling and file writing for changeset files.
  • Updated imports and handler structs to support the new changeset logic and ensure correct dependencies are included throughout the codebase. [1] [2] [3] [4] [5] [6] [7]

Workflow registry integration:

  • Refactored AllowlistRequest in workflow_registry_v2_client.go to return a TxOutput and 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.

@anirudhwarrier anirudhwarrier force-pushed the DEVSVCS-3154/add-changeset-txtype branch from 269dfa1 to 50cfb19 Compare November 21, 2025 11:37
@anirudhwarrier anirudhwarrier force-pushed the DEVSVCS-3154/add-changeset-txtype branch from 505c3b5 to 860ef4d Compare December 31, 2025 16:31
@anirudhwarrier anirudhwarrier force-pushed the DEVSVCS-3154/add-changeset-txtype branch from bf17e12 to 9084157 Compare January 2, 2026 09:16
@anirudhwarrier anirudhwarrier force-pushed the DEVSVCS-3154/add-changeset-txtype branch 4 times, most recently from 21c38d8 to 4095e5e Compare January 2, 2026 10:40
@anirudhwarrier anirudhwarrier force-pushed the DEVSVCS-3154/add-changeset-txtype branch from 4095e5e to fc0af95 Compare January 2, 2026 11:05
@anirudhwarrier anirudhwarrier force-pushed the DEVSVCS-3154/add-changeset-txtype branch from 6a1a1c8 to 4e1b37b Compare January 6, 2026 20:05
@anirudhwarrier anirudhwarrier requested a review from Copilot January 6, 2026 20:06
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 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 Changeset transaction type alongside existing Regular, Raw, and Ledger types
  • 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
Copy link

Copilot AI Jan 6, 2026

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).

Suggested change
_ = 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)
}

Copilot uses AI. Check for mistakes.
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.

1 participant