-
Notifications
You must be signed in to change notification settings - Fork 11
feat(bin): restructure init command with explicit rollup/sovereign modes
#280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@claude /review |
|
Claude finished @kariy's task —— View job Code Review for PR #280Reviewed the refactoring to separate rollup and sovereign chain initialization into distinct subcommands. Todo Checklist:
✅ Overall AssessmentThis is a solid architectural improvement that enhances the CLI UX by separating rollup and sovereign initialization into distinct subcommands ( 🎯 Strengths
|
|
/claude-review |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #280 +/- ##
==========================================
+ Coverage 73.32% 75.72% +2.40%
==========================================
Files 209 229 +20
Lines 23132 27098 +3966
==========================================
+ Hits 16961 20521 +3560
- Misses 6171 6577 +406 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
init command with explicit rollup/sovereign modes
init command with explicit rollup/sovereign modesinit command with explicit rollup/sovereign modes
…modes (#280) Refactor `katana init` command to use explicit subcommands for rollup and sovereign chain modes. Now running `katana init` requires you to select the mode as a subcommand: `katana init rollup` or `katana init sovereign`. One of the reason why we made this change is because the CLI argument configurations will always require you to provide the arguments instead of falling back to prompting. The expected behaviour when you literally just run `katana init` is for it to prompt the arguments like so: <img width="411" height="51" alt="Screenshot 2025-09-23 at 10 03 49 AM" src="https://github.com/user-attachments/assets/e910a787-e412-4c61-b519-ea574d689382" /> But due to how the CLI arguments is being configured, we instead get an error for not providing the arguments using flags: <img width="1030" height="149" alt="Screenshot 2025-09-23 at 10 04 05 AM" src="https://github.com/user-attachments/assets/d5ab9ab6-ecb3-43f7-bd80-e4b9b646edfc" /> This is mainly because of the `#[arg(required_unless_present = "sovereign")]` tag we're using that forces us to provide the options if `--sovereign` is not present. https://github.com/dojoengine/katana/blob/d584d4224f75f3648d55d1e4cec773ed638967ff/bin/katana/src/cli/init/mod.rs#L44-L48 Afaik it doesn't seem to be possible to 'fix' this using `clap` derive macro. Even if it does, I believe separating the mode into separate commands feels like a better UX. ## Comparison with current behaviour - Current: `katana init --id my-chain --settlement-chain sepolia ...` - New: `katana init rollup --id my-chain --settlement-chain sepolia ...`
…modes (#280) Refactor `katana init` command to use explicit subcommands for rollup and sovereign chain modes. Now running `katana init` requires you to select the mode as a subcommand: `katana init rollup` or `katana init sovereign`. One of the reason why we made this change is because the CLI argument configurations will always require you to provide the arguments instead of falling back to prompting. The expected behaviour when you literally just run `katana init` is for it to prompt the arguments like so: <img width="411" height="51" alt="Screenshot 2025-09-23 at 10 03 49 AM" src="https://github.com/user-attachments/assets/e910a787-e412-4c61-b519-ea574d689382" /> But due to how the CLI arguments is being configured, we instead get an error for not providing the arguments using flags: <img width="1030" height="149" alt="Screenshot 2025-09-23 at 10 04 05 AM" src="https://github.com/user-attachments/assets/d5ab9ab6-ecb3-43f7-bd80-e4b9b646edfc" /> This is mainly because of the `#[arg(required_unless_present = "sovereign")]` tag we're using that forces us to provide the options if `--sovereign` is not present. https://github.com/dojoengine/katana/blob/d584d4224f75f3648d55d1e4cec773ed638967ff/bin/katana/src/cli/init/mod.rs#L44-L48 Afaik it doesn't seem to be possible to 'fix' this using `clap` derive macro. Even if it does, I believe separating the mode into separate commands feels like a better UX. ## Comparison with current behaviour - Current: `katana init --id my-chain --settlement-chain sepolia ...` - New: `katana init rollup --id my-chain --settlement-chain sepolia ...`
Refactor
katana initcommand to use explicit subcommands for rollup and sovereign chain modes. Now runningkatana initrequires you to select the mode as a subcommand:katana init rolluporkatana init sovereign.One of the reason why we made this change is because the CLI argument configurations will always require you to provide the arguments instead of falling back to prompting.
The expected behaviour when you literally just run
katana initis for it to prompt the arguments like so:But due to how the CLI arguments is being configured, we instead get an error for not providing the arguments using flags:
This is mainly because of the
#[arg(required_unless_present = "sovereign")]tag we're using that forces us to provide the options if--sovereignis not present.katana/bin/katana/src/cli/init/mod.rs
Lines 44 to 48 in d584d42
Afaik it doesn't seem to be possible to 'fix' this using
clapderive macro. Even if it does, I believe separating the mode into separate commands feels like a better UX.Comparison with current behaviour
katana init --id my-chain --settlement-chain sepolia ...katana init rollup --id my-chain --settlement-chain sepolia ...