feat: add support for multiple api key to deploy workflow [CLD-2307]#55
Conversation
| MCMSSolanaState map[uint64]solstate.MCMSWithTimelockState | ||
| MCMSAptosState map[uint64]aptos.AccountAddress | ||
| MCMSTONState map[uint64]tonstate.MCMSChainState | ||
| MCMSTONState map[uint64]cldfproposalutils.TonMCMSChainState |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
APIKeyNametoCREWorkflowDeployInputand select the named key viaCLIRunner.WithNamedAPIKeyduring 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.
| 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) |
| 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 |
🤖 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>
AI Summary
This pull request adds support for selecting among multiple named CRE API keys when deploying a workflow, by introducing an
APIKeyNamefield 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, themcmsdependency is updated to a new version.Feature: Support for selecting named CRE API keys
APIKeyNamefield to theCREWorkflowDeployInputstruct, allowing users to specify which CRE API key to use when multiple are configured.CREWorkflowDeployOpoperation to use the specifiedAPIKeyNameby callingWithNamedAPIKeyon 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
APIKeyNameis 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
mcmsdependency from v0.41.1 to v0.42.0 ingo.mod.Go module housekeeping
chainlink-ton/deploymentdependency to the indirect section ingo.modfor consistency.