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

[quality] prefixed.ts: /stage and /status exclusive replacement, two-value /remove-lifecycle, mixed-case allowlist values and the first protected offender survive mutation

Chiusa Adatta ai principianti
#538 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@hivecommons-hive ci sta già lavorando.

Dal 20/10/2026.

  • #539 di @hivecommons-hive — aperta

Valutazione

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

Direzione di ricerca

Inizia con __tests__/label/lifecycle.test.ts e __tests__/label/label.test.ts; leggi i casi esistenti dei comandi ed esegui i test Vitest correlati. Aggiungi i casi indicati che rilevano le mutazioni per la sostituzione esclusiva di /stage e /status, la rimozione di più etichette del ciclo di vita, i valori della allowlist con maiuscole e minuscole miste e la segnalazione della prima etichetta protetta. Il lavoro è completato quando ogni caso verifica le chiamate API richieste o il messaggio di rifiuto e i test correlati passano.

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

Descrizione

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

Finding

src/labels/prefixed.ts is 100 % line- and branch-covered by npm run test:coverage and by npm run test:coverage:e2e on main @ 88241f4. A single-operator mutation probe over the file (59 mutants: ===/!==, &&/||, ??/||, .some/.every, .filter/.map, .find/.findLast, .toLowerCase() removal, exclusive: true→false, new Set removal, comparison bounds) still left six non-equivalent survivors against npx vitest related src/labels/prefixed.ts --run (49 files / 722 tests):

line mutant behaviour nothing asserts
32 /stage registry entry exclusive: true → false /stage beta on an issue carrying stage/alpha must DELETE stage/alpha before POST stage/beta. Only /lifecycle (__tests__/label/lifecycle.test.ts) and /priority (__tests__/label/priority.test.ts) have a replacement case; /stage is only ever added to a label-less issue.
33 /status registry entry exclusive: true → false same for /status in-review over status/in-progress
136 present = currentLabels.filter(label => labels.some(…)) → .every(…) /remove-lifecycle stale frozen with both labels on the issue must delete both. Every /remove-<cmd> case in the suite names a single value, so some and every agree.
239 new Map(allowed.map(value => [value.toLowerCase(), value])) → [value, value] An allowlist value written Frozen in the yaml must match the comment /lifecycle frozen and apply lifecycle/Frozen. Every fixture allowlist is lower-case, so the key fold never decides.
266 sameLabel: a.toLowerCase() === b.toLowerCase() → a === b.toLowerCase() With the yaml value Frozen and lifecycle/frozen on the issue, /lifecycle frozen must not treat the existing label as stale, and /remove-lifecycle frozen must delete it. The existing casing tests (kind.test.ts, help.test.ts) vary the issue side only, so the requested side is always already lower-case.
255 labels.find(isProtectedLabel) → .findLast(…) /label hold lgtm must name hold, the first protected label, in the refusal. The existing refusals each carry one protected label.

Equivalent, not actionable: line 54 protectedPrefixes.some→.every (one prefix in the array), line 102 cmd.prefix.toLowerCase() removal (registry prefixes are lower-case and dynamic ones pass labelCommandName), line 106 stale.length > 0→>= 0 (removeLabels([]) makes no call), line 221 ?? false→|| false (the operand is boolean | undefined), lines 88/124 required: true→false (getInput is stubbed).

Recommendation

Add to __tests__/label/lifecycle.test.ts:

  • an it.each with /stage beta over stage/alpha and /status in-review over status/in-progress, asserting ['DELETE <stale>', 'POST <label>']
  • /remove-lifecycle stale frozen with both on the issue → two DELETEs
  • a with a mixed-case yaml value block (lifecycle:\n - Frozen\n): /lifecycle frozen → POST lifecycle/Frozen; the same with lifecycle/frozen already present → POST only, no DELETE; /remove-lifecycle frozen → DELETE lifecycle%2Ffrozen

Add to __tests__/label/label.test.ts › protected labels: /label hold lgtm refused with label: hold is managed by its own command.

Test-only; no src/ or dist/ change. Disjoint from the open held PRs #510–#537: none touches __tests__/label/lifecycle.test.ts, __tests__/label/label.test.ts or src/labels/prefixed.ts (#512 edits __tests__/label/remove.test.ts only).

Evidence

  • unit: npm run test:coverage → 100 / 99.75 / 100 / 100 (main @ 88241f4, local run, 163 files / 2206 tests); prefixed.ts 100 % lines, no zero-hit branch
  • e2e: npm run test:coverage:e2e → 99.96 / 98.79 / 100 / 99.95 (same revision, local run); prefixed.ts 100 % lines, no zero-hit branch (the two reports come from different transforms and are analysed separately)
  • probe: each mutant applied in turn to src/labels/prefixed.ts, npx vitest related src/labels/prefixed.ts --run → 722 passed for all six; with the recommended cases each mutant fails at least one test

Priority

  • Impact: medium — exclusive is what makes /stage and /status single-valued; a regression there stacks stage/alpha and stage/beta on the same issue with the suite green
  • 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 17h
PR unite (30g)
219

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.