Repository navigation
ci: gate PR CI on a run-ci label and an approval for external authors - #397
Merged
Merged
Conversation
6 tasks done
Rockdu
marked this pull request as ready for review
November 18, 2026 07:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
ci-gateauthorizes a PR run with one rule: the PR carries arun-ci-*label, and either its author has write access to the repository or a reviewer with write access has approved the PR. The approval is PR-wide, as inradixark/miles: it covers later pushes too.pull_request_reviewtrigger is removed. Reviews never start or rerun a suite; a label (or a re-run of the redci-gaterun after approving) does.pulls.get, so a re-run evaluates the current labels and reviews rather than the event payload. Roles come fromrepos.getCollaboratorPermissionLevel().permission(write/admin;maintainand custom roles fold into their base permission).Why
The old gate authorized every PR on
approval || labeland the workflow also fired onpull_request_review, so any review (approve, comment, dismiss) on any PR re-ran the whole GPU suite on an already-green head (observed on #384 and #392). A label alone was also a full authorization regardless of who the author was.Validation
yaml.safe_loadon both workflows; the gate script extracted and run throughnode --check;pre-commit(check-yaml) clean.authorizedoutput and failure message. Harness kept outside the repo.run-ci-basic). The outside-author path can only be exercised by a PR from a read-role account after merge.bot-slash-lint.yamlruns the PR head's pre-commit hooks for any commenter with a write token; the gate lives in workflow files taken from the PR merge ref and the fork-approval policy exempts org members; PR-bodyci-sglang-*lines are honoured for every authorized PR.Files
.github/workflows/pr-test.yml—on:withoutpull_request_review;ci-gaterewritten; three checkoutref:expressions drop the review-event branch..github/workflows/_run-ci.yml— two checkoutref:expressions drop the review-event branch.Checklist
pre-commit run --all-filespasses (check-yaml on the touched files; no Python touched)pytest -xis green — not applicable, no Python changedpython3 train.py --helpstill parses — not applicable