feat(ci): label fresh PRs waiting-for-review once they clear the bar - #4179
Conversation
`waiting-for-review` had exactly one entrance: the handoff that fires when an author replies to feedback. A PR nobody had touched yet sat in neither state, so 478 of 479 open PRs carry no review-state label and the label cannot yet be used as a review queue. A new sweep step applies it to PRs that clear the bar. The bar today is just "references an issue", reusing pr-issue-link.js's resolution so the gate and the nudge can never disagree about what counts. It is meant to rise: CI green, demo present, Polly clean each become a predicate in `belowBar`. Never applied to a draft, to a PR already carrying `waiting-on-author` (which would break the mutual exclusion the pair relies on), or to a PR whose label a human removed before, since a sweep that reapplies it hourly would be arguing with the maintainer who took it off. Forward-only, sharing the issue-link effective date, because labelling the whole backlog at once would bury the signal. Ships dry-run. Verified against production with the label write rigged to throw: 26 PRs in the window, 4 ready, 20 below bar, 2 drafts skipped, no writes attempted. Co-authored-by: Isaac Signed-off-by: Dhruv Gupta <dhruv.gupta@databricks.com>
|
/review |
|
removedBefore matched any removal of waiting-for-review, ignoring the actor the query already fetched. But waiting_on_author.py removes that label itself on every waiting-on-author transition, since the two are mutually exclusive, so the bot's own routine state change was read as a maintainer saying "not ready". The effect was permanent: a PR that had been through one review round trip and then ended up in neither state, which is exactly the gap this gate exists to close, would never be re-labelled. Confirmed on a real PR from earlier today whose timeline records "unlabeled waiting-for-review by github-actions[bot]". Rename to removedByHuman and filter out [bot] actors. A missing actor fails toward eligible, since a removal we cannot attribute is not evidence of intent. Also make the label write per-PR so one failure no longer abandons the rest of the sweep, matching the resilience close_stale_waiting_prs already has. Co-authored-by: Isaac Signed-off-by: Dhruv Gupta <dhruv.gupta@databricks.com>
|
/review |
2 similar comments
|
/review |
|
/review |
|
|
🏷️ Doc impact: Adds a CI-only GitHub Actions "ready-for-review" labeling gate plus its workflow and unit tests, an internal maintainer tooling change with no user-facing surface or integration affected. Auto-classified on merge. Set the label manually before merging to override. · run |
Related issue
Part of OMNI-2214 / OMNI-2315. Closes the last gap in the review-state machine;
this PR declares Test / CI below, which is one of the exempt types.
Summary
waiting-for-reviewhad exactly one entrance:hand_off_to_reviewer, which fireswhen an author replies to feedback on a PR already carrying
waiting-on-author.A PR nobody had touched yet therefore sat in neither state. That is why 478 of
479 currently-open PRs carry no review-state label, and why the label cannot yet be
used as the review queue it was built to be. A fresh PR that references an issue
should be labelled ready, and today nothing does that.
This adds a sweep step that applies the label to PRs clearing the bar.
The bar today is just "references an issue." It reuses
pr-issue-link.js'sresolution (closing links, sidebar links, and
Part of/Related to/Towards/
Refspointing at a real issue), so the gate and the nudge can never disagreeabout what counts. It is designed to rise: CI green, demo present, Polly clean each
become one more predicate in
belowBar, and nothing else changes.Never applied when:
waiting-on-authoris set (the ball is in the author's court, and applying bothwould break the mutual exclusion the pair relies on)
"not ready"; an hourly sweep that reapplies it would be arguing with them. An
unrelated label removal is ignored.
Forward-only, sharing
EFFECTIVE_FROMwith the issue-link check: labelling 478backlog PRs in one sweep would bury the signal the label exists to create.
Ships dry-run (
ENFORCE: "false"), consistent with how the nudge shipped.Test Plan
node .github/workflows/ready-for-review.test.jspasses. 12 cases: a closinglink clears the bar;
Part of #Nto a real issue clears it; a reference to aPR does not; no reference does not; drafts skip;
waiting-on-authorwins;idempotent; a prior manual removal is respected while an unrelated removal is
ignored; a dry run reports
READYwithout labelling; an unverifiable linklookup fails closed; and the effective date is shared with the issue-link module.
Verified against production with the label write rigged to throw, so
"nothing was touched" is proven rather than assumed:
The 4 ready are fix(pi-native): carry catalog token limits into the pi-native model list #4178, Persist custom agent reasoning effort for bundled sessions #4128, feat(web): keep conversation streams open in the background #4113, fix(datetime): make timezone handling explicit #4095. Note fix(datetime): make timezone handling explicit #4095 is the
Refs #3644PRfrom the earlier
Part offix, so that change flows through to the gate asintended. fix(python-client): fail loud when a stream opens on a redirect #4173 comes back
below bar (no issue referenced), matching the nudge'sverdict on the same PR. No write was attempted.
A new
ready-for-review-test.ymlruns the unit test on any PR touching thescript, its test, or the issue-link module it reuses.
Demo
N/A. CI label mechanics, no user-visible UI.
Type of change
Test coverage
Coverage notes
Unit tests cover every predicate and exclusion. Manual verification was running the
shipped script against live GitHub with the label write rigged to throw, confirming
both the verdict set and that nothing was written.
Follow-up
Once this is enforcing, CONTRIBUTING can state that reviewers work the
waiting-for-reviewqueue. It deliberately does not say that today, because thelabel was not yet applied to fresh PRs and the doc would have read as "we will
never review your PR."