pg-boss 12 won't compile, and its schema migration needs checking

Abierto
#19 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
58/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
bun, typescript

Línea de trabajo

Start with the pg-boss 11 and 12 release notes, then inspect packages/jobs/src/index.ts and packages/jobs/src/index.test.ts; check the constructor, schedule, and work options against the v12 docs. Run bun run typecheck and bun test packages/jobs, then test upgrading a dev instance with a scheduled job from version 10 and document whether it runs after restart. Done means the migration behavior is understood and recorded in the PR.

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

Descripción

dependencies help wanted javascript

Dependabot's #15 moves pg-boss from 10.4.2 to 12.40.0, two majors in one step. It doesn't compile at d3f9dcc0, and compiling is the easy half.

The import changed: version 12 has no default export, so import PgBoss from "pg-boss" becomes import { PgBoss } from "pg-boss". With the class unresolved, the error handler and several test callbacks lose their types too (TS7006 on err and s).

Where

  • packages/jobs/src/index.ts:3 (the import) and :163 (boss.on("error", …))
  • packages/jobs/src/index.test.ts:54, :62, :66, :226

What to change

  1. Switch to the named import and let the types come back.
  2. Read pg-boss's release notes for 11 and 12 before you go further. pg-boss migrates its own schema when it starts, and every Sentrello install runs that migration the first time it boots the new version. We need to know what it does to queued and scheduled jobs on a running instance, and the PR should say so in its description.
  3. Check every option we pass to new PgBoss(…), schedule and work against the 12 docs. An option that was renamed won't always fail the typecheck, so read rather than trust the compiler.

This one isn't a quick fix, and I'd rather it went slowly and right. If you take it, say so here and I'll assign it.

Test

bun run typecheck
bun test packages/jobs

Then the part a test can't show: start a dev instance on 10 with a scheduled job, stop it, upgrade, start it again, and confirm the job still runs. Put what you saw in the PR.

Lenguaje dominante
TypeScript
Estrellas
13
Forks
3
Merge medio
38 min
PR fusionados (30 d)
14

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 Sentrello/Sentrello

Todos los issues de Sentrello/Sentrello

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.