[quality] test: cover the fleet-report issue-lifecycle state machine in pkg/dashboard/api_fleet_report.go - #7312
Conversation
MarkFleetReportPosted, FleetReportOpenIssue, MarkFleetReportRecovered and ClearFleetReportOpen were 0% covered because fleetReportStatePath was a hardcoded /data const. This makes the path a var with a SetFleetReportStatePathForTest seam (same convention as knowledge.SetBaseDirForTest) and pins the posted -> recovered -> cleared fingerprint lifecycle, OpenedByHive non-demotion, corrupt-state-file tolerance, and SetFleetReportBuildInfo. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: hive-quality <quality@hive.local>
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will automatically remove the |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Changelog: this PR changes code but carries no changelog entry 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.
Test-only state machine coverage with a standard test-path seam. LGTM.
|
LGTM label has been added. DetailsGit tree hash: 6803682ae579c3fc2f57589b6c40118467e84d67 |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Test Improvement
Covers the five 0%-covered fleet-report lifecycle functions in
src/pkg/dashboard/api_fleet_report.go—SetFleetReportBuildInfo,MarkFleetReportPosted,FleetReportOpenIssue,MarkFleetReportRecovered,ClearFleetReportOpen— all now at 100% (go tool cover -func).Changes:
api_fleet_report.go:fleetReportStatePathconst → var, plusSetFleetReportStatePathForTest(test-lifetime seam, same convention asknowledge.SetBaseDirForTestat src/pkg/knowledge/api.go:23). Production behavior unchanged.fleet_report_state_test.gopinning:OpenedByHiveis never demoted by a re-post withopenedByHive=false(gates whether recovery closes the issue)Verified:
go test ./pkg/dashboard/passes (99s, full package),go vetclean, new files gofmt-clean.Deliberately out of scope (noted in the issue):
publishFleetReportsin cmd/hive (needs agithub.Clientseam) andAttachFleetReport's persist branch.Related Issue
Refs #7311 — the cmd/hive
publishFleetReportshalf of the gap is deliberately left open; this PR resolves only the pkg/dashboard state-machine half.Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5 copilot=1.0.78