[quality] approve.ts: ten mutation survivors — any-Bot /approve, user-token bot review, require_self_approval break, approver sort, label casing, isBot notifier match
I maintainer di solito rispondono entro 2 giorni
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
Direzione di ricerca
Leggi src/plugins/approve.ts e i test esistenti in __tests__/plugins/approve.test.ts e __tests__/plugins/approveEvents.test.ts. Aggiungi i casi elencati nella raccomandazione per i commenti dei bot e delle persone, l’ordine delle auto-approvazioni, l’ordinamento degli approvatori, la corrispondenza dei notifier e le maiuscole e minuscole delle label. Esegui i file di test indicati e conferma che tutti e dieci i comportamenti che prima non erano ancora coperti sono ora coperti dai test e che la suite passa.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Finding
A single-operator mutation probe over src/plugins/approve.ts on main@88241f4 (123 mutants, each run against __tests__/plugins/{approve,approveErrorPaths,approveEvents,approveReview}.test.ts + __tests__/issueCommentTest/approve.test.ts, survivors re-run against the full npx vitest related src/plugins/approve.ts set: 46 files / 920 tests) leaves ten non-equivalent survivors. Line coverage is 100% for this file in both the unit run (npm run test:coverage: 163 files / 2206 tests, 100 % lines / 99.75 % branches) and the bundle e2e run (npm run test:coverage:e2e: 83 files / 502 tests, approve.ts 100 % lines), so this is an assertion-strength gap, not a coverage gap.
| # | site | mutant that survives | behaviour the suite does not pin |
|---|---|---|---|
| 1 | approvalEvents approve.ts:118 |
login === undefined || submitted_at == null → && |
With a user token (tokenLogin set), a Bot's APPROVED review and a pending (submitted_at: null) review must still be skipped. Today the bot case only passes because login === tokenLogin is undefined === undefined in every test. |
| 2 | humanLogin approve.ts:144 |
user.login === '' || user.type === 'Bot' → && |
A comment whose user.login is '' must yield no event. |
| 3 | humanLogin approve.ts:144 |
user.type === 'Bot' || login === 'github-actions[bot]' → && |
Any Bot user's /approve (e.g. renovate[bot]) must be ignored, not just github-actions[bot]. Only the latter is ever used in the suite. |
| 4 | computeApproval approve.ts:172 |
continue → break |
With require_self_approval, skipping the author's own event must not stop later events: the suite always puts the author's event last. |
| 5 | computeApproval approve.ts:191 |
drop .sort() on per-file approvers |
coveredFiles approver lists are documented "sorted"; every test approves in alphabetical order already. |
| 6 | computeApproval approve.ts:213 |
drop .sort() on approvers |
Same for the PR-level approvers set (drives the notifier's "approved by" order). |
| 7 | syncLabel approve.ts:396 |
drop .toLowerCase() |
An existing Approved label (any casing) must count as present; otherwise approved is re-added. |
| 8–10 | isBot approve.ts:430 |
===→!== (both sides), ||→&& |
The notifier is found by `user.type === 'Bot' |
Equivalent / not worth pinning (recorded for the next probe so it is not re-derived): :202 debug text, :208 &&→|| (author in approving already covers every file they could be suggested for), :243 size > 0 → >= 0 (loop exits on coverage.size === 0), :347 sort of a union of identical per-OWNERS lists, :400 removeLabels([]) is a no-op, :416 .trim() either side.
Recommendation
Add six cases to __tests__/plugins/approve.test.ts (approvalEvents with a tokenLogin; any-Bot and empty-login comments; require_self_approval author-first ordering; non-alphabetical approval order across one and two files) and four to __tests__/plugins/approveEvents.test.ts (another App's bot notifier is patched; a human quoting the marker is not; Approved label casing). Each of the ten mutants then fails at least one test; the whole set stays green on main.
Priority
- Impact: medium (3 and 8–10 are authorization/idempotency behaviour of the approve plugin; the rest are ordering/idempotency contracts the docs promise)
- Effort: low
Decision taken by hive: pin behaviour with tests only; no production change.
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
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cncf/prow-github-actions
-
[quality] approveReview.ts: a PAT that is not the author never has its review submission asserted, and withdrawalReason's five-file bound, lgtm skip, user casing and withdrawer order are unpinnedForse già presa @hivecommons-hive l’ha presa oggi. Apertaagent/quality needs-kind stage/040-covered-by-pr testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
cncf/prow-github-actions#526 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
[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 assertedForse già presa @hivecommons-hive l’ha presa 1 giorno fa. Apertaagent/quality needs-kind stage/040-covered-by-pr testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
cncf/prow-github-actions#523 · 4 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
[quality] mutation survivors in src/plugins/requireMatchingLabel.ts: the withGracePeriod default, the graceMs > 0 guard, isBot's || and the no-rule debug text are not pinned by any testForse già presa @hivecommons-hive l’ha presa 1 giorno fa. Apertaagent/quality needs-kind stage/040-covered-by-pr testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
cncf/prow-github-actions#519 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
[quality] tide.ts: six mutation survivors in the merge-queue gate, draft refusal, fork-403 workflow-file diagnosis and getPull's fork flag are unpinned by any testForse già presa @hivecommons-hive l’ha presa 1 giorno fa. Apertaagent/quality needs-kind stage/040-covered-by-pr testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
cncf/prow-github-actions#517 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
[quality] coverage-e2e names auth.ts:24 as the only uncovered line on main; getErrorDetails' non-object arm is unreachable through dist/ (Octokit always rejects a RequestError)Forse già presa @hivecommons-hive l’ha presa 1 giorno fa. Apertaagent/quality hive/partially-addressed hive/verified-open needs-kind stage/040-covered-by-pr testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
cncf/prow-github-actions#507 · 5 commenti ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di cncf/prow-github-actions
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
getsentry/sentry-conventions#732 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
status:in-linear status:team-assigned team:nodes
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
n8n-io/n8n#41548 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
motiondivision/motion#3955 ·
I maintainer di solito rispondono entro 1 giorno
-
DQ assisgnment closing at CRApertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
equinor/prisma-decision-web#919 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 83/100