feat(cli): add release-independent event mode to symbol-sets upload - #89834
feat(cli): add release-independent event mode to symbol-sets upload#89834ablaszkiewicz wants to merge 5 commits into
Conversation
…OG_RELEASE_ID Document the runtime env-var workflow for native apps: `release resolve` prints the release id, you export it as `POSTHOG_RELEASE_ID`, and the SDK reports it as `$release_id` on every event. This is the deploy-time counterpart to the web `$release_id`, and it needs no new CLI code — `release resolve` already ships. posthog-rs reads the variable (PostHog/posthog-rs#239). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
🤖 CI report✅ Trunk lane — non-backend laneThis PR is assigned to the non-backend lane. It does not run backend Python tests and may merge in parallel with PRs in other lanes. |
posthog-rs reports the release id only on `$exception` events, so match that wording: the SDK stamps `$release_id` on each exception, not on every event. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add `--release-mode` to `symbol-sets upload` (env `POSTHOG_RELEASE_MODE`). The default `symbol-set` mode keeps binding the release to every uploaded symbol set. `event` uploads the symbol sets release-independent — bound to no release — so one symbol set serves every release of an unchanged binary, and the upload no longer needs `--release-name`/`--release-version`. In event mode the release rides the event as `$release_id`, which the SDK reports from `POSTHOG_RELEASE_ID` (posthog-rs 0.26+, PostHog/posthog-rs#239); the release is named with `posthog-cli release resolve`, whose id you pass to the app. No binary patching and no code signing, unlike the injected `--release-mode=event` variant. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
🦔 PostHog Review reviewed this pull requestFound 0 must fix, 1 should fix, 1 consider. Published 2 findings (view the review). Resolved comments: 1 fixed, 1 left for you |
|
PostHog Review alpha 🦔 If you find any issues helpful - please reply "valid", "invalid", etc., for evaluation purposes 🙏 |
The runtime release-id section claimed posthog-rs and "other native SDKs" read POSTHOG_RELEASE_ID, with no version gate. Only posthog-rs 0.26+ reads it (PostHog/posthog-rs#239), and no other native SDK does today. State the version gate the CLI help text and changeset already carry, and drop the unverified multi-SDK claim. Generated-By: PostHog Desktop Task-Id: 81d53914-e1ab-4ecf-9740-da990f29d7dd
Prompt To Fix All With AI### Issue 1
cli/src/debug_symbols/upload.rs:65
**Event mode resolves plist**
When an event-mode upload supplies a missing or malformed `--info-plist`, `resolve_info_plist()` aborts the command before the release-independent branch runs, preventing otherwise valid symbols from uploading even though this mode does not use release metadata.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "docs(cli): gate release-id env docs to p..." | Re-trigger Greptile |
…e docs Address review feedback on the release-independent event mode: - resolve_info_plist() ran unconditionally, so a bad --info-plist aborted an event-mode upload that never reads release metadata. Move it into the symbol-set arm. - The runtime log and field help said "each event"; $release_id is reported only on exceptions. Say "each exception". - The shared ReleaseMode / UploadConflictArgs help described the sourcemap (injection) event mode, which contradicts the native symbol-sets path. Make the shared wording mode-neutral. - README: assign then export, so a failing `release resolve` is not masked by export's own exit status. - Document that event mode only creates new symbol sets unbound and leaves an existing binding intact (README, help, changeset). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
I think new release mode makes no sense for native technologies with a single-chunk-build - https://posthog.slack.com/archives/C07AA937K9A/p1787845698964179 |
Problem
The default
symbol-sets uploadalways binds the symbol set to a release — from--release-name/--release-version, or from git when you omit them. That has two costs for native apps: the upload needs release coordinates, and the same binary re-binds (and can collide) on every release. There was no way to upload native symbols release-independent and carry the release on the event instead — the native equivalent of the web$release_id.Changes
Add
--release-modetosymbol-sets upload(envPOSTHOG_RELEASE_MODE):symbol-set(default, unchanged): resolve a release and bind it to every uploaded symbol set.event: upload the symbol sets release-independent — bound to no release. One symbol set then serves every release of an unchanged binary, and the upload needs no--release-name/--release-version.In event mode the release rides the event as
$release_id. You name the release withrelease resolve, pass its id to the app inPOSTHOG_RELEASE_ID, and the SDK reports it (PostHog/posthog-rs#239):This is the same
--release-mode=eventas the injected variant (#89117), minus the binary patching and code signing: the release still rides the event, but the SDK reads the id from the environment rather than from bytes patched into the build. This pair (this PR + PostHog/posthog-rs#239) and the injection pair (#89117 + PostHog/posthog-rs#237) are alternatives — pick one.How did you test this code?
Automated (
cargo test): parse tests that the flag defaults tosymbol-setand acceptsevent, pluscargo fmt --checkandcargo clippyclean.End to end against a local PostHog stack, run by the agent (Claude). The
rust-release-envexample is built once; its symbols upload release-independent; two different releases resolve off that one symbol set purely by the reported$release_id.event-mode upload — release-independent, no release name/version
No
found release …, no binding — contrast the default mode, where a bare upload resolves a git release and binds the set to it.name the release, run the app, resolve by id — off the one release-independent symbol set
The same binary earlier resolved
rust-release-env@1.0.0off the same symbol set (debug id8A089A84-…), so one release-independent symbol set serves both releases. Symbolication and release resolution in the UI:$release_id🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Authored by Claude in Claude Code, directed by @ablaszkiewicz (DRI). This is the CLI half of a second, env-variable-based approach to native release tracking, offered alongside the marker-injection pair (#89117 + PostHog/posthog-rs#237) for comparison. It started as docs-only until the DRI pointed out that
symbol-sets uploadbinds the symbol set by default, so event mode was needed here too. The end-to-end verification above was run by the agent against a local PostHog dev stack (ingestion + cymbal); the example data is invented (rust-release-env) and draws on no customer material.🤖 Generated with Claude Code