feat: send $release_id from POSTHOG_RELEASE_ID on every event - #975
Merged
Merged
Conversation
A Python app has no bundle to inject a release id into, so the SDK reads the id that `posthog-cli release resolve` prints from the POSTHOG_RELEASE_ID env var and sends it as `$release_id` on every event. On `$exception` events the server resolves the release by a direct id lookup. An explicit `$release_id` in the event properties or super_properties wins over the env var. Minimal `$feature_flag_called` events keep their strict cross-SDK property allowlist and do not carry the id. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
posthog-python Compliance ReportDate: 2026-09-21 13:27:59 UTC ✅ All Tests Passed!111/111 tests passed Capture_V1 Tests✅ 94/94 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
Contributor
|
The PR appears safe to merge with the intended release-ID behavior consistently implemented across synchronous and asynchronous clients. Reviews (1) · Last reviewed commit: "feat: send $release_id from POSTHOG_RELE..." |
Contributor
ablaszkiewicz
marked this pull request as ready for review
September 22, 2026 09:06
marandaneto
approved these changes
Sep 22, 2026
This was referenced Sep 22, 2026
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.

💡 Motivation and Context
A Python app cannot link its error tracking issues to a release.
posthog-cliinjects the release id into JavaScript bundles, and Python has no bundle.POSTHOG_RELEASE_ID(the id thatposthog-cli release resolveprints) and sends it as$release_idon every event.$exceptionevents the server resolves the release by a direct id lookup.$release_idin eventpropertiesor insuper_propertieswins over the env var.$feature_flag_calledevents keep their cross-SDK property allowlist, so they do not carry the id.💚 How did you test it?
posthog/test/test_release_id.py. The full suite passes (3467 passed, 16 skipped), as do ruff, mypy, and the public API check.posthog-cli release resolve, one handled exception, and one plain event. Both events carried$release_id, and the server resolvedpython-release-env@1.0.0from it. Not tested against production.The issue page resolves the release that the CLI created:
The event JSON shows the
$release_idthat the SDK sent and the$exception_releasethat the server resolved from it (same id):📝 Checklist
If releasing new changes
sampo addto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Written with Claude Code (Claude Fable 5.1), directed by the PR assignee.
$exceptionevents only. The assignee then asked for all events..sampo/changesetsformat, not with thesampo addcommand.🤖 Generated with Claude Code