Skip to content

fix(pr-gate): a draft above a PR no longer makes it skip; only a ready top covers the PRs below - #36

Merged
igorlamos merged 1 commit into
mainfrom
claude/pr-gate-draft-top
Nov 24, 2026
Merged

igorlamos merged 1 commit into
mainfrom
claude/pr-gate-draft-top

Conversation

@beplus-agent-claude

Copy link
Copy Markdown
Contributor

What broke

In a stack, the PR gate skipped a PR whenever any open PR was based on its branch, draft or not. A draft runs nothing (PG-D1). So a PR with only drafts above it reported "skipped: the top covers it" and was never tested.

That is how bepluscloud/ai#885 merged into dev without console CI: draft #886 sat above it.

The fix

The stack step in pr-gate/action.yml now walks up past drafts:

Above the PR Before Now
a ready PR skips skips (unchanged)
only drafts skips (nothing runs) runs its own checks; the summary says "Only drafts are above #N (#M)…"
a ready PR above a draft above it skips skips: "#3 (ready) is above #1 in its stack, past the draft #2…"
a draft and a ready PR side by side skips skips (the ready one covers it)

A draft itself still runs nothing. If the gate cannot list the PRs above, it still fails open: the checks run.

PG-D2 in PR-GATE.md now says what happens in each case:

  • A stack with a ready PR above a draft cannot merge until the draft is ready. Once the draft is ready, it skips under the top.
  • When a top PR turns back into a draft, the PRs below keep their "skipped" until someone pushes to them or marks them ready again.

Tests

I ran test/pr-gate/run.sh (what test-pr-gate.yml runs) locally: all 41 cases pass. The new cases:

  • only a draft above;
  • two drafts above;
  • a ready PR above a draft above;
  • a ready PR and a draft side by side above;
  • the draft in the middle;
  • the ready top past a draft (root dev);
  • the reason each case gives.

Against the old action.yml, the draft cases fail (8 ✗).

No file under .github/workflows changes.

…dy top covers the PRs below

In a stack, a PR skipped whenever any open PR was based on its branch, draft or not.
A draft runs nothing, so a PR under only drafts reported "skipped" and was never
tested: bepluscloud/ai#885 merged into dev without console CI under draft #886.

Now the gate walks up past drafts. A ready PR above (based on its branch, or on a
draft's above it) covers it and it skips; drafts alone above leave it to run its own
checks, and the run's summary says so. A ready PR above a draft above a PR still
covers it: that top's tree holds both.

Tests (test/pr-gate/run.sh): only a draft above, two drafts above, ready above a
draft above, a ready PR and a draft side by side above, and the reasons each gives.
The old gate fails the draft cases.

Co-Authored-By: Igor Lamos <igor@be.plus>
@beplus-agent-claude
beplus-agent-claude Bot marked this pull request as ready for review November 24, 2026 12:11
@igorlamos igorlamos self-assigned this Nov 24, 2026
@igorlamos
igorlamos merged commit 0f0fd56 into main Nov 24, 2026
2 checks passed
@beplus-agent-claude
beplus-agent-claude Bot deleted the claude/pr-gate-draft-top branch November 25, 2026 19:20
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.

1 participant