Repository navigation
π decision: move an answered PR out of needs-decision and dispatch the fix - #14684
Conversation
β¦ the fix A trusted merger's /hive decision on a hive-authored PR at stage/085-needs-decision was acknowledged but never acted on: - parseUnparkCommand kept only the first line, so the recorded instruction (and the fix kick) read "approve" instead of the numbered instructions under it; - ClassifyStage answered the swarm's decision-requested verdict before the lane's human-changes-requested reason, so the owner's decision on the current head never outranked the question it answered and the PR stayed at 085; - a bare /hive decision approve was recorded as a change request too. Now the whole comment is the decision text; the recorded requester is noted on the stage detail and folded through ReviewFacts, and a decision on the current head derives fixing (owned rank, human-changes-requested) ahead of RequiresHumanStage. A bare approve is recorded with kind approve: HumanChangeRequestFor hides it from the planner and the lanes treat it as a trusted human approval that releases requires_human. The un-park path submits a PRDecided fact so 070 is written in the same pass as the reply, logs one 'decision: unpark pr=β¦ head=β¦ mode=β¦ by=β¦ β stage=β¦' line, tags the reply with the exact head, and on later sweeps rebuilds a missing or first-line-only record from the acknowledged comment thread for the live head only. Fixes #14679 Signed-off-by: Andy Anderson <andy@clubanderson.com>
|
[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 No conflicting open PRs or same-file overlaps were found. |
|
@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. |
β¦decisions through the same mode/stage path Signed-off-by: Andy Anderson <andy@clubanderson.com>
|
@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. |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
|
merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 9f62e2a. |
Fixes #14679
What broke (hive#14628, head
3b4a2b5)The owner commented
/hive decision approve+ three numbered instructions on a hive-authored PR parked atstage/085-needs-decision. The hive replied "Decision recorded β¦ this PR moves to the fixing stage", then nothing moved: 40 minutes later the PR still wore 085, the lane kept loggingcontributor-lane:decision-requested, and the fix that eventually went out carried the instruction textapprove.Root causes
pkg/github/issue_unpark_command.goparseUnparkCommand/hive decision approvewere dropped, so the store heldbody: "approve"and the fix prompt quoted that.pkg/stageengine/derive_pr_classify.goClassifyStageDetail.Verdict.DecisionRequested/RequiresHumanStagebranches ran beforestageFixingReasons(which containshuman-changes-requested). Only a trusted human approval on the head cleared requires_human; a recorded human change request on the same head had no equivalent, so the reviewer's question outranked the owner's answer and the PR re-derived 085 every pass.pkg/review/dispatch.goPlanDispatch/hive decision approvewas also recorded as a change request, which would kick a fix whose instruction is "approve".Fix
unparkCommand.Textkeeps the whole decision (rest of the command line + every line below);Decisionstays the first line so the issue-sideDecision:round-trip is unchanged.BareApproval()recognisesapprove/approved/lgtm/yeswith nothing else.review.HumanChangeRequest.Kind(""= changes,"approve").HumanChangeRequestFor(planner input) returns nil for approvals;HumanApprovalForis the inverse.Lookup(repo, number, source, id)is the cheap "already seen" test.prstage.Detail.HumanChangeRequester/Head+ReviewFacts.HumanChangeRequester, noted by the self lane from the store (noteStageHumanChangeRequest), copied across lanes indrain, folded inReviewFactsFrom/ObservationsFromPRFacts.ClassifyStagegainsHumanChangeRequestStage(fixing, owned,human-changes-requested) checked before the decision-requested block and in the admission branch;RequiresHumanStagealso yields to it. Hold labels (excluded-label:*, needs-human reasons) still win.trustedHumanApprovalForRequiresHumanfalls back to a recorded approval on the head (recordedHumanApprovalForHead), which notes the human approval on the stage detail β requires_human released β 090/merge path per existing rules (including the β¨ merge: owner approval releases the workflow-path fenceΒ #14672 workflow fence).FactSink.PRDecided(ref, PRDecisionFact): the un-park path submits the decision to the stage engine in the same pass as the reply (instruction β self-lanehuman-changes-requestedobservation β 070; bare approve β abstain, lanes take it next pass). A failed write is logged and the store record makes the next sweep converge.decision: unpark pr=14628 head=3b4a2b5 mode=changes_requested by=clubanderson β stage=stage/070-fixing(stage=next-sweepwhen the write was deferred).<!-- hive:decision-head <sha> mode=β¦ -->.reconcileAnsweredPRDecisionruns when no new command is pending: the newest answered/hive decisionby a trusted merger whose reply names the live head (marker, or the 7-char prose prefix for older replies) and whose store record is missing or kept only the first line is re-recorded silently and the stage fact re-submitted; a decision answered for an older head is ignored.Behaviour matrix
/hive decision approve+ instructionshuman-changes-requested(no moredecision-requested)/hive decision approveready-for-human-merge/hive decision <text>(no approve word)human-changes-requestedTests (CI is the verdict; no
go testlocally)TestParseUnparkCommandKeepsDecisionTextAfterFirstLineTestHumanChangeRequestApprovalKindIsNotAFixRequest(store + planner)TestClassifyStageHumanDecisionSupersedesDecisionRequested(table: instructions β 070; bare approve β not 085; stale head β 085 stands),β¦OnAdmission,TestReviewFactsCarryHumanChangeRequesterForHeadOnly,TestFactSinkPRDecidedDerivesFixingForInstructionTestSweepIssueUnparkCommandsDecisionApproveModes,TestSweepIssueUnparkCommandsReconcilesAnsweredDecisionAfterRestart(live head / first-line repair / pre-marker reply / old head),TestParsePRDecisionHeadMarkerTestTrySweepSelfAuthoredPRRecordedDecisionNotesStageAndApprovalReleasesNo
time.Sleepadded.Not in this PR
workflowApprovalCommentActorreads only the first line of/hive decision approve, so a comment that is approve + instructions also counts as the workflow-path approval for the contributor lane. Left as is; worth a follow-up once this lands.approve-only record; after deploy the reconcile path repairs it from the thread on the next un-park sweep and the stage derives 070 from the lane.