Skip to content

chore: move save_existing.go changeset out of common [CLD-2109]#22289

Merged
ChrisAmora merged 2 commits intodevelopfrom
ecpablo/port-save-existing
May 5, 2026
Merged

chore: move save_existing.go changeset out of common [CLD-2109]#22289
ChrisAmora merged 2 commits intodevelopfrom
ecpablo/port-save-existing

Conversation

@ecPablo
Copy link
Copy Markdown
Contributor

@ecPablo ecPablo commented May 4, 2026

Moving save existing changeset to ccip pkg. CCIP is the only user of these functions and they are using the address book which is deprecated.

AI Summary

This pull request refactors and reorganizes the tests for saving existing contract addresses in the deployment system. The main changes involve moving and updating test files, consolidating logic, and ensuring consistent usage of types and imports across the codebase. The tests are now better aligned with the new structure and more clearly separated between the ccip and common modules.

Key changes include:

Test Refactoring and Consolidation

  • Removed the save_existing_test.go test file from deployment/common/changeset and moved its tests to deployment/ccip/changeset/save_existing_test.go, updating them to use the ccip/changeset types and structure. [1] [2]
  • Added new and updated tests in deployment/ccip/changeset/save_existing_test.go to cover saving existing contracts, addresses with labels, and MCMS addresses, ensuring they use the correct environment and imports. [1] [2]

Imports and Type Consistency

  • Updated imports and type references in several files to consistently use the ccip/changeset package for ExistingContractsConfig and related types, replacing previous references to the common/changeset package. [1] [2] [3] [4] [5] [6] [7] [8]

Test Coverage Improvements

  • Added a new integration-style test for saving existing CCIP contracts in deployment/ccip/changeset/save_existing_ccip_test.go, which verifies the correct state is loaded after saving multiple contract types across multiple chains.

These changes improve maintainability and clarity of the test suite for contract address management in the deployment framework, and ensure all tests use the latest structure and conventions.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

✅ No conflicts with other open PRs targeting develop

@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented May 4, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@cl-sonarqube-production
Copy link
Copy Markdown

@ecPablo ecPablo marked this pull request as ready for review May 4, 2026 22:25
Copilot AI review requested due to automatic review settings May 4, 2026 22:25
@ecPablo ecPablo requested review from a team as code owners May 4, 2026 22:25
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

Risk Rating: MEDIUM — introduces a new SaveExistingContractsChangeset implementation under deployment/ccip/changeset (including address validation logic) and rewires CCIP v1.6 E2E logic/tests to use the new types; mistakes here can break deployment-time config handling.

Changes:

  • Moved the “save existing contracts” changeset API into deployment/ccip/changeset and updated CCIP v1.6 codepaths to use it.
  • Refactored tests: migrated former common tests into CCIP changeset tests and added an integration-style CCIP state-loading test.
  • Updated Solana and v1.6 E2E test/config code to reference the new ExistingContractsConfig/Contract types.

Scrupulous human review recommended (targeted areas):

  • deployment/ccip/changeset/save_existing.go: address validation semantics (EVM vs Solana) and error wrapping/diagnostics.
  • deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e.go: RemoveLinkTokenAddressIfExists mutation behavior and whether config validation expectations changed.
  • deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e_test.go: import block correctness and CI/lint compliance for tests.

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
deployment/common/changeset/save_existing_test.go Removed tests from common package as part of moving functionality to CCIP.
deployment/ccip/changeset/save_existing.go New CCIP-scoped changeset implementation with per-family address validation.
deployment/ccip/changeset/save_existing_test.go Unit tests for saving existing contracts, including label handling and MCMS label loading.
deployment/ccip/changeset/save_existing_ccip_test.go Added integration-style test verifying CCIP state loads correctly after saving addresses.
deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e.go Switched new-chain config and save-existing invocation to CCIP changeset types.
deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e_test.go Updated tests to build ExistingContractsConfig using the CCIP changeset package.
deployment/ccip/changeset/solana_v0_1_1/save_existing_test.go Updated Solana tests to use the CCIP changeset package location.

Comment on lines 22 to 28
mcmstypes "github.com/smartcontractkit/mcms/types"

"github.com/smartcontractkit/chainlink/deployment"
"github.com/smartcontractkit/chainlink/deployment/ccip/changeset"
"github.com/smartcontractkit/chainlink/deployment/ccip/changeset/globals"
"github.com/smartcontractkit/chainlink/deployment/ccip/changeset/internal"
"github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers"
Comment on lines +139 to 142
require.Len(t, addressForChain1, 1)
// load mcms state
mcmsState, err := changeset2.MaybeLoadMCMSWithTimelockChainState(dummyEnv.BlockChains.EVMChains()[chainsel.TEST_90000001.Selector], addressForChain1)
require.NoError(t, err)
@ChrisAmora ChrisAmora added this pull request to the merge queue May 5, 2026
@ecPablo ecPablo changed the title chore: move save_existing.go changeset out of common. chore: move save_existing.go changeset out of common [CLD-2109] May 5, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 5, 2026
@ChrisAmora ChrisAmora added this pull request to the merge queue May 5, 2026
Merged via the queue into develop with commit 7b9e7d1 May 5, 2026
319 of 321 checks passed
@ChrisAmora ChrisAmora deleted the ecpablo/port-save-existing branch May 5, 2026 13:36
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.

5 participants