[quality] cover pkg/github ETagCacheStats and MergeVerdictKey (0% → 100%) - #7554
Conversation
go tool cover -func on main showed 0.0% for two exported contract functions in pkg/github: - ETagCacheStats (etagcache.go:109): exercised through etagCacheWrap and the existing etagServer helper so the test proves the stats come from the SHARED cache the transport chain installs — one charged fetch, one free 304 revalidation, hits/misses/entries deltas 1/1/1, with cleanup dropping the test's entry from the process-wide cache. - MergeVerdictKey (merge_verdict.go:50): table test pinning the Repo"#"Number spelling for bare and owner/name repos — the shared key contract between the governor's verdict map and the dashboard lookup (#7478). Closes #7552 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: sec-check <sec-check@hive.kubestellar.io>
|
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. |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Test Improvement
Adds hermetic unit tests for two exported
pkg/githubcontract functions that were at 0.0% coverage on main (9d44557):TestETagCacheStats_ReportsSharedCache(src/pkg/github/etagcache_stats_test.go) — exercisesETagCacheStatsthroughetagCacheWrap+ the existingetagServerhttptest helper: one charged fetch, one free 304 revalidation, asserts hits/misses/entries deltas of 1/1/1, and cleans its entry out of the process-wide shared cache. Proves the operator's GitHub API quota exhausted 1s after every reset: all 16 repos fail to enumerate, scheduler runs blind #7430 quota telemetry reads the cache the transport chain actually uses.TestMergeVerdictKey(src/pkg/github/merge_verdict_test.go) — pins theRepo + "#" + Numberkey spelling (bare repo, owner/name, zero value) that the governor's verdict map and the dashboard lookup both depend on (🌱 dashboard: a green PR pill should mean "the sweep would merge this now", with amber for mergeable-but-outstanding #7478).Test-only change; no production code touched. Both functions now measure 100%;
go test ./pkg/github -shortpasses.Files claimed:
src/pkg/github/etagcache_stats_test.go,src/pkg/github/merge_verdict_test.go(new files only) — disjoint from open PRs #7545/#7547/#7549/#7550.Related Issue
Closes #7552
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5