Detect Release Automatically
Note on ---
Should we call special attention to something to encourage best practices and prevent and bad DX?
Release
Copied
{
"release": "my-project-name@1.0.0"
}
SDK Examples
Source | Description |
---|---|
Python SDK | -SENTRY_RELEASE env variable - Output of git rev-parse HEAD |
Rust SDK | -SENTRY_RELEASE env if nothing was explicitly sent. & example snippets include release: sentry::release_name!() |
Browser SDK | 1. the SENTRY_RELEASE global var injected by bundlers (like webpack plugin): link 2. and then falls back to undefined |
Node SDK | 1. release parameter 2. SENTRY_RELEASE env var 3. SENTRY_RELEASE.id global var - variety of env variables 4. and then falls back to undefined |
Dart/Flutter | - SENTRY_RELEASE environment variable- -dart-define=SENTRY_RELEASE dart define variable - SDK init options.release By default, it uses the appId@appVersion+buildNumber whenever possible/available. |
Java | - SDK init options - sentry.properties file - defaults to git commit_id for spring-boot |
Android(Java) | - SDK init options - AndroidManifest.xml io.sentry.release metadata- By default, it uses the appId@appVersion+buildNumber |
Cocoa/Apple | The SDK sets the default, which is CFBundleIdentifier@CFBundleShortVersionString+CFBundleVersion , on the init of the Options. An example is io.sentry.sample.iOS-Swift@7.31.2+1 |
React Native | - SDK init options (overrides platform defaults) iOS: - platform default Android: - platform default - SENTRY_RELEASE environment variable only source maps upload |
Unity | SDK defaults to $"{productName}@{application.Version}"+{application.BuildGUID}" on initializing SentryUnityOptions |
Capacitor | Same rules as Browser, otherwise fetch from the native SDK iOS - id as CFBundleIdentifier - version as CFBundleShortVersionString - build as CFBundleVersion Android: - id as packageName - version as versionName - build as versionCode |
Cordova | gets from SENTRY_RELEASE , or it's set by Sentry CLI from the command sentry-cli releases propose-version during build (the hash from the last commit) |
Xamarin | PackageName@VersionString+BuildString PackageName : the application package name for Android/iOS and the application GUID for UWP.VersionString : versionName on Android, CFBundleVersion on iOS, Assembly version on UWP.BuildString : versionCode on Android, CFBundleShortVersionString on iOS. |
PHP | in order of precedence: PHP/Laravel/Symfony - options.release - SENTRY_RELEASE |
Ruby | in order of precedence: - config.release - ENV[’SENTRY_RELEASE’] - git rev-parse —short HEAD if .git present- capistrano REVISION file or from revisions.log - ENV['HEROKU_SLUG_COMMIT'] if on heroku- nil otherwise |
Golang | in order of precedence: - options.Release - various env vars "SENTRY_RELEASE" "HEROKU_SLUG_COMMIT" "SOURCE_VERSION" "CODEBUILD_RESOLVED_SOURCE_VERSION" "CIRCLE_SHA1" "GAE_DEPLOYMENT_ID" "GITHUB_SHA" "COMMIT_REF" "VERCEL_GIT_COMMIT_SHA" "ZEIT_GITHUB_COMMIT_SHA" "ZEIT_GITLAB_COMMIT_SHA" "ZEIT_BITBUCKET_COMMIT_SHA" - git describe --long --always --dirty |
.NET | In order of precedence: - The release configuration option if set- The SENTRY_RELEASE env var if set- "{AssemblyName}@{AssemblyInformationalVersion}" based on the entry assembly, when an informational version attribute is present (commonly set by csproj <Version> tag in modern .NET)- "{AssemblyName}@{AssemblyVersion}" based on the entry assembly, using the full assembly version (usually in older .NET Framework)Varies slightly for mobile. On .NET Android: - The release configuration option if set- "{PackageName}@{PackageVersion}+{PackageVersionCode}" from the Android package. (Should matche appId@appVersion+buildNumber from the Android SDK.)On .NET for iOS/MacCatalyst: - The Release configuration option if set - "{CFBundleIdentifier}@{CFBundleShortVersionString}+{CFBundleVersion}" which matches the iOS SDK. |
You can edit this page on GitHub.