Skip to content

Conversation

@MiSikora
Copy link
Contributor

@MiSikora MiSikora commented Dec 3, 2025

Description

Currently, our builds upload data to our main Android Sentry project. Since we decided to split Android, Automotive, and Wear apps into separate ones, this now needs to be handled in the build system.

Our Sentry configuration is stored in the sentry.properties file. However, this file lives in the root project. I wasn’t able to find anything in the Sentry documentation indicating whether it’s possible to have multiple such files one in each sub-project or to define per-project properties within the root file.

To address this, I propose configuring everything through the Gradle plugin. This change will need to be accompanied by an update to the mobile-secrets repo to add the necessary properties. I can do it once we agree on the approach and sync the modifications in both repositories.

Relates to: https://linear.app/a8c/issue/AINFRA-1610/

Testing Instructions

I'm not sure if it is possible to test it really until we create a release build. But if anyone has an idea I'd like to know.

@MiSikora MiSikora added this to the 8.2 milestone Dec 3, 2025
Copilot AI review requested due to automatic review settings December 3, 2025 08:53
@MiSikora MiSikora requested a review from a team as a code owner December 3, 2025 08:53
@MiSikora MiSikora added the [Type] Tooling Related to the Gradle build scripts and the setup or maintenance of the project build process. label Dec 3, 2025
@MiSikora MiSikora requested review from geekygecko and removed request for a team December 3, 2025 08:53
@MiSikora MiSikora requested a review from a team December 3, 2025 08:53
@dangermattic
Copy link
Collaborator

dangermattic commented Dec 3, 2025

1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

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 migrates Sentry configuration from a single sentry.properties file to per-project Gradle configuration, enabling separate Sentry projects for Android, Automotive, and Wear applications.

Key Changes

  • Added Sentry configuration properties (auth token, org, and project names) to dependencies.gradle.kts
  • Configured project-specific Sentry project names in each application module's build file
  • Renamed configureSentry() to applyCommonSentryConfiguration() and added auth token and org configuration
  • Added "prototype" to ignored build types for Sentry uploads

Reviewed changes

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

Show a summary per file
File Description
dependencies.gradle.kts Adds five new Sentry-related properties from secret properties: auth token, org, and three project names
build.gradle.kts Renames Sentry configuration function, adds auth token and org properties, includes "prototype" in ignored build types, removes unused import
app/build.gradle.kts Configures Android project-specific Sentry project name
automotive/build.gradle.kts Configures Automotive project-specific Sentry project name
wear/build.gradle.kts Configures Wear project-specific Sentry project name

Comment on lines +109 to +110
set("sentryAuthToken", secretProperties.getProperty("sentryAuthToken", ""))
set("sentryOrg", secretProperties.getProperty("sentryOrg", ""))
Copy link
Contributor

Choose a reason for hiding this comment

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

If I'm not mistaken, those 2 properties as still in sentry.properties currently, not secret.properties.

  • So either we keep the sentry.properties file as-is (and also in .configure) and let the SentryPluginExtension automatically read those (at least I'm guessing that's who reads those implicitly so far) from sentry.properties, only overwriting the projectName via Gradle (assuming setting a sentry { … } section in the build.gradle.kts files doesn't disable SentryPluginExtension reading from sentry.properties implicitly, but instead adds on top of it so that the properties are merged?)
  • Or you plan to set those via Gradle as well like you do in your new applyCommonSentryConfiguration, and want to move secret values from sentry.properties to secrets.properties to have Gradle read from that .properties file instead… which could make sense too… but in that case I'd expect this PR to contain changes for the .configure-files/secrets.properties.enc, deletion of the .configure-files/sentry.properties.enc and removal of the entry for sentry.properties in the .configure JSON file to reflect that

PS: ICYMI, the convoluted/confusing way we currently use to manage/updates secrets in git repos with configure (and how to update the .enc files when you change secrets, etc) will very soon change to become way more simple and transparent (Internal ref: paaHJt-96q-p2). 🔜

Copy link
Contributor Author

@MiSikora MiSikora Dec 3, 2025

Choose a reason for hiding this comment

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

Thanks for bringing this up. This might have been unclear from the PR description but this is what I meant.

To address this, I propose configuring everything through the Gradle plugin. This change will need to be accompanied by an update to the mobile-secrets repo to add the necessary properties. I can do it once we agree on the approach and sync the modifications in both repositories.

I didn't want to update secrets in case the approach I'm proposing is incorrect. And yes, this approach means dropping sentry.properties.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, un-caffeinated me missed that part, thanks for highlighting it! Makes sense indeed.

If this PR is not extra-urgent and can wait a couple of days, maybe I can put PCAndroid as next on the list in my project to test our brand new way to manage in-repo secret files (AINFRA-1539).

Since that new approach to deal with in-repo secrets does not rely on .mobile-secrets nor .configure anymore, and instead transparently handles secret files via git's built-in filters feature, that means that any change you need to make on a secret files will then be done directly in the PCAndroid repo—and thus be part of the list of files changed in the PRs, with the contents of the secret file not being updated in main until the PR is merged there, like any other regular file, etc.
So once we adopt that new tool you wouldn't have the problem above in this PR anymore.

If you don't want to wait for me to migrate PCAndroid to the new tool and want to merge this PR earlier that's ok with me too, though in that case you'll indeed have to synchronize your merging of this PR with the push of changes to secret files in .mobile-secrets.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I think it can wait. I'd be great to test using git filters for that. I'll keep it open for now but as a draft. Thanks!

@MiSikora MiSikora marked this pull request as draft December 3, 2025 13:58
Copilot AI review requested due to automatic review settings December 4, 2025 14:12
@MiSikora MiSikora force-pushed the mehow/task/sentry/config branch from 0dfbdee to 4a0604d Compare December 4, 2025 14:12
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

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

@wpmobilebot wpmobilebot modified the milestones: 8.2, 8.3 Dec 8, 2025
@wpmobilebot
Copy link
Collaborator

Version 8.2 has now entered code-freeze, so the milestone of this PR has been updated to 8.3.

@AliSoftware
Copy link
Contributor

If this PR is not extra-urgent and can wait a couple of days, maybe I can put PCAndroid as next on the list in my project to test our brand new way to manage in-repo secret files (AINFRA-1539).

FYI: The PR to migrate this repo to git-conceal is now ready for review.

PS: Note that, timing-wise, I don't plan to merge it before mid-January (once I come back from AFK then the AI Workshop in NY) so that I can be around for support if needed and to help ease the adoption.

}

sentry {
projectName = project.findProperty("sentryWearProject")?.toString()
Copy link
Contributor

Choose a reason for hiding this comment

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

@MiSikora question, just to double check: I don't think there should be differences related to what we do in annotate_sentry_mapping_uuid given we're building separate app bundles anyway (that is, each app will have its own base/assets/sentry-debug-meta.properties), right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question but I don't know. I would think that no changes are required since sentry.properties do not provide any other values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] Tooling do not merge [Type] Tooling Related to the Gradle build scripts and the setup or maintenance of the project build process.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants