Skip to content

[quality] labelIssue's refused POST /issues/{n}/labels write (src/utils/labeling.ts L88) has no end-to-end coverage #336

Closed

Description

@hivecommons-hive

Finding

labelIssue (src/utils/labeling.ts L80–89) is the single write path every label command and plugin uses (/kind, /area, /hold, /lgtm, ok-to-test, approve, owners-label, require-matching-label). Its catch at L88 rewraps a refused POST /repos/{o}/{r}/issues/{n}/labels as could not add labels: <cause>, which is what reaches the run's ::error:: annotation.

  • Unit evidence: npx vitest run --coverage on main @ 3fc21f2 — labeling.ts 100 % lines; the L88 arm is asserted in __tests__/label/area.test.ts, __tests__/plugins/ownersLabel.test.ts, __tests__/plugins/requireMatchingLabel.test.ts and __tests__/cronJobTest/sweep.test.ts.
  • End-to-end evidence: npm run test:coverage:e2e on main @ 3fc21f2 (Node v26.10.0, vitest 5.0.3, 6 files / 142 tests) — labeling.ts 73.07 % lines, uncovered 29–32, 52–59, 88, 114, 135, 170, 174, 203. L88 is never executed: every __tests__/bundle case that reaches a label write routes POST …/issues/1/labels to 200.

Of the other uncovered labeling.ts lines, L29–32 (#246), L135 (#298), L174 (#300/#310/#326) and L202–203 (#326) are claimed by open hold-gated PRs; L52–59 (getArgumentLabels) and L114 (resetLabelCache) have no caller under src/, and L170 is the legacy string-label shape GitHub no longer returns — none of those is reachable through the bundle. L88 is the one remaining reachable arm.

Recommendation

  • __tests__/bundle/labelWriteRefused.test.ts (new): /kind cleanup with .prowlabels.yaml served, GET /labels listing kind/cleanup, and POST /issues/1/labels answered 500 → exit 1, the single error error handling issue comment: Error: could not add labels: HttpError: boom, exactly one POST with { labels: ['kind/cleanup'] } after the configuration reads and the labels read.

Measured: with that file, labeling.ts e2e lines 73.07 → 75 % and L88 leaves the uncovered set; bundle suite 142 → 143 tests.

Priority

  • Impact: medium — unit-covered, e2e-uncovered (priority 2 under the coverage evidence rules)
  • Effort: low

Filed by quality agent (hold-gated mode)

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 Oct 6, 2026
  2. github-actions commented on Oct 6, 2026

    @github-actions
    Contributor

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

  3. added
    🐝 covered by PRHive verified that an open PR references or claims this issue; still actionable until confirmed
    on Oct 6, 2026
  4. added a commit that references this issue on Oct 7, 2026
    554c862
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 provenanceneeds-kindqualityCreated by Hive for agent-filed issue provenancetestingCreated by Hive for agent-filed issue provenance🐝 covered by PRHive verified that an open PR references or claims this issue; still actionable until confirmed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions