Skip to content

fix: the generated gate fails when a needed job was skipped - #19

Merged
AlexeyShalaev merged 1 commit into
masterfrom
fix/16-gate-skipped-jobs
Oct 16, 2026
Merged

AlexeyShalaev merged 1 commit into
masterfrom
fix/16-gate-skipped-jobs

Conversation

@AlexeyShalaev

Copy link
Copy Markdown
Member

The problem

The generated All checks passed job failed only when a needed job ended failure or cancelled. A job that ended skipped counted as passed. This is the one check the master ruleset requires, so if an if: or a paths filter is ever added to test-unit or test-integration, "the tests did not run" shows as green. The template's own CI already requires success from every job.

The decision

Every needed job has to end success. The jobs named in MAY_SKIP may also end skipped, and only those. The list is empty in the template. needs and the list reach the shell through env:, and jq reports each job that did not pass, by id and result.

I considered copying the template's own all(.result == "success"). That would turn pg-partsmith's gate red on every push to master, because its dependency-review job runs on pull requests only. With the list, that skip is written down in the file as intended, and any other skip fails.

Evidence

The rendered step, run with bash -eo pipefail (as Actions runs it):

all success                                  exit=0  All checks passed.
test-unit skipped, not listed                exit=1  Not passed: test-unit: skipped
test-unit skipped, listed in MAY_SKIP        exit=0  All checks passed.
listed job succeeded anyway                  exit=0  All checks passed.
test-integration failure                     exit=1  Not passed: test-integration: failure
listed job failed (MAY_SKIP is not MAY_FAIL) exit=1  Not passed: test-unit: failure
lint cancelled                               exit=1  Not passed: lint: cancelled test-unit: skipped test-integration: skipped
pg-partsmith shape, MAY_SKIP=["dependency-review"]  exit=0  All checks passed.

Before this change, the second case rendered as [[ "false" == "true" ]] (no failure, no cancelled) and passed. That is the case in the issue, and pg-partsmith run 38169905669 shows it on master.

actionlint 1.7.12 with shellcheck is clean on the generated workflows. The generated gate on the render: ruff/mypy clean, 1 test passed, uv build OK.

For the existing libraries

The libraries have the old step. pg-partsmith would need MAY_SKIP: '["dependency-review"]' when it takes this change.

Closes #16

The All checks passed job failed only on failure or cancelled, so a job that
ended skipped counted as passed. Today that takes a failed lint, which already
fails the gate, but an if: or a paths filter added to the test jobs later would
turn "the tests did not run" into a green required check.

Every needed job now has to succeed. A job skipped by design is named in
MAY_SKIP, and only those may end skipped. The template's own CI already
requires success from every job; the generated one now does too, without
breaking a library that skips a job on purpose.

Closes #16
@AlexeyShalaev
AlexeyShalaev merged commit 8bf4563 into master Oct 16, 2026
2 checks passed
@AlexeyShalaev
AlexeyShalaev deleted the fix/16-gate-skipped-jobs branch October 16, 2026 14:59
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.

The generated All checks passed gate counts a skipped job as passed

1 participant