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

[quality] trigger.ts: /test matches workflow names and paths case-insensitively, /ok-to-test honours an existing label in any case, and the non-PR arm of /test and /ok-to-test leaves the run green — none of it is asserted

Aperta Adatta ai principianti
#523 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@hivecommons-hive ci sta già lavorando.

Dal 19/10/2026.

  • #524 di @hivecommons-hive — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
github-actions, typescript
Ambito
ci-cd, testing

Direzione di ricerca

Leggi __tests__/issueCommentTest/trigger.test.ts insieme a src/issueComment/trigger.ts, poi esegui i test Vitest pertinenti. Aggiungi i casi consigliati per nomi di workflow e percorsi senza distinzione tra maiuscole e minuscole, un’etichetta esistente con maiuscole e minuscole miste e comandi non relativi alle PR che mantengono verde l’esecuzione. Il lavoro è completato quando queste asserzioni rilevano le mutazioni sopravvissute elencate; l’issue richiede modifiche solo ai test.

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

Descrizione

agent/quality needs-kind stage/040-covered-by-pr testing

Finding

src/issueComment/trigger.ts is 100 % line- and branch-covered by npm run test:coverage and all but one branch (statusOf, line 323) by npm run test:coverage:e2e on main @ 88241f4. A single-operator mutation probe over the file (117 mutants: ===/!==, &&/||, ??/||, comparison bounds, .some/.every, .toLowerCase() removal, true/false, ++/--, continue/break, status codes) still left five non-equivalent survivors against npx vitest related src/issueComment/trigger.ts --run (43 files / 837 tests):

line mutant behaviour nothing asserts
272 (run.name ?? '').toLowerCase() === arg → (run.name ?? '') === arg /test e2e must match a workflow whose display name is E2E even when its file (end-to-end.yml) does not. The existing /test CI case passes through the lowercase fixture path ci.yml, so the name comparison is never the deciding arm.
275 run.path.toLowerCase() → run.path /test lint-checks must match .github/workflows/Lint-Checks.yml. Every fixture path is already lowercase.
121 label.toLowerCase() === okToTestLabel → label === okToTestLabel A pull request already carrying OK-To-Test must not have the label re-added, and with nothing pending gets the "No workflow runs waiting" comment rather than a rocket. Only the exact-case label is tested.
72 /test: cmd === undefined → cmd === null /test on a plain issue comments "only applies to pull requests" and leaves core.setFailed uncalled. The /retest sibling test asserts both; the /test and /ok-to-test ones assert only the comment, so a thrown TypeError after the comment goes unnoticed.
113 /ok-to-test: same same

Equivalent survivors, not actionable: count-- in rerunEach (only === 0 is observed), current === null in headRuns (GITHUB_WORKFLOW is always set in Actions), ??→|| on empty-string folds, and type-annotation undefined→null.

Recommendation

Add to __tests__/issueCommentTest/trigger.test.ts:

  • /test › an it.each with E2E/end-to-end.yml under /test e2e and Lint/Lint-Checks.yml under /test lint-checks, asserting the re-run and that no listing comment is posted.
  • /ok-to-test › the label-already-present case with { name: 'OK-To-Test' }.
  • /test and /ok-to-test › extend the "only applies to pull requests" tests with a setFailed spy asserted not called (and, for /test, the exact calls list; for /ok-to-test, that the runs endpoint is not read).

Test-only; no src/ or dist/ change. Disjoint from the open held PRs #510–#522 (auth, contributing, remove, command/labelMatch, sweep, tide, requireMatchingLabel, approve).

Evidence

  • unit: npm run test:coverage → 100 / 99.75 / 100 / 100 (main @ 88241f4, local run)
  • e2e: npm run test:coverage:e2e → 99.96 / 98.79 / 100 / 99.95 (same revision, local run; the two reports are produced by different transforms and are not merged, as vitest.e2e-coverage.config.mjs documents)
  • probe: each mutant applied in turn to src/issueComment/trigger.ts, npx vitest related src/issueComment/trigger.ts --run → 837 passed for all five

Priority

  • Impact: medium — /test is the user-facing re-run command; case-insensitive matching is what makes /test ci work for a workflow named CI in a file not named ci.yml
  • Effort: low

Filed by quality agent (hold-gated mode)


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

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

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

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.