Repository navigation
ci(pr-policy): add the maintainer takeover label - #2117
Merged
Merged
Conversation
A maintainer who finishes a community PR adds the label. The bot tells the author, assigns the maintainer, and stops flagging or closing the PR. Dependabot keeps to the dependencies label.
Contributor
🟢 e2e web: 95 passedAll 95 tests in 43 files
Tested by e2e 0.24.0 · 1m 31s · web · run artifacts |
Contributor
🟢 e2e web agent: 34 passed35 agent steps · 26 replayed from cache · 27 model calls · 149.6k tokens (93% cached) · $0.0065 All 34 tests in 5 files
Tested by e2e 0.24.0 · 1m 38s · web · run artifacts |
Contributor
🟢 e2e android agent: 20 passed24 agent steps · 15 replayed from cache · 42 model calls · 270.4k tokens (87% cached) · $0.0156 All 20 tests in 1 file
Tested by e2e 0.24.0 · 5m 53s · android-emulator · run artifacts |
Contributor
🟢 e2e ios: 59 passed, 1 skippedAll 60 tests in 7 files
Tested by e2e 0.24.0 · 7m 22s · ios-simulator · run artifacts |
Contributor
🟢 e2e ios agent: 21 passed, 1 skipped25 agent steps · 12 replayed from cache · 57 model calls · 414.1k tokens (82% cached) · $0.0275 All 22 tests in 1 file
Tested by e2e 0.24.0 · 8m 21s · ios-simulator · run artifacts |
Contributor
🟢 e2e android: 60 passed, 1 skippedAll 61 tests in 7 files
Tested by e2e 0.24.0 · 10m 39s · android-emulator · run artifacts |
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
A maintainer who decides to finish a community PR themselves adds the
maintainer takeoverlabel. The bot then:needs:complianceand its comment, and neither the 72 hour close nor the stale sweep touches the PRRemoving the label deletes the comment, and the policy check applies again.
The comment the author gets:
Dependabot PRs get only the
dependencieslabel.Why
When a maintainer finishes a contributor's PR, nothing on the PR says so. The author keeps pushing or waits for a review, and the policy bot can still flag the PR and close it after 72 hours, or close it as stale.
The
dependabot.ymlchange belongs to a label cleanup done by hand in the repo settings. Dependabot's defaults addjavascriptandgithub_actions, which nothing reads, and would bring them back after they were deleted.How it works
pr-policy.ymlalso runs onlabeledandunlabeled(.github/workflows/pr-policy.yml:12) and gets a second step,takeover.ts(:38).outstanding()returns no problems for a PR carrying the label (scripts/pr-policy/rules.ts:169).check.ts:51and the sweep'ssettleFlagged(sweep.ts:118) both call it on the live PR, so their existing "nothing to fix" path clears the flag. A PR labeled between the sweep's listing and its turn is caught the same way.isStaleskips a labeled PR (rules.ts:262).takeover.tsskips closed PRs and PRs from maintainers or bots, then reads the live labels, the bot's announcement, and who last added the label from the timeline (labeledBy,scripts/pr-policy/github.ts:108).takeoverChange()(rules.ts:203) decides from that state: post the announcement, rewrite it when another maintainer took over, withdraw it when the label is gone, or do nothing.announceTakeoverposts or edits the comment and assigns the maintainer (github.ts:127).withdrawTakeoverdeletes the comment and leaves the assignee, because nothing records why someone was assigned (github.ts:138).CONTRIBUTING.md:62documents the label for contributors.Decision: both steps read the PR as it is and ignore which event fired. The workflow's concurrency group drops a queued run when a newer event arrives, so a step keyed on the
labeledevent could lose the announcement for good. For the same reason the job has no filter on the label's name: a skipped run would still evict a queued one.Issue
Verified
Ran it locally: yes
--dry-runagainst a live fork PR (fix(web): return plain objects made in a same-origin iframe from evaluate #2102), with its REST payload as the event. This exercises the live reads, including the new timeline query:main, so it cannot run before merge.takeoverChange,announceTakeover, andwithdrawTakeoverare covered byscripts/pr-policy/*.test.ts.Checklist
pnpm changeset) for any change to a published package, or the change is testbed, docs, or CI only.