chore(gradle-plugin): deprecate event release mode - #747
Merged
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
This was referenced Sep 1, 2026
Contributor
This was referenced Sep 1, 2026
ablaszkiewicz
marked this pull request as ready for review
September 1, 2026 13:38
Contributor
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
Member
|
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
Contributor
Author
|
@marandaneto deprecated it instead of getting rid of it as you suggested. May I get a re-review? |
marandaneto
approved these changes
Sep 2, 2026
marandaneto
left a comment
Member
There was a problem hiding this comment.
approving to unblock but see comments first
Review asked for three refinements. The posthog.releaseMode property now feeds the upload task's releaseMode input through gradleProperty, so the execution-time warning fires on every executed upload, including builds that reuse a configuration cache entry. An inherited POSTHOG_RELEASE_MODE that used to select event mode gets its own warning, worded to not ask for removal because the variable still steers other PostHog tools. The env pin comment names the CLI range it covers. A functional test runs the upload with the configuration cache twice and asserts the warning on the reused entry. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0177eam86deHk8HZYMKcJtbD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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.