Repository navigation
Description
Finding
#608 added the GitHub App adapter (src/adapters/app/) and its Node server (src/server/), shipped as a separate ncc bundle (dist-server/index.js, built by npm run pack:server and run by the Dockerfile). vitest.e2e-coverage.config.mjs excludes src/adapters/app/** and src/server/** from the bundle-coverage run with the note "unit coverage holds them to 100%". At main@282b8e0 that is not what the unit run reports:
| file | lines | miss |
|---|---|---|
src/server/main.ts |
0 % | line 3 — the entry point main() call is never executed |
src/server/node.ts |
94.7 % | line 24 — buildReceiver's default background (every test overrides it); branch at line 47, the env.PORT ?? 8080 default |
src/adapters/app/webhook.ts |
100 % lines, 93.75 % branches | line 65 — the String(error) arm when building the platform throws a non-Error |
Separately, nothing executes the server as shipped. __tests__/bundle/ runs the committed dist/index.js end to end and selfContained.test.ts checks its require() list, but dist-server/ is gitignored, test.yml builds it (npm run pack) only after test:coverage, and no test reads or boots it. An ncc-specific breakage in the server bundle (a leaked require, a dynamic import ncc cannot follow, a node: prefix issue in hono / @octokit/auth-app) would pass CI and fail at docker run.
Evidence / provenance
- Unit:
npx vitest run --coverageonmain@282b8e0, local — All files 99.88 / 99.54 / 99.82 / 99.88;src/server/main.ts0 % lines;src/server/node.ts94.73 % lines, 75 % branches;src/adapters/app/webhook.ts93.75 % branches. The run is green because the floor invitest.config.mjsis 99. - End-to-end (bundle):
vitest.e2e-coverage.config.mjscoverage.exclude: ['src/adapters/app/**', 'src/server/**']— these paths are by design absent from the e2e figure, so there is no e2e evidence to combine; this finding uses unit data only. - Shipped bundle:
npm run pack:server(14.7 s locally) produced a self-contained bundle that, copied to a directory with nonode_modules, answered/healthz200, a signedpingwithpong200 and an unsigned one with 401 — i.e. it works today, and nothing pins that.
Recommendation
One PR, cluster src/server/** + src/adapters/app/webhook.ts:65:
-
__tests__/server/main.test.ts— mirror of__tests__/main.test.ts: loading the entry point callsmain()once with no arguments. -
__tests__/server/node.test.ts— withbuildReceiver's defaultbackground, a signed delivery throughbuildAppis answered 202 while its dispatch is still pending. -
__tests__/adapters/app/webhookNonErrorThrow.test.ts—receiveWebhookanswers 400unusable deliveryand logs the thrown value whenappPlatformthrows a non-Error. -
__tests__/server/bundle.test.ts— buildsrc/server/main.tswith ncc into a temp directory outside the repository (so a leakedrequirecannot resolve), boot it there, and check therequire()list, the JSONlistening on :<port>line,/healthz, a signedpingand an unsigned rejection. Building inside the test is what makes it run innpm testandtest:coveragewithout reorderingtest.yml.
Decision taken by hive: the env.PORT ?? 8080 default (node.ts:47) is left unpinned — reaching it means binding port 8080 on the runner, which is not something a unit test should depend on. If the maintainers want the comment in vitest.e2e-coverage.config.mjs to stay true, that arm is the one line that keeps src/server under 100 % branches after the PR.
Priority
- Impact: medium — a new deployment path (Docker image, beta) with its entry point and shipped artifact never executed by any suite
- Effort: low
Filed by quality agent (hold-gated mode)
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: d8f3f5b
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
Activity
github-actions commentedon Oct 29, 2026
Please add a kind label with
/kind feature,/kind failing-testor/kind cleanup.hivecommons-hive commentedon Oct 29, 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] #614's App cron arms landed below the unit floor (cron.ts:85, node.ts:67/82); the e2e config's 'unit holds app/server at 100%' premise has no gate
Finding
vitest.e2e-coverage.config.mjs:45-47excludessrc/adapters/app/**andsrc/server/**from the bundle-coverage run with the note "unit coverage holds them to 100%". Nothing enforces that premise:vitest.config.mjs:22-27carries only a global 99 % floor, and the rest ofsrc/is large enough to absorb whole uncovered arms in the App adapter.#614 (
main@1ce22f0) is the first case.npx vitest run --coverageon that revision (local, 200 files / 2543 tests) reports:src/adapters/app/cron.ts:85String(error)arm of the per-repository error log — a scheduled handler that throws a non-Error is never drivensrc/server/node.ts:82PROW_CRON_INTERVALtick's.catch— no test lets an in-server tick rejectsrc/server/node.ts:67?? 0arm — everystartServertest setsPROW_CRON_INTERVALsrc/server/main.tsEvery other
instanceof Error ? … : String(e)arm insrc/has a named unit driver (auth.test.ts drives it,run.test.ts drives it, …, see thev8 ignorenotes insrc/run.ts:39,src/utils/auth.ts:17), so the App adapter landing without one is a drift from the repository's own convention rather than a new policy question.No end-to-end evidence is claimed for these paths: the bundle run excludes them by design, and that exclusion is exactly what makes the unit floor the only gate.
Recommendation
Drive
cron.ts:85: a scheduled handler that throws a non-Error is reported as[object Object]and counted inreport.failed. (PR follows this issue.)Drive
node.ts:82andnode.ts:67: an in-serverPROW_CRON_INTERVALtick whoserunScheduledJobsrejects (Error and non-Error) is logged as{ level: 'error', event: 'schedule' }and the server keeps serving; onestartServertest withPROW_CRON_INTERVALunset.src/server/**is claimed by held test(server,app): execute src/server's entry point and bundle, pin #614's cron arms, and gate src/adapters/app/** + src/server/** at 100% (main.ts, node.ts:24/67/82, webhook.ts:65, cron.ts:85, vitest.config.mjs) #611 until it merges, so this box waits for that.Make the e2e config's premise a gate — add per-path thresholds to
vitest.config.mjsso the two excluded trees must stay at 100 % (vitestcoverage.thresholdsaccepts glob keys):This can only go green after test(server,app): execute src/server's entry point and bundle, pin #614's cron arms, and gate src/adapters/app/** + src/server/** at 100% (main.ts, node.ts:24/67/82, webhook.ts:65, cron.ts:85, vitest.config.mjs) #611 and the second box land (
main.ts0 % andwebhook.ts:65are test(server,app): execute src/server's entry point and bundle, pin #614's cron arms, and gate src/adapters/app/** + src/server/** at 100% (main.ts, node.ts:24/67/82, webhook.ts:65, cron.ts:85, vitest.config.mjs) #611's), so it is last.Decision taken by hive: per-glob thresholds in the existing
vitest.config.mjsrather than a separate config or a workflow step — additive, no new file, and the workflow directory is out of reach for this agent anyway.Priority
Filed by quality agent (hold-gated mode)
🐝 Hive Agent:
quality| Instance:hosted-available-lke648397-260827-5q9t| SHA:1ce22f0— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
jeefy commentedon Oct 29, 2026
Maintainer note on the coverage-gate direction in #611 (cc @jeefy): per-path 100 % thresholds for
src/adapters/app/**andsrc/server/**mean any future change there fails CI on a single uncovered arm, andsrc/server/worker.ts(#615) is deliberately excluded from unit coverage because it only executes inside workerd. Whether to adopt 100 % gates there, versus the global 99 % floor, is a project call rather than a review call — leaving it open here for a human decision.