Repository navigation
Description
Problem
Every push to a branch in a PR stack produces three J5 CI runs on the same commit. One of them is often cancelled, which leaves the PR's required check, "Format, lint, typecheck, and unit tests", showing failed. The PR is then blocked even though the same commit already passed twice. After each stack push, someone has to re-run the cancelled runs by hand.
Seen repeatedly on the peering poll-mode stack (#400–#408, tracked in #399). For example, PR #401 at edf3065d14:
| Run | Event | Result |
|---|---|---|
| 37706086993 | push |
success |
| 37706093846 | pull_request |
success |
| 37706095001 | pull_request, one second later |
cancelled. Its quality gate job failed, so the required check reads failed. |
Every PR in the stack showed the same pattern, and it marked #401–#408 as BLOCKED until the cancelled runs were re-run.
Cause
.github/workflows/j5-ci.yml:
on:
push:
branches:
- "j5/**"
pull_request:
branches:
- "j5/**"
- "codex/agent-led-pb-*"
concurrency:
group: j5-ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true- Push and PR both fire. Stack branches are named
j5/…, so a push to one triggers apushrun as well as the PR's own run. Thepushrun duplicates the PR run. - Two PR events fire close together. Updating a stacked branch sends two
pull_requestevents about a second apart, both in thej5-ci-<pr>concurrency group. Withcancel-in-progress, one cancels the other, and sometimes the newer run is the one cancelled. - GitHub reports the newest run. The required check takes its status from the newest run, so a cancelled duplicate makes it fail even though the code passed.
The push trigger for j5/** dates from the original workflow (43f28c9, "feat: add J5 CI and macOS packaging"). Nothing in the history says PR branches need push runs.
Proposed fix
Edit j5-ci.yml only; it's J5-owned, so there's no FORK.md entry.
- Narrow
pushtoj5/mainand any branch that really needs push runs. Check release and evidence branches first:j5/evidencemust stay excluded, and release branches may need to stay included. PR branches are already covered bypull_request. This also cuts duplicate CI time by about a third. - Make the concurrency group per commit, so only a genuinely newer commit cancels an in-flight run. For example, add
github.event.pull_request.head.sha || github.shato the group.
Acceptance
- Force-pushing every branch in a multi-PR stack leaves each PR's newest J5 CI run green, with no manual re-runs.
- A new commit pushed to a PR still cancels that PR's in-flight run on the older commit.
j5/mainstill gets its push run, and the ruleset's required check name is unchanged.
Activity
ci: stacked-PR pushes no longer leave a blocked required check (#479)