[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 test
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
Inizia da __tests__/plugins/tideMergeQueue.test.ts e __tests__/plugins/tide.test.ts, poi leggi i punti decisionali citati in src/plugins/tide.ts e i test esistenti che li riguardano. Aggiungi un test mirato per ciascuna delle sei lacune nelle asserzioni elencate, seguendo i casi proposti nell’issue. Il lavoro è completo quando questi test falliscono con i mutanti descritti e passano con l’implementazione attuale.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Finding
src/plugins/tide.ts is at 100 % lines and 100 % branches under the unit suite (npm run test:coverage, main@88241f4: All files 100 | 99.75 | 100 | 100, no zero-hit BRDA for tide.ts in coverage/lcov.info), so coverage can no longer say which of its decisions the tests actually pin. A 50-mutant single-site probe of tide.ts (operator/constant/guard mutations, each run against npx vitest related src/plugins/tide.ts --run, 60 files / 1166 tests) found 8 survivors. Six are real assertion gaps in the automerge path:
| # | Site | Mutant that passes the suite | Why it matters |
|---|---|---|---|
| 1 | tide.ts:188 tide.merge_queue === 'auto' ? await queueState(...) : undefined |
always call queueState |
merge_queue: off must not issue a GraphQL query. queueState swallows a failed read with one core.warning and falls back to a direct merge, so the two existing merge_queue: off tests in tideMergeQueue.test.ts (which rely on "no /graphql handler would fail the test") do not actually detect the call. |
| 2 | tide.ts:71 queueRefusedStates = new Set(['dirty', 'draft']) |
drop 'draft' |
Every existing draft case also sets draft: true, which blockedReason catches first; a payload with no draft field (getPull defaults it to false) and mergeable_state: draft is the only path to this entry, and nothing drives it, so a queue-mode PR in that shape would be enqueued. |
| 3 | tide.ts:415 blockedReason: if (pr.draft) return 'not mergeable (draft)' |
delete the branch | Same redundancy from the other side: with mergeable_state: 'draft' the later state check produces the same reason string. The observable difference is that a draft with an unknown state must be refused without the 7 s retry loop; no test pins the no-retry behaviour. |
| 4 | tide.ts:280 workflowFiles: path.startsWith('.github/workflows/') |
path.includes(...) |
A fork 403 diagnosis would count docs/.github/workflows/x.yml or templates/.github/workflows/prow.yml (this repository ships the latter) as workflow files and post the "token may not merge it" comment instead of surfacing the failure. |
| 5 | tide.ts:285 fileList: paths.length > 5 |
>= 5 |
Exactly five workflow files would be reported as "… and 0 more". The only existing test uses seven. |
| 6 | tide.ts:437 getPull: fork: head.repo?.full_name !== undefined && head.repo.full_name !== base.repo?.full_name |
drop the !== undefined guard |
A head whose repository was deleted (head.repo: null) is currently read as not a fork; nothing pins that, so the 403 diagnosis/compare path could silently start running for it. |
Two further survivors are domain-equivalent and are not proposed for tests: getPull state === 'open' → !== 'closed' and tideOnComment issue.state !== 'open' → === 'closed' only differ for a state GitHub never emits.
The other 42 mutants (state sets, event-action filters, hopeless conclusions, retry predicate, once, lgtm binding, sha pinning on both paths, 405/409/403 handling, dequeue guards, enqueue result shapes, loadTide defaults, the failure threshold) were all killed.
Recommendation
Add the killing cases to the two files that already own this ground, one it per site, named after the behaviour it pins:
-
__tests__/plugins/tideMergeQueue.test.ts: serve/graphqlwith the call counter in bothmerge_queue: offtests and assertcallsis empty andcore.warningis not called (site 1); add "a pr without a draft field whosemergeable_stateis draft is refused, not enqueued" (site 2). -
__tests__/plugins/tide.test.ts: "does not wait for an unknown state on a draft pr" — one GET, nosleep(site 3); in the fork-403 describe, "a nested.github/workflows/copy is not a workflow file" (site 4) and "exactly five workflow files are all listed" (site 5); ingetPull, "a head whose repository is gone is not a fork" (site 6).
No production change. Disjoint from the open held PRs (#510 auth.ts, #511 contributing.md, #512 remove.test.ts, #514 labelMatch/command tests, #516 sweep.test.ts).
Evidence / provenance
- Unit:
npm run test:coverageon main@88241f4, local — 163 files / 2206 tests, 100 / 99.75 / 100 / 100; tide.ts has no uncovered line or branch. - Mutation: 50 single-site mutants of
src/plugins/tide.ts, each run againstnpx vitest runof the five direct tide test files (16 s each); the 8 survivors re-run against the fullnpx vitest related src/plugins/tide.ts --runset (60 files / 1166 tests) on a clean checkout — all 8 still pass. - e2e: the bundle harness exercises
dist/index.js, which asrc/mutation does not change withoutnpm run pack; it was not evaluated per mutant and nothing here claims an e2e gap.
Priority
- Impact: medium (automerge decisions; every mutant above is a silent behaviour change in the merge/enqueue path)
- Effort: low (two test files, ~70 lines)
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] approve.ts: ten mutation survivors — any-Bot /approve, user-token bot review, require_self_approval break, approver sort, label casing, isBot notifier matchForse 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#521 · 1 commento ·
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] 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