Repository navigation
Conversation
An impression or click with neither resolvedBidId nor entity, and a purchase with a line that has no numeric price, are rejected by Topsort with a 400. They now fail in the transform with an InstrumentationError instead of being sent, so they no longer reject the batch they share and force every job in it to be re-sent on its own. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
…chase A line without a numeric price is dropped like a zero-priced one, so the rest of the purchase is still delivered. Only a purchase left with no priced line fails. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## contrib/5818 #5818 +/- ##
==============================================
Coverage 92.05% 92.05%
==============================================
Files 749 749
Lines 41973 41978 +5
Branches 9899 9790 -109
==============================================
+ Hits 38638 38643 +5
Misses 3152 3152
Partials 183 183 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks @bernirosas! This is merged into |
…5826) > **Contributed by @bernirosas in #5818** (fork PR). This PR brings their commits from `contrib/5818` to `develop` so the full CI (Docker build + ingestion-service test, SonarCloud) runs. **Merge with "Create a merge commit" (not squash)** to keep the contributor's commits on `develop`. ## What are the changes introduced in this PR? The Topsort destination no longer sends events or purchase lines that the Topsort Events API always rejects with a 400. | Event | Topsort's 400 | Now | | --- | --- | --- | | Impression or click with neither `properties.resolvedBidId` nor `properties.entity` | `Entity ... failed on the 'required_without' tag` | Fails with a 400 (`InstrumentationError`), not sent | | Purchase line with no price, or a non-numeric one | `UnitPrice ... failed on the 'required' tag` | The line is dropped, like a zero-priced one; the rest of the purchase is sent | | Purchase with no priced line left | `UnitPrice ...` / `no_purchase_items` | Fails with a 400 (`InstrumentationError`), not sent. All lines priced 0 is still skipped as filtered (298), as before | - Sponsored events (with `resolvedBidId`) and organic events (with `entity`) are unchanged. - The check covers every event a message fans out to over `products`, since both fields come from the message. - Zero-priced lines are still dropped as before (#5808). ## What is the related Linear task? N/A ## Please explain the objectives of your changes below Both rejections were observed on live Events API traffic, for clicks and purchase lines. No impression without `entity` showed up in that traffic, so the impression case follows the API reference (impressions and clicks share the same `resolvedBidId`/`entity` requirement) rather than an observed 400. Because the Events API rejects a whole request for one bad event, each of these events currently: 1. rejects the batch it is in, and 2. triggers the 400 handler's `dontBatch` retry, so every job in that batch is re-sent on its own before the bad one is finally aborted. Failing them in the transform keeps them out of the batch: the valid events go out on the first request, no extra per-job requests are made, and the failure shows in Live Events with a message naming the missing field. The 400 delivery handling is unchanged and still covers any other rejection. ### Any changes to existing capabilities/behaviour, mention the reason & what are the changes ? - Impressions and clicks without `resolvedBidId` or `entity` now fail in the transform instead of at Topsort. - A purchase line with no price was previously sent (#5808 kept it), which made Topsort reject the whole purchase. It is now dropped, so the purchase's priced lines are delivered. Everything that now fails or is dropped was already rejected by Topsort, so nothing that used to be delivered stops being delivered. Purchases with an unpriced line go from fully rejected to delivered without that line. ### 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? Fewer requests to Topsort: these events no longer cause a rejected batch followed by one request per job. <hr> ### Developer checklist - [x] My code follows the style guidelines of this project - [x] **No breaking changes are being introduced.** - [x] All related docs linked with the PR? - [x] All changes manually tested? - [ ] Any documentation changes needed with this change? - [x] 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**? 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Bernardita Rosas <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
What are the changes introduced in this PR?
The Topsort destination no longer sends events or purchase lines that the Topsort Events API always rejects with a 400.
properties.resolvedBidIdnorproperties.entityEntity ... failed on the 'required_without' tagInstrumentationError), not sentUnitPrice ... failed on the 'required' tagUnitPrice .../no_purchase_itemsInstrumentationError), not sent. All lines priced 0 is still skipped as filtered (298), as beforeresolvedBidId) and organic events (withentity) are unchanged.products, since both fields come from the message.What is the related Linear task?
N/A
Please explain the objectives of your changes below
Both rejections were observed on live Events API traffic, for clicks and purchase lines. No impression without
entityshowed up in that traffic, so the impression case follows the API reference (impressions and clicks share the sameresolvedBidId/entityrequirement) rather than an observed 400. Because the Events API rejects a whole request for one bad event, each of these events currently:dontBatchretry, so every job in that batch is re-sent on its own before the bad one is finally aborted.Failing them in the transform keeps them out of the batch: the valid events go out on the first request, no extra per-job requests are made, and the failure shows in Live Events with a message naming the missing field. The 400 delivery handling is unchanged and still covers any other rejection.
Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?
resolvedBidIdorentitynow fail in the transform instead of at Topsort.Everything that now fails or is dropped was already rejected by Topsort, so nothing that used to be delivered stops being delivered. Purchases with an unpriced line go from fully rejected to delivered without that line.
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?
Fewer requests to Topsort: these events no longer cause a rejected batch followed by one request per job.
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?
🤖 Generated with Claude Code