V1 release - DO NOT MERGE - #231
Draft
marandaneto wants to merge 35 commits into
Draft
Conversation
Deletes the V0 capture implementation and the `capture-v1` Cargo feature. Capture V1 (`POST /i/v1/analytics/events`) is now the only capture path and compiles unconditionally. No V1 logic, retry policy, buffering, or option-extraction behavior changes — the V1 code is byte-identical, it just stops being `#[cfg]`-gated. - Delete `src/client/v0_capture.rs`, the V0 transport pipeline, the V0 retry decisions (`should_retry_v0` and friends), the V0 wire format's `BatchRequest`, and both `send_immediate` V0 bodies. - Drop the `capture-v1` feature; `brotli` and `zstd` become unconditional dependencies. All four codecs the endpoint accepts (gzip/deflate/br/zstd) now work by default instead of silently degrading to uncompressed. - Compliance adapter advertises `capture_v1` unconditionally and reports as `posthog-rs`; delete the V0 adapter image and its workflow. The `capture_v1` capability string is a frozen harness contract key. - Collapse the CI build/test matrices, whose V0 and V1 entries became duplicates, and drop `--features capture-v1` from `check-public-api.sh`. `Event::prepare_for_v0` and `InnerEvent` are retained temporarily as test-only scaffolding; the tests that depend on them are ported to the V1 builder in the next commit, which then deletes them. Verified against a pre-change baseline: 379/316/356 tests pass for the default, blocking, and blocking+error-tracking configs — identical counts to the same suites under `--features capture-v1` before this change. Public API snapshot unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Rewrites the tests that depended on the V0 serialization scaffolding, then deletes that scaffolding, so nothing V0 remains in the tree. - `src/error_tracking.rs`: `built_event_json` now serializes through `V1Event::from_event`, so all 33 tests assert the shape actually sent. Two assertions move `$process_person_profile` from `properties` to the typed `options` object and additionally pin that it is stripped from `properties`. - `src/event.rs`: 10 `v0_*` tests ported to assert the V1 shape and renamed without the version marker. `v0_adds_lib_properties` and `v0_preserves_existing_lib_properties` are dropped instead — the V1 builder never touches `$lib`/`$lib_version`, which now travel in the `posthog-sdk-info` header and are covered by `build_headers_sdk_info_is_canonical_lib_slash_version`. - Delete `Event::prepare_for_v0`, `Event::apply_minimal_flag_called_allowlist`, and `InnerEvent`. The shared `is_minimal_flag_called_property` predicate is kept — the V1 path uses it. `semver` was only used by `prepare_for_v0`, so it is dropped as a dependency. - Port the orphaned integration assertions that had no V1 twin, in both the async and blocking variants: `Event::with_flags` attaching flag properties without a second `/flags` fetch, `$is_server` on `$feature_flag_called`, client-level `ErrorTrackingOptions` applying to `capture_exception`, and the blank/whitespace API-key noop path. Test totals move 379/316/356 -> 381/317/358 for the default, blocking, and blocking+error-tracking configs: four ported tests added per applicable config, less the two `$lib` tests whose behavior moved to the header. Public API snapshot unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The `V1` markers existed only to scope the new pipeline during the dual-use
period. With V0 gone they are noise, so this adopts plain capture names —
including the pre-existing public `Endpoint::Capture`. Mechanical rename only:
no logic, retry, buffering, or option-extraction behavior changes, and no
existing test's assertions were altered.
Breaking:
- `V1ErrorResponse` -> `CaptureErrorResponse`, which also re-signatures the
public `CaptureFailure::error_response()`.
- `Endpoint::Batch` removed; `Endpoint` is now `#[non_exhaustive]`.
- `Endpoint::Capture` re-points from `/i/v0/e/` to `/i/v1/analytics/events`.
Callers of `Endpoint::Capture.path()` compile unchanged but see a different
URL — the one change here with no compile-time signal.
Internal:
- `V1Event` -> `CaptureEvent` (not `Event`, which is taken by the public input
type), `V1BatchRequest{,Ref}` -> `BatchRequest{,Ref}`, `PreparedV1` ->
`Prepared`.
- `src/event_v1.rs` -> `src/capture_event.rs`, `src/client/v1_capture.rs` ->
`src/client/capture.rs`. The former cannot be `event.rs` — the public `Event`
lives there.
- `V1_CAPTURE_PATH` is deleted; both call sites now go through
`build_url(Endpoint::Capture)`, which is byte-identical output since
`build_custom_url` only normalized a leading slash that was already present.
- Tests renamed to match: `test_v1_capture.rs` -> `test_capture.rs`,
`test_v1_blocking.rs` -> `test_capture_blocking.rs` (not `test_blocking.rs`,
which survives), `test_error_tracking_v1.rs` -> `test_error_tracking.rs`.
- `compliance/v1/` -> `compliance/harness/`, and the compliance workflow drops
its `-v1` suffixes.
The harness contract keys are deliberately untouched: the `capture_v1`
capability advertised by the adapter and the `--suite capture_v1` argument are
external strings the test harness matches on.
Adds the major-release changeset. Test counts are unchanged from the previous
commit (381/317/358), and the public API diff is exactly the three intended
items with nothing else moving.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`compliance/harness/Dockerfile` does `COPY . .` from the repo root, so with no .dockerignore the build context included the whole local `target/` tree — 33GB after a few cargo runs here — and the build died with ResourceExhausted while hardlinking incremental artifacts. CI never hit this because a fresh checkout has no `target/`, which is why the documented local compose path was quietly broken for anyone who had built the crate. Excluding target/, .git/, and .github/ drops the context from 33GB to 1.14MB, which also trims the CI build. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Porting the V0 tests left `event.rs` asserting the capture wire shape, which `capture_event.rs` already owns — six were straight duplicates (timestamp normalization, the anon/group/explicit `$process_person_profile` cases, and `$groups`). Wire-shape assertions now live only in `capture_event.rs`, next to the builder they exercise; `event.rs` keeps just its `Event`-level timestamp tests. The four assertions that were genuinely unique moved across rather than being dropped: `distinct_id` at the root (with no legacy `$distinct_id` and no duplicate in properties), auto-generated and caller-overridden `uuid`, and `$process_person_profile` being absent from *both* options and properties when unset. The `$lib`-coverage note moved with them. Net -6 tests per config (375/311/352) — the duplicates, nothing else. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…h exists The v0/v1 split left scaffolding that no longer earns its keep. - Drop `--suite capture_v1` from the local compose. That filter existed only to pick v0 and v1 apart; with one capture path the harness selects suites from the adapter's advertised /health capabilities, which is what CI already does (it passes no --suite). Local runs were silently narrower than CI as a result — 94 tests instead of 111, skipping feature_flags entirely. - Flatten `compliance/harness/` back to `compliance/`. The extra directory level only existed to hold the two per-mode variants. Verified from the new layout: 111/111, capabilities `capture_v1, encoding_gzip`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This reverts commit bd6da7f.
* refactor!: remove deprecated APIs * refactor!: rename local evaluation secret key field * fix local evaluation API fallback * preserve local-only evaluation privacy
* feat!: mark evaluate flags options as non-exhaustive * fix non-exhaustive options call sites
# Conflicts: # .github/workflows/sdk-compliance-tests-v1.yml # .github/workflows/sdk-compliance-tests.yml
Contributor
posthog-rs Compliance ReportDate: 2026-08-31 08:00:38 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
|
# Conflicts: # api/public-api.txt # src/event.rs
* refactor: unify feature flag evaluation engine * test: consolidate feature evaluation cases
# Conflicts: # api/public-api.txt # src/event.rs
* refactor(error-tracking): centralize debug image filtering * fix: avoid self-joining transport worker on drop * refactor: unify feature flag evaluation engine * refactor: share feature flag retry classifier * refactor: centralize capture preprocessing * refactor: share feature flag event host * refactor: share feature flag evaluation state * refactor: centralize capture enqueue policy * test: consolidate malformed capture responses * test: consolidate client runtime assertions * test: consolidate feature evaluation cases * fix: avoid async shutdown worker deadlock * style: format shutdown regression test * fix: avoid async shutdown worker deadlock
* fix: avoid self-joining transport worker on drop * refactor: share feature flag retry classifier * fix: avoid async shutdown worker deadlock
* fix: avoid self-joining transport worker on drop * refactor: share feature flag retry classifier * refactor: centralize capture preprocessing * fix: avoid async shutdown worker deadlock
* fix: avoid self-joining transport worker on drop * refactor: share feature flag retry classifier * refactor: centralize capture preprocessing * refactor: share feature flag event host * fix: avoid async shutdown worker deadlock
* fix: avoid self-joining transport worker on drop * refactor: share feature flag retry classifier * refactor: centralize capture preprocessing * refactor: share feature flag event host * refactor: share feature flag evaluation state * fix: avoid async shutdown worker deadlock
* fix: avoid self-joining transport worker on drop * refactor: share feature flag retry classifier * refactor: centralize capture preprocessing * refactor: share feature flag event host * refactor: share feature flag evaluation state * refactor: centralize capture enqueue policy * fix: avoid async shutdown worker deadlock
* fix: avoid self-joining transport worker on drop * refactor: share feature flag retry classifier * refactor: centralize capture preprocessing * refactor: share feature flag event host * refactor: share feature flag evaluation state * refactor: centralize capture enqueue policy * test: consolidate client runtime assertions * fix: avoid async shutdown worker deadlock
* fix: avoid self-joining transport worker on drop * refactor: share feature flag retry classifier * refactor: centralize capture preprocessing * refactor: share feature flag event host * refactor: share feature flag evaluation state * refactor: centralize capture enqueue policy * test: consolidate malformed capture responses * fix: avoid async shutdown worker deadlock
# Conflicts: # src/client/async_client.rs # src/client/blocking.rs # tests/test_group_identify.rs
* ci: test capture compliance across clients and encodings * fix: scope compliance concurrency to matrix jobs
* docs!: audit and document the v1 public API * docs: remove the standalone public API audit * docs: narrow the v1 migration guide * docs: clarify immediate capture durability checks
* feat!: make the TLS provider configurable * chore: remove the TLS changeset
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
Closes #207
💚 How did you test it?
📝 Checklist
If releasing new changes
sampo addto generate a changeset file