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

[quality] src/server (GitHub App server) is never executed: entry point at 0 % lines, default background arm unpinned, dist-server bundle never built-and-run by any test

Cerrado
#610 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Ya se ha fusionado un pull request relacionado.

  • #611 de @hivecommons-hive — fusionado

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
node.js, typescript
Área
backend, testing

Línea de trabajo

Read the existing tests in __tests__/main.test.ts and inspect src/server/main.ts, src/server/node.ts, and src/adapters/app/webhook.ts. Add the four tests described in the issue, including building and booting the ncc bundle in a temporary directory. Run npm test and test:coverage; done means the server entry point, default background behavior, non-Error throw path, and shipped bundle are exercised.

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

#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 --coverage on main@282b8e0, local — All files 99.88 / 99.54 / 99.82 / 99.88; src/server/main.ts 0 % lines; src/server/node.ts 94.73 % lines, 75 % branches; src/adapters/app/webhook.ts 93.75 % branches. The run is green because the floor in vitest.config.mjs is 99.
  • End-to-end (bundle): vitest.e2e-coverage.config.mjs coverage.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 no node_modules, answered /healthz 200, a signed ping with pong 200 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 calls main() once with no arguments.
  • __tests__/server/node.test.ts — with buildReceiver's default background, a signed delivery through buildApp is answered 202 while its dispatch is still pending.
  • __tests__/adapters/app/webhookNonErrorThrow.test.ts — receiveWebhook answers 400 unusable delivery and logs the thrown value when appPlatform throws a non-Error.
  • __tests__/server/bundle.test.ts — build src/server/main.ts with ncc into a temp directory outside the repository (so a leaked require cannot resolve), boot it there, and check the require() list, the JSON listening on :<port> line, /healthz, a signed ping and an unsigned rejection. Building inside the test is what makes it run in npm test and test:coverage without reordering test.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

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.