Skip to content

🐛 090 and workflow-fence comments: name auto-merge off, and no /lgtm without Prow - #18843

Merged
hivecommons-hive[bot] merged 3 commits into
hivecommons:v6from
Danathar:fix/merge-wording-auto-merge-off
Nov 18, 2026
Merged

hivecommons-hive[bot] merged 3 commits into
hivecommons:v6from
Danathar:fix/merge-wording-auto-merge-off

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary

On a repository whose hive auto-merge is off, two hive comments describe the wrong merge path:

  • The 090 "Ready for a human merge" comment says "Blocked only by role/trusted" and asks for /lgtm /approve, even in repositories that run no Prow.
  • The workflow-path fence's owner-approval comment says "the hive merges this PR itself", but the hive never merges there.

With this PR:

  • The 090 comment states the real reason, in the same words the dashboard's gate cell already uses: "Auto-merge is off for this repo, so a person merges."
  • When the PR wears none of Prow's labels, the 090 comment asks the person to approve and merge on GitHub instead.
  • The fence comment says a person merges the PR.

This changes comment text only. Routing, stages, and which repositories have auto-merge off are unchanged.

What happened

Seen on projectbluefin, where actions, common, documentation, server and website have hive auto-merge off. actions and website run no Prow. Times are Eastern.

Cause

090 comment

  • postHumanEntry builds the comment with trustCause(obs.Reason, role). trustCause has no case for repo-auto-merge-disabled, so it falls through to the bare role label.
  • The 090 stage already knows the real reason: prstage.HumanMergeReason maps it to auto-merge-off, and the dashboard shows it. The comment never used it.
  • The closing line was fixed text that always offered /lgtm /approve.

Fence comment

  • workflowApprovalComment always promised a hive merge.
  • The observe-only pass skips the comment, but the merge relay's lane gate evaluates the PR on the live engine and posts it anyway.

What changed

Shared words (prstage/reasons.go)

  • The dashboard's word-and-sentence table for each human-merge reason moved into prstage.HumanMergeReasonWords.
  • The dashboard's gate cell and caption (stage_tracker_caption.go, stage_tracker_actor.go) read it from there, and so does the 090 comment. The strings themselves are unchanged.

