Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#629 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

@hivecommons-hive ya está trabajando en esto.

Desde el 30/10/2026.

  • #630 de @hivecommons-hive — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
typescript
Área
backend, testing

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
TypeScript
Estrellas
132
Forks
24
Merge medio
1 d 12 h
PR fusionados (30 d)
229

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de cncf/prow-github-actions

Todos los issues de cncf/prow-github-actions

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.