feat(cli): add scaffold for setup_surfnet iac#373
Merged
MicaiahReid merged 3 commits intomainfrom Oct 17, 2025
Merged
Conversation
lgalabru
reviewed
Oct 16, 2025
crates/cli/src/cli/mod.rs
Outdated
| #[clap(long = "autopilot", action=ArgAction::SetTrue, default_value = "false")] | ||
| pub autopilot: bool, | ||
| /// Apply suggested defaults for runbook generation and execution when running as part of an anchor test suite (eg. surfpool start --anchor-compatibility) | ||
| #[clap(long = "anchor-compatibility", action=ArgAction::SetTrue, default_value = "false")] |
Collaborator
There was a problem hiding this comment.
anchor-compatibility or anchor-legacy ?
I know it's weird, but ideally we only enable this mode for anchor 0.x
lgalabru
approved these changes
Oct 16, 2025
Collaborator
lgalabru
left a comment
There was a problem hiding this comment.
LGTM, thanks @MicaiahReid!
5a56a12 to
4cf4ad2
Compare
1e5f61b to
78e258b
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request introduces support for handling genesis accounts defined in
Test.tomlandAnchor.tomlfiles for Anchor projects, and refactors the CLI to use a new--anchor-compatibilityflag instead of the previous--autopilotflag. The main changes improve the detection and scaffolding of infrastructure-as-code (IaC) for test suites, allowing for more flexible and accurate test environment setup, especially for Anchor-based projects.Anchor project genesis account discovery and propagation:
The Anchor project detection logic (
anchor.rsand related calls) now discovers and aggregates genesis accounts from bothAnchor.tomland anyTest.tomlfiles found in the workspace. These accounts are returned as part of the framework detection result and are used for scaffolding IaC. [1] [2] [3]New types and logic for reading, merging, and canonicalizing
Test.tomlfiles, including support for inheritance via theextendsfield and proper merging of genesis account entries.CLI flag and workflow refactor:
StartSimnetstruct replaces theautopilotflag with a more descriptiveanchor_compatflag (--anchor-compatibility), which is used to trigger Anchor test suite-compatible defaults for runbook generation and execution. All related logic and checks in the CLI workflow have been updated accordingly. [1] [2] [3]IaC scaffolding improvements:
Dependency updates:
walkdircrate is added to the workspace and relevant crates to support recursive discovery ofTest.tomlfiles. [1] [2]Type and import updates:
These changes together enable more robust and flexible test environment setup for Anchor projects, particularly when working with complex test suites and custom genesis accounts.