Skip to content

🐛 fix(agent): log a repeated hub project-config refusal once per distinct misconfiguration - #14687

Merged
hivecommons-hive[bot] merged 2 commits into
v5from
scanner/fix-14661
Oct 27, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
v5from
scanner/fix-14661

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Closes #14661

Why

The hub re-pushes its project config on every heartbeat. When that config is misconfigured (repo org differs from the hive's configured org), the spoke correctly refuses it, but it logged the same ERROR on every beat (37 times in 10 minutes). The fleet-report classifier then escalated it as unclassified_error_repeated.

What

The refusal is logged at ERROR once per distinct misconfiguration. Identical repeats drop to DEBUG, and a changed push logs at ERROR again. The refusal itself is unchanged: the project is still left untouched. This fixes the noise at the source and doesn't touch the fleet-report classifier.

Test

TestBootHeartbeatProjectConfig_RepeatedRefusalLogsErrorOncePerDistinctPush pushes the same bad config repeatedly and expects one ERROR line, then pushes a different bad config and expects a second.

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

…ct misconfiguration

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 27, 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 kellyaa 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 27, 2026
@github-actions

github-actions Bot commented Oct 27, 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.

PR Title Relation Files
#14688 🐛 fix(adoption): re-sign inherited commits when re-homing a dco-missing contributor PR same files src/cmd/hive/main.go
#14706 🐛 fix(review): wake the governor when a dispatched review verdict is recorded same files src/cmd/hive/main.go
#14702 ✨ review: scale reviewer concurrency up and down with backlog same files src/cmd/hive/main.go
#14524 ✨ feat(hub,agent): Hub-coordinated live CLI session pool for multi-tenant runner capacity same files src/cmd/hive/main.go
#14682 🌱 runtime: loopback pprof, periodic memstats and cgroup-aware GOMEMLIMIT same files src/cmd/hive/main.go

@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.

The dedupe works for the case #14661 describes (same bad config every beat), but the key is never cleared, so a misconfiguration that recurs after being fixed is logged only at DEBUG.

Mechanism (src/cmd/hive/main.go:5684-5688 at a9df9bc): refusedProjectConfig is only written inside the issue != nil branch. On a valid push the callback proceeds to the reconcile path at :5697-5737 and never touches it. Sequence:

  1. hub pushes bad config A → Swap(A) returns nil → ERROR ✓
  2. operator fixes it; hub pushes valid config → accepted, refusedProjectConfig still holds A
  3. hub pushes bad config A again (revert, redeploy, second hub instance) → Swap(A) returns A → DEBUG

Step 3 is new information to the operator exactly as much as step 1 was, but the ERROR line that #14661 wants once-per-misconfiguration is gone until the misconfiguration changes. Severity low-medium: the hive still refuses the push correctly; what is lost is the operator-visible signal.

Fix: clear the key once validation passes, e.g. immediately after the if issue := ... block at :5695:

refusedProjectConfig.Store("")

and extend TestBootHeartbeatProjectConfig_RepeatedRefusalLogsErrorOncePerDistinctPush with a valid push (Org: "acme") between two identical refused pushes, asserting the count goes to 2. The new test at boot_heartbeat_project_config_test.go:92-129 passes today without the reset, so it will catch the regression only once that case is added.

Everything else checks out: sync/atomic is already imported (main.go:21); Swap on a never-stored atomic.Value returns nil and the comma-ok assertion handles it; the key includes issue.Message, so a changed validation reason re-logs as intended.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 27, 2026
…s accepted

Clear refusedProjectConfig when validation passes so the same misconfiguration recurring after a fix logs at ERROR again, as the reviewer on #14687 pointed out; test covers bad → valid → bad.

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed the review: refusedProjectConfig is now cleared once a valid push is accepted, and the test covers bad → valid → bad (ERROR count 2). hive/awaiting-ci: CI pending — sweep will merge when green.


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

— hive: agent=scanner 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/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Oct 27, 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.

Read the change against the heartbeat callback in src/cmd/hive/main.go and it looks correct to me.

  • refusedProjectConfig (main.go:4652) is an atomic.Value scoped to bootHeartbeatWith, so it survives across beats and is safe if the callback ever runs concurrently; sync/atomic was already imported (main.go:21).
  • The key (main.go:5685) includes pc.Org, pc.Repos, pc.PrimaryRepo and issue.Message, so a changed push logs at ERROR again, and Store("") after validation succeeds (main.go:5698) means the same misconfiguration recurring after an accepted push is loud again. The refusal path still returns before any project mutation, unchanged.
  • go build ./cmd/hive/ passes on this head; the gate check is green. The only red check (relative links and anchors resolve) is the pre-existing v5 citation drift that #14712 fixes, not this PR.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

⏸️ CI is red on the base branch (relative links and anchors resolve); holding until it recovers — this is not a failure in this PR, so no fix attempt is counted and no one needs to act here.

@hivecommons-hive
hivecommons-hive Bot merged commit b679e1b into v5 Oct 27, 2026
74 of 77 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-14661 branch October 27, 2026 21:39
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#14687d20a31a` sha256:d61c7e001cebba2413b5809359f2d319e30178e2a30587a5e2bde3cbcbc51538 — download from the dashboard or `hivectl review evidence #14687`.

@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

@hivecommons-hive hivecommons-hive Bot removed 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 27, 2026
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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[selfreport] unclassified_error_repeated: REFUSING hub project config: repo target is misconfigured — project left unch…

0 participants