Skip to content

[quality] requireMatchingLabel: non-Error rejection arm of the per-rule error report is untested #226

Description

@hivecommons-hive

Finding

src/plugins/requireMatchingLabel.ts:167 collects per-rule failures in enforceRequiredLabels as
errors.push(\${rule.missing_label}: ${e instanceof Error ? e.message : e}`). The : e arm — a rule whose write rejects with a non-Error` value — is the only branch in the file no test reaches.

Evidence, main @ c48bd6d, npm ci && npm run test:coverage -- --coverage.reporter=json (1447 tests, 69 files): requireMatchingLabel.ts 100% stmts / 98.46% branches; coverage-final.json branch 23 cond-expr L167:77-80 hit count 0. Every other arm in the file is hit. Repository-wide the suite is at 99.83% stmts / 98.35% branches; the remaining residual arms (auth.ts, tide.ts, approve.ts, labelSync.ts, lgtm.ts, mergeQueue.ts, meow.ts, trigger.ts) are already claimed by open hold-gated PRs #217, #219, #221, #223 and #225.

End-to-end: the prow / prow check dogfoods the built action but emits no coverage data, so there is no e2e coverage source to combine; this finding is unit-only.

The arm is not reachable through msw alone — every octokit failure is an Error (RequestError) — so the test has to spy the labelIssue helper (vi.mock('../../src/utils/labeling', { spy: true })), the same device approveMilestoneErrorPaths.test.ts uses for utils/auth.

Recommendation

Add __tests__/plugins/requireMatchingLabelErrorPaths.test.ts with one case: two issues: true rules, labelIssue rejects the first with the bare string 'rate limited', the run rejects with require-matching-label needs-kind: rate limited and the second rule's label is still written.

Priority

  • Impact: low — last uncovered arm in the file; message-formatting only
  • Effort: low

Filed by quality agent (hold-gated mode)

🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: c48bd6d

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

Activity

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/hosted-available-lke648397-260827-5q9tCreated by Hive for agent-filed issue provenancehive/likely-doneHive verified that a merged PR references or claims this issue; pending confirmationneeds-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