Skip to content

chore(gradle-plugin): deprecate event release mode - #747

Merged
ablaszkiewicz merged 4 commits into
mainfrom
chore/remove-event-release-mode
Sep 2, 2026
Merged

chore(gradle-plugin): deprecate event release mode#747
ablaszkiewicz merged 4 commits into
mainfrom
chore/remove-event-release-mode

Conversation

@ablaszkiewicz

@ablaszkiewicz ablaszkiewicz commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

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

  • Event mode helps only when two releases ship a byte-identical mapping.
  • The map id is already a content hash of the mapping, so a release that changes code gets its own symbol set.
  • An ordinary release therefore never collides with an earlier one, and the mode adds nothing.
  • Removing the property outright would silently flip a configured build to binding, with nothing in the build output saying so.

Changes

  • A build that sets posthog.releaseMode keeps building and gets a deprecation warning. The value is ignored, and the mapping uploads bound to the release the build creates.
  • The upload task keeps its public releaseMode input as a @Deprecated no-op, so a build script that configures the task does not break. Setting it warns at execution.
  • The POSTHOG_RELEASE_MODE environment variable no longer reaches the upload. The task pins symbol-set into the posthog-cli child environment, so an inherited value cannot unbind the mapping on an older CLI.
  • The plugin stays silent about the environment variable on purpose. It still steers the sourcemap and hermes uploads of other PostHog tools, so a warning about it would not be actionable.
  • PostHogReleaseMode and 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 detekt passes.
  • The warning paths have no test. The module has no Project or Exec harness, and building one for two log lines does not earn its cost.

🤖 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-mode parseable on the CLI side, which covers a build that upgrades the CLI before this plugin.

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
@posthog

posthog Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🦔 PostHog Review reviewed this pull request

Nothing worth raising this time, so here's a calming picture instead:

A panda relaxing and waving

@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown
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
@marandaneto

Copy link
Copy Markdown
Member

if people set those, this will break their builds
instead, deprecate the config and mention its a no-op, and remove the behaviour, but upgrading should not break peoples build
or, bump a major

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
@ablaszkiewicz ablaszkiewicz changed the title chore(gradle-plugin): remove event release mode chore(gradle-plugin): deprecate event release mode Sep 1, 2026
@ablaszkiewicz

Copy link
Copy Markdown
Contributor Author

@marandaneto deprecated it instead of getting rid of it as you suggested. May I get a re-review?

@turnipdabeets
turnipdabeets requested a review from a team September 1, 2026 19:46

@marandaneto marandaneto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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
@ablaszkiewicz
ablaszkiewicz enabled auto-merge (squash) September 2, 2026 08:00
@ablaszkiewicz
ablaszkiewicz merged commit 79c9201 into main Sep 2, 2026
16 checks passed
@ablaszkiewicz
ablaszkiewicz deleted the chore/remove-event-release-mode branch September 2, 2026 08:01
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