090 comment (stagelabels/human.go, automerge_stage_human.go)

  • Route gains two fields, which postHumanEntry fills through readyCommentRoute:
    • HumanMergeWhy: the sentence for a reason other than the author's trust (auto-merge off, merge method, branch protection, App permission, reviewer deferred). It replaces "Blocked only by role/…".
    • NoProw: set when the PR carries none of the labels in ProwManagedLabels (approved, size/*, do-not-merge/*, ok-to-test, needs-ok-to-test, tide/*). The hive already uses this function for its dashboard approvals.
  • Trust reasons, and reasons with no words of their own (the policy fallback), keep trustCause, so the text is unchanged there.
  • With NoProw, every closing line drops /lgtm /approve:
    • the plain line reads "approve and merge it on GitHub if you accept it";
    • the held and behind-base lines get the same treatment;
    • the manual-merge line drops "(or /lgtm + /approve for tide)".
  • A Prow-managed PR's wording is unchanged.

Fence comment (automerge_contributor_workflow_approval.go)

  • workflowApprovalComment takes the repository's auto-merge state, from repoAutoMergeAllowed(displayRepo).
  • When auto-merge is off, all three verdict variants say "a person merges it once the usual gates … are clear (auto-merge is off for this repository, so the hive never merges it)".
  • The marker line is unchanged, so the once-per-head dedupe still works.

Docs and changelog

  • stage-labels.md gets a 090 row for the non-trust reasons and a note on when the closing line asks for /lgtm.
  • operator-reference/README.md notes the fence comment's wording on auto-merge-off repositories.
  • A changelog fragment.

Related

Not in this PR

  • Whether the merge relay should evaluate auto-merge-off repositories at all. It is what posts the fence comment there. That's a routing question, left as is.
  • Turning auto-merge on for any repository. That's an owner decision.

Tests

  • stagelabels/ready_wording_test.go: ReadyComment with Prow and without, across five cases: trust, auto-merge off (with and without behind-base), behind-base, held, and manual merge. The Prow cases keep today's text exactly.
  • automerge_stage_ready_wording_test.go:
    • readyCommentRoute for repo-auto-merge-disabled, with and without a size/M label;
    • trust and unknown reasons keep the trust clause;
    • merge-method and branch-protection reasons read their own words;
    • workflowApprovalComment with auto-merge on and off, for every verdict state and for carried approvals.
  • prstage/human_merge_words_test.go: every human-merge code except policy has words.
  • Updated:
    • automerge_stage_ready_status_test.go: its fixture PR has no Prow labels, so the folded 090 line now asks for a GitHub approve and merge;
    • the existing workflowApprovalComment call sites now pass false, which keeps their text.

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

…without Prow

On a repository whose hive auto-merge is off, the 090 comment said
"Blocked only by `role/trusted`" and offered /lgtm /approve even where no
Prow runs, and the workflow-fence approval comment said "the hive merges
this PR itself". The 090 comment now states a non-trust reason in the
dashboard's words (moved to prstage.HumanMergeReasonWords so both read
one table), asks for a GitHub approve and merge when the PR wears none
of Prow's labels, and the fence comment says a person merges on an
auto-merge-off repository. Text only; routing is unchanged.

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 kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 17, 2026
@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 hanthor 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

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

✅ Resolved: no conflicting open PRs or same-file overlaps remain against v6.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style perspective: approve. Shared words moved into prstage cleanly and callers updated; one advisory nit inline (duplicated NoProw sentence in human.go).

— hive: agent=adjudicator-4 backend=claude model=claude-sonnet-5-5 claude=2.1.326

held()
}
b.WriteString("\n\n<sub>The hive never merges this lane's changes itself: click **Merge** (or `/lgtm` + `/approve` for tide) to land it.</sub>")
if r.NoProw {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit (advisory): this if/else duplicates the whole sentence for one clause. Consider building the tail once, e.g. tail := "click **Merge**"; if !r.NoProw { tail += " (or /lgtm+/approve for tide)" }, so the two variants cannot drift.

@hivecommons-hive

hivecommons-hive Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

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

Review findings from adjudicator (folded here because this head already carries its hive review):

Correctness review at 4c063db. The words refactor is behaviour-preserving; the problems are in the conditions that choose the new text. Both have inline threads with fixes.

  1. NoProw is guessed from PR labels (automerge_stage_human.go:693). ProwManagedLabels ignores lgtm, and a fresh PR in a Prow repo has none of the labels it checks. Those repos lose the /lgtm /approve text that was correct before this PR.
  2. "auto-merge is off" is broader than the check (automerge_contributor_workflow_approval.go:160). repoAutoMergeAllowed is also false for below-L6 and bad merge_strategy repos. Use repoObservedOnly.

Tests cover the wording only. None covers a Prow repo whose PR carries no size/ label, so finding 1 would pass them all.

Findings not on a changed line

  • src/pkg/github/automerge/automerge_stage_human.go:693: NoProw is inferred from the PR's labels: hgithub.ProwManagedLabels (pr_decision_operator.go:550) only matches approved, ok-to-test, needs-ok-to-test, size/*, do-not-merge/*, tide/*. It does not match lgtm, and a Prow repo whose PR has not been labelled yet, or one without the size plugin, has none of the others. The PR then reads as no-Prow and the 090 comment drops /lgtm /approve and the tide hint. That is a regression for Prow repos, which kept the right text before this PR. Absence of labels is not evidence that Prow is absent. Fix: also treat lgtm as a Prow label, and prefer a repo-level signal (a Prow-configured flag) over per-PR labels. If none exists, make NoProw true only when the repo has never shown a Prow label.
  • src/pkg/github/automerge/automerge_contributor_workflow_approval.go:160: !c.repoAutoMergeAllowed(displayRepo) is also false when auto-merge is refused for other reasons (below L6, bad merge_strategy; see automerge_sweep.go:662-677). The new text then says 'auto-merge is off for this repository' for a repo where the owner did not switch it off. repoObservedOnly (automerge_sweep.go:672) shows the distinction: it adds repoAutoMergeSwitchedOff. Fix: autoMergeOff := c.repoObservedOnly(displayRepo) (or !allowed && switchedOff).

Review findings from adjudicator-3 (folded here because this head already carries its hive review):

HUMAN DECISION NEEDED — intent-alignment review could not run (GitHub API hourly cap reached); please re-dispatch after the cap resets. Danathar

I could not read the diff or the 4c063db..78036e7 delta (96 files, 5650 lines). Every gh call returned HTTP 429 ("agent GitHub API hourly cap reached (300/300)"). I made no judgement on whether this PR matches its intent. I did not re-check the four earlier findings (automerge_stage_human.go:693, automerge_contributor_workflow_approval.go:160, automerge_stage_human.go:676, stagelabels/human.go:946), so their status is unknown.

Review findings from reviewer (folded here because this head already carries its hive review):

Read the diff against the tree (ReadyComment in src/pkg/stagelabels/human.go, readyCommentRoute in automerge_stage_human.go, ProwManagedLabels in src/pkg/github/pr_decision_operator.go:550). The wording change looks correct to me: the dashboard's word table moved into prstage.HumanMergeReasonWords with identical strings, trust and policy reasons still fall through to trustCause, and the fence-comment marker line is unchanged so the once-per-head dedupe is untouched. Tests are added for both comment paths and the shared table, and the changelog fragment sits at the repository root as AGENTS.md requires.

One open question, not a defect: NoProw is inferred from the PR's labels (!ProwManagedLabels(obs.Labels), automerge_stage_human.go, readyCommentRoute), not from whether the repository runs Prow. On a Prow repository where a PR reaches 090 before the size or tide labels land, the comment would drop /lgtm /approve and ask for a GitHub approve and merge. That is still a valid action there, so the cost is low. Say so if that trade-off is deliberate.

I did not run anything; CI is the verdict.

Review findings from reviewer-2 (folded here because this head already carries its hive review):

The change does what the body says: I read readyCommentRoute, ReadyComment, workflowApprovalComment and the moved word table. The dashboard strings are unchanged, the trustCause fallback is kept for trust and policy reasons, and the fence comment's marker line is untouched, so the once-per-head dedupe still works. One open concern, on the NoProw heuristic (inline).

Findings not on a changed line

  • src/pkg/github/automerge/automerge_stage_human.go:747: Low severity, open question: NoProw is inferred from the labels on this one PR (!ProwManagedLabels(obs.Labels), pkg/github/pr_decision_operator.go:550), not from whether the repo runs Prow. A Prow repo whose PR has none of approved, size/*, do-not-merge/*, ok-to-test, needs-ok-to-test or tide/* (no size plugin configured, or the labeler has not run yet) is told to 'approve and merge it on GitHub' and loses the /lgtm /approve hint. That is a harmless degradation of wording, but the PR body presents it as repo-level. If a repo-level Prow signal exists, prefer it; otherwise a code comment saying this is a per-PR heuristic would help.
Evidence bundle `#18843bfcbccf` sha256:ceab682658c7ed9fc1f9027efa52900b0d906d29eb04c69a3ae295b1a7b016a6 — download from the dashboard or `hivectl review evidence #18843`.

merged by Hive trusted-author auto-merge: author Danathar holds role owner and GitHub permission maintain on repo; CI green at bfcbccf.

@hivecommons-hive

hivecommons-hive Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

@Danathar this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Review asks:

  • the review swarm requested changes

Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path.

Queued in your relay fix queue (13 waiting): fixes are handed out before new work as soon as you have capacity.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delta re-review at 78036e7. The four earlier findings are all still present, none fixed:

  • Fence comment 'off' vs 'not allowed': still present. automerge_contributor_workflow_approval.go:160 uses !repoAutoMergeAllowed. That is also false for below-L6 and bad merge_strategy, where repoObservedOnly is false (automerge_sweep.go:672-677). Use c.repoObservedOnly(displayRepo).
  • NoProw from PR labels: still present at automerge_stage_human.go:746. A Prow repo with an unlabelled PR is told to approve and merge on GitHub.
  • Wider 090 wording: still present. readyCommentRoute applies HumanMergeWhy to all non-trust reasons (automerge_stage_human.go:735).
  • Style, duplicated NoProw wording: still present (low). The manual-merge branch in stagelabels/human.go (~L955) still hardcodes the Prow and no-Prow strings instead of reusing readyCommentAccept/approve.

— hive: agent=adjudicator backend=claude model=claude-sonnet-5-5 claude=2.1.326

// The merge relay's lane gate evaluates on the live engine even for
// an auto-merge-off repo, so the comment must not promise a hive
// merge there (projectbluefin/actions#752).
if err := c.commentWorkflowApproval(ctx, owner, repo, number, headSHA, approval, verdictState, !c.repoAutoMergeAllowed(displayRepo)); err != nil {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gate on the switched-off state, not 'not allowed':

Suggested change
if err := c.commentWorkflowApproval(ctx, owner, repo, number, headSHA, approval, verdictState, !c.repoAutoMergeAllowed(displayRepo)); err != nil {
if err := c.commentWorkflowApproval(ctx, owner, repo, number, headSHA, approval, verdictState, c.repoObservedOnly(displayRepo)); err != nil {

route.HumanMergeWhy = why
}
}
route.NoProw = !hgithub.ProwManagedLabels(obs.Labels)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NoProw is inferred from this PR's labels, so an unlabelled PR in a Prow repo gets the no-Prow wording. Use a per-repo Prow signal.

@hivecommons-hive
hivecommons-hive Bot merged commit c04240b into hivecommons:v6 Nov 18, 2026
72 of 73 checks passed
hivecommons-hive Bot pushed a commit that referenced this pull request Nov 18, 2026
…0 manual-merge line (#18862)

Follow-up to the hive review of #18843 (merged before it was addressed):

- The fence comment is gated on !repoAutoMergeAllowed, which is also
  true below L6 and for an invalid merge_strategy, where the hive does
  not merge either. Keep that gate (repoObservedOnly would bring back
  "the hive merges this PR itself" below L6) and word the note so it is
  true in every case.
- Build the 090 manual-merge closing line once, so the Prow and no-Prow
  variants cannot drift.

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

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