Repository navigation
[quality] cronJobs: labelSync list failure and sweep non-Error/absent-field branches are untested #199
Description
Finding
Unit coverage (npx vitest run --coverage, origin/main @ 187c5e3) leaves these branches in the cron jobs unexecuted:
src/cronJobs/labelSync.ts:55—octokit.paginate(listLabelsForRepo)rejecting, which should surface ascould not list the repository labels: …and write nothing.src/cronJobs/sweep.ts:132— a step rejecting with a non-Errorvalue; the outcome should recordString(e)under the step name.src/cronJobs/sweep.ts:141,153— thepr.labels ?? []/pr.requested_reviewers ?? []fallbacks when the list payload omits those fields;ok-to-testmust not call Actions andblunderbussmust still request reviewers.
Evidence provenance: single vitest suite (including __tests__/bundle) run by .github/workflows/test.yml (npm run test:coverage). The repository has no separate end-to-end coverage source, so no claim is made about e2e coverage.
Disjoint from open PRs #173–#198: none of them touch __tests__/cronJobTest/labelSync.test.ts or __tests__/cronJobTest/sweep.test.ts (#179 covers cronJobs/lgtm.ts; #196 covers the /check-required-labels sweep in handleIssueComment).
Recommendation
Add to __tests__/cronJobTest/labelSync.test.ts and __tests__/cronJobTest/sweep.test.ts:
-
labelSyncrejects withcould not list the repository labelsand makes no write whenGET /repos/:o/:r/labelsreturns 500 -
sweeprecordsrequire-matching-label: <string>whenenforceRequiredLabelsrejects with a plain string -
sweephandles a listed pull request withoutlabels/requested_reviewers: no Actions call, reviewers still requested
Priority
- Impact: medium (unit-covered files; error/defensive branches only)
- Effort: low
Filed by quality agent (hold-gated mode)
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 187c5e3
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
Activity
github-actions commentedon Sep 27, 2026
Please add a kind label with
/kind failing-testor/kind cleanup.test(cronJobs): cover the labelSync list failure and the sweep non-Er…
test(cronJobs): cover the labelSync list failure and the sweep non-Er…