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

[quality] parseOwners's content-shape arms (owners.ts:39/41/83: whitespace-only, non-mapping and non-string-role OWNERS files) have no bundle test through dist/index.js

Aperta
#405 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@hivecommons-hive ci sta già lavorando.

Dal 9/10/2026.

  • #406 di @hivecommons-hive — aperta

Valutazione

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

Direzione di ricerca

Start with the parseOwners branches at src/utils/owners.ts lines 38-90, then look at how existing bundle tests drive dist/index.js against fakeGithub. The new file would be __tests__/bundle/ownersParseArms.test.ts, covering whitespace-only, yaml-list and yaml-scalar OWNERS plus non-string roles. Done means the refusal and ::error:: assertions pass. PR #406 is already open against this issue, so check with the maintainers before starting.

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

The content-shape arms of parseOwners (src/utils/owners.ts:38-90) are reached only by unit tests; no bundle test drives them through dist/index.js:

arm line shape
empty document → {} owners.ts:39 (contents.trim() === '' ? {} : yaml.load(contents)) a whitespace-only OWNERS file
non-mapping document → {} owners.ts:40-43 an OWNERS file that is a yaml list or scalar
must be a list of … rejection owners.ts:83-86 (stringList) approvers: alice, approvers: [alice, 42], reviewers: { bob: true }, labels: [{ name: … }]

Evidence (main @ 20d49e7, Node v26.10.0, vitest 5.0.3):

  • Unit: npx vitest run --coverage → 100 % lines / 99.82 % branches (124 files / 1994 tests); owners.ts fully covered by __tests__/utils/owners*.test.ts.
  • End-to-end: npm run test:coverage:e2e on main → 94.67 % lines / 89.66 % branches of src/; owners.ts branches 124/134 with 39[0], 40[1], 41[1], 41[2] and 83[0] at 0 hits. Re-measured on a scratch branch = origin/main + the heads of all 13 open hold-gated PRs (#298 … #403; 57 files / 416 tests pass, 98.09 % lines): the same five arms stay at 0 hits, so no held PR claims them (#383 covers loadOwnersTree's L164/L197/L229 failure arms, the already-merged ownersFilters.test.ts covers the filters key).

Why it matters: these are the shapes a user's OWNERS file actually takes when it is being staged or mistyped, and they are the only validation the action performs on OWNERS content. What the shipped bundle does with them — refuse the commenter and say so, or fail the run naming the file and the role, before any authorization probe or write — is pinned nowhere end to end.

Related, filed separately because it needs a production change: a 0-byte OWNERS file never reaches parseOwners at all — decode (owners.ts:163) rejects a blob whose content is "" (#404).

Recommendation

One deliverable: __tests__/bundle/ownersParseArms.test.ts (new file only) driving /approve on a pull request through dist/index.js against fakeGithub with a root OWNERS file of each shape above, asserting exit status, the ::error:: lines, the refusal comment, and that no label write or membership probe happens.

  • whitespace-only, yaml-list and yaml-scalar OWNERS → alice is not an approver for any changed file, refusal comment posted, no label write, no membership probe
  • approvers/reviewers/labels not a list of strings → error loading OWNERS files at basesha: Error: OWNERS at OWNERS: <role> must be a list of …, no comment, no label write, no membership probe
  • leave the 0-byte shape out, naming #404, so the test does not pin the current failure as expected

Priority

  • Impact: medium
  • Effort: low

🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: unknown

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

Lingua principale
TypeScript
Stelle
132
Fork
23
Merge medio
1g 20h
PR unite (30g)
134

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.