Skip to content

Commit 220ba77

Browse files
authored
fix: Adjust the Sentry release property format according to the docs (#193)
1 parent c67bcc3 commit 220ba77

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

sentry/src/main/scala/com/avast/sst/sentry/SentryModule.scala

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,20 @@ object SentryModule {
2626
}
2727

2828
/** Makes [[io.sentry.SentryClient]] initialized with the given config and overrides the `release` property
29-
* with `Implementation-Version` from the `MANIFEST.MF` file inside the same JAR (package) as the `Main` class.
29+
* with `Implementation-Title`@`Implementation-Version` from the `MANIFEST.MF` file inside the same JAR (package) as the `Main` class.
30+
*
31+
* This format is recommended by Sentry ([[https://docs.sentry.io/workflow/releases]])
32+
* because releases are global and must be differentiated.
3033
*/
3134
def makeWithReleaseFromPackage[F[_]: Sync, Main: ClassTag](config: SentryConfig): Resource[F, SentryClient] = {
3235
for {
3336
customizedConfig <- Resource.liftF {
3437
Sync[F].delay {
3538
for {
3639
pkg <- Option(implicitly[ClassTag[Main]].runtimeClass.getPackage)
37-
v <- Option(pkg.getImplementationVersion)
38-
} yield config.copy(release = Some(v))
40+
title <- Option(pkg.getImplementationTitle)
41+
version <- Option(pkg.getImplementationVersion)
42+
} yield config.copy(release = Some(s"$title@$version"))
3943
}
4044
}
4145
sentryClient <- make[F](customizedConfig.getOrElse(config))

0 commit comments

Comments
 (0)