Skip to content

Commit d4007e5

Browse files
authored
Improve auto-triage: always include drafts, close stale ones, prefetch next page, show reviews (#64669)
- Remove --include-drafts flag; draft PRs always enter the triage pipeline - Non-stale draft PRs are filtered out from candidates and display - Stale drafts (triaged >7 days, no author response) are auto-closed with a comment inviting the author to reopen after addressing feedback - Add skip action (s) to workflow approval diff review prompts - Show review instructions before batch workflow approval - Wait for user confirmation before starting diff review - Background prefetch of next page at 75% of current batch in sequential mode - Show approval/rejection count and reviewer names in PR headers (both sequential and TUI modes) - Fetch review decisions via GraphQL and add ReviewDecision model - LLM prompt: treat generated files as auto-generated (CI checks handle them)
1 parent 8c4c990 commit d4007e5

11 files changed

Lines changed: 1031 additions & 191 deletions

File tree

‎dev/breeze/doc/13_pr_tasks.rst‎

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,18 @@ When the command starts, it runs through several startup phases with a progress
5555
mergeability.
5656
7. **Verify CI status** — Verifies that SUCCESS status is from real CI (not just bot/labeler
5757
checks).
58-
8. **Filter & classify** — Filters out collaborators, bots, drafts (optional), and applies
59-
label/date/author filters.
58+
8. **Filter & classify** — Filters out collaborators, bots, and applies
59+
label/date/author filters. Drafts are always included for staleness detection.
6060
9. **Check prior triage** — Checks if PRs already have triage comments from previous runs.
61+
10. **Detect stale PRs** — Identifies stale draft PRs and inactive open PRs for closing:
62+
63+
- **Triaged drafts** — Draft PRs with a triage comment older than 7 days and no author
64+
response are marked for closing.
65+
- **Non-triaged drafts** — Draft PRs with no activity (based on ``updated_at``) for
66+
over 3 weeks are marked for closing.
67+
- **Inactive open PRs** — Non-draft PRs with no activity for over 4 weeks are marked
68+
for closing.
69+
- Non-stale drafts are skipped from triage (they stay in draft until they become stale).
6170

6271
TUI mode (full-screen interactive)
6372
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -353,8 +362,20 @@ in sequential mode, presenting PRs one at a time:
353362

354363
6. **Already triaged** — Previously triaged PRs offered for re-evaluation.
355364

356-
Each PR info panel shows the PR Classification, LLM Review status, labels, and
357-
author profile.
365+
7. **Stale drafts** — Draft PRs that have been inactive are automatically closed:
366+
367+
- Triaged drafts with no author response for 7+ days
368+
- Non-triaged drafts with no activity for 3+ weeks
369+
370+
8. **Inactive open PRs** — Non-draft PRs with no activity for 4+ weeks are
371+
automatically converted to draft with a comment asking the author to mark
372+
as ready when they resume work.
373+
374+
9. **Stale workflow-approval PRs** — PRs awaiting workflow approval with no activity
375+
for 4+ weeks are automatically converted to draft with a comment.
376+
377+
Each PR info panel shows the PR Classification, LLM Review status, maintainer
378+
reviews (approvals/changes requested from collaborators), labels, and author profile.
358379

359380
Session summary
360381
^^^^^^^^^^^^^^^
@@ -402,6 +423,27 @@ The command uses the following GitHub labels to track triage state:
402423
These labels must exist in the GitHub repository before using the command. If a label is
403424
missing, the command will print a warning and skip the labeling step.
404425

426+
Automatic staleness detection and closing
427+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
428+
429+
The command automatically detects and proposes closing PRs that have gone stale.
430+
Different thresholds apply depending on the PR state:
431+
432+
============================ ========== ========== =============================================
433+
PR State Threshold Action Condition
434+
============================ ========== ========== =============================================
435+
Triaged draft 7 days Close Triage comment posted, no author response
436+
Non-triaged draft 3 weeks Close No activity (``updated_at``) from author
437+
Open (non-draft) 4 weeks Draft No activity (``updated_at``) from author
438+
Awaiting workflow approval 4 weeks Draft No activity (``updated_at``) from author
439+
============================ ========== ========== =============================================
440+
441+
For draft PRs that are stale, the PR is closed with a comment inviting the author to
442+
reopen. For non-draft PRs, the PR is converted to draft with a comment asking the
443+
author to mark as ready when they resume. All actions go through the normal triage
444+
action flow, so ``--dry-run`` will show what would happen without making changes.
445+
No labels are added when converting to draft — only a comment is posted.
446+
405447
Example usage
406448
^^^^^^^^^^^^^
407449

‎dev/breeze/doc/images/output_pr_auto-triage.svg‎

Lines changed: 34 additions & 42 deletions
Loading
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8f322c67369d5757a2b2b8df5248d02b
1+
15636cdbbdf6fde36f2ae6e5c43da51e

0 commit comments

Comments
 (0)