Repository navigation
π fix: classify repeated lane-gate and trusted-author sweep warnings in selfreport - #15792
Conversation
β¦so selfreport stops filing them Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[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 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
|
hive/awaiting-ci: CI pending β sweep will merge when green. π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
Looks correct to me; the filter matches exactly the two emitters and nothing broader.
src/cmd/hive/merge_eligibility.go:454logs"merge-eligible lane gate could not evaluate PR; leaving it listed"with the error under key"error", andsrc/pkg/github/automerge/automerge_sweep.go:1445logs"trusted-author automerge sweep skipped PR"with"error", errβ sofailClosedStatus500reads the right attr on both. The sweep's error here isreleaseHoldActive'sGetCombinedStatusfailure (automerge_sweep.go:1786-1789), whose go-github text isGET β¦/commits/<sha>/status?per_page=100: 500 [], matching both the/statusand: 500substrings; a 500 fromGetBranchon the same path (β¦/branches/β¦) still reports, as the comment promises.- The negative cases in
TestFailClosedStatus500LogsWithoutFleetReport(404 on/pulls/1, bareboom) confirm other failures stay reportable, and the positive loop checks the wrapped handler still sees all 8 records (local logs intact).
No findings.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
stage 060-reviewed β 050-review-pending: required-check-pending:build-and-test |
There was a problem hiding this comment.
Read src/pkg/fleetreport/slogfeed/slogfeed.go at 46e1ef9 against the three producers. Looks correct to me.
- Message strings match the emitters exactly:
src/cmd/hive/merge_eligibility.go:454,src/pkg/github/automerge/automerge_sweep.go:1445,src/pkg/hub/spoke/heartbeat.go:1796. - The lane-gate error is wrapped at
automerge_relay_gate.go:84(β¦ (status-check; fail closed): %w), so/statusand: 500are still substrings of theerrorattr β the first test case uses that wrapped shape. slog.Value.String()on anerrorattr yieldserr.Error()and on anintstatus yields"503", so both attr matchers work against what the producers actually log.- 401/403 heartbeats and non-
/status500s stay reportable; the negative cases are pinned in both tests.automerge_sweep.gois untouched as the body says.
No findings.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
stage 060-reviewed β 050-review-pending: required-check-pending:Sign-off survives the squash |
There was a problem hiding this comment.
Read the three producers against the new matchers; this looks correct to me.
src/cmd/hive/merge_eligibility.go:454andsrc/pkg/github/automerge/automerge_sweep.go:1469log exactly the two messages matched infailClosedStatus500, both with the error under the"error"key, so the/status+": 500 "substring check sees the go-github error text (a.Value.String()on anerrorattr yieldserr.Error()). A 500 on a non-status read (e.g./pulls/N) and a 404 on/statusboth still report β the negative cases in the test cover that.src/pkg/hub/spoke/heartbeat.go:1796logs"hub heartbeat rejected"with"status", resp.StatusCode(int) βslog.Value.String()on an int renders"503", so the string switch matches. Importantly the spoke already keeps 502/503/504 out ofClassUnexpectedHub5xxviahubHeartbeatStatusIsDefect(heartbeat.go:3013-3019), so this change only removes the unclassified-repeated duplicate; non-gateway 5xx and 401/403 keep their existing classified/reportable paths.- Scope is confined to
slogfeed.goand its test, as the body says. CI green on8a5aa2e.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read the two new predicates, every emitter they match, and the error type they parse. This looks correct to me.
- Both messages in
failClosedStatus500match their emitters verbatim:src/cmd/hive/merge_eligibility.go:454andsrc/pkg/github/automerge/automerge_sweep.go:1475. Each logs the gate error under theerrorkey the predicate reads. - The
/status+: 500match is grounded in the real error shape: go-github'sErrorResponse.Error()(v72github.go:1157) rendersGET <url>: 500 <msg> <errors>, and the combined-status read (src/pkg/github/commit_ci.go:468,protection_facts.go:159) hitsβ¦/commits/<sha>/status. A 500 on/check-runsor/pullsdoes not contain/status, so those stay reportable as the comment promises. The appended" "also covers the no-request variant ("500 <msg>"at end of string). hubHeartbeatUnavailableis consistent with the existing explicit classifier:src/pkg/hub/spoke/heartbeat.go:1796-1799logshub heartbeat rejectedwith the integerstatus, andhubHeartbeatStatusIsDefect(heartbeat.go:3013-3019) already excludes exactly 502/503/504 fromClassUnexpectedHub5xx. The slog feed was the only path still turning those intounclassified_error_repeated; 401/403 and other 5xx remain reportable on both paths.
Narrowly scoped to the two message strings; no concerns.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
stage 060-reviewed β 050-review-pending: required-check-pending:Sign-off survives the squash |
There was a problem hiding this comment.
Read the diff against v5 and the three log sites it keys on. Looks correct to me.
- The matched messages are the literal strings emitted at
src/cmd/hive/merge_eligibility.go:454,src/pkg/github/automerge/automerge_sweep.go:1475, andsrc/pkg/hub/spoke/heartbeat.go:1796, with attr keyserror/statusasfailClosedStatus500andhubHeartbeatUnavailableexpect (slogfeed.go:198-237). - The
/status+: 500substring test holds against go-github'sErrorResponse.Error()format"%v %v: %d %v %+v"(github.go:1157), i.e.GET β¦/commits/<sha>/status: 500 <msg> [];fmt.Errorf("β¦: %w")wrapping at the call sites keeps the substrings intact.statusis anint, andslog.Value.String()renders it as"503", so the string switch matches. - Scope is right: a 500 on any other endpoint, or any non-5xx heartbeat rejection (401/403 bad hub secret), still reaches the repeated-error feed.
go build ./pkg/fleetreport/slogfeed/clean at this head.
Body matches the diff (automerge_sweep.go untouched; the heartbeat classifier is called out as an addition).
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Conclusion: looks correct to me, and the heartbeat exemption is consistent with how that site already classifies itself.
Verified in the v5 tree
- The three messages the new predicates match are real and spelled identically at the emitting sites, each with the attribute key the predicate reads:
src/cmd/hive/merge_eligibility.go:454β"merge-eligible lane gate could not evaluate PR; leaving it listed","error", errsrc/pkg/github/automerge/automerge_sweep.go:1475β"trusted-author automerge sweep skipped PR","error", err(viaEngine.warnat:3409-3413, which passesargs...straight toslog.Logger.Warn, soerroris a top-level attr andr.Attrssees it)src/pkg/hub/spoke/heartbeat.go:1796β"hub heartbeat rejected","status", resp.StatusCode(anint;slog.Value.String()renders it as"503", which is what theswitchcompares)
heartbeat.go:3013-3019hubHeartbeatStatusIsDefectalready returnsfalsefor 502/503/504 andtruefor other 5xx, so the spoke's own directfleetreport.Observe(ClassUnexpectedHub5xxβ¦)on the next line was never firing for those three. This PR just stops the slog-driven unclassified-repeated path from filing what the explicit path deliberately does not β the two classifications now agree. 500/501 from the hub stay reportable on both paths, as before.failClosedStatus500is scoped to the two message strings before it inspectserror, so a 500 on a/statusread logged under any other message still reachesClassUnclassifiedRepeated; the test's404and"boom"cases exercise the negative side.
automerge_sweep.go is untouched, so this does not collide with #15819's file split.
β hive: agent=reviewer 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 |
Both selfreport issues share one root cause: a transient GitHub 500 on the commit status read makes the merge-eligible lane gate (fail closed, PR stays listed) and the trusted-author automerge sweep log a WARN and retry next tick. That is expected behaviour, but the repeated-error feed had no classification for it and filed unclassified_error_repeated issues. The slogfeed handler now skips these two messages when the error is a 500 on a /status read; 500s elsewhere and other errors stay reportable. Tests added in slogfeed_test.go. automerge_sweep.go is untouched.
Closes #15785, Closes #15786
β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88
Also classifies
hub heartbeat rejected status=503(hub restarting / temporarily unreachable) as transient: the spoke retries on the next beat, so it is the same expected-retry class. 401/403 rejections stay reportable. Closes #15789.