Repository navigation
fix(openai_ads): honor destination hashing configuration - #5718
Conversation
|
👋 I'm rudder-devbox. I opened this PR from a Linear ticket. Mention |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
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 @@
## develop #5718 +/- ##
===========================================
+ Coverage 92.33% 92.35% +0.02%
===========================================
Files 737 737
Lines 40850 40848 -2
Branches 9507 9505 -2
===========================================
+ Hits 37719 37726 +7
+ Misses 2947 2938 -9
Partials 184 184 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@rudder-devbox please address the following review feedback on this PR:
|
|
@rudder-devbox follow-up that supersedes item 2 of my previous comment (the Auto-hash the
Tests (replacing the ones requested in item 2), all with
PR description: document that with hashing disabled, email, phone, first/last name, and |
|
Implemented the superseding anonymous-ID behavior. With hashing disabled, a fallback Added the three requested focused cases and updated the PR description with the config PR link and the corrected identifier contract. Validation passed: lint, 88 unit tests, 14 component tests, TypeScript, full secret-path regeneration, and Pushed in 7e9fdc112af138e659b4bf1344a5f7ade448d936. |
|
Knowledge distillation completed |
|
Knowledge distillation completed |
|
Knowledge distillation completed |
|
| }; | ||
|
|
||
| const hashUserPayload = ( | ||
| const processHashedUserPayload = ( |
There was a problem hiding this comment.
| const processHashedUserPayload = ( | |
| const processUserPayload = ( |
HashedUserPayload is confusing as it implies input is already hashed @ItsSudip



What are the changes introduced in this PR?
OpenAI Ads cloud transformations now honor destination-level
isHashRequired. Hashing remains enabled when the setting is absent, while disabling it accepts valid pre-hashed customer identifiers and lowercases them before delivery.When hashing is disabled and
userIdis absent, the SDK-generatedanonymousIdfallback is handled separately: an existing SHA-256 digest passes through lowercased, while a plain value is normalized and hashed through the existing external-ID path. Audience hashing consistency metrics also carry the real workspace and destination identifiers.The transformer passes only plain destination metadata through the OpenAI Ads builder. The descriptor required by
processAudienceRecordis constructed at the utility call boundary, and hash-format recognition is shared with audience consistency validation.Focused unit and component coverage verifies enabled, disabled, and default behavior, all supported hashed identifiers, anonymous-ID fallback handling, mixed/plain input rejection, metric attribution, and the shared hash-format predicate.
What is the related Linear task?
Resolves INT-7432
Please explain the objectives of your changes below
Allow customers that hash OpenAI Ads identifiers upstream to disable transformer hashing without changing the existing default behavior. The matching destination configuration is provided by rudder-integrations-config#2864.
Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?
When
isHashRequiredisfalse, email, phone number, first name, last name, anduserIdmust already be normalized and SHA-256 hashed; plain values remain rejected. Pre-hashed values are emitted as lowercase hexadecimal strings. IfuserIdis absent, RudderStack automatically normalizes and hashes a plainanonymousIdfallback, or lowercases and passes through an already-hashed fallback. An absent ortruesetting retains the existing normalization and hashing behavior.Any new dependencies introduced with this change?
N/A
Any new generic utility introduced or modified. Please explain the changes.
Exposes
isAlreadyHashed(value, hashingType)from the shared audience utility and uses it in both hashing-consistency validation and the OpenAI Ads anonymous-ID fallback decision. The shared digest regex remains the single definition of an already-hashed value.Any technical or performance related pointers to consider with the change?
OpenAI Ads passes
workspaceIdanddestinationIdas plain metadata through its builder.processHashedUserPayloadconstructs the destination descriptor only whereprocessAudienceRecordis called, preserving the uppercaseOPENAI_ADSmetric series without leaking the audience utility input shape through the transformer.Validation
npm run lint- passednpm test -- --testPathPattern="src/v0/(destinations/openai_ads/routerTransform|util/audienceUtils).test.ts" --no-coverage --runInBand- passed, 120 testsnpm run test:ts -- component --destination=openai_ads- passed, 14 tests./node_modules/.bin/tsc --noEmit -p tsconfig.test.json- passedheaders.Authorization, and the aggregate artifact remains unchangedgit diff --check- passedisHashRequiredwill follow in rudder-sdk-js#3295.rudder-hugodocumentation covering pre-hashed customer identifiers, automatic anonymous-ID fallback hashing, normalization responsibilities, and both cloud and web device-mode behavior.Developer checklist
rudder-hugodependency described above.Reviewer checklist