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

[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

Aperta Adatta ai principianti
#517 2 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.

  • #518 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
devtools, testing

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

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

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 /graphql with the call counter in both merge_queue: off tests and assert calls is empty and core.warning is not called (site 1); add "a pr without a draft field whose mergeable_state is 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, no sleep (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); in getPull, "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:coverage on 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 against npx vitest run of the five direct tide test files (16 s each); the 8 survivors re-run against the full npx vitest related src/plugins/tide.ts --run set (60 files / 1166 tests) on a clean checkout — all 8 still pass.
  • e2e: the bundle harness exercises dist/index.js, which a src/ mutation does not change without npm 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

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.