Repository navigation
π fix(github): retire merge-queue-required alerts on positive evidence - #16350
Conversation
|
[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 |
Generated by changelog-fragment-guard from the PR title (#5675). Edit the wording freely, or replace this file with the no-changelog label if the change is not user-visible. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: hivecommons-hive[bot] <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. hive/awaiting-ci: fixed the changelog fragment (prose fragment lacked the '- ' bullet; folded into fixed-16350.md). The build/docker failures were a transient π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 Review findings from Read Code β looks correct to me
Why CI is red (one needs a push, one does not)
Nit, not a blocker: the body says Review findings from Read
Nothing to change from my side. Evidence bundle `#163508a8917e` sha256:c07fcc5821418e1acabe5122d2b7f21862187648c851dd0227e48f0cbd7ec113 β download from the dashboard or `hivectl review evidence #16350`. |
There was a problem hiding this comment.
The code change looks correct to me; the one thing blocking this PR is a changelog fragment that does not satisfy the guard.
Correctness (read revalidateMergeFailureAlerts in full at cf94004): the new branch at src/pkg/github/merge_failure_alert.go:191-196 follows the same shape as the app-permission and fork-run-approval cases above it β a successful read is required (rerr == nil && rules != nil) before len(rules.MergeQueue) == 0 counts as evidence, so a 403/404 on the rules read leaves the alert standing. The key matches the one raised at :271, and it is guarded on pr.GetBase().GetRef() != "". go build ./pkg/github/ passes against go-github v72, so BranchRules.MergeQueue exists. The new test file covers the retire path.
Why CI is red:
changelog-fragment-guard(run 41559607161) is this PR's fault:changelog.d/fixed-merge-queue-required-retire.mdis a bare sentence, and the guard requires every fragment to start with a-bullet (##[error] a fragment must start with a '- ' entry bullet). There is also a second fragment,changelog.d/fixed-16350.md, which already carries the entry β so the simplest fix is to deletefixed-merge-queue-required-retire.md, or fold its better wording into the bullet infixed-16350.md.v2 CI/Build and Push Docker Image(run 41559158054) fail in the image build atnpm install -g β¦ cline@${CLINE_VERSION}, unrelated to this diff.
Body-vs-diff: matches β the diff does exactly what the title says and nothing else.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
changelog-fragment-guard requires a '- ' entry bullet; the second fragment was prose and duplicated fixed-16350.md. Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Read src/pkg/github/merge_failure_alert.go at the PR head alongside the merged #16339 on v5. Looks correct to me.
- The new branch at
merge_failure_alert.go:191-196sits after theclosedcheck (line 154) and follows the exact pattern of the siblingapp-permission/fork-run-approvalbranches:resolvedonly becomes true onrerr == nil && rules != nil && len(rules.MergeQueue) == 0, so a 404/5xx on the rules read leaves the alert in place, matching the "errors keep the alert in place" contract documented in the function comment (lines 107-113) and inhive-merge.md. GetRulesForBranchis the right API: in go-github v72 (src/go.mod:14) it returns the rules active on the branch, including org-level rulesets, andBranchRules.UnmarshalJSONfolds"type":"merge_queue"intoMergeQueueβ so the test fixtures[{"type":"merge_queue",β¦}]/[{"type":"deletion"}]exercise the real decoder, not a stub.- The key
"merge-queue-required"is the oneclassifyMergeFailureForOperatorraises at line 271 (from #16339, now onv5as 2ec55ca), so the retirement actually matches the alert it targets. - The test's three-phase sequence (rule present β not cleared; rule gone but 502 β not cleared; rule gone + 200 β cleared) covers the only decision points the new code adds, and the
now += mergeAlertRevalidateIntervalsteps respect the throttle at line 123. CI test shards are green.
Diff matches the body and #16342/#16343: one retirement branch, one test, one doc paragraph, one changelog fragment.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read the full revalidation loop in src/pkg/github/merge_failure_alert.go:150-205 and the raise site at :270-273, plus go-github v72's GetRulesForBranch. Looks correct to me.
- The new branch (
merge_failure_alert.go:191-196) follows the same positive-evidence shape as theapp-permissionandfork-run-approvalretire paths above it:rerr == nil && rules != nil && len(rules.MergeQueue) == 0, so an API error or a ruleset still carryingmerge_queueleaves the alert in place. - The endpoint is the right one for this alert: the key is only raised on the ruleset 405 (
"Repository rule violations found β¦ must be made through the merge queue",merge_request_watcher.go:238), andGET /rules/branches/{ref}returns active rules at every level (repo + org), so an org-level merge-queue rule is still seen. pr.GetBase().GetRef() != ""guard is cheap insurance; the PR fetch already happened for the state check so no extra round-trip is added when nothing is pending.- Test (
merge_failure_alert_revalidate_test.go:178-234) covers the three states that matter: rule present β kept, rules read error β kept, rule gone β cleared. - Docs paragraph in
hive-merge.md:144-147matches the behaviour;changelog.d/fixed-16350.mdfollows the<category>-<pr>.mdnaming.
Both linked issues (#16342 code path, #16343 doc) are addressed, so Closes on both is right. go build ./pkg/github/ passes locally; I couldn't run the test package here (agent sandbox), CI will.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
The merge-queue-required alert had no key-specific retirement, so it lingered until the PR closed even after the operator removed the merge-queue rule. Revalidation now clears it once the base branch's active rules are read successfully and contain no merge queue, and the retirement conditions are documented in hive-merge.md.
Closes #16342
Closes #16343
β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88