You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(mcms): build the environment from BuildParams in analyze and convert commands [CLD-3911] - #1199
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.
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, 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!
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lets the
mcmscommands (analyze-proposal-v2,convert-upf,analyze-proposal) build their environment from a BuildParams YAML document instead of adomains/<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 themcmsCLI (mcms-tools). Without a document, behavior is unchanged.Changes
envparamspackage that resolves the document, with the same rules as mcms-tools (flag wins over variable, empty flag is an error,--environmentrejected alongside a document, strict decoding).environment.Buildwhen a document is given. Resolution runs in a per-commandPreRunE.DepsgainsEnvironmentBuilderandGetenvfor tests.Behavior
domainmust match the binary's.networks, otherwise the command fails naming the selector.execute-fork,hooksanderror-decode-evmare unchanged.Domain owners
Bump the framework, and use
domain.NewDomain(domain.DomainsRoot, "<key>")instead ofMustGetDomain, which panics at startup withoutdomains/. Older binaries ignore the variable. To detect support, check thatmcmsv2 analyze-proposal-v2 --helpcontains--env-build-params.