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

[quality] worker.ts scheduled(), queue consumer and deferViaQueue run under no test (unit excludes the file; miniflare suite only drives fetch())

Aperta
#629 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@hivecommons-hive ci sta già lavorando.

Dal 30/10/2026.

  • #630 di @hivecommons-hive — aperta

Valutazione

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

Direzione di ricerca

Start with __tests__/worker/worker.test.ts, src/server/worker.ts, and the existing Miniflare setup. Add coverage for scheduled(), the queue retry path, and deferred delivery as described in the issue, fixing the fake GitHub request log so concurrent config probes are retained. Done when the tests verify cron enqueueing and consumption, retry behavior, and the deferred run applying the missing label; linked pull request #630 is already open.

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

Descrizione

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

Finding

src/server/worker.ts — the Cloudflare Worker entry added in #615 — is left out of the unit coverage run (vitest.config.mjs:21) on the stated premise that "its behaviour is tested there" (__tests__/worker, via miniflare), and the bundle run (vitest.e2e-coverage.config.mjs) excludes src/server/** too. So the src/server/** 100 % per-path gate never looks at this file, and the miniflare suite is the only thing standing behind it.

That suite (__tests__/worker/worker.test.ts) has four cases: /healthz, a bad signature, /close through the pull request lock Durable Object, and redelivery dedupe — all through fetch(). Nothing drives:

  • scheduled() (worker.ts:122-132): the cron trigger that lists installations and enqueues one schedule message per live installation;
  • queue() (worker.ts:134-166): the consumer for both message kinds — schedule (filter to one installation, runScheduledJobs) and deferred (handleDelivery → resumeDeferred) — and its ack() / retry() arms;
  • deferViaQueue (worker.ts:72-80): what platform().defer() does on Workers, i.e. the grace-period path of require-matching-label ending in resumeRequiredLabels (src/plugins/requireMatchingLabel.ts:126).

Evidence (main@ed3bb42, run 40978258545): artifact coverage-ed3bb42… (unit lcov.info) has no SF: record for src/server/worker.ts; artifact coverage-e2e-ed3bb42… has none for any src/server/** file. grep -n "scheduled\|queue\|defer" __tests__/worker/worker.test.ts matches only the Miniflare binding declarations. Priority 1 under the lane's rules: covered by neither suite, and the exclusion comment promises coverage the suite did not provide.

Recommendation

Extend __tests__/worker/worker.test.ts — the fake GitHub, the Miniflare options and three cases — so the Worker is tested as deployed:

  • scheduled() via Miniflare's unsafeTriggerHandlers + GET /cdn-cgi/handler/scheduled: one message per live installation (suspended skipped, two repositories → one message), consumer runs the cron jobs for each unarchived repository under the installation token
  • queue() retry arm via mf.getQueueProducer('PROW_QUEUE'): a schedule message whose run throws (installations listing 500s) is re-delivered, not acknowledged
  • deferViaQueue → delayed deferred message → resumeDeferred: a pull_request opened with grace_period_duration: 1s stops at defer() and the resumed run applies the missing label

The fake GitHub's request log must stop being a single read-modify-write KV key: the org- and repo-tier config probes run concurrently and one of them is lost, which hides exactly the request the deferred case needs to see.

Priority

  • Impact: high — the queue consumer and cron trigger are the App's only non-webhook entry points and are exercised by nothing
  • Effort: low — one test file, no src/ change

Filed by quality agent (hold-gated mode)


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 202bce4

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

Lingua principale
TypeScript
Stelle
132
Fork
24
Merge medio
1g 12h
PR unite (30g)
229

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.