trunk-merge/pr-73758/a92328c6-8265-4923-baf5-49831183c4d6 - #85866
Closed
trunk-io[bot] wants to merge 482 commits into
Closed
trunk-merge/pr-73758/a92328c6-8265-4923-baf5-49831183c4d6#85866trunk-io[bot] wants to merge 482 commits into
trunk-io[bot] wants to merge 482 commits into
Conversation
Test selection was wired to draft PRs only, and in practice it never narrowed anything: select-tests treated any run_legacy=true from turbo-discover as untrusted, but run_legacy is true for every diff that touches posthog/ or ee/. Django only runs when run_legacy is true, so "selected" mode and a running Django matrix were mutually exclusive. The whole mechanism reduced to "drafts skip the heavy matrices". Split the two things run_legacy conflates. A direct legacy edit is what the selector is built for, so it is now trusted; an inferred product->legacy cascade still is not. turbo-discover publishes run_legacy_reason so the workflow reads the cause instead of reconstructing it from two coarse booleans. Ready PRs now narrow too. Untrusted selection runs the full matrices on a ready PR and still skips them on a draft, which has its ready run as a backstop. The merge queue's trunk-merge/** run and master pushes never reach select-tests, so what actually gates master is unchanged. Trusting legacy diffs exposed a hole: several entries in the `legacy` paths filter are not Python, so the import graph reaches no test through them and the selector returned nothing. A quarantine lift or a C++ parser change would have gated on zero Django tests. Added the missing full-run patterns, plus a backstop that refuses to narrow to nothing when legacy files changed, so a future paths-filter entry that nobody teaches the selector about fails safe. Compat is now carried through selection instead of dropped, driven by the same env var the compat pytest run uses. It is inert until a second ClickHouse version lands, since all entries currently match. Also: select-tests decides trust before checking out, so an untrusted PR no longer clones the repo in front of the full matrix it is about to run; it moves to depot like every other pre-job on this critical path; and coverage instrumentation is gated on full runs, matching the report job that consumes it. DISABLE_BACKEND_TEST_SELECTION puts every PR back on the full matrices without a code change.
Generated-By: PostHog Desktop Task-Id: ef95bb24-cf25-4bf8-bd81-189d422cfac3
…-test-selection-all-prs
Destinations created from the Python-era template (before Oct 2025, including those bumped from 202409 by linked-api-version-update) build body.user.userInfo in place with no guard line, so the replace key bumped their header while leaving userInfo unguarded, trading the 426 for a 422 on any event without both names. The key now also rewrites that legacy userInfo section into the collect-and-guard form, and a new only_if_contains gate keeps those replacements off the deliberately excluded 202409 destinations.
Generated-By: PostHog Desktop Task-Id: 581b9408-d8ce-4150-9659-36c4c15f121d
Generated-By: PostHog Desktop Task-Id: f9e0a97b-8c72-41cd-93ee-95989ea9d9c9
Generated-By: PostHog Desktop Task-Id: f9e0a97b-8c72-41cd-93ee-95989ea9d9c9
Generated-By: PostHog Desktop Task-Id: 581b9408-d8ce-4150-9659-36c4c15f121d
Generated-By: PostHog Desktop Task-Id: f9e0a97b-8c72-41cd-93ee-95989ea9d9c9
… config instead of a custom session The previous fix passed a hand-built `session` in the Clever resource's client config, which bypassed `RESTClient`'s own tracked-session construction — and broke the existing test suite, which drives the sync end-to-end by mocking `rest_client.make_tracked_session`. Instead, add a `capture` option to `ClientConfig`/`RESTClient` that's threaded down to the default tracked session (`capture: bool = True`, backward compatible for every other source). Clever now sets `"capture": False` in its client config, keeping roster PII out of HTTP sample storage while leaving `RESTClient`'s normal session construction (and the existing tests that mock it) intact.
1 updated Run: ad7969c6-da18-4e4e-b1e0-b8ad4c601796 Co-authored-by: GeneralistDev <1705096+GeneralistDev@users.noreply.github.com>
Generated-By: PostHog Desktop Task-Id: 84d72519-5cb5-4c5e-af27-5b28a99e17cf
`get_resource()` returns `EndpointResource`, whose `endpoint` field is typed `str | Endpoint | None`. Indexing into it directly (`resource["endpoint"]["params"]`) doesn't type-check. Every other source's tests wrap the result in `cast(dict[str, Any], ...)` first (see `cast_ai`, `census`, etc.) — apply the same pattern here. This was the last cause of the "Python code quality (depot-ubuntu-24.04)" / "Check static typing" CI failure (10 mypy errors, all on these lines).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A release condition rollout percentage that is not a whole number fails to parse on .NET before 2.13.3 and Java before 2.12.1, which stops local evaluation for every flag in the project rather than just the edited flag. Show a warning above the release conditions naming the offending percentages and the minimum SDK versions. Skip client-only flags, which never run local evaluation, and skip multivariate variant rollouts, which those SDKs have always read as floats. Generated-By: PostHog Desktop Task-Id: b46f1d31-74ad-4a17-854c-4019b1e4e020
`BlueskyResumeConfig` used a bare `@dataclasses.dataclass` with no explicit `frozen=` choice. That trips two CI guards for new (non-grandfathered) dataclasses: - `posthog/test/repo_invariants/test_dataclass_defaults.py`, run as part of the backend "Repo checks" job. Its failure is treated as a deterministic failure and cancels the rest of the backend CI matrix (explains the Django/Python-quality/cascading-cancellation failures on this PR). - `.semgrep/rules/devex/prefer-frozen-dataclasses.yaml` (WARNING severity, but blocking on new findings via the "New warnings (blocking)" step in `semgrep-devex`), which feeds into "Semgrep Checks Pass". Sibling resumable sources added since the guard existed (e.g. `firebase.py`) use `@frozen` from `posthog.dataclasses` for their resume-config dataclass, constructed with keyword args exactly like `BlueskyResumeConfig` already is. Switched to the same pattern; no behavior change.
10 updated Run: 5e107aca-9988-4e3b-b28a-c71472a31529 Co-authored-by: HaynesPostHog <181385999+HaynesPostHog@users.noreply.github.com>
…ike protocol `VendrEndpointConfig` was a frozen dataclass but gets passed as `endpoint_configs: Mapping[str, FanoutEndpointLike]` to `build_dependent_resource`. mypy treats a frozen dataclass's fields as read-only, which doesn't structurally satisfy `FanoutEndpointLike`'s plain (read-write) attribute declarations - this is exactly the failure in the "Python code quality" CI check (`mypy`'s `arg-type` error on `build_dependent_resource`'s `endpoint_configs` argument). Fixed by setting `frozen=False`, matching the identical, already-established fix + comment on `YocoEndpointConfig` (same fan-out pattern, same protocol).
…umeConfig dataclass The bare `@dataclasses.dataclass` on `Dynamics365BusinessCentralResumeConfig` had no explicit `frozen=` choice, tripping the `prefer-frozen-dataclasses` repo-invariant guard (posthog/test/repo_invariants/test_dataclass_defaults.py) and the matching semgrep devex rule. Every sibling `*ResumeConfig` dataclass in this directory already declares `frozen=True`; this brings the new source in line with that convention. No behavior change — the config is only ever constructed with kwargs and never mutated after construction.
Generated-By: PostHog Desktop Task-Id: 581b9408-d8ce-4150-9659-36c4c15f121d
…l "tests" module collision CI's failure logs (surfaced via the Trunk Test Analytics PR comment) showed shopify's tests failing to import with "module 'tests.test_validate_credentials' could not be found" — not an asaas test failing directly. `asaas/tests/` and `shopify/tests/` are the only two source test dirs in the whole `sources/` tree that carry a `tests/__init__.py`; neither `asaas/` nor `shopify/` itself is a package (no `__init__.py`), so pytest's default import mode registers each as a top-level `tests` package rooted at its own vendor directory. With two vendors doing this, the second one collected shadows the first in `sys.modules["tests"]`, and the module actually imported wins — breaking the other vendor's test collection for the whole session, which is why every warehouse-sources CI shard failed identically. Every other of the ~650 source test directories has no `__init__.py`; matching that convention (removing the file added in this PR) fixes the collision without touching shopify's pre-existing one.
Generated-By: PostHog Desktop Task-Id: f9e0a97b-8c72-41cd-93ee-95989ea9d9c9
Slack linkifies a typed @PostHog even inside an org-scoped package or repo path, so writing @PostHog/react-native-plugin fires a real app_mention and starts an agent run against a prompt that is only the path's tail. Drop the event when every mention in the text sits directly before a slash. Requiring every mention to be glued leaves a message that also tags the app properly untouched, which avoids a users.info round-trip in the hot path. Generated-By: PostHog Desktop Task-Id: 257aa657-55f4-4d72-84dd-8d8057ac5e13
Offset slicing loaded every matching insight id into memory up front and re-walked the primary key index from the start on each batch. Keyset pagination scans forward from the previous batch's last id instead, matching how the rest of the repo batches (`hypercache_manager`, `resave_cohorts`, the dashboard tile backfill). The cursor is safe here because nothing in the batch writes touch `id`, so it can neither skip nor repeat a row. Each batch now fetches `Insight` rows directly rather than ids that the batch helper immediately refetched, so this drops a query per batch. Project scoping moves to the source queryset, which the batches are sliced from, so it is unchanged. `insights_considered` becomes a running counter, since there is no longer a full id list to take a length from. The test patches the batch size down to 2 over 5 insights. Nothing else in the class exercises more than one batch, so a cursor that fails to advance or advances too far would otherwise go uncaught. Generated-By: PostHog Desktop Task-Id: fbd7806c-cc0b-47a7-84ce-a5a26568f868
Contributor
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
Contributor
🤖 CI report
|
trunk-io
Bot
deleted the
trunk-merge/pr-73758/a92328c6-8265-4923-baf5-49831183c4d6
branch
August 19, 2026 17:25
Author
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.
This pull request was created and is being managed by Trunk Merge.
This pull request is based on the master branch at SHA 013921af19434fa91e43012b3dd21ef8c186856e.
See more details about each PR in the batch here:
When CI completes, this pull request will be closed automatically.
Pull Requests Being Tested
This pull request is testing a batch with the changes from pull requests 73758 and 84289 - batching documentation.
Dependencies
This pull request depends on the changes from pull requests 85236, 85514, 84617, 77555, 84373, 85235, 83909, 85530, 83139, 85108, 84348, 83858, 85681, 85597, 85612, 83976, 85322, 85743, 85682, 73764, 85716, 84345, 84453, 82973, 85646, 84531, 83323, 54933, 85529, 85084, 85793, and 83250.