Repository navigation
Automate PR review and rebase decisions - #427
Merged
Merged
Conversation
The PR sweep now says who each pull request waits on, queues the ones waiting on a maintainer for review, lists Refs lines that close nothing, and asks for a rebase on its own when a PR merges cleanly but fails only a cargo-audit advisory main has already fixed. post-review.sh posts a confirmed review only while the PR is where the reader left it. These were steps a triage run did by hand and got wrong at least once, as when a standing request for Closes #141 went unseen. CONTRIBUTING.md now asks pull requests to avoid Refs unless it sits beside a Closes or a full account of the motivation and the implementation.
A stale-base diagnosis now counts only for the head the sweep read, and post-review.sh posts the checked text instead of rereading a file that may have changed since its checks. closing_prs marks an issue truncated past ten closing PRs, waiting.md says a closing reference narrows the candidates rather than settling them, and review.md records the updatedAt that post-review.sh compares against.
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.
A triage run spent most of its time on steps a script can settle: deciding who each open pull request waits on, finding the ones ready for a maintainer review, noticing a
Refsline that closes nothing, diagnosing a cargo-audit failure that only needs a rebase, and checking that a pull request had not moved before posting a confirmed review. Doing them by hand also went wrong, as when a maintainer's standing request forCloses #141on #143 went unseen. This moves those decisions into the sweep scripts, so the skills read their output instead of re-deriving it.pr-sweep.shgives each pull request awaits_on(author, maintainer, ci, approval) read from the same table as its grade, areviewqueue of the ones waiting on a maintainer,refs_onlyfor pull requests that close nothing yet name an issue withRefs, and arebaselist whose entries carry a reason:conflicts, orstale_basewhenci-failure.shfinds the only failure is an advisory main has since moved past.stale_baseholds only when the pull request changes none of the files the audit reads, main's passing run is newer than the failing one, and no other check is failing or pending.issue-sweep.shnames the open pull requests that close each unanswered or waiting issue. The newpost-review.shrefuses to post when the head orupdatedAtmoved, a comment would fall outside the diff, or the payload has no event.CONTRIBUTING.mdand the contributor skill now ask pull requests to avoidRefsunless it sits beside aClosesor a full account of the motivation and the implementation.Verified with
./scripts/test.sh(no failed gates; browser lanes skipped here for want of Chromium),python3 -m unittest tests.test_skill_scripts(56 tests, 15 of them new or extended),shellcheck,scripts/indent.sh --checkandscripts/check-skill-refs.py. Against the live repository the sweep queued #422, #396, #411 and #401 for review, flagged #143 as already asked, marked #334 a stale base and #423 not, andpost-review.shrefused a payload on a stale head with exit 3.Left out:
pr-sweep.shandci-failure.sheach read main's latest check run; sharing that lookup means a helper both scripts source, which is a structural change of its own.Summary by cubic
Moves triage decisions out of triage runs and into the sweep scripts: who each open pull request waits on, which are ready for a maintainer review, which
Refslines close nothing, and which failing cargo-audit checks a rebase fixes. Confirmed reviews post through a new guard that refuses when the pull request changed.pr-sweep.shreports awaits_onper PR, areviewqueue,refs_onlyentries, andrebaseentries carrying aconflictsorstale_basereason. Astale_basediagnosis only counts for the head the sweep read; one for any other head is dropped.post-review.shexits 3 without posting when the head orupdatedAtmoved, a comment falls outside the diff, or the payload has no event. It posts the checked text, not the payload file again, so a rewrite after the checks cannot slip in.issue-sweep.shnames the open pull requests that close each unanswered or waiting issue; past ten closing PRs the issue is marked truncated, and the reference narrows the candidates without settling them.CONTRIBUTING.mdand the contributor skill now ask PRs to avoidRefsunless it sits beside aClosesor a full account of the motivation and the implementation, and reviews record theupdatedAtthe guard compares against.Written for commit 4886d53. Summary will update on new commits.