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

[quality] e2e coverage report's repository-escape guard has no test

Chiusa Adatta ai principianti
#970 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
89/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, node.js, playwright

Direzione di ricerca

Leggi tests/tools/e2e-coverage-report.mjs:196-200 e i casi correlati in tests/e2e-coverage-report.test.mjs:709 e :848. Crea il fixture descritto con src come symlink al di fuori della radice del fixture, quindi esegui node --test tests/e2e-coverage-report.test.mjs. È completato quando il test asserisce /source map source escapes repository/ e le righe di guardia sono coperte.

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

Descrizione

agent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5n31 quality testing

Finding

tests/tools/e2e-coverage-report.mjs is the tool that converts Playwright V8 coverage
into src/** line attribution. It contains three layered containment guards that stop a
malicious or malformed source map from pulling file contents in from outside the
repository. One of them — the repository-escape guard — has no test:

tests/tools/e2e-coverage-report.mjs:196-200

if (!isInside(rootPath, resolvedSource)) {
  throw new Error(
    `source map source escapes repository: ${sourceFile.relative}`,
  );
}

Its two siblings are already pinned: tests/e2e-coverage-report.test.mjs:709
(rejects symlinked maps, bundles, and sources) and :848
(rejects a nominal src symlink to an unrelated repo file) both assert
/source map source escapes src directory/. Nothing asserts
/source map source escapes repository/.

The guard is reachable, not dead code. It fires when src itself is the symlink:
srcRootPath = await realpath(srcRoot) then resolves to the outside directory, so the
isInside(srcRootPath, resolvedSource) check at :185-189 is satisfied and only the
repository check at :196 sees the escape. Untested, a refactor can delete it silently
and the tool will happily read and embed file contents from outside the checkout into a
published coverage artifact.

Evidence

Unit evidence — npm run test:unit:coverage (node --test coverage, TZ=UTC,
node v26.8.1) run locally on 2026-10-02 at 0c87310:

tests/tools/e2e-coverage-report.mjs | 97.32 | 89.49 | 133-134 180-183 197-200 598-602 | ...

Lines 197-200 are the guard body. Adding one test moves the file to
98.03 | 89.83 and leaves 197-200 covered.

End-to-end evidence — not applicable. This file is build tooling executed by the
End-to-end coverage (non-gating) CI job; it is never loaded in the browser, so it
cannot appear in the Playwright V8 coverage artifact. Confirmed against the
e2e-coverage artifact (id 11211344262) of run
https://github.com/cncf/endusers/actions/runs/36972418667 (report.txt, run
36972418667-1, status passed), whose file list is src/** only. This is therefore
a unit-only gap and carries no e2e dimension.

Why this matters now

Repository region coverage is 94.90% against the --check-regions 94 floor enforced by
npm run test:unit:coverage:check. tests/tools/e2e-coverage-report.mjs at 89.49%
regions is the single largest drag on that margin.

Recommendation

Add one test to tests/e2e-coverage-report.test.mjs that builds a fixture whose src
is a symlink to a directory outside the fixture root, and assert
collectE2ECoverage rejects with /source map source escapes repository/.

Completion criteria

  • a test asserts /source map source escapes repository/
  • node --test tests/e2e-coverage-report.test.mjs passes
  • tests/tools/e2e-coverage-report.mjs lines 196-200 are covered

Priority

  • Impact: medium
  • Effort: low

Filed by quality agent (hold-gated mode)


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5n31 | SHA: 0c87310

— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88

Lingua principale
JavaScript
Stelle
0
Fork
2
Merge medio
17h 48m
PR unite (30g)
553

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

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/endusers

Tutte le issue di cncf/endusers

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.