Propagate CLI subprocess exit code#55
Merged
Merged
Conversation
eggplants
requested changes
Apr 29, 2026
a8c6bdc to
1be73c0
Compare
There was a problem hiding this comment.
2 issues found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="tests/test_cli.py">
<violation number="1" location="tests/test_cli.py:48">
P2: Replacing the dedicated CLI exit-code test with another invalid-argument test drops coverage for `cli()` propagating `run(...).returncode`.</violation>
</file>
<file name="openapi_generator_cli/__init__.py">
<violation number="1" location="openapi_generator_cli/__init__.py:61">
P1: Console-script entry point will drop all user CLI arguments because `cli()` now falls back to `[]` when invoked without argv.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="openapi_generator_cli/__init__.py">
<violation number="1" location="openapi_generator_cli/__init__.py:61">
P2: `cli([])` now falls back to `sys.argv` instead of honoring the caller-provided empty argv, changing public API behavior and potentially propagating unrelated process arguments.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
eggplants
requested changes
Apr 29, 2026
eggplants
requested changes
Apr 29, 2026
eggplants
approved these changes
Apr 29, 2026
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.
Problem
The console script currently discards the return code from the Java subprocess. That means callers can see a successful Python CLI exit even when Java fails.
Solution
Exit from the console entry point with the subprocess return code. Add a regression test that verifies the CLI propagates a non-zero result.
Summary by cubic
Propagate the Java subprocess exit code from the
openapi-generator-clientrypoint so callers and CI fail correctly.clinow acceptsargvand defaults tosys.argvto preserve behavior and simplify testing.sys.exit(run(args).returncode)and parse args as(argv or sys.argv)[1:].run([...])andcli([...])to assert non-zero exit codes, error message, and no stdout on invalid args.cli(argv)argument and default behavior in the docstring.Written for commit 44495ec. Summary will update on new commits. Review in cubic