Skip to content

chore: reorg codegen logic and add test gobindings#950

Merged
graham-chainlink merged 2 commits intomainfrom
chore/add-testdata-go-bindings-and-split-ops-codegen
Apr 23, 2026
Merged

chore: reorg codegen logic and add test gobindings#950
graham-chainlink merged 2 commits intomainfrom
chore/add-testdata-go-bindings-and-split-ops-codegen

Conversation

@RayXpub
Copy link
Copy Markdown
Contributor

@RayXpub RayXpub commented Apr 22, 2026

Summary

This PR reorganizes the operations code generation logic by splitting the single evm.go file into:

  • evm.go — Handler
  • config.go — YAML config structs
  • abi.go — ABI parsing
  • contract.goContractInfo extraction and struct def collection
  • codegen.go — template data types, rendering, and naming helpers

This PR does not introduce any code logic change, it is purely a code reorg to improve readability and code management. It also introduces go bindings under testdata to anticipate upcoming changes which will update the code generation logic to build on top of gobindings (#949).

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 22, 2026

⚠️ No Changeset found

Latest commit: 87b9363

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@RayXpub RayXpub marked this pull request as ready for review April 22, 2026 17:10
@RayXpub RayXpub requested a review from a team as a code owner April 22, 2026 17:10
Copilot AI review requested due to automatic review settings April 22, 2026 17:10
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 refactors the EVM operations generator implementation by splitting the previously monolithic EVM generator file into focused modules (config, ABI parsing, contract extraction, codegen), and adds pre-generated Go bindings under testdata to support upcoming gobindings-based generation work.

Changes:

  • Split EVM generator responsibilities across new config.go, abi.go, contract.go, and codegen.go files while keeping evm.go as the handler entrypoint.
  • Update tests to use an external test package (evm_test) and add targeted unit tests for codegen/name helpers.
  • Add abigen-style Go bindings under tools/operations-gen/testdata/evm/gobindings/... for future generator evolution.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tools/operations-gen/testdata/evm/gobindings/v1_0_0/many_chain_multisig/many_chain_multisig.go Adds generated gobindings fixture for ManyChainMultiSig contract.
tools/operations-gen/testdata/evm/gobindings/v1_0_0/link_token/link_token.go Adds generated gobindings fixture for LinkToken contract.
tools/operations-gen/internal/families/evm/evm_golden_test.go Moves golden tests to evm_test and updates references to exported APIs.
tools/operations-gen/internal/families/evm/evm.go Leaves handler orchestration in place; delegates details to new modules.
tools/operations-gen/internal/families/evm/contract.go Introduces ContractInfo extraction and struct definition collection.
tools/operations-gen/internal/families/evm/config.go Introduces YAML config structs for EVM generator inputs/contracts/outputs.
tools/operations-gen/internal/families/evm/codegen_test.go Adds unit tests for ToSnakeCase and big.Int import detection logic.
tools/operations-gen/internal/families/evm/codegen.go Adds template data types + rendering + naming helper(s) and big.Int detection.
tools/operations-gen/internal/families/evm/abi_test.go Updates ABI-related tests to evm_test and targets exported parsing helpers.
tools/operations-gen/internal/families/evm/abi.go Adds ABI parsing, type mapping, and helper utilities used by codegen/extraction.

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

Comment thread tools/operations-gen/internal/families/evm/codegen.go
Comment thread tools/operations-gen/internal/families/evm/abi.go Outdated
Comment thread tools/operations-gen/internal/families/evm/config.go Outdated
@cl-sonarqube-production
Copy link
Copy Markdown

Quality Gate failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube

@graham-chainlink graham-chainlink added this pull request to the merge queue Apr 23, 2026
Merged via the queue into main with commit 2194dcd Apr 23, 2026
25 of 26 checks passed
@graham-chainlink graham-chainlink deleted the chore/add-testdata-go-bindings-and-split-ops-codegen branch April 23, 2026 05:25
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