Skip to content

πŸ§ͺ test(dashboard): cover breaker-state, governor-watchdog, providers-headroom, and repo-cost handlers - #4931

Merged
clubanderson merged 1 commit into
v4from
quality/test-dashboard-state-readouts
Aug 28, 2026
Merged

πŸ§ͺ test(dashboard): cover breaker-state, governor-watchdog, providers-headroom, and repo-cost handlers#4931
clubanderson merged 1 commit into
v4from
quality/test-dashboard-state-readouts

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds src/pkg/dashboard/api_state_readouts_test.go covering four dashboard API handlers that had 0% coverage:

Handler Route Coverage
handleBreakerState GET /api/breaker 0% β†’ 100%
handleGovernorWatchdog PUT /api/config/governor/watchdog 0% β†’ 96.9% (validation table + legacy Enabled-flag clearing + partial updates)
handleProvidersHeadroom GET /api/providers/headroom 0% β†’ 83.3% (owner gate + nil rotation manager)
handleRepoCost / auditPathForActivity GET /api/repo-cost 0% β†’ 87.5% / 66.7% (nil-deps degradation)

validateGovernorWatchdog also reaches 100%.

Claimed ground

Exactly the four handlers above in pkg/dashboard (files api.go, api_governor_watchdog.go, api_providers_headroom.go, repo_cost.go β€” tests only, one new test file). Disjoint from open hold PRs #4923 (cmd/bd), #4905 (cmd/hive main.go), #4032 (proxy auth injection).

Test-only change; no production code touched. Verified: go test ./pkg/dashboard/ passes.


Filed by quality agent (hold-gated mode). Human review required.

β€” hive: agent=quality backend=copilot model=claude-fable-5

…providers-headroom, and repo-cost handlers

Four dashboard API handlers had 0% coverage. This adds handler-level
tests in pkg/dashboard/api_state_readouts_test.go:

- handleBreakerState (GET /api/breaker): 0% -> 100%
- handleGovernorWatchdog (PUT /api/config/governor/watchdog): 0% -> 96.9%
  including validation rejections and the legacy Enabled-flag clearing
- handleProvidersHeadroom (GET /api/providers/headroom): 0% -> 83.3%
- handleRepoCost (GET /api/repo-cost) + auditPathForActivity: 0% -> 87.5%/66.7%

Test-only change; no production code touched.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: hive-quality <sec-check@hive.kubestellar.io>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Aug 28, 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 clubanderson 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

@github-actions

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.

@github-actions

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

agent/quality Approved by a Hive merger/owner for auto-merge on green CI copilot dco-signoff: yes Indicates the PR's author has signed the DCO. hive/hosted-available-oke-11-placeholder-r05x Approved by a Hive merger/owner for auto-merge on green CI hold quality size/L Denotes a PR that changes 100-499 lines, ignoring generated files. testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant