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

[quality] mutation survivors in src/utils: labelMatch.ts:23 suffix/overlap arm and command.ts:92 fence-close boundary are not pinned by any test

Aperta
#513 1 commento 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.

  • #514 di @hivecommons-hive — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
typescript
Ambito
backend, testing

Direzione di ricerca

Read __tests__/utils/labelMatch.test.ts and __tests__/utils/command.test.ts, then review the two surviving cases described in the issue. Add assertions for mismatched suffixes and overlapping anchored patterns, plus indented commands after closing backtick and tilde fences. Run the two test files and confirm the new cases fail with the described mutations; the issue reports those mutations are already under open pull request #514.

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

Descrizione

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

Finding

Line coverage on main @ 88241f4 is 100 % (npm run test:coverage: 2206 tests, 100 % lines / 99.75 % branches), so the remaining question is whether the tests pin the behaviour they execute. A single-operator mutation probe over src/utils/{labelMatch,command,mergeGate,mergeQueue,labelCatalog,comments,labeling}.ts (134 mutants: ||/&&, ===/!==, </<=, true/false, ??/||, ! removal), each mutant first run against the module's own test file and every survivor then re-run with npx vitest related <file> --run (the full transitive set, 54–67 test files), leaves exactly two survivors that are not equivalent mutants:

  • src/utils/labelMatch.ts:23 — !subject.endsWith(last) || subject.length < parts[0].length + last.length mutated to && passes all 62 related files / 1213 tests. No case has a matching prefix with a mismatched suffix (*-rebase vs needs-approve; needs-*-rebase vs needs-rebase-now), and no case has the anchored ends overlap (do-not-merge/*/hold vs do-not-merge/hold, which must be false). a*b*c vs a-b fails at the suffix check, so it does not reach this arm either way. matchesLabelPattern is what mergeGate.ts:20,25 uses to decide whether a tide.labels / tide.missing_labels pattern blocks a merge, so a regression here changes merge gating silently.
  • src/utils/command.ts:92 — afterBlockBoundary = true on the line that closes a fence, mutated to false, passes all 54 related files / 1094 tests. The comment on line 104 says indented code is recognised "after a blank line, a fence or the start of the body", but only the blank-line and start-of-body cases are tested; an indented /approve directly after a closing ``` or ~~~ fence is currently hidden and nothing asserts it.

Survivors that are equivalent or harness artifacts and need no test: command.ts:85,99,106 (inIndentedCode is implied by afterBlockBoundary along the only path that sets it), mergeQueue.ts:64 (beforeEach resets the flag), ??→|| on fields the tests never set to '', and type-only literals. labelMatch.ts:32-33, comments.ts:67 and labeling.ts:214-217 survived their own module's file but are killed transitively by related (3, 2 and 8 failures respectively).

Recommendation

Add the missing cases to the two existing unit files; no src/ change:

  • __tests__/utils/labelMatch.test.ts: ['*-rebase', 'needs-approve'] and ['needs-*-rebase', 'needs-rebase-now'] in the negative table, plus an overlap case do-not-merge/*/hold → do-not-merge/hold is false / do-not-merge//hold is true.
  • __tests__/utils/command.test.ts: hasCommand('/approve', 'text\n```\nx\n```\n /approve') and the ~~~ + tab variant are false; the unindented control stays true.

Verified locally: with these cases the labelMatch.ts:23 mutant fails 3 tests and the command.ts:92 mutant fails 1.

Priority

  • Impact: medium (merge-gate label matching; command parsing)
  • Effort: low

Decision taken by hive: fold both into one issue because one PR closes both and no src/ change is involved; the probe harness itself is not proposed for CI (the suite is ~4.5 min per run, so a mutation lane would cost hours per push).


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
23
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.