Skip to content

πŸ› fix: classify repeated lane-gate and trusted-author sweep warnings in selfreport - #15792

Merged
hivecommons-hive[bot] merged 17 commits into
v5from
scanner/fix-15785
Oct 30, 2026
Merged

hivecommons-hive[bot] merged 17 commits into
v5from
scanner/fix-15785

Conversation

@hivecommons-hive

@hivecommons-hive hivecommons-hive Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

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.

…so selfreport stops filing them

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 30, 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 nicholasjackson 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

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

No conflicting open PRs or same-file overlaps were found.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending β€” sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 30, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Looks correct to me; the filter matches exactly the two emitters and nothing broader.

  • src/cmd/hive/merge_eligibility.go:454 logs "merge-eligible lane gate could not evaluate PR; leaving it listed" with the error under key "error", and src/pkg/github/automerge/automerge_sweep.go:1445 logs "trusted-author automerge sweep skipped PR" with "error", err β€” so failClosedStatus500 reads the right attr on both. The sweep's error here is releaseHoldActive's GetCombinedStatus failure (automerge_sweep.go:1786-1789), whose go-github text is GET …/commits/<sha>/status?per_page=100: 500 [], matching both the /status and : 500 substrings; a 500 from GetBranch on the same path (…/branches/…) still reports, as the comment promises.
  • The negative cases in TestFailClosedStatus500LogsWithoutFleetReport (404 on /pulls/1, bare boom) 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

@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 30, 2026
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 30, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 30, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

stage 060-reviewed β†’ 050-review-pending: required-check-pending:build-and-test

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: new head 46e1ef9 (adds the #15789 heartbeat 5xx classification); CI pending β€” sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator-3 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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 /status and : 500 are still substrings of the error attr β€” the first test case uses that wrapped shape.
  • slog.Value.String() on an error attr yields err.Error() and on an int status yields "503", so both attr matchers work against what the producers actually log.
  • 401/403 heartbeats and non-/status 500s stay reportable; the negative cases are pinned in both tests. automerge_sweep.go is untouched as the body says.

No findings.

β€” hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator-3 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 30, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

stage 060-reviewed β†’ 050-review-pending: required-check-pending:Sign-off survives the squash

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Read the three producers against the new matchers; this looks correct to me.

  • src/cmd/hive/merge_eligibility.go:454 and src/pkg/github/automerge/automerge_sweep.go:1469 log exactly the two messages matched in failClosedStatus500, both with the error under the "error" key, so the /status + ": 500 " substring check sees the go-github error text (a.Value.String() on an error attr yields err.Error()). A 500 on a non-status read (e.g. /pulls/N) and a 404 on /status both still report β€” the negative cases in the test cover that.
  • src/pkg/hub/spoke/heartbeat.go:1796 logs "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 of ClassUnexpectedHub5xx via hubHeartbeatStatusIsDefect (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.go and its test, as the body says. CI green on 8a5aa2e.

β€” hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Read the two new predicates, every emitter they match, and the error type they parse. This looks correct to me.

  • Both messages in failClosedStatus500 match their emitters verbatim: src/cmd/hive/merge_eligibility.go:454 and src/pkg/github/automerge/automerge_sweep.go:1475. Each logs the gate error under the error key the predicate reads.
  • The /status + : 500 match is grounded in the real error shape: go-github's ErrorResponse.Error() (v72 github.go:1157) renders GET <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-runs or /pulls does 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).
  • hubHeartbeatUnavailable is consistent with the existing explicit classifier: src/pkg/hub/spoke/heartbeat.go:1796-1799 logs hub heartbeat rejected with the integer status, and hubHeartbeatStatusIsDefect (heartbeat.go:3013-3019) already excludes exactly 502/503/504 from ClassUnexpectedHub5xx. The slog feed was the only path still turning those into unclassified_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

@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 30, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

stage 060-reviewed β†’ 050-review-pending: required-check-pending:Sign-off survives the squash

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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, and src/pkg/hub/spoke/heartbeat.go:1796, with attr keys error / status as failClosedStatus500 and hubHeartbeatUnavailable expect (slogfeed.go:198-237).
  • The /status + : 500 substring test holds against go-github's ErrorResponse.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. status is an int, and slog.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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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", err
    • src/pkg/github/automerge/automerge_sweep.go:1475 β€” "trusted-author automerge sweep skipped PR", "error", err (via Engine.warn at :3409-3413, which passes args... straight to slog.Logger.Warn, so error is a top-level attr and r.Attrs sees it)
    • src/pkg/hub/spoke/heartbeat.go:1796 β€” "hub heartbeat rejected", "status", resp.StatusCode (an int; slog.Value.String() renders it as "503", which is what the switch compares)
  • heartbeat.go:3013-3019 hubHeartbeatStatusIsDefect already returns false for 502/503/504 and true for other 5xx, so the spoke's own direct fleetreport.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.
  • failClosedStatus500 is scoped to the two message strings before it inspects error, so a 500 on a /status read logged under any other message still reaches ClassUnclassifiedRepeated; the test's 404 and "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

@hivecommons-hive
hivecommons-hive Bot merged commit 55b85f4 into v5 Oct 30, 2026
75 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-15785 branch October 30, 2026 21:07
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#157927742304` sha256:9651aaca7e2fcf910cc69726159a6d644fe758af6228cb2266cff98ef19e36ac β€” download from the dashboard or `hivectl review evidence #15792`.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/L Denotes a PR that changes 100-499 lines, ignoring generated files. stage/050-review-pending Review swarm requested; awaiting a verdict for the current head

Projects

None yet

0 participants