Skip to content

[quality] test: cover labelPlanSink KickedPlan/QueuedPlan and planFromLabeledIssues fallback-store paths - #5665

Merged
kubestellar-prow[bot] merged 1 commit into
v4from
quality/test-plan-label-sink
Sep 2, 2026
Merged

[quality] test: cover labelPlanSink KickedPlan/QueuedPlan and planFromLabeledIssues fallback-store paths#5665
kubestellar-prow[bot] merged 1 commit into
v4from
quality/test-plan-label-sink

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds src/cmd/hive/plan_from_label_sink_test.go covering the plan-from-label wiring in src/cmd/hive/main.go that the existing plan_from_label_wiring_test.go leaves untested (it passes nil governor and nil dashboard throughout):

  • labelPlanSink.KickedPlan — 0% → 100%: asserts the governor kick is recorded for the architect (KickHistory), a plan_from_label audit 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 with go tool cover -func.

Occupied-ground check

Claims only src/cmd/hive/main.go functions labelPlanSink.KickedPlan, labelPlanSink.QueuedPlan, planFromLabeledIssues via 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

…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>
@kubestellar-hive kubestellar-hive Bot added the hold label Sep 2, 2026
@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Changelog: this PR changes code but does not touch CHANGELOG.md.

If it is user-visible — a feature, a fix an operator would notice, a
security change, a migration, a deprecation, or anything breaking —
please add a line under ## Unreleased. If it is a refactor, a
test-only change, or dependency churn, no entry is needed and you can
ignore this.

This is a reminder, not a gate; it never blocks a merge.

@clubanderson clubanderson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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 in KickHistory for the architect and that the plan_from_label audit entry names both the epic ID and the source ref — drop either the RecordKick or the AuditLog and the test fails. The nil-dashboard test fails by panic if the dashSrv != nil guard 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 the store == nil guard 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.

@clubanderson clubanderson added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed hold labels Sep 2, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[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

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 merged commit 14d8d5f into v4 Sep 2, 2026
55 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-plan-label-sink branch September 2, 2026 15:13
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

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

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. copilot dco-signoff: yes Indicates the PR's author has signed the DCO. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant