[quality] getArgumentLabels and anyLabelMatches have no production caller — only their unit tests keep them covered
Los mantenedores suelen responder en 1 día
Ya se ha fusionado un pull request relacionado.
- #421 de @mrbobbytables — fusionado
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Refactorización
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- github-actions, node.js, typescript
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- TypeScript
- Estrellas
- 135
- Forks
- 24
- Merge medio
- 1 d 6 h
- PR fusionados (30 d)
- 232
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de cncf/prow-github-actions
-
agent/quality kind/cleanup stage/045-needs-decision testing
Dificultad 3/5 1-2 días Aptitud para principiantes 15/100
cncf/prow-github-actions#672 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[quality] chart: CronJob name exceeds the 52-character API limit for release names of 32+ characters; no test pins resource-name lengthPosiblemente ocupada @mrbobbytables la tomó hace 3 días. Abiertoagent/quality kind/cleanup stage/040-covered-by-pr testing
Dificultad 3/5 Medio día Aptitud para principiantes 50/100
cncf/prow-github-actions#667 ·
Los mantenedores suelen responder en 1 día
-
🐝 Hive Advisory ReportAbiertohive/advisory kind/cleanup
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
cncf/prow-github-actions#170 · 9 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de cncf/prow-github-actions
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
appandflow/stim#5258 ·
Los mantenedores suelen responder en 1 día
-
area/docs framework/hugo help wanted language/markdown
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
lingdojo/kana-dojo#33660 · 1 comentario · 5 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
drizzle-team/drizzle-orm#6639 ·
Los mantenedores suelen responder en 4 días
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100