chore(gradle-plugin): deprecate event release mode - #747
Conversation
The plugin uploads the proguard mapping bound to the release it creates. The map id is a content hash of the mapping, so two releases collide only when they ship a byte-identical mapping. An ordinary release that changes code already gets its own symbol set. The property was experimental and undocumented. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jg6r6rFUBnowrXssZyU7yR
Prompt To Fix All With AI### Issue 1
posthog-android-gradle-plugin/src/main/kotlin/com/posthog/android/PostHogUploadProguardMappingsTask.kt:60
**Inherited release mode remains active**
If the Gradle daemon or CI environment has `POSTHOG_RELEASE_MODE=event`, this task still passes that inherited variable to `posthog-cli` without an overriding argument, causing the mapping to remain release-independent instead of being bound to the release as documented.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "chore(gradle-plugin): remove event relea..." | Re-trigger Greptile |
An Exec task inherits the daemon environment, and posthog-cli reads POSTHOG_RELEASE_MODE for proguard upload. A value set for another tool would leave the mapping release-independent, which is what this PR removes. A posthog-cli without the flag ignores the variable. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jg6r6rFUBnowrXssZyU7yR
|
if people set those, this will break their builds |
Review asked for deprecation instead of removal, so upgrading cannot silently change a configured build. The posthog.releaseMode property and the task's releaseMode input stay accepted, warn, and do nothing. The POSTHOG_RELEASE_MODE environment variable stays silent because it still steers other PostHog tools. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0177eam86deHk8HZYMKcJtbD
|
@marandaneto deprecated it instead of getting rid of it as you suggested. May I get a re-review? |
| // POSTHOG_RELEASE_MODE for `proguard upload`, and an Exec task inherits the daemon | ||
| // environment, so a value set for another tool would otherwise leave the mapping | ||
| // release-independent. Pin it. A posthog-cli that has no such flag ignores the variable. | ||
| environment("POSTHOG_RELEASE_MODE", "symbol-set") |
There was a problem hiding this comment.
[question] Pinning this is the right call for the inherited-env case. One gap though: POSTHOG_RELEASE_MODE=event used to select event mode too, so a CI job that set it there gets its mappings bound to a release again with no warning at all — the gradle property path warns, this one doesn't. Could we warn when the inherited value isn't symbol-set, worded so it doesn't ask people to unset it (it still steers sourcemap and hermes)?
| extension.uploadNativeSymbols.convention(false) | ||
| extension.includeNativeSymbolSources.convention(false) | ||
|
|
||
| warnIfDeprecatedReleaseModeSet(project) |
There was a problem hiding this comment.
[suggestion] This runs at configuration time, so with the configuration cache it prints on the first build and never again on a reused entry — and Gradle 9 turns that on by default. If we also set the property's value on the upload task's releaseMode, the execution-time warning fires every build instead. NativeSymbolsUploadFunctionalTest already builds a real app with --configuration-cache and asserts on the output, so it's a short test there.
| } | ||
|
|
||
| // The mapping always binds to the release this build creates. posthog-cli reads | ||
| // POSTHOG_RELEASE_MODE for `proguard upload`, and an Exec task inherits the daemon |
There was a problem hiding this comment.
[nit] PostHog/posthog#92401 removes env = "POSTHOG_RELEASE_MODE" from proguard upload, so this stops being true once that ships and the pin only covers CLI 0.12.0 up to that release. Worth naming that window here so we know when it can go.

Related PRs
Event mode is live today, and it is opt-in. These PRs settle where it stays and where it goes.
Deprecating the mobile knobs. The symbol id on these paths is already a content hash, so two releases collide only when they ship a byte-identical artifact. An ordinary release that changes code gets its own symbol set and never collides. The dSYM path also lost release attribution for embedded targets, because one upload covers every target while it creates one release. Review asked for deprecation instead of removal, so every knob stays accepted as a warned no-op.
Making it the default.
React Native. Scopes the mode to the Hermes upload and defaults it to event. That is the one path where two releases really do ship the same artifact.
Problem
Changes
posthog.releaseModekeeps building and gets a deprecation warning. The value is ignored, and the mapping uploads bound to the release the build creates.releaseModeinput as a@Deprecatedno-op, so a build script that configures the task does not break. Setting it warns at execution.POSTHOG_RELEASE_MODEenvironment variable no longer reaches the upload. The task pinssymbol-setinto the posthog-cli child environment, so an inherited value cannot unbind the mapping on an older CLI.PostHogReleaseModeand the mode plumbing stay removed. Only the warning path reads the property now.How did you test this code?
./gradlew :posthog-android-gradle-plugin:test spotlessCheck detektpasses.🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Written with Claude Code (Opus 5); reshaped from removal to deprecation with Claude Code (Fable 5). Skills invoked:
/writing-pr-descriptions.This replaces #739. The reshape answers the review comment asking that upgrading must not break or silently change configured builds. PostHog/posthog#92401 keeps
proguard upload --release-modeparseable on the CLI side, which covers a build that upgrades the CLI before this plugin.