Repository navigation
fix(twitter_ads): classify non-string identifier failures as validation errors - #5752
Conversation
|
👋 I'm rudder-devbox. I opened this PR from task Mention |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #5752 +/- ##
========================================
Coverage 92.42% 92.42%
========================================
Files 741 741
Lines 41048 41059 +11
Branches 9635 9643 +8
========================================
+ Hits 37938 37949 +11
Misses 2848 2848
Partials 262 262 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Reuse integrations-lib isPrimitive instead of a local type list, read all identifiers together, compute the lowercased event name once, and drop the unreachable bigint from the validation message. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…error Numeric and boolean email/phone/ip_address/user_agent values crashed on trim() with a 500; abort them with an InstrumentationError instead of coercing them into hashes of "true"/"0". twclid keeps its original handling since it never crashed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the Twitter Ads identifier-validation changes.
No open issues 🎉
What changed in this PR
This PR updates the Twitter Ads transformer so malformed identifiers produce non-retryable validation errors rather than transformer failures, while preserving valid string handling and hashes.
Changes:
- Add field-specific validation for non-string email, phone, IP address, and user agent values.
- Skip non-string event mapping names so unmatched events reach the existing configuration error.
- Add processor regression fixtures for malformed identifiers, whitespace-only phones, and invalid mapping names.
| File | Description |
|---|---|
test/integrations/destinations/twitter_ads/processor/data.ts |
Adds regression cases for identifier validation and malformed event mappings. |
test/integrations/destinations/twitter_ads/common.ts |
Provides shared destination and authentication fixtures. |
src/v0/destinations/twitter_ads/transform.js |
Validates identifier types before trimming and guards event mapping name types. |
Review effort: Balanced
|
Both ARM64 image jobs failed in I set a bounded 30-second timeout for those component cases. The affected fixtures and Twitter Ads component tests pass locally; TypeScript and Prettier checks pass. The fix is pushed and CI will run on the new commit. |
|
Knowledge distillation completed |
|



What are the changes introduced in this PR?
Reject non-string
email,phone,ip_addressanduser_agentvalues with field-specific validation errors, and safely handle malformed event-name configuration. Add processor regression fixtures.What is the related Linear task?
Resolves INT-7478
Please explain the objectives of your changes below
Prevent malformed customer identifiers from surfacing as retryable transformer 500s. Preserve valid string request shapes and hashes.
Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?
Every non-string identifier (number, boolean, array, object) that previously crashed
trim()with a 500 now aborts with a 400InstrumentationErrornaming the field; values are not coerced, so nothing is hashed from"true"or"0".twclidhandling is unchanged (it never crashed). Whitespace-only phone values fall through to the existing missing-identifier guard. Invalid event-name mappings reach ConfigurationError.Any new dependencies introduced with this change?
None.
Any new generic utility introduced or modified. Please explain the changes.
None; the existing integrations-lib predicate is reused.
Any technical or performance related pointers to consider with the change?
Monitor Twitter Ads abort counts after rollout and notify the affected account owner: malformed events will shift from retryable 500s to non-retryable 400s.
Validation
npm run lint— passed.npm run build:ciandnpx tsc --noEmit -p tsconfig.test.json— passed.npm test -- --testPathPattern=twitter_ads --no-coverage --runInBandandnpm run test:ts -- component --destination=twitter_ads --runInBand— passed.Full-corpus secret-path regeneration and
npm run check:secret-paths— passed; no artifact diff.Local
miniverification: built the transformer fromdevelopand from this branch and sent the same track events to/v0/destinations/twitter_adsand/routerTransform:developproperties.phonetransformation—phone?.trim is not a functioninstrumentation—properties.phone must be a string, received numberproperties.emailtransformationinstrumentationproperties.phonetransformationinstrumentation— namesproperties.phonerudderEventNamein configtransformationconfiguration(no matching eventId)Simplify pass: reused the existing
isDefinedAndNotNull/getTypehelpers; removed a redundant post-trim blankness check.npm run buildcannot complete here because its copy step requires the unavailable system executablecpio;npm run build:cipassed.Developer checklist
Reviewer checklist