Skip to content

[beman-tidy] Fail run-on-all-libraries jobs only when beman-tidy crashes - #384

Merged
neatudarius merged 1 commit into
bemanproject:mainfrom
neatudarius:fix-run-on-all-libraries-exit-code
Nov 19, 2026
Merged

neatudarius merged 1 commit into
bemanproject:mainfrom
neatudarius:fix-run-on-all-libraries-exit-code

Conversation

@neatudarius

Copy link
Copy Markdown
Member

Problem

Run on all Beman libraries fails a library job whenever beman-tidy reports any failed check, although the step is meant to accept violations and fail only on a crash:

  • The step runs under bash -e, so a non-zero exit from beman-tidy aborts it before exit_code=$? is evaluated.
  • The exit code is the number of failed checks (sys.exit(failed_checks) in cli.py), so 2 means "two failed checks", not "crashed". An uncaught exception exits with 1.

Seen on #342, #345 and #347: every red library job there was a real rule violation, with no traceback.

Fix

Run beman-tidy with set +e, keep its output in beman-tidy.log, and fail the job only when the output has a Python traceback or lacks the beman-tidy pipeline finished line. Otherwise log the number of failed checks and pass.

Testing

Ran the step body under bash -e locally:

Case Result
main build on beman.optional (0 failed checks) pass
#345 build on beman.net (1 failed check) pass, logs "1 failed checks"
fake beman-tidy raising an exception fail, ::error::beman-tidy crashed ...

The step ran under bash -e, so any failed check aborted it before the exit-code test. The exit code is also the number of failed checks, not a crash marker, so detect crashes from the output instead.
@neatudarius
neatudarius marked this pull request as ready for review November 19, 2026 09:47
@neatudarius
neatudarius merged commit db3a144 into bemanproject:main Nov 19, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant