Skip to content

feat(mcms): build the environment from BuildParams in analyze and convert commands [CLD-3911] - #1199

Merged
bytesizedroll merged 5 commits into
mainfrom
CLD-3911/build-params
Oct 13, 2026
Merged

bytesizedroll merged 5 commits into
mainfrom
CLD-3911/build-params

Conversation

@bytesizedroll

Copy link
Copy Markdown
Contributor

Summary

Lets the mcms commands (analyze-proposal-v2, convert-upf, analyze-proposal) build their environment from a BuildParams YAML document instead of a domains/<domain>/ checkout. This unblocks running proposal analysis in the Temporal worker, which has no checkout.

Jira: CLD-3911

It uses the same document, flag (--env-build-params) and variable (MCMS_ENV_BUILD_PARAMS) as the mcms CLI (mcms-tools). Without a document, behavior is unchanged.

Changes

  • New envparams package that resolves the document, with the same rules as mcms-tools (flag wins over variable, empty flag is an error, --environment rejected alongside a document, strict decoding).
  • The three commands build the environment with environment.Build when a document is given. Resolution runs in a per-command PreRunE.
  • Deps gains EnvironmentBuilder and Getenv for tests.

Behavior

  • The document's domain must match the binary's.
  • Every proposal chain must be listed under networks, otherwise the command fails naming the selector.
  • All listed networks are dialed.
  • Addresses come only from the Catalog. A warning is logged if it returns none.
  • execute-fork, hooks and error-decode-evm are unchanged.

Domain owners

Bump the framework, and use domain.NewDomain(domain.DomainsRoot, "<key>") instead of MustGetDomain, which panics at startup without domains/. Older binaries ignore the variable. To detect support, check that mcmsv2 analyze-proposal-v2 --help contains --env-build-params.

@bytesizedroll
bytesizedroll requested a review from a team as a code owner October 13, 2026 15:29
Copilot AI balanced review requested due to automatic review settings October 13, 2026 15:29
@changeset-bot

changeset-bot Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5982d3a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
chainlink-deployments-framework Minor

Not sure what this means? Click here to learn what changesets are.

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

@github-actions

Copy link
Copy Markdown

👋 bytesizedroll, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Required network validation occurs too late to guarantee the documented selector-specific failure.

1 open finding
What changed in this PR

Enables MCMS analysis and conversion commands to build environments from YAML parameters without a domain checkout.

Changes:

  • Adds strict BuildParams resolution from a flag or environment variable.
  • Integrates environment building into three MCMS commands.
  • Adds dependency injection, documentation, and tests.
File Description
.changeset/​quiet-pens-build.md Documents the new capability.
engine/​cld/​environment/​envparams/​envparams.go Resolves and parses BuildParams documents.
engine/​cld/​environment/​envparams/​envparams_test.go Tests resolution and validation.
engine/​cld/​commands/​mcms/​env_build_params.go Builds and validates environments.
engine/​cld/​commands/​mcms/​env_build_params_test.go Tests command integration.
engine/​cld/​commands/​mcms/​proposal_config.go Selects parameter-based environment building.
engine/​cld/​commands/​mcms/​deps.go Adds injectable builder and environment lookup.
engine/​cld/​commands/​mcms/​cmd_convert_upf.go Enables BuildParams for conversion.
engine/​cld/​commands/​mcms/​cmd_analyze_proposal.go Enables BuildParams for legacy analysis.
engine/​cld/​commands/​mcms/​cmd_analyze_proposal_v2.go Enables BuildParams for v2 analysis.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread engine/cld/commands/mcms/env_build_params.go
Copilot AI balanced review requested due to automatic review settings October 13, 2026 15:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The parser silently accepts and ignores additional YAML documents, undermining strict configuration validation.

0 open findings

1 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Medium severity Require EOF after decoding to reject trailing YAML documents

engine/​cld/​environment/​envparams/​envparams.go:105

Decode is called only once, so input such as a valid document followed by ---\nbogus: true succeeds and silently ignores the second YAML document. This bypasses the strict-decoding guarantee and can hide mistakenly appended configuration; decode again and require EOF (and cover this case in the parser tests).

🧠 Review effort: Balanced

Comment thread engine/cld/environment/envparams/envparams.go
@bytesizedroll
bytesizedroll added this pull request to the merge queue Oct 13, 2026
Merged via the queue into main with commit 0228782 Oct 13, 2026
27 of 28 checks passed
@bytesizedroll
bytesizedroll deleted the CLD-3911/build-params branch October 13, 2026 16:19
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.

4 participants