sentry-javascript-bundler-plugins icon indicating copy to clipboard operation
sentry-javascript-bundler-plugins copied to clipboard

Staging Environment remains when promoting from staging to prod without an extra build step

Open smeubank opened this issue 7 months ago • 8 comments

Problem Statement

An issue has been identified with the @sentry/vite-plugin in relation to Heroku pipeline workflows:

  • The Sentry configuration is injected during the initial build step, typically executed in a staging environment.
  • Upon promotion from staging to production within Heroku, an additional build step is not triggered. As a result, the staging Sentry settings persist and remain active in the production environment.

This causes two significant problems:

  1. Errors originating from the production environment are incorrectly reported to the staging environment in Sentry.
  2. Flexible strategies for source map deletion, such as deleting sourcemaps post-upload exclusively in production, are currently unavailable.

Desired Behavior

The Sentry Vite plugin should ideally support environment-specific configurations or allow dynamic injection of configurations post-build, improving compatibility with pipeline workflows like Heroku. Specifically:

  • Provide functionality to dynamically inject or override Sentry configurations at runtime instead of only at the initial build step.
  • (not specifically related)Support distinct configurations for source map deletion between staging and production environments, possibly through post-promotion scripting.

smeubank avatar Mar 20 '25 10:03 smeubank