Repository navigation
fix(cli): CLI subcommands exiting 0 when the child command fails - #6758
Conversation
Greptile SummaryThe PR makes miscellaneous CLI subcommands fail when their Python children fail.
Confidence Score: 4/5The runtime fix appears safe to merge, with non-blocking corrections needed so its regression test runs in the regular suite and its Windows documentation is precise. Checked execution correctly turns child failures into nonzero CLI exits, but the newly added test is outside the orchestrator's discovery roots and the Windows batch wrapper does not preserve exact pytest status codes as documented. Files Needing Attention: tools/test_cli_exit_codes.py, docs/source/refs/contributing.rst Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
CLI[IsaacLab CLI subcommand] --> Child[Python child process]
Child -->|exit 0| Success[CLI returns successfully]
Child -->|nonzero| Check[run_command check=True]
Check --> Exit[sys.exit with child status]
Exit --> Shell[Invoking shell or CI step]
Reviews (1): Last reviewed commit: "Merge branch 'develop' into fix/cli-exit..." | Re-trigger Greptile |
There was a problem hiding this comment.
Isaac Lab Review Bot
Summary
Passes check=True at the five run_python_command call sites in isaaclab/cli/commands/misc.py so -t, --new, --vscode, and --docker propagate a failing child's exit code, matching the existing -p behavior. Includes a changelog fragment, a contributing-guide note, a CONTRIBUTORS entry, and a new regression test under tools/. The core change is small, consistent, and matches the established pattern; the remarks below are about the new test's robustness and one behavioral nuance in the VS Code path. Note that command_build_docs still calls run_command for the pip install and sphinx build without check=True, so -d retains the same swallow-the-failure behavior — worth a follow-up if that is in scope.
Architecture impact
No architectural change. The fix only adjusts keyword arguments at existing call sites and preserves the deliberate check=False probes in utils.py and the interactive -s launch.
Test coverage
A new tools/test_cli_exit_codes.py covers run_command in both check=True and check=False modes and guards the misc call sites via a mocked run_python_command. Coverage of the intermediate run_python_command forwarding is missing, and one assertion is coupled to the presence of an optional repo file.
Implementation verdict
Minor fixes needed. Posted 4 actionable findings inline.
Automated comment-only review; human maintainers own approval decisions.
isaaclab.sh -t, --new, --vscode and --docker ran their Python child processes without check=True, so a failing child (e.g. pytest failures) still exited 0. Pass check=True at the remaining run_python_command call sites, matching the earlier fix to the -p paths, so run_command propagates the child's exit code. Fixes isaac-sim#5237 Signed-off-by: Michael Wedd <[email protected]>
Covers the check=True propagation with a regression test for the misc subcommand wiring, documents that the test commands exit with pytest's exit code, and adds Michael Wedd to CONTRIBUTORS.md. Signed-off-by: Michael Wedd <[email protected]>
- Move the regression test to source/isaaclab/test/cli/ so the -t orchestrator actually collects it (tools/ is not walked), which also removes the module-level sys.path insertion. - Keep --vscode settings generation best-effort: it also runs inside the install flow, and a failure generating editor settings should not abort the invoking command. Missing script and failing script now behave consistently. - Add a test that check=True survives the delegation from run_python_command to run_command. - Docs: promise nonzero failure propagation rather than the exact pytest code, since isaaclab.bat maps any failure to 1. Signed-off-by: Michael Wedd <[email protected]>
f914f33 to
28cf204
Compare
…e-propagation # Conflicts: # source/isaaclab/isaaclab/cli/commands/misc.py
|
run-ci |
|
run-ci |
|
Backported to |
# Description Follow-up to #5237 and #5238. PR #5238 fixed `isaaclab -p` exiting 0 on child failure, but the same bug remained in the `-t`, `--new`, and `--docker` subcommands. `run_python_command` defaults to `check=False`, so these commands reported success even when their Python child failed. This passes `check=True` at the three affected call sites, matching the existing `-p` behavior. Probe-style subprocesses and the interactive Isaac Sim launch retain their explicit unchecked behavior. The regression coverage is consolidated into the existing `source/isaaclab/test/cli/test_misc_commands.py` module. One mocked test invokes all three subcommands and verifies their exact checked calls without launching child processes. ## Type of change - Bug fix (non-breaking change) ## Validation - `uv run python -m pytest source/isaaclab/test/cli/test_misc_commands.py -q` (`8 passed in 0.03s`) - Verified an invalid pytest option now makes `isaaclab -t` return pytest's nonzero exit code instead of 0. - `uv run python tools/changelog/cli.py check develop` - `uv run isaaclab -f` ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the pre-commit checks - [x] I have made corresponding documentation changes - [x] My changes generate no new warnings - [x] I have added focused regression coverage - [x] I have added a changelog fragment - [x] The contributor is listed in `CONTRIBUTORS.md` ## Release backport - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` --------- Signed-off-by: Michael Wedd <[email protected]> Co-authored-by: Mustafa Haiderbhai <[email protected]> (cherry picked from commit a3c2eb1)
…ng docs (#7957) Backports the three changes from the September 20–23 `develop` audit that are missing from `release/3.0.0`, alongside the existing cloning-guide backport: - #7722 (`4cf439dfeb`): reject a second `SimulationContext` construction instead of silently discarding its configuration. Includes the original fixture cleanup and regression coverage. - #7893 (`22fcd71bc4`): validate DelayBuffer lag values before mutating its live configuration. - #7947 (`6e9ef17f59`): make `v3.0.0-EA` the default documentation version in deployment and local multi-version builds. - #7129 (`354168560f`): clarify that `replicate_physics=False` skips the active physics context while other declared replication contexts still run. **Compatibility:** repeated `SimulationContext(...)` calls now raise. Retrieve the live context with `SimulationContext.instance()`, or call `clear_instance()` before constructing a replacement. The original major changelog fragment includes this migration. The runtime and test files match current `develop`. The docs-default backport adapts the release branch's existing redirect template, validates the target page, and preserves explicit overrides. The cloning-guide backport preserves the current release APIs; its obsolete sections were already removed. ## Release audit Checked all **35 PRs** merged into `develop` from **2026-09-20 16:43:18 UTC** through `cff81e8473` (September 23), against release head `5d3e0b695e`. **32 are already covered; the remaining three are included here.** Git history, patch equivalence, GitHub's merged PR list, and remaining file differences were checked. Branch-specific version/changelog compilation and existing release-only changes are preserved. <details> <summary>Already covered PRs</summary> 26 have an equivalent patch in release: #7919, #7922, #7923, #7924, #7925, #6758, #7928, #7902, #7927, #7891, #7931, #7691, #7861, #7929, #7916, #7939, #4609, #7942, #7940, #7948, #7937, #7955, #7960, #7961, #7970, #7958. Six were squash-merged or adapted: #7530 and #7899 in #7926; #7637 in #7933; #7860 in #7936; #7954 and #7950 in #7964. Their implementation differences were checked against the current release tree. </details> ## Validation - **276 tests passed**: SimulationContext (51, including CPU/CUDA), headless context construction (15), nine schema/fragment suites (165), four manager suites (38), and DelayBuffer (7). - Both backported regressions reproduce with the original release implementations. - Docs redirect recipe: local/deployment EA defaults, explicit override, and missing-target rejection passed with a stubbed Sphinx builder. - All 22 changed files match the intended backport scope; `uv run isaaclab -f` and `git diff --check` passed. - Fresh Sphinx validation (`-b dummy -W --keep-going`): passed without warnings, excluding static assets as the HTML builder does. Full HTML documentation CI is running. Local runtime validation used PyTorch 2.12.0, CUDA 13.0, Isaac Sim 6.0.1.0, and an RTX 5090. Existing runtime/deprecation warnings occurred; the CI jobs validate the pinned environments. The previous [docs CI failure](https://github.com/isaac-sim/IsaacLab/actions/runs/35795116307/job/106972539281) was an external connection reset fetching the Omniverse intersphinx inventory, producing one warning under `-W`. That URL returned HTTP 200 when rechecked. This update starts a fresh docs build. --------- Co-authored-by: hujc <[email protected]> Co-authored-by: Zihan Xu <[email protected]>
Description
Follow-up to #5237 and #5238. PR #5238 fixed
isaaclab -pexiting 0 on childfailure, but the same bug remained in the
-t,--new, and--dockersubcommands.
run_python_commanddefaults tocheck=False, so these commandsreported success even when their Python child failed.
This passes
check=Trueat the three affected call sites, matching the existing-pbehavior. Probe-style subprocesses and the interactive Isaac Sim launchretain their explicit unchecked behavior.
The regression coverage is consolidated into the existing
source/isaaclab/test/cli/test_misc_commands.pymodule. One mocked test invokesall three subcommands and verifies their exact checked calls without launching
child processes.
Type of change
Validation
uv run python -m pytest source/isaaclab/test/cli/test_misc_commands.py -q(
8 passed in 0.03s)isaaclab -treturn pytest'snonzero exit code instead of 0.
uv run python tools/changelog/cli.py check developuv run isaaclab -fChecklist
CONTRIBUTORS.mdRelease backport
develop