Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Chiusa
#432 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Una pull request collegata è già stata integrata.

  • #433 di @hivecommons-hive — integrata

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
github-actions, typescript
Ambito
testing

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
TypeScript
Stelle
132
Fork
24
Merge medio
1g 17h
PR unite (30g)
219

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cncf/prow-github-actions

Tutte le issue di cncf/prow-github-actions

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.