Repository navigation
refactor(on-pr): run PR checks as a single job - #138
Merged
Merged
Conversation
on-pr.yml previously fanned out into 8 jobs from a capability-detection
job. Most were skipped per repo, every running job paid runner spin-up +
checkout overhead, and Bazel was set up three separate times.
Rewrite it as one job whose steps are the individual checks. Each check
step is gated with `if: ${{ !cancelled() && <capability> }}`, so a
failing check still reports its own pass/fail but does not stop the
checks after it, while the job fails if any step failed. setup-uv and
setup-bazel are themselves gated, so nothing heavy installs unless the
repo needs it, and Bazel is set up once.
The two bzlmod-lock-check.yml checks are inlined and on-pr's internal
`uses:` call is dropped; the standalone bzlmod-lock-check.yml is
unchanged. bazel-module-name-check is kept but disabled (&& false) until
its detection script is fixed. Also drops the unused id-token: write
request, as no step consumes an OIDC token.
Signed-off-by: Alexander Lanin <Alexander.Lanin@etas.com>
Callers can now force-skip an individual check even when its capability is detected, e.g. a repo that has a .pre-commit-config.yaml but does not want on-pr to run it. Adds five optional boolean workflow_call inputs, all defaulting to false so existing callers are unaffected: skip-pre-commit, skip-python-tests, skip-format, skip-copyright, skip-bzlmod-lock Each check step's condition gains `&& !inputs.skip-<name>`. Signed-off-by: Alexander Lanin <Alexander.Lanin@etas.com>
The top-level README is long and never documented on-pr at all, even though it is the main PR entry point. Add docs/workflows/on-pr.md covering usage, auto-detected checks, the skip-* inputs, behavior (non-stopping, sequential, lazy tool setup, pull_request_target refusal), permissions and runner selection. Link it as the first row of the README's workflow table. Signed-off-by: Alexander Lanin <Alexander.Lanin@etas.com>
Move the doc from docs/workflows/ to .github/workflows/on-pr.md so it sits right beside the workflow it documents. Keeping them together makes it far more likely the docs get updated whenever the workflow changes. Update the README link accordingly. Signed-off-by: Alexander Lanin <Alexander.Lanin@etas.com>
A red check with no explanation leaves contributors guessing. Each check now writes a tailored block to $GITHUB_STEP_SUMMARY on failure: what went wrong, how to reproduce it locally, and how to fix it (e.g. `bazel run //:format` for formatting, `bazel mod tidy` for the lockfile). The job still fails as before. Guidance lives inside each step, next to the command it explains. Document the behavior in on-pr.md. Signed-off-by: Alexander Lanin <Alexander.Lanin@etas.com>
AlexanderLanin
marked this pull request as ready for review
July 17, 2026 13:02
AlexanderLanin
requested review from
MaximilianSoerenPollak,
PiotrKorkus,
dcalavrezo-qorix,
lurtz,
nradakovic,
opajonk and
pawelrutkaq
as code owners
July 17, 2026 13:02
MaximilianSoerenPollak
approved these changes
Jul 17, 2026
MaximilianSoerenPollak
left a comment
Contributor
There was a problem hiding this comment.
For me this looks like a good improvement and logical
Member
Author
|
as the old on-pr is barely used, this change can only be an improvement. I'll merge this. |
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.
Why
on-pr.ymlis the main PR-check entry point for all S-CORE repositories, but it fans out into 8 separate jobs from a capability-detection job. For a typical repo this means:detect-repo-bazel-targets,bazel-format-check, andbazel-copyright-check).Few maintainers want independent pass/fail feedback from a dozen trivial jobs; a single consolidated result is more useful and much cheaper.
What
Rewrite
on-pr.ymlas one job whose steps are the individual checks.Non-stopping, still per-step visible
Every check step is gated
if: ${{ !cancelled() && <capability> }}. Because the condition isn't the implicitsuccess(), a failing check does not skip the checks after it — each still shows its own red/green, and the job fails if any step failed. No shell "collect failures and exit at the end" aggregation is needed.Failures vs. infrastructure
checkoutand the detection steps keep the defaultsuccess()gate. If either fails, the capability outputs are empty, so every<capability> == 'true'guard is false and all checks skip while the job is already red — a broken checkout can't run checks against a missing tree, but a broken check never blocks its siblings.Nothing heavy installs unless needed
setup-uvandsetup-bazelare themselves gated, so a docs-only repo installs neither, and Bazel is set up once — shared by target-detection + format + copyright + lockfile.Trade-off
Checks now run sequentially in one runner instead of in parallel across runners (for a Bazel repo: format → copyright → lockfile one after another). This is the deliberate cost of eliminating per-job runner spin-up and skipped-job clutter.
Changes
.github/workflows/on-pr.yml— collapsed 8 jobs into a singlepr-checksjob; checks gated with!cancelled() && <capability>so failures don't stop siblings.bzlmod-lock-check.ymlchecks (mod tidy+git diff, andmod deps --lockfile_mode=error) and droppedon-pr's internaluses:call. The standalonebzlmod-lock-check.ymlis unchanged (still consumed directly by other repos).bazel-module-name-checkkept but disabled via the&& falseidiom (a bareif: falseis rejected by actionlint) until its detection script is fixed.pull_request_targetrefusal guard (frombzlmod-lock-check.yml) as the first step, now covering the whole job.id-token: writerequest — no step consumes an OIDC token (sibling Bazel workflows usesetup-bazelwithout it).