Skip to content

fix(cli): exit non-zero when --auto-build fails - #641

Open
Siddhanthguptaa wants to merge 1 commit into
ControlCore-Project:devfrom
Siddhanthguptaa:fix/auto-build-exit-code
Open

Siddhanthguptaa wants to merge 1 commit into
ControlCore-Project:devfrom
Siddhanthguptaa:fix/auto-build-exit-code

Conversation

@Siddhanthguptaa

Copy link
Copy Markdown

Fixes #640

When the build script failed, concore build --auto-build printed "Build failed" but then showed "Workflow ready!" and exited 0. The auto-build except block now prints the build's stdout and stderr and re-raises, the same as the generation step just above it, so cli.py prints Error: ... and exits 1. stdout is printed too because cmd writes its errors there on Windows.

Testing

  • New test test_build_command_auto_build_failure_exits_nonzero (only the build-script call fails): fails on current dev (exit 0), passes with this change.
  • pytest on Windows 11 / Python 3.11: 239 passed, 12 skipped. ruff check . and ruff format --check . pass.
  • Manual on Windows with --type docker --auto-build (build script not runnable by cmd): before, exit 0 and "Workflow ready!"; after, exit 1 and the cmd error is shown.

Not in this PR: when the build script is missing, auto-build is still skipped silently.

The auto-build step caught CalledProcessError, printed "Build failed"
and then fell through to the "Workflow ready!" panel, so the command
exited 0. Print the build's stdout/stderr and re-raise, like the
generation step does, so cli.py reports the error and exits 1.
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.

1 participant