Skip to content

πŸ› stage: the 085 note stops asking for an approval the head already has - #18849

Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/085-note-approved-head
Nov 17, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/085-note-approved-head

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary

When the lane stops at an earlier gate (a fork-guard check, a hold), the 085 "Needs a decision" note keeps asking for an owner approval the head already has. It lists:

  • the reviewer's requires_human question;
  • the workflow fence "awaiting owner approval";
  • "What to do: a trusted merger approves this head".

All of that appears even though a trusted maintainer approved that exact head, and the hive itself posted that the approval released the fence.

With this change, the stage pass reads the head's trusted approval itself in that case. The note then names only what is actually left (here the fork guard), and What to do says "nothing more to approve: @x approved this head".

What happened

Seen on projectbluefin/utah-packages#1181 (11-17, Eastern). It is a fork PR that edits workflows, and its required Canary check refuses fork PRs.

  • 6:23 AM: a trusted maintainer approved head 11352dc.
  • 6:25 AM: the hive posted that the approval releases the workflow-path fence and answers the swarm's requires_human question.
  • 6:26 AM: the hive posted its 085 note, rewritten at 7:49 AM on the same head. Besides the real blocker (Canary), it still lists requires_human, the reviewer's question and "awaiting owner approval", and asks a trusted merger to approve the head.

projectbluefin/utah-packages#1013 has the same shape (11-16 approval, 11-17 1:51 PM note on the same head).

This is not the empty-note bug fixed in #18669. Here the note names causes that are already settled.

Cause

There are two gaps, and both are needed for the wrong note.

  1. The approval isn't in the evidence.
    • humanEvidence takes the approver only from the per-pass obs.Detail.HumanApprover.
    • That field is noted only by a lane that reached the review gate or the workflow fence.
    • A lane stopped at fork-guard:<check> reaches neither, so the route lists requires_human and takes the "a trusted merger approves this head" branch of DecisionActions.
    • The same-head re-park (preserveNeedsDecisionOnSameHead β†’ sameHeadDecisionRoute, added in πŸ› stage: the 085 needs-decision comment always names a causeΒ #18669) builds its reasons from the verdict with no approver check, so it has the same gap.
  2. The released fence is still listed.
    • routeProgress drops the fence cause only on the manual-merge path (manualMergeApproved, which needs ManualMergeRule).
    • So a fence the approval released still printed "awaiting owner approval", even with an approver set.

What changed

  • humanEvidence: when the route would ask for an approval (requires_human verdict, or a fence the approval releases) and no lane noted one, it reads the head's trusted approval via headTrustedApproval:
    • an APPROVED review reaching the head, and for requires_human a recorded /hive decision approve;
    • only when trusted mergers are configured, as for the sign-off election's existing one-off read;
    • cached per PR and head for humanChecksTTL (10 minutes), like the head's checks.
  • Stage pass: the approval the route read is stamped on the observation, so the steps after it see it too.
  • Same-head re-park: before re-asking, it reads the approval the same way (sameHeadApproved). An approved head is not re-parked on the question the approval answered. sameHeadDecisionRoute also skips the requires_human reasons when the head carries an approval.
  • routeProgress: a new Evidence.CauseAwaitsApproval marks the fence-awaiting-approval cause. With an approver set, that cause is no longer listed, and "the automerge lane will not merge this unattended" doesn't stand in for it.
    • The manual fence (owner_approval_releases_workflow_fence off) is unchanged: an approved head is still a person's merge at 090.
  • Docs and changelog: docs/hive-merge.md and a changelog fragment.

What counts as an approval is unchanged, and so is the fork-guard and sentinel wording.

Not in this PR

  • The Activity monitor row (human_approver, the offered reviewer question, Approve enabled). The dashboard takes human_approver only from the :human-approved@ reason suffix, which is written at 090. At 085 it shows no approver even when a lane did note one, so that is a separate dashboard change.
  • Whether a fork PR should reach 085 for Canary at all. That is repo policy.
  • The stage labels frozen by the write-back gate on feat: ReDoc API docs, Hub/Spoke distinction, icon fixΒ #1013. That is a separate bug.

Tests

  • stagelabels/human_approved_fence_test.go:
    • fork guard plus an approved head: the note lists only the guard and says nothing is left to approve;
    • the same PR without the approval: unchanged;
    • an approved manual fence: still 090 for the person's merge;
    • a released fence that was the only reason: no 085.
  • automerge/automerge_stage_human_approved_head_test.go:
    • humanEvidence with a fork-guard observation reads @bob's approval from a stubbed reviews endpoint;
    • the read is cached across passes on the head, re-read past the TTL and on a new head;
    • no approval: today's note;
    • a lane-noted approval: no extra read;
    • sameHeadApproved / sameHeadDecisionRoute with and without an approval.

Only gofmt -l was run locally (AGENTS.md bans local go test/go build/go vet); this PR's CI is the test run.

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

A lane that stops at an earlier gate (a fork-guard check, a hold) never
reaches the review gate or the workflow fence, so nothing notes the
trusted approval on the head. The 085 note then kept listing the
reviewer's requires_human question and the fence "awaiting owner
approval", and asked a trusted merger to approve the head again
(projectbluefin/utah-packages#1181, hivecommons#1013).

humanEvidence now reads the head's trusted approval when the route would
ask for one and no lane noted it (cached per head for humanChecksTTL),
routeProgress drops the workflow-path fence the approval released, and
the same-head 085 re-park reads it before re-asking the answered
question.

Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v6

Conflicts are checked with every PR merged onto the current tip of v6, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#18843 πŸ› 090 and workflow-fence comments: name auto-merge off, and no /lgtm without Prow same files src/pkg/github/automerge/automerge_stage_human.go
src/pkg/stagelabels/human.go
#18842 πŸ› base red: remember the base's red checks and read new heads from them CONFLICT src/pkg/github/automerge/automerge_stage_labels.go (conflict)
#18838 πŸ› contributor lane: recognise the cncf/prow-github-actions ok-to-test refusal same files src/docs/hive-merge.md
#18847 πŸ› adoption: a red optional check escalates where auto-merge is off same files src/docs/hive-merge.md

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Hive status β€” updated in place; edits do not notify. Full history is in the Activity Monitor.

Evidence bundle `#1884996b9551` sha256:2d141b973f2614782d057c786cbc043dadb6152887f36f030bf7526fdddb0612 β€” download from the dashboard or `hivectl review evidence #18849`.

hivecommons-hive Bot pushed a commit that referenced this pull request Nov 18, 2026
#18950)

* fix(dashboard): 085 row stops asking for an approval the head has

At 085 the Activity monitor learned a head's trusted approver only from
the `:human-approved@` reason suffix, which is written at 090. A head a
trusted merger approved but that stays at 085 for another blocker
(projectbluefin/utah-packages#1013: fork-guard:Canary) kept showing the
reviewer's requires_human question and an enabled Approve.

- The stage pass records the head's trusted approval it found
  (obs.Detail.HumanApprover for the head) on the stage record:
  Record.ApprovedHead / ApprovedBy, display evidence only.
- The tracker row reads it at 085 when the reason carries no approver.
- decisionForPR skips the reviewer question the approval answered and
  disables Approve with the approver named, except on a sentinel alert,
  where Approve also clears the label.

Follow-up to #18849.

Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

* test(dashboard): type-assert the open-PR entry before moving its head

OpenPrs holds any; vet refused the field access.

Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts-with-open-pr Open PR has a merge conflict with another open PR dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant