Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .configure
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
{
"project_name": "pocketcasts-android",
"branch": "trunk",
"pinned_hash": "29f04c18842c391363c5129b59b8a32973319611",
"pinned_hash": "f8db88d1a1d1149ce3a144b7c629e36717c885ea",
"files_to_copy": [
{
"file": "android/pocket-casts/secret.properties",
"destination": "secret.properties",
"encrypt": true
},
{
"file": "android/pocket-casts/sentry.properties",
"destination": "sentry.properties",
"encrypt": true
},
{
"file": "android/pocket-casts/google-services.json",
"destination": "app/google-services.json",
Expand Down
Binary file modified .configure-files/secret.properties.enc
Binary file not shown.
8 changes: 6 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ plugins {
alias(libs.plugins.compose.compiler)
}

sentry {
projectName = project.findProperty("sentryAndroidProject")?.toString()
}

android {
namespace = "au.com.shiftyjelly.pocketcasts"

Expand Down Expand Up @@ -46,8 +50,8 @@ android {
named("release") {
manifestPlaceholders["appIcon"] = "@mipmap/ic_launcher"

if (!file("${project.rootDir}/sentry.properties").exists()) {
println("WARNING: Sentry configuration file 'sentry.properties' not found. The ProGuard mapping files won't be uploaded.")
if (project.findProperty("sentryAndroidProject")?.toString().isNullOrBlank()) {
println("WARNING: Sentry configuration not found. The ProGuard mapping files won't be uploaded.")
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions automotive/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ plugins {
alias(libs.plugins.compose.compiler)
}

sentry {
projectName = project.findProperty("sentryAutomotiveProject")?.toString()
}

android {
namespace = "au.com.shiftyjelly.pocketcasts"

Expand All @@ -35,6 +39,10 @@ android {

named("release") {
manifestPlaceholders["appIcon"] = "@mipmap/ic_launcher"

if (project.findProperty("sentryAutomotiveProject")?.toString().isNullOrBlank()) {
println("WARNING: Sentry configuration not found. The ProGuard mapping files won't be uploaded.")
}
}
}

Expand Down
8 changes: 5 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import com.google.devtools.ksp.gradle.KspGradleSubplugin
import io.sentry.android.gradle.extensions.InstrumentationFeature
import io.sentry.android.gradle.extensions.SentryPluginExtension
import java.util.EnumSet
import kotlin.collections.addAll
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions
import org.jetbrains.kotlin.gradle.plugin.KotlinBasePlugin
Expand Down Expand Up @@ -174,7 +173,7 @@ subprojects {
}

plugins.withId(rootProject.libs.plugins.sentry.get().pluginId) {
configureSentry()
applyCommonSentryConfiguration()
}

configurations.configureEach {
Expand Down Expand Up @@ -419,8 +418,11 @@ subprojects {
}
}

fun Project.configureSentry() {
fun Project.applyCommonSentryConfiguration() {
extensions.getByType(SentryPluginExtension::class.java).apply {
authToken = project.findProperty("sentryAuthToken")?.toString()
org = project.findProperty("sentryOrg")?.toString()

val shouldUploadDebugFiles = System.getenv()["CI"].toBoolean() &&
!project.properties["skipSentryProguardMappingUpload"]?.toString().toBoolean()
includeProguardMapping = shouldUploadDebugFiles
Expand Down
5 changes: 5 additions & 0 deletions dependencies.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,10 @@ project.apply {
set("encryptionKey", secretProperties.getProperty("encryption_key", ""))
set("appSecret", secretProperties.getProperty("app_secret", ""))
set("metaAppId", secretProperties.getProperty("metaAppId", ""))
set("sentryAuthToken", secretProperties.getProperty("sentryAuthToken", ""))
set("sentryOrg", secretProperties.getProperty("sentryOrg", ""))
Comment on lines +109 to +110
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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!

set("sentryAndroidProject", secretProperties.getProperty("sentryAndroidProject", ""))
set("sentryAutomotiveProject", secretProperties.getProperty("sentryAutomotiveProject", ""))
set("sentryWearProject", secretProperties.getProperty("sentryWearProject", ""))
}
}
8 changes: 6 additions & 2 deletions wear/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ plugins {
alias(libs.plugins.compose.compiler)
}

sentry {
projectName = project.findProperty("sentryWearProject")?.toString()
Copy link
Copy Markdown
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
Copy Markdown
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.

}

android {
namespace = "au.com.shiftyjelly.pocketcasts"

Expand All @@ -32,8 +36,8 @@ android {
named("release") {
manifestPlaceholders["appIcon"] = "@mipmap/ic_launcher"

if (!file("${project.rootDir}/sentry.properties").exists()) {
println("WARNING: Sentry configuration file 'sentry.properties' not found. The ProGuard mapping files won't be uploaded.")
if (project.findProperty("sentryWearProject")?.toString().isNullOrBlank()) {
println("WARNING: Sentry configuration not found. The ProGuard mapping files won't be uploaded.")
}
}
}
Expand Down