Conversation
✅ Deploy Preview for jumpstarter-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughThe CLI result handling has been updated to capture the return value and convert non-zero exit codes into exceptions. A new exception handler for Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Areas requiring extra attention:
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
fixes the bug of j tmt always returning 0 click in standalone_mode=False mode, as we use it in j, will not raise the click.Exception.Exit but instead return the result as an integer. this commit looks for the integer, and raisex the exception that can be caught on the external try block.
cc3b93e to
88241fc
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/jumpstarter-cli/jumpstarter_cli/j.py (1)
45-47: Consider simplifying sincesys.exit()terminates immediately.The loop will only ever execute once since
sys.exit()raisesSystemExiton the first iteration. Unlike theClickExceptionhandler (lines 48-52) where all exceptions are shown before a singlesys.exit(1), here the exit happens inside the loop.This works correctly, but could be simplified to make the single-exit intent clearer:
except* click.exceptions.Exit as excgroup: - for exc in leaf_exceptions(excgroup): - sys.exit(exc.exit_code) + exc = next(iter(leaf_exceptions(excgroup))) + sys.exit(exc.exit_code)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/jumpstarter-cli/jumpstarter_cli/j.py(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)
Ruff should be used for code formatting and linting, excluding
jumpstarter-protocolpackage
Files:
packages/jumpstarter-cli/jumpstarter_cli/j.py
🧠 Learnings (3)
📚 Learning: 2025-05-28T15:09:35.768Z
Learnt from: NickCao
Repo: jumpstarter-dev/jumpstarter PR: 463
File: packages/jumpstarter-cli-admin/jumpstarter_cli_admin/get_test.py:270-270
Timestamp: 2025-05-28T15:09:35.768Z
Learning: The jumpstarter CLI is designed to match kubectl's behavior, including returning exit code 0 (success) when no resources are found, rather than exit code 1 (failure).
Applied to files:
packages/jumpstarter-cli/jumpstarter_cli/j.py
📚 Learning: 2025-11-27T09:58:41.875Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/creating-new-drivers.mdc:0-0
Timestamp: 2025-11-27T09:58:41.875Z
Learning: Applies to packages/jumpstarter-driver-*/jumpstarter_driver_*/client.py : Driver client CLIs should either implement known classes that provide a CLI interface, or implement their own CLI interface. Use `CompositeClient` from `jumpstarter_driver_composite.client` for composite drivers with child drivers.
Applied to files:
packages/jumpstarter-cli/jumpstarter_cli/j.py
📚 Learning: 2025-11-27T09:58:55.346Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.346Z
Learning: Applies to packages/jumpstarter-cli-*/pyproject.toml : CLI packages must depend on `jumpstarter` and `jumpstarter-cli-common` in their `pyproject.toml`
Applied to files:
packages/jumpstarter-cli/jumpstarter_cli/j.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: Redirect rules - jumpstarter-docs
- GitHub Check: Header rules - jumpstarter-docs
- GitHub Check: Pages changed - jumpstarter-docs
- GitHub Check: build
- GitHub Check: pytest-matrix (ubuntu-24.04, 3.11)
- GitHub Check: pytest-matrix (ubuntu-24.04, 3.13)
- GitHub Check: pytest-matrix (macos-15, 3.13)
- GitHub Check: pytest-matrix (macos-15, 3.11)
- GitHub Check: pytest-matrix (ubuntu-24.04, 3.12)
- GitHub Check: e2e
🔇 Additional comments (1)
packages/jumpstarter-cli/jumpstarter_cli/j.py (1)
29-31: LGTM! Correctly handles Click's integer return value in standalone_mode=False.The fix properly captures the exit code returned by Click when
standalone_mode=Falseand wraps it in an exception group for the outer handler to process. The type check and non-zero condition are appropriate.
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin release-0.7
git worktree add -d .worktree/backport-755-to-release-0.7 origin/release-0.7
cd .worktree/backport-755-to-release-0.7
git switch --create backport-755-to-release-0.7
git cherry-pick -x 88241fc359eb1f734bd2b139b68430a94b913022 |
|
Successfully created backport PR for |
fixes the bug of j tmt always returning 0
click in standalone_mode=False mode, as we use it in j, will not raise the click.Exception.Exit but instead return the result as an integer.
this commit looks for the integer, and raisex the exception that can be caught on the external try block.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.