[quality] getCurrentLabels' bare-string label arm (labeling.ts:148) is unit-only; no bundle test serves a non-object label
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
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 --coverageonmain@ d0b1d87 (132 files / 2073 tests) → 100 % lines,labeling.ts100 % branch — reached only by__tests__/utils/labeling.test.tscalling the function directly. - End-to-end:
npm run test:coverage:e2eonmain@ d0b1d87 (63 files / 436 tests) →labeling.ts95.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 otherlabeling.tsresidual, line 92, isresetLabelCache, 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 servesGET /issues/1withlabels: ['kind/cleanup', { id: 2 }, { name: 'needs-kind' }]to/remove-kind cleanupand asserts the string label is matched and deleted and the nameless object folds to''(kind: found labels for issue kind/cleanup,,needs-kindin the debug log). Locally this takeslabeling.tsto 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
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cncf/prow-github-actions
-
[quality] e2e gap: meow.ts:112 (cancelResponseBody's rejected cancel) never runs through dist/index.jsPossibly taken @hivecommons-hive claimed this today. Openagent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5q9t needs-kind quality testing
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
cncf/prow-github-actions#456 · 1 comment ·
Maintainers usually reply within 2 days
-
[quality] bare /uncc by a non-collaborator (uncc.ts:79) and /milestone with no milestones (milestone.ts:66) are never driven through dist/index.jsPossibly taken @hivecommons-hive claimed this today. Openagent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5q9t needs-kind quality testing
Difficulty 2/5 1-3 hours Newbie friendliness 20/100
cncf/prow-github-actions#454 · 1 comment ·
Maintainers usually reply within 2 days
-
agent/quality hive/hosted-available-lke648397-260827-5q9t needs-decision needs-kind quality testing
Difficulty 1/5 Under an hour Newbie friendliness 25/100
cncf/prow-github-actions#452 · 2 comments ·
Maintainers usually reply within 2 days
-
kind/cleanup
Difficulty 4/5 3-5 days Newbie friendliness 10/100
cncf/prow-github-actions#414 · 7 comments ·
Maintainers usually reply within 2 days
-
kind/cleanup
Difficulty 5/5 Over a week Newbie friendliness 15/100
cncf/prow-github-actions#170 · 2 comments ·
Maintainers usually reply within 2 days
All issues in cncf/prow-github-actions
Similar issues
-
nextjs-tracking
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
cloudflare/vinext#3887 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
apache/rocketmq-dashboard#6331 ·
Maintainers usually reply within 5 days
-
bug cache clinical-safety P1-critical
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
juspay/blend-design-system#1788 ·
Maintainers usually reply within 1 day
-
[Analytics] Add Focus Time-Block Efficiency Ratio Calculator in src/lib/focus/efficiency-ratio.tsOpenanalytics beginner friendly community contributions-welcome enhancement good first issue hacktoberfest help wanted up-for-grabs
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day