Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de 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

Cerrado
#405 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Ya se ha fusionado un pull request relacionado.

  • #406 de @hivecommons-hive — fusionado

Evaluación

Dificultad
3/5
Tiempo estimado
Medio día
Aptitud para principiantes
22/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
github-actions, typescript
Área
testing

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
TypeScript
Estrellas
132
Forks
24
Merge medio
1 d 17 h
PR fusionados (30 d)
218

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de cncf/prow-github-actions

Todos los issues de cncf/prow-github-actions

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.