Skip to content

feat: add support for multiple api key to deploy workflow [CLD-2307]#55

Merged
ecPablo merged 8 commits into
mainfrom
ecpablo/workflow-deploy-multi-api-key-support
May 15, 2026
Merged

feat: add support for multiple api key to deploy workflow [CLD-2307]#55
ecPablo merged 8 commits into
mainfrom
ecpablo/workflow-deploy-multi-api-key-support

Conversation

@ecPablo
Copy link
Copy Markdown
Contributor

@ecPablo ecPablo commented May 14, 2026

  • Adds support for multiple api key selection on deploy workflow
  • Fixes linting errors related to TON changeset from when lint checks were not required.

AI Summary

This pull request adds support for selecting among multiple named CRE API keys when deploying a workflow, by introducing an APIKeyName field to the deployment input and updating the workflow deploy operation accordingly. It also includes new tests to verify the correct propagation and error handling for this feature. Additionally, the mcms dependency is updated to a new version.

Feature: Support for selecting named CRE API keys

  • Added an optional APIKeyName field to the CREWorkflowDeployInput struct, allowing users to specify which CRE API key to use when multiple are configured.
  • Updated the CREWorkflowDeployOp operation to use the specified APIKeyName by calling WithNamedAPIKey on the CLI runner before performing any CLI operations. The operation version was bumped to 1.1.0 to reflect this change. [1] [2] [3]

Testing: Enhanced test coverage for API key selection

  • Added tests to ensure that APIKeyName is correctly propagated through the deployment changeset and to the CLI runner, and that errors are handled when an unknown API key is specified. [1] [2]

Dependencies

  • Updated the mcms dependency from v0.41.1 to v0.42.0 in go.mod.

Go module housekeeping

  • Moved the chainlink-ton/deployment dependency to the indirect section in go.mod for consistency.

MCMSSolanaState map[uint64]solstate.MCMSWithTimelockState
MCMSAptosState map[uint64]aptos.AccountAddress
MCMSTONState map[uint64]tonstate.MCMSChainState
MCMSTONState map[uint64]cldfproposalutils.TonMCMSChainState
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was moved to cldf to prevent import cycles as a workaround, but we'll need a bigger refactor here that involves moving this type and all of the code in chainlink-ton/deployment to cld-changesets inside pk/family/ton/mcms/state.go

@ecPablo ecPablo marked this pull request as ready for review May 15, 2026 18:44
@ecPablo ecPablo requested a review from a team as a code owner May 15, 2026 18:44
Copilot AI review requested due to automatic review settings May 15, 2026 18:44
@ecPablo ecPablo enabled auto-merge (squash) May 15, 2026 18:45
@ecPablo ecPablo changed the title feat: add support for multiple api key to deploy workflow feat: add support for multiple api key to deploy workflow [CLD-2307] May 15, 2026
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

This PR adds support for selecting a specific named CRE API key when deploying workflows (for environments where CRE_API_KEY is configured as a JSON object of named keys). It also adjusts TON MCMS state wiring and performs dependency tidying/upgrades.

Changes:

  • Add APIKeyName to CREWorkflowDeployInput and select the named key via CLIRunner.WithNamedAPIKey during workflow deploy.
  • Add/extend tests to verify API key selection behavior and error handling; refactor tests to use slices.Index.
  • Update dependencies (notably chainlink-deployments-framework, mcms, and others) and clean up TON-related state typing.

Reviewed changes

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

Show a summary per file
File Description
cre/operations/workflow_deploy.go Adds APIKeyName, detects named-key configuration, and selects the named key runner before executing deploy.
cre/operations/workflow_deploy_test.go Adds tests for API key selection and required-field behavior; switches to slices.Index.
cre/operations/workflow_delete_test.go Switches to slices.Index and minor formatting alignment.
cre/changesets/workflow_deploy_test.go Adds changeset-level coverage ensuring APIKeyName propagates to WithNamedAPIKey.
legacy/mcms/proposeutils/propose.go Updates TON MCMS state type to use framework proposalutils type, removing TON deployment state import.
go.mod Dependency upgrades/tidy (including mcms and chainlink-deployments-framework).
go.sum Corresponding dependency checksum updates.

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

Comment on lines +110 to +118
if usesNamedAPIKeys(deps.CRECfg.Auth.APIKey) && strings.TrimSpace(input.APIKeyName) == "" {
return CREWorkflowDeployOutput{}, errors.New("cre workflow deploy: apiKeyName is required when CRE_API_KEY is configured as a JSON object of named API keys")
}

cli := deps.CLI
if input.APIKeyName != "" {
selected, err := deps.CLI.WithNamedAPIKey(input.APIKeyName)
if err != nil {
return CREWorkflowDeployOutput{}, fmt.Errorf("select cre api key %q: %w", input.APIKeyName, err)
Comment thread go.mod
Comment on lines 21 to 24
github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260421142741-9c7fbaf7c828
github.com/smartcontractkit/chainlink-protos/job-distributor v0.18.0
github.com/smartcontractkit/chainlink-ton/deployment v0.0.0-20260430134932-681b7a7fe426
github.com/smartcontractkit/mcms v0.41.1
github.com/smartcontractkit/mcms v0.43.0
github.com/smartcontractkit/quarantine v0.0.0-20251203215908-fd0551c6adf9
@ecPablo ecPablo merged commit a68f156 into main May 15, 2026
18 checks passed
@ecPablo ecPablo deleted the ecpablo/workflow-deploy-multi-api-key-support branch May 15, 2026 18:54
ecPablo pushed a commit that referenced this pull request May 18, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.4.0](v0.3.0...v0.4.0)
(2026-05-18)


### Features

* add changeset and operation to delete CRE workflow
([#54](#54))
([f0e341a](f0e341a))
* add support for multiple api key to deploy workflow
([#55](#55))
([a68f156](a68f156))
* transfer native
([#56](#56))
([4368e49](4368e49))


### Bug Fixes

* use cache dir for sol programs loading
([#52](#52))
([b04f4d9](b04f4d9))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: app-token-issuer-ops-platform[bot] <275822481+app-token-issuer-ops-platform[bot]@users.noreply.github.com>
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