Repository navigation
🐛 fix: preserve owner intent through PR decision paths (adopted) - #15233
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
@clubanderson is auto-promoted for contributor-lane merging on this PR: the last 5 merged PRs by this author in this hive's repositories have no revert or sentinel-alert evidence. CI, reviewer verdict, diff fences, soak, holds and branch protection still apply. |
1 similar comment
|
@clubanderson is auto-promoted for contributor-lane merging on this PR: the last 5 merged PRs by this author in this hive's repositories have no revert or sentinel-alert evidence. CI, reviewer verdict, diff fences, soak, holds and branch protection still apply. |
|
@clubanderson this PR is held at Failing checks:
Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path. |
6623c40 to
528b448
Compare
|
@clubanderson this PR is held at Failing checks:
Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path. |
Recognize approval rationale, preserve intentional non-closing issue links, release metadata-only fixes on same-head approval, and route trusted contributor change requests before requires_human admission returns. Hive-Run: #14816 Hive-Plan: issue-14816/decision-path Hive-Spec: issue-14816#1-4 Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com> Signed-off-by: thatguywob <thatguywob@users.noreply.github.com> Signed-off-by: Andrew Anderson <andy@clubanderson.com> Signed-off-by: Andrew Anderson <clubanderson@users.noreply.github.com>
Include the automated author kind when checking contributor stage routing, and keep the ignored-stage regression outside both supported decision stages (070 and 085). Signed-off-by: thatguywob <thatguywob@users.noreply.github.com> Signed-off-by: Andrew Anderson <andy@clubanderson.com> Signed-off-by: Andrew Anderson <clubanderson@users.noreply.github.com>
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
… as instructions Address review on #14822: - A same-head APPROVED review persisted as an approval-kind decision is dropped again when that review is dismissed or the reviewer's latest opinion on the head is no longer APPROVED, so a revoked approval cannot keep answering requires_human or shadow the earlier instruction. Comment/dashboard decisions stay durable. Adds HumanChangeRequestStore.Forget. - `yes` approves only when bare; `yes, but …` stays an instruction. - Trailing punctuation after the approval word (approve, / lgtm;) no longer defeats the first-word rule. - Changelog fragment lives at repo-root changelog.d/. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
528b448 to
3715f54
Compare
There was a problem hiding this comment.
Read the full diff against v5 (b127931) plus the callers in automerge_contributor_lane.go, automerge_review_gate.go, pr_issue_link.go and the un-park sweep. go build ./... is clean on the head (3715f54); go test is disabled on this host, so CI is the test verdict. The change does what it says and I found no defect — two low-severity notes a maintainer may want to weigh, neither blocking.
Verified
/hive decision approve <rationale>→Approval()(src/pkg/github/issue_unpark_command.go:110-120): first wordapprove|approved|lgtmwith.:,;!trimmed approves;yesonly when bare. Sweep now also reads PRs atstage/070-fixing(:326).latestTrustedHumanApproval(automerge_review_gate.go:314-321) now goes throughlatestTrustedHumanReview, which keeps each reviewer's latest opinion across all pages before filtering (automerge_human_changes_requested.go:36-76), so an APPROVED later superseded by the same reviewer's CHANGES_REQUESTED no longer counts.noteStageReviewsis still called once with the full page set (:60), same as before.- Contributor lane: the head-scoped trusted CHANGES_REQUESTED check sits before the
claim.Reason/requires_humanearly returns (automerge_contributor_lane.go:1272-1276), so it yields to 072 as the body claims. EnsureIssueStagePRLinkskips theRefs→Fixesupgrade whenhive:decision-headappears in the body or in a hive comment (pr_issue_link.go:317-328), andrewriteRefsIssueLinkToClosingrefuses on the marker too (:368).HumanChangeRequests.Forget(src/pkg/review/human_change_request.go:232-254) is the only store implementation — no test fakes implement the interface, so the new method is safe to add.- Body ↔ diff: every bullet in the description maps to a hunk; the dropped
v2-ci.ymltimeout commit is indeed absent from the file set.
Low — reconcileReviewBackedApproval keys on "is the latest approval", not "does this review still stand" (automerge_human_changes_requested.go:160-163). With two trusted approvers A then B on the same head, the record persisted for A's review has SourceID != live.GetID() (B is newer), so A's still-valid approval is Forget-ted on the next sweep. Behaviourally harmless today — the live lookup in trustedHumanApprovalForRequiresHuman runs first (automerge_review_gate.go:328), and the standing path in humanChangesRequestedForHead re-records B when an older instruction surfaces (:103-115) — but the store ends without an approval record for a head that has two live ones, and only live API reads cover it. If you want the record to survive, compare against the set of APPROVED reviews on head (latest[login] state check) rather than the single newest one.
Low — pr.LastEditedAt == "" guard disables the Refs→Fixes repair after any body edit, including the hive's own (pr_issue_link.go:333). pr_supersession_resolve.go:322 edits hive-authored bodies, so a superseding PR whose body carries Refs #N will keep it and fall to partial-reference. This is the conservative direction and the stage comment still links the issue, so it is a judgment call rather than a bug — but it is broader than the "edited Refs body" wording in the description suggests.
Looks correct to me; the two notes above are optional follow-ups, not blockers. CI on this head currently shows cancelled/queued runs from the rebase, so the test gate is still pending.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
hanthor
left a comment
There was a problem hiding this comment.
Reviewed the full adopted diff at 3715f54aa609e758a2a5b6a113316df6b7327970, including the durable store, review-gate consumers and stage folding. My P2 on superseded #14822 is addressed: reconcileReviewBackedApproval removes the review-sourced approval when the live approval no longer stands, reveals the preceding instruction, and is called before the recorded-approval fallback in trustedHumanApprovalForRequiresHuman. Explicit comment/dashboard decisions are not revoked by review reconciliation.
The added regression is meaningful rather than just checking the helper: TestReviewBackedApprovalRevokedOnDismissal first persists a same-head approval, then changes its live state to DISMISSED / CHANGES_REQUESTED and asserts that requires_human is no longer approved, the lane is held, the planner receives the correct instruction, and the approval-kind record is gone. TestCommentApprovalSurvivesReviewDismissal protects the durable /hive decision approve distinction. The remaining tests cover same-head metadata release, approval ordering/trust/head exclusions, approval text, and edited Refs preservation.
Existing exact-head CI evidence (no local build/test/lint run by me): v2 Tests test and coverage passed, v2 CI build-and-test and overlayfs-exec-guard passed, security/lint passed, and DCO plus squash attribution passed. The arm64 image build was still in progress when inspected; this review does not substitute for its result or any required check. No workflow timeout change is carried into this adoption.
Approval is for this code/head only. Keep branch protection, Prow/owner approval, soak, CI, security and any runtime/sentinel holds intact; do not treat this as authorization to bypass them.
|
LGTM label has been added. DetailsGit tree hash: 24dcf0b05601838d0e7007a4248533c18ea78934 |
Fixes #14816
Supersedes #14822
Adopted from @thatguywob's #14822 — original commits preserved with authorship (
63634feda,637dc265e— content unchanged; adopterSigned-off-byadded alongside the author's so the squash-attribution gate passes, as hive's adopt flow does), rebased onto current v5 and finished per the operator's adopt-supersede decision.What the fix does (unchanged from #14822)
/hive decision approve <rationale>on a hive-authored PR is an approval, not a change request; the rationale is kept in the durable decision record. The sweep reads/hive decisionatstage/070-fixingas well asstage/085-needs-decision.latestTrustedHumanApprovalnow uses each reviewer's latest opinion across all review pages (an approval later superseded by the same reviewer's CHANGES_REQUESTED no longer counts).EnsureIssueStagePRLinknever upgradesRefs→Fixeson a PR carrying a recorded human decision (hive:decision-headmarker in body or hive comment), and leaves an editedRefsbody alone.requires_humanearly returns, so the PR yields to 072 and the author nudge.Dropped from #14822
b0f5f8064"allow full image build budget for overlayfs guard" (.github/workflows/v2-ci.ymltimeout 10→45 min): unrelated to 🐛 decision path: approve-with-rationale reads as changes_requested, Refs→Fixes rewrite overrides owner decision, 070 deadlock without a new head #14816 and, per the review, the run still exceeded 45 min — a separate CI concern, not part of this fix.pr_unpark_decision_test.go, a new test from 🐛 fix: preserve owner intent through PR decision paths #14822-era v5 landing beside the contributor's).Review points addressed (commit
d095cb13c)reconcileReviewBackedApprovaldrops an approval-kind record whoseSource == reviewwhen the reviewer's latest trusted opinion on the head is no longer that APPROVED review (dismissed / changes requested again). Runs inhumanChangesRequestedForHeadand intrustedHumanApprovalForRequiresHumanafter the live lookup fails, so neitherrecordedHumanApprovalForHeadnor stage folding keeps treatingrequires_humanas answered, and the earlier instruction reaches the fixer again. Comment/dashboard decisions are durable and never revalidated. AddsHumanChangeRequestStore.Forget. Covered byTestReviewBackedApprovalRevokedOnDismissal(approve → dismissed, approve → changes requested, unchanged head) andTestCommentApprovalSurvivesReviewDismissal.yesas a prefix swallows conditional answers:yesapproves only when bare;yes, but rename the flagstayschanges_requested..:,;!, soapprove, the body change is appliedandlgtm; ship itapprove.changelog.d/(the guard rejectssrc/changelog.d/);maintainer-commands.mdupdated for the above.Validation:
gofmt -lclean on changed files;go build ./...;go test ./pkg/review ./pkg/github ./pkg/github/automerge.