Conversation
mkconcore.py used quit() on every error path, which exits with status 0. concore build only checks the return code, so errors like an unsupported file extension or duplicate node labels were reported as a successful build, STUDY.json got written into a half generated study, and the actual error message was never printed. Use sys.exit(1) on the error paths so build sees the failure. The quit() at the end of docker generation is a normal exit and is left as is.
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.
Fixes #594
mkconcore.py was using
quit()on all its error paths, andquit()exits with status 0. Sinceconcore buildonly checks the subprocess return code, a failed generation (unsupported extension, duplicate node labels, missing runtime files etc) was treated as success. The CLI printed the success messages, wrote STUDY.json into a half generated output folder, and the actual error from mkconcore was never shown.Changes:
quit()calls in mkconcore.py withsys.exit(1)quit()at the end of the docker branch alone since that one is the normal exit after generating docker scriptstest_build_command_fails_on_unsupported_extensionin tests/test_cli.py which builds a node with a.rbsource and checks that build exits non-zero, prints mkconcore's error, and doesn't write STUDY.jsonNo changes to build.py were needed, it already prints mkconcore's stdout/stderr when the subprocess fails, it just never got there before.
Verified with:
pytest tests/test_cli.py(all pass, the new test fails on dev without the fix)ruff format --check .andruff check .passBefore
Building a workflow with a
.rbnode on dev reports success and exits with 0:After
Same workflow with this PR, mkconcore's error is shown and build exits with 1: