[quality] getArgumentLabels and anyLabelMatches have no production caller — only their unit tests keep them covered
Maintainers usually reply within 2 days
A pull request for this has already been merged.
- #421 by @mrbobbytables — merged
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- github-actions, node.js, typescript
Research direction
Read src/utils/labeling.ts and src/utils/labelMatch.ts, then check their corresponding tests in __tests__/utils/labeling.test.ts and __tests__/utils/labelMatch.test.ts. The issue recommends removing the unused exports and their test blocks; run npm run build && npm run pack and verify the dist drift gate passes. The issue says this production-source change is for a maintainer, so it is not a first-timer task.
Written by the indexing model from the issue text.
Description
Finding
Two exported helpers in src/utils/ have no production caller. The only code that invokes them is their own unit test, so they count toward the 100 % unit line coverage on main @ 3fc21f2 while nothing the action ships ever runs them:
| export | defined | last production caller | only remaining caller |
|---|---|---|---|
getArgumentLabels(octokit, context, arg) |
src/utils/labeling.ts:47-60 |
src/labels/prefixed.ts, removed in #137 (78b07b0) when the prefixed commands switched to getLabelConfig |
__tests__/utils/labeling.test.ts |
anyLabelMatches(patterns, labels) |
src/utils/labelMatch.ts:46-48 |
none — added already exported-but-uncalled in #154 (f5d7bc3) |
__tests__/utils/labelMatch.test.ts |
Evidence:
grep -rn "getArgumentLabels\|anyLabelMatches" src/→ only the two definitions.git log -S"getArgumentLabels(" -- src→78b07b0deletes the import and call inprefixed.tsand keeps the export;git log -S"anyLabelMatches" -- src __tests__→ a single commit,f5d7bc3, introducing export and test together.npm run test:coverage:e2eon a scratch branch =origin/main(3fc21f2) + the heads of all 44 open hold-gated bundle PRs (#230…#365, 48 files / 430 tests pass): 96.4 % statements; both functions have 0 hits (labeling.ts52–59,labelMatch.ts47 remain uncovered). Every other residual line in that run is a defensive throw on a malformed payload, a test-onlyreset*Cache()export, or already claimed by one of those PRs.- Both still ship:
grep -n "getArgumentLabels\|anyLabelMatches" dist/index.js→dist/index.js:41388,dist/index.js:43239(nccdoes not tree-shake them).
Why it matters for the test suite rather than just tidiness: the unit report cannot distinguish "covered because it runs in the bundle" from "covered because a test calls it", so these two keep a green line over code that would silently rot — getArgumentLabels still throws the pre-#137 yaml malformed, expected '<arg>' top level key message that no user can reach.
Recommendation
One PR, one deliverable (deleting both exports and their test blocks is a single mechanical change; npm run pack to drop them from dist/):
- remove
getArgumentLabelsfromsrc/utils/labeling.tsand itsdescribeblock in__tests__/utils/labeling.test.ts - remove
anyLabelMatchesfromsrc/utils/labelMatch.tsand its tests in__tests__/utils/labelMatch.test.ts(or wire it intomatchesAnyLabel-style call sites if a consumer was intended in #154) -
npm run build && npm run packso the dist/ drift gate passes
This touches production source, so it is not a PR this lane opens; it is filed for a maintainer. Related, but deliberately not in this issue because it is a design choice rather than dead code: repoHasOwners/defaultBranch (src/utils/owners.ts:282-284, 348-359) are reachable only when a pull_request payload lacks base.ref (approve.ts:504, tide.ts:543), so they too have 0 e2e hits.
Priority
- Impact: low
- Effort: low
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 3fc21f2
— 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
-
Bayern feature:Application ready web
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
digitalfabrik/entitlementcard#3176 ·
Maintainers usually reply within 7 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
NanmiCoder/cc-haha#1533 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
🐛 Bug: Calendar work items cannot be opened on mobilePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100