Commit graph

3 commits

Author SHA1 Message Date
Huang Xin
b6618dbefd
ci(pr-gate): fail closed past 250 commits, retry re-runs, unique check names (#7712)
Answers CodeRabbit's review of #7709:
- The PR commits API lists at most 250 commits. When the PR has more, the
  gate now fails and asks the contributor to squash, instead of passing
  unchecked commits.
- The CI re-run now happens before the gate comment is deleted. A failed
  re-run leaves the comment, so the next event retries it.
- The three `gate` jobs get distinct check names: "PR gate"
  (pull_request_target), "CI gate" and "CodeQL gate". "PR gate" is the one to
  require. It runs main's copy of the workflow and script, so a PR can't edit
  it away the way it can edit the CI gates.

Verified: node --test .github/scripts/pr-gate.test.mjs passes 7 tests. The
new 250-cap test failed before the fix (truncated was undefined), along with
the two tests that now assert truncated: false. A check-only dry run on
#7687 (13 commits), #7701 and #7708 gives the same verdicts as before. Biome
is clean and the workflow YAML parses.

Co-authored-by: Claude Code (Claude Opus 5.5) <noreply@anthropic.com>
2026-11-20 14:48:54 +01:00
Huang Xin
4e65eb63d1
ci: gate outside PRs on a linked issue and agent attribution (#7709)
PRs from authors who aren't owners, members or collaborators (bots exempt)
must link an issue (closingIssuesReferences, i.e. "Fixes #N") and carry
"Co-Authored-By: <agent> (<model>) <email>" in every non-merge commit.

- pull-request.yml and codeql.yml get a `gate` job that every other job
  needs, so a failing PR skips the rest of CI. Push and schedule runs pass
  straight through.
- pr-gate.yml (pull_request_target, base-branch checkout only, never the PR's
  code) adds `needs-issue` / `needs-attribution` labels and one comment saying
  what to fix. The PR stays open. Once it passes, the labels and comment are
  removed and the CI runs the gate skipped are re-run, since linking an issue
  doesn't trigger CI.
- CONTRIBUTING.md states the linked-issue rule.

Verified:
- node --test .github/scripts/pr-gate.test.mjs: 6 pass. It failed before
  pr-gate.mjs existed (module not found).
- Check-only dry run against the 8 latest outside PRs (#7683-#7703): all
  fail, 5 missing a linked issue and all 8 with unattributed commits,
  matching their closingIssuesReferences and commit messages. #7708 (member)
  and a push event pass.
- The workflow YAML parses; actionlint isn't installed here.
- Not run: the --report path (labels, comment, re-run) against a live PR. The
  first outside PR after merge exercises it.

Co-authored-by: Claude Code (Claude Opus 5.5) <noreply@anthropic.com>
2026-11-20 14:19:42 +01:00
Huang Xin
c842c4b7fb
ci(release): retry transient GitHub and R2 failures (#7378) 2026-11-06 23:41:17 +08:00