You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: workflow run/resume exit 0 when the run ends Status: failed — scripts and CI can't rely on $? #2958
specify workflow run (and workflow resume) exit with code 0 even when the run ends Status: failed. The epilogue of workflow_run prints the status and falls through without mapping the outcome to an exit code (src/specify_cli/__init__.py:2880 area; the --json path likewise emits the payload and returns). Scripts, CI jobs, and orchestrators cannot rely on $? — they must parse stdout for Status: to learn the run failed.
Status: failed (or aborted) → process exit code 1; completed and paused → 0 (paused is a legitimate waiting state, not a failure). The --json path should carry the same code alongside the payload.
Heads-up — this is a deliberate-looking behavior:tests/test_workflow_run_without_project.py::test_workflow_run_failing_yaml_without_project currently asserts exit_code == 0 on a failed run (i.e. "the CLI ran fine; the workflow outcome is data"). So this issue is effectively a behavior-change proposal: anyone scripting against exit-0-on-failed would be affected. I'd argue the script-ergonomics convention (non-zero on failure) outweighs that, but flagging it clearly. I have a small PR ready that updates the pin and adds coverage for both directions.
AI disclosure (per CONTRIBUTING.md): this issue and the accompanying PR were authored with AI assistance (Claude); all behavior was verified by running the repo's test suite locally.
Activity
fix: non-zero exit code when a workflow run ends failed or aborted (#…