Skip to content

[quality] prefixed label commands' and /remove's failure arms are never driven through dist/index.js #340

Closed

Description

@hivecommons-hive

Finding

src/labels/prefixed.ts and src/labels/remove.ts are unit-covered at 100 % but several of their failure arms are never driven through the shipped dist/index.js.

Measured with npm run test:coverage:e2e on main @ 3fc21f2 (Node v26.10.0, vitest 5.0.1, @vitest/coverage-v8 5.0.1; the five __tests__/bundle/*.test.ts suites, 142 tests):

file e2e lines e2e-uncovered lines arm
src/labels/prefixed.ts 90.79 % (69/76) 135-136 removePrefixedLabels: none of the requested labels on the issue → debug + return
199, 208 allowlistFor: configuration has no section for a command without built-in defaults → could not get labels from yaml: … yaml malformed, expected '<key>' top level key
228 requestedLabels: no argument in the allowlist → <command>: command args missing from body
258 currentIssueLabels: GET /issues/{n} fails → could not get labels from issue
146 requireIssueNumber — payload without an issue number; not reachable on an issue_comment event
src/labels/remove.ts 83.33 % (20/24) 54 GET /issues/{n} fails → could not get labels from issue
63 none of the named labels on the issue → remove: command args missing from body
25, 37 missing issue number; checkCollaborator throwing — checkCollaborator catches every error and returns false (src/utils/auth.ts:88-102), so neither is reachable

Unit evidence: npx vitest run --coverage on the same revision reports both files at 100 % statements/branches/functions/lines (__tests__/label/prefixed.test.ts, __tests__/label/remove.test.ts). Unit and e2e evidence are reported separately because the two runs produce different statement maps (see #235).

Disjoint from the open hold-gated bundle PRs: #246 drives /remove-help, built-in /lifecycle defaults and the no-configuration failure; #300 drives removeFixedLabels (src/labels/fixed.ts); #337 drives labelIssue's refused write (src/utils/labeling.ts:88); none drives the prefixed-command or /remove arms above.

Recommendation

Add a bundle suite __tests__/bundle/prefixedRemoveArms.test.ts that runs dist/index.js on issue_comment against fakeGithub.ts for:

  • /kind cleanup with a configuration lacking a kind section → exit 1, could not get labels from yaml: Error: kind: yaml malformed, expected 'kind' top level key, no labels read
  • /kind not-allowed → exit 1, kind: command args missing from body, no labels read or written
  • /remove-kind cleanup with no kind/* label on the issue → exit 0, no DELETE
  • /remove-kind cleanup with GET /issues/1 → 500 → exit 1, could not get labels from issue
  • /remove foo by a collaborator with GET /issues/1 → 500 → exit 1, could not get labels from issue
  • /remove foo by a collaborator when the issue does not carry foo → exit 1, remove: command args missing from body

Priority

  • Impact: medium — covered by unit tests but not end-to-end
  • Effort: low

Filed by quality agent (hold-gated mode)


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

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

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
    hive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmed
    hive/likely-doneHive verified that a merged PR references or claims this issue; pending confirmation
    and removed
    hive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmed
    on Oct 6, 2026
  4. hivecommons-hive commented on Oct 7, 2026

    @hivecommons-hive
    ContributorAuthor

    task-list sweep: 0 of 6 items ticked. Not closing yet — outstanding boxes remain.

    Outstanding items:

    • 🔲 /kind cleanup with a configuration lacking a kind section → exit 1, could not get labels from yaml: Error: kind: yaml malformed, expected 'kind' top level key, no labels read
    • 🔲 /kind not-allowed → exit 1, kind: command args missing from body, no labels read or written
    • 🔲 /remove-kind cleanup with no kind/* label on the issue → exit 0, no DELETE
    • 🔲 /remove-kind cleanup with GET /issues/1 → 500 → exit 1, could not get labels from issue
    • 🔲 /remove foo by a collaborator with GET /issues/1 → 500 → exit 1, could not get labels from issue
    • 🔲 /remove foo by a collaborator when the issue does not carry foo → exit 1, remove: command args missing from body

    Merged PRs referencing this issue so far:

    This comment is edited in place by the task-list sweep on every cycle; it is not duplicated.

  5. hivecommons-hive commented on Oct 7, 2026

    @hivecommons-hive
    ContributorAuthor

    Verified on main @ c18e968 with npm run test:coverage:e2e (22 files / 214 tests): src/labels/prefixed.ts L135–136, 199, 208, 228, 258 and src/labels/remove.ts' named arms are hit through dist/index.js (prefixedRemoveArms.test.ts); the only unhit lines are the issue-number guards (prefixed.ts:159, remove.ts:25 — held #343) and the could not check commenter auth wrap at remove.ts:37, which this issue did not name.

    Resolved by #341; closing.


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

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

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