Skip to content

Conversation

@vladanpaunovic
Copy link
Contributor

@vladanpaunovic vladanpaunovic commented Aug 22, 2022

relates: #20

This behaviour tries to replicate the behaviour of release option of sentry-webpack-plugin.

Release name can be specified via process.env.SENTRY_RELEASE. Otherwise, it will automatically detects values for Heroku, AWS CodeBuild, CircleCI and Vercel. Otherwise uses HEAD's commit SHA. (For HEAD option, requires access to git CLI and for the root directory to be a valid repository).

Logic taken from sentry-cli here

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 🚀

Comment on lines +19 to +24
"SENTRY_RELEASE",
"SOURCE_VERSION", // Heroku #1 https://devcenter.heroku.com/changelog-items/630
"HEROKU_SLUG_COMMIT", // Heroku #2: https://docs.sentry.io/product/integrations/deployment/heroku/#configure-releases
"CODEBUILD_RESOLVED_SOURCE_VERSION", // AWS CodeBuild: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html
"CIRCLE_SHA1", // CircleCI: https://circleci.com/docs/2.0/env-vars/
"VERCEL_GIT_COMMIT_SHA", // Vercel docs: https://vercel.com/docs/concepts/projects/environment-variables#system-environment-variables
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the order matter here? If yes, is the order correct?
(Looking at it again, I think it doesn't but I'm not sure about Heroku...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great question! It does. This is why SENTRY_RELEASE is on the top of the list, everything else is carrying equal weight. I was thinking to extract SENTRY_RELEASE from the rest of the pack but found it to be overkill

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explaining. Makes sense! Then, let's make sure to add a comment that SENTRY_RELEASE should be the first item in the list.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
@vladanpaunovic vladanpaunovic merged commit 484a719 into main Aug 22, 2022
@vladanpaunovic vladanpaunovic deleted the add-release-mmt branch August 22, 2022 13:16
@lforst lforst mentioned this pull request Aug 22, 2022
29 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants