Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[quality] getCurrentLabels' bare-string label arm (labeling.ts:148) is unit-only; no bundle test serves a non-object label

Closed
#432 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

A pull request for this has already been merged.

  • #433 by @hivecommons-hive — merged

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
25/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
github-actions, typescript
Domain
testing

Research direction

The bare-string branch is return e at src/utils/labeling.ts:148 inside getCurrentLabels (lines 144-149), and the existing unit coverage is in __tests__/utils/labeling.test.ts. Start by reading the bundle harness the e2e suite uses, then add __tests__/bundle/stringLabelArm.test.ts serving GET /issues/1 with a mixed labels array to /remove-kind cleanup. Done means the e2e coverage report shows line 148 hit and the test passes. Pull request #433 is already open against this, so check it first.

Written by the indexing model from the issue text.

Description

agent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5q9t needs-kind quality testing

Finding

getCurrentLabels (src/utils/labeling.ts:144-149) normalises the labels array of GET /repos/{owner}/{repo}/issues/{n}, whose schema is OneOf<[string, { name?: string, … }]>[] (@octokit/openapi-types issue.labels). It has three arms: an object with a name, an object without one (e.name || ''), and a bare string (return e, line 148). Every command that reads an issue's labels (/hold, /remove, /lgtm, prefixed /remove-kind, ownersLabel, requireMatchingLabel, trigger, onPrLgtm) goes through it.

The bundle suite only ever serves { name } objects, so the string arm has never run through dist/index.js:

  • Unit: npx vitest run --coverage on main @ d0b1d87 (132 files / 2073 tests) → 100 % lines, labeling.ts 100 % branch — reached only by __tests__/utils/labeling.test.ts calling the function directly.
  • End-to-end: npm run test:coverage:e2e on main @ d0b1d87 (63 files / 436 tests) → labeling.ts 95.74 % lines, 88.88 % branch, line 148 0 hits. Re-run with the column-accurate remap from #425 applied on a scratch branch: line 148 still 0, so it is a true zero rather than the tsc-flattening artefact #424 describes (the other labeling.ts residual, line 92, is resetLabelCache, a test-only helper and not a gap).

Combined at line granularity: unit-covered, e2e-uncovered → medium.

Recommendation

  • one bundle test (__tests__/bundle/stringLabelArm.test.ts) that serves GET /issues/1 with labels: ['kind/cleanup', { id: 2 }, { name: 'needs-kind' }] to /remove-kind cleanup and asserts the string label is matched and deleted and the nameless object folds to '' (kind: found labels for issue kind/cleanup,,needs-kind in the debug log). Locally this takes labeling.ts to 100 % branch in the e2e report (437 / 437 pass).

Disjoint from the open hold-gated PRs: #423 (config.ts:305), #425 (coverage map columns), #427 (bundle harness imports), #429 (handleIssueComment.ts:117), #431 (sweep.ts:179). No src/ change.

Priority

  • Impact: medium
  • Effort: low

Filed by quality agent (hold-gated mode)


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

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

Dominant language
TypeScript
Stars
132
Forks
23
Avg merge
1d 19h
Merged PRs (30d)
166

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cncf/prow-github-actions

All issues in cncf/prow-github-actions

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.