getsentry / sentry-webpack-plugin

Repo moved to https://github.com/getsentry/sentry-javascript-bundler-plugins. Please open any issues/PRs there.
MIT License
662 stars 116 forks source link

feature: expand release option to support format function #361

Closed alexrhogue closed 2 years ago

alexrhogue commented 2 years ago

Hey Team. I'm currently integrating this plugin with a few of my team's repositories. Having the ability to do a format pass on the auto generated release name would be really useful for us.

It could be used like this to allow us to add the project name to the release while still utilizing the auto detect value of the CLI

new SentryCliPlugin({
   release: (version) => `MyProject-${version}`,
})

I'm opening up this quick POC pr to start a conversation on adding this functionality.

kamilogorek commented 2 years ago

Thanks for the contribution. What is the exact use-case for having such a specific release name? We have other ways to distinguish between projects/env, so maybe they can already cover it.

alexrhogue commented 2 years ago

Some of our frontend projects deploy multiple frontend apps so we prepend our versions with the name of the specific subsection being deployed.

I've moved out team's projects to using the CLI directly in out build pipeline, so this PR is no longer needed for us. I'll let you decide if it's worth adding. Otherwise, you can close.

Thanks!

kamilogorek commented 2 years ago

Some of our frontend projects deploy multiple frontend apps so we prepend our versions with the name of the specific subsection being deployed.

Gotcha. For that though, we have and encourage to use the dist value, which is explained as:

Unique identifier for the distribution, used to further segment your release. Usually your build number.

Cheers!