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

[quality] owners-label's early-return and failure arms are never driven through dist/index.js (e2e 80% lines, unit 100%)

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

I maintainer di solito rispondono entro 2 giorni

Una pull request collegata è già stata integrata.

  • #298 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, node.js, typescript
Ambito
testing-qa

Direzione di ricerca

Read src/plugins/ownersLabel.ts and the existing tests under tests/bundle, then add tests/bundle/ownersLabelArms.test.ts to exercise the listed cases through dist/index.js using fakeGithub. Run npm run test:coverage:e2e; done means those non-write and failure arms are covered in the bundle suite and their specified logs, API calls, and failure behavior are asserted.

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

src/plugins/ownersLabel.ts is the pull_request owners-label plugin. The unit suite covers it fully, but the end-to-end bundle suite (__tests__/bundle, the only place the shipped dist/index.js runs) only reaches its happy path — adding a declared label the pull request lacks. The arms that stop short of a write are never driven through the bundle:

lines arm
61-62 the pull request already carries every declared label (case-insensitive compare) → no repo-labels read, no write
70 GET /repos/…/labels fails → could not list the repository labels: … rethrown, run fails
77-78, 81 a declared label the repository does not have → owners-label: skipping label … (run label-sync) info line, nothing written
30 pull_request payload without pull_request → github context payload missing pull request: …

Evidence (main @ 3fc21f2, Node v26.10.0, vitest 5.0.3, @vitest/coverage-v8 5.0.3):

  • Unit: npx vitest run --coverage (81 files / 1644 tests) → ownersLabel.ts 100 % lines / 100 % branches / 100 % functions.
  • End-to-end: npm run test:coverage:e2e (vitest.e2e-coverage.config.mjs, __tests__/bundle, 5 files / 142 tests) → ownersLabel.ts 80 % lines / 73.33 % branches, uncovered lines 30, 61-62, 70, 77-78, 81.
  • The two sources are analysed separately: their statement maps come from different transforms and do not line-merge (#235).

Covered by unit but not end-to-end → priority 2 (medium) under the coverage evidence rules.

Recommendation

Add __tests__/bundle/ownersLabelArms.test.ts driving dist/index.js on pull_request synchronize (so require-matching-label, blunderbuss and tide stay out of the call list) against fakeGithub:

  • already-carrying case (Area/SDK on the issue vs area/sdk in OWNERS): asserts no GET /labels, no POST …/labels
  • every declared label unknown to the repository: asserts both skipping label … info lines and no write
  • mixed known/unknown: asserts only the known one is posted, in the OWNERS spelling
  • GET /labels → 500: asserts ::error::error handling pull_request event: could not list the repository labels: … and that approve's probe still runs after it
  • payload without pull_request: asserts the missing pull request failure with no API calls

Disjoint from every open hold-gated bundle PR (#242 cron jobs input, #244 /meow, #246 fixed/prefixed labels + helpers.ts, #283 OWNERS authorization, #286 approve.github_review, #289 tide merge gate, #291 blunderbuss, #293 hold/sweep, #296 close/milestone): none drives owners-label's non-write arms, and helpers.ts is not touched.

Priority

  • Impact: medium
  • Effort: low

Filed by quality agent (hold-gated mode)


🐝 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

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

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.