Repository navigation
feat(topsort): move to batching framework with dontBatch delivery - #5618
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/topsort-batching-framework #5618 +/- ##
===================================================================
+ Coverage 93.03% 93.12% +0.09%
===================================================================
Files 731 700 -31
Lines 39440 38534 -906
Branches 9249 8992 -257
===================================================================
- Hits 36692 35886 -806
+ Misses 2549 2439 -110
- Partials 199 209 +10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
## What are the changes introduced in this PR? Merges the Topsort feature branch into `develop`. It contains: - #5606 (contributed by Topsort): deterministic event ids so retries are idempotent (`<messageId>`, or `<messageId>-<index>` for events fanned out from `properties.products`), removal of the `additionalAttribution` mapping, and chunking at the Events API's per-array cap of 50. - #5618: moves Topsort fully onto the batching framework. - Registers `TOPSORT: { routerTransform: true, batching: true, transformerProxy: true }` in `src/features.ts`. - Removes the legacy `process` / `processRouterDest` transform and the processor test fixtures; the destination is router-only. - Converts the destination to TypeScript. - Requires `messageId` in the input schema. - Sends impressions, clicks and purchases in one request, each array capped at 50. - Adds `delivery.ts`: a 400 from the Events API retries each job on its own with `dontBatch: true`; a job already sent alone is aborted. ## What is the related Linear task? Resolves INT-7228 ## Please explain the objectives of your changes below **Dependent change:** rudder-integrations-config #2763 (`transformAtV1: "router"` for Topsort) is merged. It must be released before this PR, because this PR removes the processor `process` transform. ### Any changes to existing capabilities/behaviour, mention the reason & what are the changes ? - Topsort is router-only; the processor route (`/v0/destinations/topsort`) is no longer supported. - The `id` sent for events carrying a `products` array changes to `<messageId>-<index>`. - `additionalAttribution` is no longer mapped. - Events of different types share a request. - A message without `messageId` fails with `message.messageId: Required`. - A 400 from Topsort retries each job alone (`dontBatch`) instead of aborting the batch. ### Any new dependencies introduced with this change? N/A ### Any new generic utility introduced or modified. Please explain the changes. N/A ### Any technical or performance related pointers to consider with the change? N/A <hr> ### Developer checklist - [x] My code follows the style guidelines of this project - [ ] **No breaking changes are being introduced.** - [ ] All related docs linked with the PR? - [ ] All changes manually tested? - [ ] Any documentation changes needed with this change? - [ ] Is the PR limited to 10 file changes? - [x] Is the PR limited to one linear task? - [x] Are relevant unit and component test-cases added in **new readability format**? ### Reviewer checklist - [ ] Is the type of change in the PR title appropriate as per the changes? - [ ] Verified that there are no credentials or confidential data exposed with the changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: bernirosas <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]> Co-authored-by: Bernardita Rosas <[email protected]>



What are the changes introduced in this PR?
Moves the Topsort destination fully onto the batching framework and makes it router-only.
TOPSORT: { routerTransform: true, batching: true, transformerProxy: true }insrc/features.ts, so the destination is GA on the framework for every workspace.process/processRouterDesttransform (transform.js,purchase.js,impressions-and-clicks.js,utils.js,config.js) and the processor test fixtures.config.ts,types.ts,utils.ts(buildTopsortEvents) androuterTransform.ts.messageIdin the input schema. Event ids are derived from it (<messageId>or<messageId>-<index>for fanned-out products), so an event without one now fails on its own instead of being sent with anundefinedid.delivery.ts: a 400 from the Events API rejects the whole request, so every job is retried on its own withdontBatch: true; a job that was already sent alone is aborted. Other statuses keep the framework default. Failure reasons are built from Topsort's[{ errCode, message }]error array.What is the related Linear task?
Resolves INT-7228
Please explain the objectives of your changes below
Follow-up to #5606 (merged into
feat/topsort-batching-framework).Dependent change: rudder-integrations-config must set
transformAtV1: "router"for Topsort before this is released (rudderlabs/rudder-integrations-config#2763). This PR removes the processorprocesstransform, which Topsort uses while its definition is onprocessor.Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?
/v0/destinations/topsort) is no longer supported.messageIdfails withmessage.messageId: Required.dontBatch) instead of aborting the batch.Any new dependencies introduced with this change?
N/A
Any new generic utility introduced or modified. Please explain the changes.
N/A
Any technical or performance related pointers to consider with the change?
Combining event types reduces the number of requests for mixed traffic by up to 3×. A rejected batch costs one extra request per job when it is retried with
dontBatch.Developer checklist
My code follows the style guidelines of this project
No breaking changes are being introduced.
All related docs linked with the PR?
All changes manually tested?
Any documentation changes needed with this change?
Is the PR limited to 10 file changes?
Is the PR limited to one linear task?
Are relevant unit and component test-cases added in new readability format?
Reviewer checklist
Is the type of change in the PR title appropriate as per the changes?
Verified that there are no credentials or confidential data exposed with the changes.
🤖 Generated with Claude Code