fix(data-warehouse): use org id as distinct_id for dwh-postgres-cdc flag#59938
Merged
Conversation
Match PostHog convention for org-aggregated feature flags. Previously passed team.uuid as distinct_id while also passing the org as the groups/group_properties context, which is inconsistent with how similar flags are evaluated elsewhere (e.g. table.py warehouse-api). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
Reviews (1): Last reviewed commit: "fix(data-warehouse): use org id as disti..." | Re-trigger Greptile |
Contributor
ClickHouse migration SQL per cloud environmentNo ClickHouse migrations changed in this PR. |
MarconLP
approved these changes
May 27, 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.
Problem
The
dwh-postgres-cdcfeature flag is evaluated server-side inis_cdc_enabled_for_teamand on the frontend (viaposthog-jswith the org auto-bound as a group inuserLogic.ts). The flag's intent is org-level rollout, but the backend passedteam.uuidas thedistinct_idwhile supplying the organization ingroups/group_properties. That works, but it's inconsistent with how the rest of the codebase evaluates org-aggregated flags (e.g.warehouse-apiinproducts/data_warehouse/backend/api/table.py) and makes the evaluation semantics ambiguous before we widen the rollout.Changes
str(team.organization_id)as thedistinct_idinis_cdc_enabled_for_team, matching the existing convention used by other org-aggregated flag checks in the repo.userLogic.tsalready callsposthog.group('organization', user.organization.id, …), so org-aggregated evaluation works as-is for thefeatureFlags[FEATURE_FLAGS.DWH_POSTGRES_CDC]read inSourceForm.tsx.How did you test this code?
I'm an agent. No automated or manual tests were run for this one-line distinct_id swap; the change is type-preserving and the call site contract is unchanged. Pre-commit
ruff/tychecks passed via lint-staged.Publish to changelog?
no
🤖 Agent context
team.uuidas thedistinct_id; rejected because the flag will be flipped to org-aggregated with a kill-list condition for safe 100% rollout, and inconsistent identifiers across call sites make the kill switch behavior harder to reason about.posthog.isFeatureEnabledcall with manually-provided groups; rejected becauseposthog-jsalready has the org bound and the existing kea selector pattern is the standard.