Cloudflare wizard overwrites `src/index.ts` and reports success without setting up Sentry

Abierto
#1,394 1 comentario 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
3/5
Tiempo estimado
Medio día
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript
Área
cli, devtools

Línea de trabajo

Start in src/cloudflare/sdk-setup.ts at createSentryInitFile and in src/cloudflare/templates.ts at getCloudflareWorkerTemplateWithHandler, and trace how the wrangler main entry is resolved when the file is missing or already exists. Done means existing files are never overwritten, a missing main target gets a Sentry-enabled worker or a clear message, and the wizard does not print the success outro when Sentry was not set up. Ask in the issue thread which behavior the maintainers want for case B before changing it.

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

Descripción

Cloudflare Workers
Environment

@sentry/wizard master (b262ed0, 9.1.0 plus one commit), Cloudflare integration. Reproduced by running createSentryInitFile directly, not a full wizard run.

Steps to Reproduce

Case A, no main in the wrangler config:

  1. Have a wrangler.jsonc without main and an existing src/index.ts.
  2. Run npx @sentry/wizard -i cloudflare.

Case B, main points to a missing file:

  1. Set "main": "nope.ts" without creating that file.
  2. Run npx @sentry/wizard -i cloudflare.
Expected Result
  • Existing files are never overwritten.
  • A newly created worker is set up with Sentry.
  • The wizard does not report success if Sentry was not set up.
Actual Result
  • Case A: src/index.ts is overwritten with a plain worker template that contains no Sentry code.
  • Case B: no file is created or changed, and no message is shown for it.

From reading the code, both cases continue to the "Sentry has been successfully configured for your Cloudflare project." outro, and case A also adds main: src/index.ts to the wrangler config.

See createSentryInitFile in src/cloudflare/sdk-setup.ts and getCloudflareWorkerTemplateWithHandler in src/cloudflare/templates.ts.

Lenguaje dominante
TypeScript
Estrellas
297
Forks
88
Merge medio
5 h 29 min
PR fusionados (30 d)
5

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 getsentry/sentry-wizard

Todos los issues de getsentry/sentry-wizard

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.