[quality] test: cover labelPlanSink KickedPlan/QueuedPlan and planFromLabeledIssues fallback-store paths - #5665
Conversation
…mLabeledIssues fallback-store paths Covers cmd/hive/main.go plan-from-label wiring left untested by the existing plan_from_label_wiring_test.go (which passes nil governor and nil dashboard throughout): - labelPlanSink.KickedPlan: 0% -> 100% (governor kick recorded for the architect, plan_from_label audit entry naming epic + source issue, nil-dashboard guard) - labelPlanSink.QueuedPlan: 50% -> 100% (paused vs unavailable log branches, nil governor enforces no kick on the queue path) - planFromLabeledIssues: 58.3% -> 91.7% (fallback to any store when no architect store is configured; nil store value returns safely) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: sec-check <sec-check@hive.kubestellar.io>
|
Changelog: this PR changes code but does not touch If it is user-visible — a feature, a fix an operator would notice, a This is a reminder, not a gate; it never blocks a merge. |
clubanderson
left a comment
There was a problem hiding this comment.
Review — OK to merge.
These are real invariant assertions, not shape checks — each test was read against the labelPlanSink / planFromLabeledIssues implementations and would fail under a plausible regression:
KickedPlan: asserts the kick lands inKickHistoryfor the architect and that theplan_from_labelaudit entry names both the epic ID and the source ref — drop either theRecordKickor theAuditLogand the test fails. The nil-dashboard test fails by panic if thedashSrv != nilguard is removed.QueuedPlan: passing a nil governor is the sharp part — it turns "the queue path never kicks" into a hard invariant (any governor touch panics) rather than a log assertion. The paused/unavailable message checks assert both presence and cross-absence, so the two log-only branches genuinely can't be swapped.planFromLabeledIssues: fallback test asserts the epic actually lands in the non-architect store (1 bead minted), and the nil-store-value test fails by panic if thestore == nilguard goes.
Occupied-ground claim checks out — single new test file, functions disjoint from #5648/#5637/#5647. CI green including coverage.
Minor, non-blocking: the paused/unavailable assertions couple to exact log strings; that's unavoidable for log-only branches, and the nil-gov invariant carries the real weight.
|
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
Test Improvement
Adds
src/cmd/hive/plan_from_label_sink_test.gocovering the plan-from-label wiring insrc/cmd/hive/main.gothat the existingplan_from_label_wiring_test.goleaves untested (it passes nil governor and nil dashboard throughout):labelPlanSink.KickedPlan— 0% → 100%: asserts the governor kick is recorded for the architect (KickHistory), aplan_from_labelaudit entry names the epic and source issue, and the nil-dashboard guard holds.labelPlanSink.QueuedPlan— 50% → 100%: distinguishes the paused ("architect paused") vs unavailable ("architect unavailable") log branches; nil governor enforces that the queue path never kicks.planFromLabeledIssues— 58.3% → 91.7%: fallback to any available store when no architect store is configured; a nil store value returns safely.Verified:
go vet ./cmd/hive/clean, all 9 tests in the run selector pass, coverage deltas confirmed withgo tool cover -func.Occupied-ground check
Claims only
src/cmd/hive/main.gofunctionslabelPlanSink.KickedPlan,labelPlanSink.QueuedPlan,planFromLabeledIssuesvia a new test file. Disjoint from open quality PRs #5648 (resolveGatewayAuth/curatorConfigFromHive) and #5637 (handleAgentLoginCode/Collector.AgentErrorStreaks), and from #5647 (pkg/config only).Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5