diff --git a/changelog.d/fixed-native-queue-withdraw-release-human-path.md b/changelog.d/fixed-native-queue-withdraw-release-human-path.md new file mode 100644 index 0000000000..1a1730dbca --- /dev/null +++ b/changelog.d/fixed-native-queue-withdraw-release-human-path.md @@ -0,0 +1 @@ +- Native merge queue withdrawal now also triggers on a release in progress and on a human-merge path, so a Hive-enqueued PR no longer keeps merging through GitHub's queue during a release freeze or after `human_merge_paths` changes (#15517). diff --git a/src/docs/native-merge-queue.md b/src/docs/native-merge-queue.md index dc7135c314..da666e8d44 100644 --- a/src/docs/native-merge-queue.md +++ b/src/docs/native-merge-queue.md @@ -47,8 +47,8 @@ close an issue. The stage observation carries the reason to the dashboard. When the owning lane rejects a PR because it lost merge eligibility — a hold or `do-not-merge`/`needs-human` label, a removed merger label, a missing, -untrusted or stale queue approval, changes requested, or a draft or closed -PR — Hive rechecks the entry's enqueuer and withdraws it only if it belongs to +untrusted or stale queue approval, changes requested, a draft or closed PR, a +release in progress on the repository, or a human-merge-path hold — Hive rechecks the entry's enqueuer and withdraws it only if it belongs to this App (a `Bot` enqueuer whose login matches the App's slug). Every other reason, including transient refusals such as `behind`, `not-mergeable`, pending checks, a moved head, API read errors, author-routing skips and Hive's own diff --git a/src/pkg/github/automerge/automerge_native_queue.go b/src/pkg/github/automerge/automerge_native_queue.go index daf9885f8b..b781064595 100644 --- a/src/pkg/github/automerge/automerge_native_queue.go +++ b/src/pkg/github/automerge/automerge_native_queue.go @@ -139,8 +139,8 @@ func ownNativeQueueEntry(e *hgithub.NativeMergeQueueEntry, slug string) bool { // nativeQueueWithdrawReason reports whether a lane's rejection reason means // the PR lost merge eligibility (#15198): a hold, a withdrawn or stale -// approval, changes requested, a paused or disabled repo, or a draft or -// closed PR. Anything else — pending or red checks, behind, a moved head, an +// approval, changes requested, a paused or disabled repo, a draft or closed +// PR, a release in progress, or a human-merge path. Anything else — pending or red checks, behind, a moved head, an // API error, a routing observation — keeps the App's queue entry. func nativeQueueWithdrawReason(reason string) bool { switch reason { @@ -149,7 +149,7 @@ func nativeQueueWithdrawReason(reason string) bool { "queue-approval-missing-head", "queue-approval-head-changed", "self-merge-ban", autoMergeReasonUntrustedMerger, "changes-requested", autoMergeReasonHumanChangesRequested, contributorLaneReasonChangesRequested, nativeQueueReasonPaused, "repo-auto-merge-disabled", relayLaneReasonDisabled, - "draft", "closed": + "draft", "closed", releaseInProgressStatusContext, autoMergeReasonHumanMergePath: return true } return strings.HasPrefix(reason, "label:do-not-merge") || strings.HasPrefix(reason, "excluded-label:") || diff --git a/src/pkg/github/automerge/automerge_native_queue_test.go b/src/pkg/github/automerge/automerge_native_queue_test.go index 819ba405c4..2a7cf38156 100644 --- a/src/pkg/github/automerge/automerge_native_queue_test.go +++ b/src/pkg/github/automerge/automerge_native_queue_test.go @@ -137,7 +137,7 @@ func (denyNativeQueueBoundary) Execute(context.Context, effects.Claim, func(cont } func TestNativeQueueGateWithdrawsOnlyHiveEntries(t *testing.T) { - for _, reason := range []string{"held", "label:hold", "label:do-not-merge", "changes-requested", autoMergeReasonHumanChangesRequested, autoMergeReasonReviewGatePrefix + ReviewGateOutcomeChangesRequested, autoMergeReasonNoHiveQueueApproval, "queue-approval-head-changed", "label-removed", nativeQueueReasonPaused, "draft", "closed"} { + for _, reason := range []string{"held", "label:hold", "label:do-not-merge", "changes-requested", autoMergeReasonHumanChangesRequested, autoMergeReasonReviewGatePrefix + ReviewGateOutcomeChangesRequested, autoMergeReasonNoHiveQueueApproval, "queue-approval-head-changed", "label-removed", nativeQueueReasonPaused, "draft", "closed", releaseInProgressStatusContext, autoMergeReasonHumanMergePath} { // A user account named like the App's slug is not the App. for _, actor := range []string{testHiveAppBotLogin, "maintainer", "another-app[bot]", "", botSlug(testHiveAppBotLogin)} { t.Run(reason+"/"+actor, func(t *testing.T) {