Skip to content

Remove automatic Vercel deploy environment detection in next major #849

Description

@cleptric

Summary

Currently, the bundler plugins automatically create Sentry deploy records with environment names like vercel-production or vercel-preview when deploying on Vercel. This behavior should be removed in the next major version.

Current Behavior

In packages/bundler-plugin-core/src/options-mapping.ts, when release.deploy is undefined and Vercel environment variables are detected, the plugin automatically sets:

options.release.deploy = {
  env: `vercel-${process.env["VERCEL_TARGET_ENV"]}`,
  url: process.env["VERCEL_URL"] ? `https://${process.env["VERCEL_URL"]}` : undefined,
};

Why Remove This

  1. Implicit behavior is surprising - Users may not expect the plugin to automatically create deploy records with opinionated environment names
  2. Environment naming conventions vary - Teams have different naming conventions for their environments; vercel-production may not align with their existing setup
  3. Explicit configuration is clearer - Users who want this behavior can easily configure it themselves

Proposed Change

Remove the automatic Vercel deploy detection. Users who want deploy tracking can explicitly configure it:

sentryPlugin({
  release: {
    deploy: {
      env: process.env.VERCEL_TARGET_ENV ?? "production",
      url: process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : undefined,
    },
  },
});

Migration

Document in the migration guide that users relying on automatic Vercel deploy tracking should add explicit configuration.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions