Skip to content

[quality] cronJobs: labelSync list failure and sweep non-Error/absent-field branches are untested #199

Closed

Description

@hivecommons-hive

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 as could not list the repository labels: … and write nothing.
  • src/cronJobs/sweep.ts:132 — a step rejecting with a non-Error value; the outcome should record String(e) under the step name.
  • src/cronJobs/sweep.ts:141,153 — the pr.labels ?? [] / pr.requested_reviewers ?? [] fallbacks when the list payload omits those fields; ok-to-test must not call Actions and blunderbuss must 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:

  • labelSync rejects with could not list the repository labels and makes no write when GET /repos/:o/:r/labels returns 500
  • sweep records require-matching-label: <string> when enforceRequiredLabels rejects with a plain string
  • sweep handles a listed pull request without labels/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

  1. added
    qualityCreated by Hive for agent-filed issue provenance
    testingCreated by Hive for agent-filed issue provenance
    agent/qualityCreated by Hive for agent-filed issue provenance
    on Sep 27, 2026
  2. github-actions commented on Sep 27, 2026

    @github-actions
    Contributor

    Please add a kind label with /kind failing-test or /kind cleanup.

  3. added a commit that references this issue on Sep 27, 2026
    27c4221
  4. added
    hive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmed
    on Sep 27, 2026
  5. added a commit that references this issue on Sep 28, 2026
    9d6d877
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/qualityCreated by Hive for agent-filed issue provenancehive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmedhive/hosted-available-lke648397-260827-5q9tCreated by Hive for agent-filed issue provenanceneeds-kindqualityCreated by Hive for agent-filed issue provenancetestingCreated by Hive for agent-filed issue provenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions