Skip to content

Conversation

@andresmr
Copy link
Collaborator

Description

Link the JIRA issue.

Install Sentry Gradle SDK to upload proguard map in production releases

@sonarqubecloud
Copy link

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR integrates the Sentry Gradle SDK to enable automatic uploading of ProGuard mapping files for production release builds to Sentry. This will improve crash report debugging by allowing deobfuscation of stack traces from minified release builds.

Key Changes:

  • Updated Sentry library from 8.23.0 to 8.29.0 and added Sentry Gradle plugin (5.12.2)
  • Configured Sentry plugin in app/build.gradle.kts with ProGuard mapping upload, source context, and disabled native symbols
  • Added SENTRY_AUTH_TOKEN to CI/CD workflows for authenticated uploads to Sentry

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
gradle/libs.versions.toml Updated Sentry library version to 8.29.0 and added Sentry Gradle plugin version 5.12.2 with corresponding alias
app/build.gradle.kts Applied Sentry Gradle plugin and configured it to upload ProGuard mappings and source context to Sentry project
.github/workflows/deploy-release.yml Added SENTRY_AUTH_TOKEN environment variable for both release and training APK builds
.github/workflows/build-release-candidate.yml Added SENTRY_AUTH_TOKEN environment variable for both release candidate and training builds

Comment on lines +328 to +329
//Upload the mapping on every release build
autoUploadProguardMapping.set(true)
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

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

The autoUploadProguardMapping is set to true, which will attempt to upload ProGuard mapping files on every release build, including local developer builds. This could cause build failures for developers who don't have the SENTRY_AUTH_TOKEN environment variable set, or unnecessary uploads during development.

Consider setting this to false and relying on CI/CD to upload mappings only when needed, or make it conditional based on the presence of the auth token.

Suggested change
//Upload the mapping on every release build
autoUploadProguardMapping.set(true)
// Upload the mapping on release builds only when an auth token is present (e.g. in CI)
val hasSentryAuthToken = System.getenv("SENTRY_AUTH_TOKEN")?.isNotBlank() == true
autoUploadProguardMapping.set(hasSentryAuthToken)

Copilot uses AI. Check for mistakes.
Comment on lines +324 to +330
authToken.set(System.getenv("SENTRY_AUTH_TOKEN"))

// Enable ProGuard/R8 mapping upload for deobfuscation, maps are available in the build folder
includeProguardMapping.set(true)
//Upload the mapping on every release build
autoUploadProguardMapping.set(true)

Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

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

The authToken is obtained directly from the environment variable without a fallback or default value. If SENTRY_AUTH_TOKEN is not set (e.g., during local development or in certain build configurations), this could cause issues with the Sentry plugin configuration.

Consider providing a default empty string or making the upload conditional on the presence of the token to allow builds to succeed locally without the token.

Suggested change
authToken.set(System.getenv("SENTRY_AUTH_TOKEN"))
// Enable ProGuard/R8 mapping upload for deobfuscation, maps are available in the build folder
includeProguardMapping.set(true)
//Upload the mapping on every release build
autoUploadProguardMapping.set(true)
val sentryAuthToken = System.getenv("SENTRY_AUTH_TOKEN")
if (!sentryAuthToken.isNullOrBlank()) {
authToken.set(sentryAuthToken)
// Enable ProGuard/R8 mapping upload for deobfuscation, maps are available in the build folder
includeProguardMapping.set(true)
// Upload the mapping on every release build
autoUploadProguardMapping.set(true)
} else {
// When no auth token is available (e.g., local development), disable uploads
includeProguardMapping.set(false)
autoUploadProguardMapping.set(false)
}

Copilot uses AI. Check for mistakes.
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