review
chernabog recipes add reviewBakes .chernabog/flows/review.ts and its prompt, .chernabog/prompts/review.md.
Picks up an open pull request whose review is requested of the persona this runs as, which it hasn’t reviewed yet, unless another flow’s run owns it. Its trigger checks the persona’s own login, so it needs no reviewRequested setting.
Runs as a persona with a seat in the reviewer pool: a login under github: in machine config that the repo’s reviewers: list. Run as the implicit account, or as a login outside the pool, it starts nothing, and chernabog status shows NotInReviewerPool with the fix.
Ends with an approval, which merges an auto:ship pull request when that’s safe, or changes requested, which the author’s address-review answers.
Its steps
Section titled “Its steps”Review.round(pr, 1, { role: "reviewer" })— reviews the head in a read-only checkout, in a fresh session of the reviewer role:flows.review.agents, or the persona’srolespick, so a different agent from the one that wrote the code can review it. It posts a real GitHub review, approving or requesting changes, with a marker comment that records the reviewer and its session. GitHub won’t let an account approve its own pull request; such a review is posted as a comment.Review.doneReviewing— removes the checkout.- On an approval,
PullRequest.shippingreads whether the pull request carriesauto:ship. If it does,PullRequest.merge(pr, { method: "squash" })merges it when that is safe, and otherwisePullRequest.handToPersonlabels itauto:needs-humanwith the reason. When GitHub refuses the merge because the pull request conflicts with its base (conflicts-pr-<n>reads itsmergeable_state), it is left forresolve-conflicts, which merges the base in and asks this reviewer again; any other refusal still goes to a person. Any other pull request, ahybridone included, is left for a person to merge.
A repo that baked review before this keeps handing a conflicting approval to a person until it brings the change over: chernabog recipes diff review shows it.
A request for changes moves no label. The author’s address-review picks the pull request up from the review itself. A person answering a review on their own pull request pushes and asks the reviewer again.