Skip to content

[quality] /label-sync comment command: missing-number guard and already-in-sync report arms have no end-to-end driver (src/issueComment/labelSync.ts:20-21,32,35) #620

Closed

Description

@hivecommons-hive

Finding

src/issueComment/labelSync.ts (the /label-sync comment command) is 100 % covered by the unit suite but three of its arms get zero hits from the bundle (end-to-end) run that executes dist/index.js:

Site Arm e2e evidence
labelSync.ts:20-21 issueNumber === undefined → throw github context payload missing issue number DA:21,0, BRDA:20,…,0
labelSync.ts:32 result.created.length > 0 false (no Created: line) BRDA:32,…,1,0
labelSync.ts:35 result.updated.length > 0 false (no Updated: line) BRDA:35,…,1,0

Why they are missed:

  • __tests__/bundle/missingNumberGuards.test.ts drives the missing-number guard of every slash command through dist/index.js except /label-sync (17-row it.each, lines 32-49).
  • Every bundle /label-sync scenario (bundle.test.ts:2128, labelSyncCatalog, labelSyncFailureArms, labelSyncNullDescription, labelSyncUnprefixedAllowlist) starts from a repository that is missing labels, so the comment always carries a Created: line. The report a maintainer sees when the job has nothing to do — label-sync: created 0, updated 0, unchanged N. with neither optional line, and no write to the labels API — is never produced end to end.

Evidence (reproducible)

  • Unit: artifact coverage-96433268fccbb9c86efa1e40fbc0a11d5b07c124 from test.yml run 40928440920 (main @ 9643326): lcov.info reports src/issueComment/labelSync.ts at 100 % lines / branches / functions.
  • End-to-end: artifact coverage-e2e-96433268fccbb9c86efa1e40fbc0a11d5b07c124 from the same run (npm run test:coverage:e2e, .coverage-bundle/index.js remapped to src/): the three records above are the only zero-count DA/BRDA lines for the file. Reproduced locally at 9643326 with the same command.
  • The two suites are reported separately by design (docs/contributing.md, test:coverage:e2e row), so no merge was attempted; each source is stated on its own.
  • Not a negative-count await artifact (those are documented in docs/contributing.md and excluded here): the counts are 0, not negative, and the arms are plain if statements with no preceding await in the condition.

Recommendation

One test-only change, both parts in __tests__/bundle/:

  • add ['/label-sync', '/label-sync', issueGuard] to the missingNumberGuards.test.ts matrix
  • add a bundle scenario where a collaborator's /label-sync runs against a repository the job already brought into line (seeded from a first sync's POST /labels bodies, so the test holds no copy of the built-in catalog) and asserts the comment is exactly label-sync: created 0, updated 0, unchanged N., that no POST/PATCH/DELETE reaches the labels API, and the stdout summary created 0 [], updated 0 [], unchanged N, failed 0

Both tests fail when the arms are mutated (> 0 → >= 0; guard condition made unreachable) with dist/ rebuilt via tsc && ncc build --no-cache.

Priority

  • Impact: medium (unit-covered, end-to-end zero-hit; user-visible comment text)
  • Effort: low

Filed by quality agent (hold-gated mode)


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

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

Activity

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

    @github-actions
    Contributor

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

  3. added a commit that references this issue on Nov 3, 2026
    e9f2f38
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 provenanceneeds-kindtestingCreated 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