refactor(modular-cmds): introduce mcms cmds#727
Conversation
|
df93eeb to
1c32ebc
Compare
f710efa to
e32b344
Compare
e32b344 to
15a7148
Compare
ecPablo
left a comment
There was a problem hiding this comment.
Looks good! Added a couple comments but nothing too big
| @@ -0,0 +1,400 @@ | |||
| package mcms | |||
There was a problem hiding this comment.
Wondering if this file is still needed? I think most of these are already on mcms-tools, maybe we can take the opportunity to remove them as it has been several months already since we've added the deprecation warnings.
There was a problem hiding this comment.
hmm yea this is used in fork command, I would like to avoid changing this in this PR but valid point to switch the logic for mcms tools. I will create ticket for it.
There was a problem hiding this comment.
Pull request overview
This PR refactors legacy MCMS commands by migrating them to a modular architecture in engine/cld/commands/mcms/, while maintaining backward compatibility through the legacy mcmsv2 package. The refactored commands include analyze-proposal, convert-upf, execute-fork, and error-decode-evm, with all deprecated code removed and functionality split across multiple files for improved maintainability.
Changes:
- Migrated four MCMS commands to modular architecture in
engine/cld/commands/mcms/ - Removed deprecated execution commands (now in mcms-tools)
- Created backward compatibility layer in legacy package
- Split implementation across multiple focused files
Reviewed changes
Copilot reviewed 27 out of 59 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
engine/cld/legacy/cli/mcmsv2/retry.go |
Removed deprecated retry logic |
engine/cld/legacy/cli/mcmsv2/mocks_test.go |
Removed test mocks |
engine/cld/legacy/cli/mcmsv2/mcms_v2_test.go |
Simplified to delegation tests only |
engine/cld/legacy/cli/mcmsv2/mcms_v2.go |
Refactored to delegate to modular commands |
engine/cld/legacy/cli/mcmsv2/helpers.go |
Removed deprecated helper functions |
engine/cld/legacy/cli/mcmsv2/execute_fork_test.go |
Moved to engine/cld/commands/mcms/ with renamed helpers |
engine/cld/legacy/cli/mcmsv2/execute_fork.go |
Moved to engine/cld/commands/mcms/ with modular structure |
engine/cld/legacy/cli/mcmsv2/err_decode_helpers_test.go |
Removed legacy error decoding tests |
engine/cld/legacy/cli/mcmsv2/err_decode_helpers.go |
Removed legacy error decoding implementation |
engine/cld/commands/mcms/types.go |
Added forkConfig type definition |
engine/cld/commands/mcms/proposal_config.go |
Added proposal configuration loading logic |
engine/cld/commands/mcms/operations.go |
Added proposal execution operations |
engine/cld/commands/mcms/execute_fork_test.go |
Added tests for execute-fork command |
engine/cld/commands/mcms/error_diagnosis.go |
Added error diagnosis utilities |
engine/cld/commands/mcms/err_decode_helpers.go |
Added error decoding implementation |
engine/cld/commands/mcms/deps.go |
Added dependency injection structure |
engine/cld/commands/mcms/command_test.go |
Added command structure tests |
engine/cld/commands/mcms/command.go |
Added main command builder |
engine/cld/commands/mcms/cmd_error_decode.go |
Added error-decode-evm command |
engine/cld/commands/mcms/cmd_convert_upf.go |
Added convert-upf command |
engine/cld/commands/mcms/cmd_analyze_proposal.go |
Added analyze-proposal command |
engine/cld/commands/mcms/chain_helpers_ton.go |
Added TON-specific helpers |
engine/cld/commands/mcms/chain_helpers_sui.go |
Added Sui-specific helpers |
engine/cld/commands/mcms/chain_helpers_aptos.go |
Added Aptos-specific helpers |
engine/cld/commands/mcms/chain_helpers.go |
Added multi-chain support helpers |
engine/cld/commands/flags/flags.go |
Added MCMS-specific flag helpers |
engine/cld/commands/commands.go |
Added MCMS command integration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Looks like tests is failing, race detected? |
Yea, seems find mutated the flag, isolated. |
|




MCMS Commands Migration
Migrated to Modular Commands (
engine/cld/commands/mcms/)The following commands have been fully migrated to the new modular architecture:
analyze-proposalconvert-upfexecute-forkerror-decode-evmThese commands are delegated from the legacy
mcmsv2for backward compatibility.All deprecated code is removed.
Code is now split into several files for better readibility.
https://smartcontract-it.atlassian.net/browse/CLD-1159