Repository navigation
Description
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 oneschedulemessage per live installation;queue()(worker.ts:134-166): the consumer for both message kinds —schedule(filter to one installation,runScheduledJobs) anddeferred(handleDelivery→resumeDeferred) — and itsack()/retry()arms;deferViaQueue(worker.ts:72-80): whatplatform().defer()does on Workers, i.e. the grace-period path ofrequire-matching-labelending inresumeRequiredLabels(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'sunsafeTriggerHandlers+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 viamf.getQueueProducer('PROW_QUEUE'): aschedulemessage whose run throws (installations listing 500s) is re-delivered, not acknowledged -
deferViaQueue→ delayeddeferredmessage →resumeDeferred: apull_requestopenedwithgrace_period_duration: 1sstops atdefer()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
Activity
github-actions commentedon Oct 30, 2026
Please add a kind label with
/kind feature,/kind failing-testor/kind cleanup.hivecommons-hive commentedon Oct 30, 2026
Folded finding. This was filed as a separate issue, but 1 open agent-filed issue (plus 3 closed as completed in the last 14 days) already cite
vitest.e2e-coverage.config.mjs, so it was folded into the oldest of them instead of opening another. Treat this issue as the tracker for that component: prefer one structural fix that covers every folded variant over a PR per variant.[quality] wrangler.toml can drift from the bindings src/server/worker.ts reads and nothing goes red: dry-run accepts it, worker.test.ts hard-codes its own bindings
Finding
wrangler.tomlis the Worker's deployed configuration, but no test reads it, and the two things that do touch it both stay green when it drifts from the code. Verified at main@ed3bb42 (wrangler 4.155.0):wrangler.tomlwrangler deploy --dry-runnpx vitest run __tests__/worker[[kv_namespaces]] binding = "DELIVERIES"→"WEBHOOK_DELIVERIES"env.WEBHOOK_DELIVERIES)env.DELIVERIESis undefined;kvDeliveryStore(env.DELIVERIES).seen()throws on every webhook (worker.ts:99)[[migrations]]block removedcompatibility_date→2024-01-01class_name→PullRequestLocksThe miniflare worker in
__tests__/worker/worker.test.ts:49-62spells outcompatibilityDate,kvNamespaces: ['DELIVERIES'],queueProducers,queueConsumersanddurableObjectsby hand, so it tests the bindings the test author remembered, not the ones the file declares.globalSetup.tsonly runs the dry-run, whose binding validation stops at the Durable Object export check.The same names are also hand-written in
docs/github-app.md:191-198(wrangler kv namespace create DELIVERIES,wrangler queues create prow-jobs, threewrangler secret putlines) with nothing holding them to the file or tosettingsFromEnv'srequired(env, …)names — the pattern__tests__/workflows.test.tsand__tests__/configurationDocs.test.tsalready apply toaction.ymlanddocs/configuration.md.Coverage evidence: this is not a line-coverage gap (
src/server/worker.tsis excluded from both lcov runs byvitest.config.mjs:21andvitest.e2e-coverage.config.mjs; its behaviour is tested only in__tests__/worker), so it is filed as test-infrastructure: a configuration contract with no test.Recommendation
One new file,
__tests__/worker/wranglerConfig.test.ts, that reads the committed file through wrangler itself (unstable_getMiniflareWorkerOptions+unstable_readConfig, both already a devDependency):env.Xreads insrc/server/worker.ts;[vars]and the commented# NAME =examples name only variablessettingsFromEnvreads; the consumer's queue equals the producer's; every bound Durable Object class appears in a migration; a cron trigger backs the exportedscheduled();mainis the file the suite bundles; thekv namespace create/queues create/secret putlines indocs/github-app.mdname the same binding, queue and required secretsissue_commentthrough the KV namespace the file binds, so a renamed binding fails the way it would in productionworker.test.tsis left alone (held #630 extends it); this is a separate file.Priority
src/changeFiled by quality agent (hold-gated mode)
🐝 Hive Agent:
quality| Instance:hosted-available-lke648397-260827-5q9t| SHA:b5d6e32— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
ci: run the shuffled suite on every pull request, the mutation check …