chore(cdp): remove the legacy Kafka batch hogflow consumer and routing#67274
Merged
Conversation
All batch hogflow traffic now goes through the cyclotron/Postgres resolver (charts flip landed and soaked). This rips out the Kafka path: - CdpBatchHogFlowRequestsConsumer + its tests - CDP_BATCH_HOGFLOW_REQUESTS_TOPIC / _PRODUCER config + producer registry - CDP_BATCH_RESOLVER_ROUTING (matcher and per-team allowlist) - CDP_BATCH_WORKFLOW_PRODUCER_BATCH_SIZE (only the deleted consumer used it) - PluginServerMode.cdp_batch_hogflow_requests + cdpBatchHogFlow capability - KAFKA_CDP_BATCH_HOGFLOW_REQUESTS constant - BATCH_HOGFLOW_REQUESTS_OUTPUT + BatchHogflowRequestsOutput - Kafka-asserting tests in cdp-api.test.ts; legacy-fallback assertions in workflows-e2e.test.ts; stale references in comments cdp-api's batch invocation handler now always dispatches to the cyclotron resolver and throws if CYCLOTRON_NODE_DATABASE_URL isn't set. No follow-up needed on producers/tests — the resolver path is what production has been running everywhere. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
Reviews (1): Last reviewed commit: "chore(cdp): remove the legacy Kafka batc..." | Re-trigger Greptile |
mayteio
approved these changes
Jul 2, 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
Once PostHog/charts#12716 has soaked and every team is routed to the cyclotron/Postgres batch resolver, the Kafka path (
CdpBatchHogFlowRequestsConsumer,CDP_BATCH_RESOLVER_ROUTINGmatcher,cdp_batch_hogflow_requeststopic producer) has zero traffic. This PR removes it end to end so nobody has to hold two paths in their head.Changes
Deleted:
nodejs/src/cdp/consumers/cdp-batch-hogflow.consumer.tsnodejs/src/cdp/consumers/cdp-batch-hogflow.consumer.test.ts(903 lines)Config cleanup:
CDP_BATCH_HOGFLOW_REQUESTS_TOPIC/CDP_BATCH_HOGFLOW_REQUESTS_PRODUCER(fields, defaults,CdpCoreServicesEnvtype union, producer-registry registration)CDP_BATCH_RESOLVER_ROUTING(config field,buildIntegerMatcherWithPercentagesetup, the routing branch incdp-api.ts)CDP_BATCH_WORKFLOW_PRODUCER_BATCH_SIZE(only the deleted consumer used it)KAFKA_CDP_BATCH_HOGFLOW_REQUESTSconstantBATCH_HOGFLOW_REQUESTS_OUTPUT+BatchHogflowRequestsOutputtypePluginServerMode.cdp_batch_hogflow_requestsand thecdpBatchHogFlowcapability fieldcdp-api.ts: the batch invocation handler is now unconditional — always dispatches to the cyclotron resolver, throws early ifCYCLOTRON_NODE_DATABASE_URLisn't set (previously the null-producer error hid behind the routing branch).Test cleanup:
cdp-api.test.ts— dropped the two Kafka-asserting tests (queues batch job request to kafka,queues batch job with filters from hog flow config when not provided), simplified the surviving cyclotron test now that there's no routing matcher to stubworkflows-e2e.test.ts— dropped thePOST /batch_invocations with no routing match falls back to the legacy Kafka pathtest, droppedCDP_BATCH_RESOLVER_ROUTING: '*'fromcreateHub, updated the staleCdpBatchHogFlowRequestsConsumerreference in a helper commentBlocking
Merge only after PostHog/charts#12716 has been live for a few days and metrics confirm the Kafka path is idle. Rollback if issues surface: revert this PR + the charts flip together.
How did you test this code?
Agent-authored, no manual runtime verification. Locally:
pnpm typescript:check— cleanpnpm lint— cleanAutomatic notifications
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Tool: Claude Code (Opus 4.7, 1M context). No mandatory skills matched — this is straight deletion of a code path, no DRF, no migrations, no new tests. The
writing-testsskill was flagged only because I edited tests, but those edits are mechanical removals of assertions on deleted behavior (exempt per the skill's own carve-out for "touching a test file for an unrelated reason").Decisions:
cdp-api.tsat request time instead of at boot. Rationale: matches the existing pattern (dev environments withoutCYCLOTRON_NODE_DATABASE_URLstill boot, they just can't handle batch triggers), avoids a boot-time coupling for a code path most local dev never exercises.convertBatchHogFlowRequestToHogFunctionInvocationGlobalsinutils.ts— the new cyclotron resolver still calls it. Name is a bit fossilized but renaming is scope creep.outputsfield wired throughcdp-services.ts(still used by other producers like warehouse webhooks and precalculated events). Only pruned the batch-hogflow slot.