From b4910b121ef508997500dc9cbca25067e824ffa3 Mon Sep 17 00:00:00 2001 From: Danathar <6772335+Danathar@users.noreply.github.com> Date: Tue, 17 Nov 2026 20:25:57 -0500 Subject: [PATCH] merge wording: fence note true for every no-auto-merge reason; one 090 manual-merge line 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 Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 --- changelog.d/fixed-merge-wording-followup.md | 1 + .../automerge/automerge_contributor_workflow_approval.go | 2 +- .../automerge/automerge_stage_ready_wording_test.go | 2 +- src/pkg/stagelabels/human.go | 8 ++++---- 4 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 changelog.d/fixed-merge-wording-followup.md diff --git a/changelog.d/fixed-merge-wording-followup.md b/changelog.d/fixed-merge-wording-followup.md new file mode 100644 index 0000000000..ce4f496746 --- /dev/null +++ b/changelog.d/fixed-merge-wording-followup.md @@ -0,0 +1 @@ +- The workflow-fence approval comment on a repo where hive auto-merge does not run now says so in words that are true for every reason (switched off, below L6, an invalid merge strategy), not only "auto-merge is off". The 090 manual-merge closing line builds its Prow and no-Prow variants from one sentence so they cannot drift (follow-up to #18843's review). diff --git a/src/pkg/github/automerge/automerge_contributor_workflow_approval.go b/src/pkg/github/automerge/automerge_contributor_workflow_approval.go index 7c85a42843..8b969ffda7 100644 --- a/src/pkg/github/automerge/automerge_contributor_workflow_approval.go +++ b/src/pkg/github/automerge/automerge_contributor_workflow_approval.go @@ -493,7 +493,7 @@ func workflowApprovalComment(headSHA string, approval workflowApproval, verdictS marker := workflowApprovalMarker(headSHA) + " by=" + strings.ToLower(approver) merges, offNote := "the hive merges this PR itself", "" if autoMergeOff { - merges, offNote = "a person merges it", " (auto-merge is off for this repository, so the hive never merges it)" + merges, offNote = "a person merges it", " (hive auto-merge does not run for this repository, so the hive never merges it)" } gates := merges + " once the usual gates (CI, soak, holds, review verdict) are clear" + offNote + "." switch verdictState { diff --git a/src/pkg/github/automerge/automerge_stage_ready_wording_test.go b/src/pkg/github/automerge/automerge_stage_ready_wording_test.go index 6488a72575..ad90574217 100644 --- a/src/pkg/github/automerge/automerge_stage_ready_wording_test.go +++ b/src/pkg/github/automerge/automerge_stage_ready_wording_test.go @@ -73,7 +73,7 @@ func TestWorkflowApprovalCommentAutoMergeOff(t *testing.T) { for _, approval := range []workflowApproval{{Login: "Danathar"}, {Login: "Danathar", CarriedFrom: "1234567890ab"}} { off := workflowApprovalComment("9fd007702e97", approval, state, true) if strings.Contains(off, "the hive merges this PR itself") || !strings.Contains(off, "a person merges it once the usual gates") || - !strings.Contains(off, "auto-merge is off for this repository, so the hive never merges it") { + !strings.Contains(off, "hive auto-merge does not run for this repository, so the hive never merges it") { t.Fatalf("state %d, carried %q: auto-merge-off comment:\n%s", state, approval.CarriedFrom, off) } on := workflowApprovalComment("9fd007702e97", approval, state, false) diff --git a/src/pkg/stagelabels/human.go b/src/pkg/stagelabels/human.go index d40f94fa97..ecd3ed1360 100644 --- a/src/pkg/stagelabels/human.go +++ b/src/pkg/stagelabels/human.go @@ -952,11 +952,11 @@ func ReadyComment(r Route, blockedBy string) string { if len(r.Gates) > 0 { held() } - if r.NoProw { - b.WriteString("\n\nThe hive never merges this lane's changes itself: click **Merge** to land it.") - } else { - b.WriteString("\n\nThe hive never merges this lane's changes itself: click **Merge** (or `/lgtm` + `/approve` for tide) to land it.") + merge := "click **Merge**" + if !r.NoProw { + merge += " (or `/lgtm` + `/approve` for tide)" } + b.WriteString("\n\nThe hive never merges this lane's changes itself: " + merge + " to land it.") return b.String() } if len(r.Gates) > 0 {