Skip to content

fix(mkconcore): exit with status 1 on generation errors - #595

Open
Sahil-u07 wants to merge 1 commit into
ControlCore-Project:devfrom
Sahil-u07:fix/mkconcore-exit-codes
Open

Sahil-u07 wants to merge 1 commit into
ControlCore-Project:devfrom
Sahil-u07:fix/mkconcore-exit-codes

Conversation

@Sahil-u07

@Sahil-u07 Sahil-u07 commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #594

mkconcore.py was using quit() on all its error paths, and quit() exits with status 0. Since concore build only 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:

  • replaced the 14 error path quit() calls in mkconcore.py with sys.exit(1)
  • left the quit() at the end of the docker branch alone since that one is the normal exit after generating docker scripts
  • added test_build_command_fails_on_unsupported_extension in tests/test_cli.py which builds a node with a .rb source and checks that build exits non-zero, prints mkconcore's error, and doesn't write STUDY.json

No 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 . and ruff check . pass

Before

Building a workflow with a .rb node on dev reports success and exits with 0:

before

After

Same workflow with this PR, mkconcore's error is shown and build exits with 1:

after

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.
Copilot AI balanced review requested due to automatic review settings October 2, 2026 23:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants