Skip to content

ci: stacked-PR pushes leave cancelled duplicate J5 CI runs that block the required check #478

Closed

Description

@Jacksondr5

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
  1. Push and PR both fire. Stack branches are named j5/…, so a push to one triggers a push run as well as the PR's own run. The push run duplicates the PR run.
  2. Two PR events fire close together. Updating a stacked branch sends two pull_request events about a second apart, both in the j5-ci-<pr> concurrency group. With cancel-in-progress, one cancels the other, and sometimes the newer run is the one cancelled.
  3. 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.

  1. Narrow push to j5/main and any branch that really needs push runs. Check release and evidence branches first: j5/evidence must stay excluded, and release branches may need to stay included. PR branches are already covered by pull_request. This also cuts duplicate CI time by about a third.
  2. 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.sha to 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/main still gets its push run, and the ruleset's required check name is unchanged.

Activity

  1. added a commit that references this issue on Oct 8, 2026
    ff92a11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions