Repository navigation
feat(pinterest_audience): add router destination on the batching framework (ACT2-1194) - #5680
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rage 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 ⚙️ 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 #5680 +/- ##
===========================================
+ Coverage 92.16% 92.21% +0.04%
===========================================
Files 719 725 +6
Lines 40017 40174 +157
Branches 9366 9321 -45
===========================================
+ Hits 36883 37045 +162
- Misses 2869 2945 +76
+ Partials 265 184 -81 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…definition asks for records_v2 Includes the component fixtures for both formats (T2+T3). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…terest-audience # Conflicts: # src/features.test.ts # src/features.ts
Review panel: Pinterest Audience D15 (classic
|
| PR | Head |
|---|---|
| config #2839 | d439f807 |
| transformer #5680 | fb3e9cf55 |
| info #800 | 2207389 |
| webapp #10275 | 366cf83e4 |
| Lookout #966 | 2c05d2cdc |
| webapp #10280 | 00d60d47c |
| specs #224 | 17fa950 |
Tally: 5 lenses (security, correctness, product, ops, coherence), 2 adversaries, both HOLDS. Codex was unavailable because the provider key is missing from its runtime.
Live verification (mini, real Pinterest, conn 3KjkihtPMxpVKN9rZfN8e5OsUId, 145 rows, full sync)
Definition config.recordFormat (served after a forced workspace-config cache rebuild) |
Body sent | Sync result | |
|---|---|---|---|
records |
classic records string |
200 | 145/145 succeeded (run dbau6vaqj4as73c35krg) |
records_v2 |
multi-field records_v2 |
403 {"code":29} |
0/145, every row aborted with the actionable "Pinterest refused the request…" message (run dbau2vaqj4as73c35kq0) |
This proves the wiring end to end: definition config → config-backend → rudder-server → transformer DestinationDefinition.Config.recordFormat.
Note for anyone repeating this: a direct DB edit of the definition is not served until the workspace-config cache is rebuilt. Our first records_v2 attempt went out classic for exactly that reason: Redis sits between config changes and data-plane polling. Use the APIs or force a cache rebuild.
The earlier pass is verify/2026-10-19-full-pass.md: web-app create, 150/150 adds (EMAIL+MAID), 5/5 mirror removes. It ran webapp at 2b41f8dab. The later webapp commits (MappingCell, icon alignment, master merge) are covered by unit tests and the before/after screenshots on #10275.
Findings
Should-fix
-
The D15 flip recipe is incomplete and has no order. Survived the adversary. spec D15 (
spec.md:129) and the chore(deps): bump docker/build-push-action from 4.1.1 to 5.1.0 #2839 body say "one-line config PR + info PR re-adding PHONE". The flip also has to restore:- PHONE in config
mappingGuidance(db-config.json); - the webapp phone/country-code hint;
- the phone line in Lookout's
aboutandhashesPiiDescription.
Order matters. Info first means PHONE shows up in the mapper while the transformer is still on classic, so a PHONE-only row aborts (D21) and phone is silently dropped from mixed rows (D20). Config first is harmless. Fix: write the checklist and order into D15 and §10.
- PHONE in config
-
A saved PHONE mapping is silently ignored, and nothing explains it. Survived the adversary; executed.
- info
/setupacceptsto: PHONE. - The webapp shows a raw
PHONEvalue with no option behind it. - Lookout prints it verbatim.
- The transformer drops it before processing, so nothing is counted as invalid.
Only dev, mini and agent-written connections can hold such a mapping, since Pinterest is unreleased. Fix: one sentence in
mappingGuidance, e.g. "PHONE is not supported yet; mappings to it are ignored." - info
-
PR bodies are stale.
- feat(pinterest_audience): add router destination on the batching framework (ACT2-1194) #5680, Clevertap: timestamp fix #800, #10275 and CustomerIO Source - addl. event support #966 still say writes fail "while the app is on Trial". D15 says the tier was never the cause.
- #10275 still lists the phone country-code help and "icons follow the release". It does not mention the shared
MappingCellmin-width: 0change, which affects every form built onVisualMapperSection. - CustomerIO Source - addl. event support #966 still mentions the phone country code and "red until the icons release".
- feat(pinterest_audience): add router destination on the batching framework (ACT2-1194) #5680 still lists P1 as provisional, and so does
transformer config.ts:18. P1 passed on 10-16 (≥10k identifiers).
-
Spec text contradicts D15 and chore(deps): bump docker/build-push-action from 4.1.1 to 5.1.0 #2839. None of these were in the delta:
- D2 (
:117, "email, MAID, phone"); - D4 (
:119, Trial); - D5 (
:120,records_v2); - the status line "D1–D14";
- the endpoints table (
:191,193); - §4 (
:292,^.{1,100}$; the KSUID rule is missing); - the sample
mappingGuidance(:277); - §12 acceptance (
:583, "map email/MAID/phone"); - the observability doc (429s blamed on Trial, no
403 code 29troubleshooting row).
- D2 (
-
Lookout CustomerIO Source - addl. event support #966 conflicts with
main. HubSpot fetchV2 api support (#916) #919 added rows next to Pinterest's inui/src/audiences/icons/DestinationTypeIcon.tsxanddocs/data-handling.md. Keep both sides, then re-run the tests foractivation-destinationsanddestinationTypes.
Nits
- The transformer
it.eachshould pin that"RECORDS_V2"and" records_v2"resolve to classic. Mutation T2 survived. - The config
recordFormatenum has no negative test. Widening or deleting it passes every test. - The D20 test claims "not counted as invalid" but never spies on the stat.
schemaGenerator.py -updatewithout--skip-deletionsstrips the KSUIDallOf. The fixtures catch that. Add a$comment, and change the chore(deps): bump docker/build-push-action from 4.1.1 to 5.1.0 #2839 body from "no diff" to "no warnings".- spec
:363and infoconfig.ts:32say create "accepts either format". Evidence showsrecords_v2creates also get a 403. The intended claim is that classic works before and after the flip. - The webapp master merge also carries a blank line in
.agents/knowledge/architecture.mdand a brace reformat instepsStore.ts. Harmless.
Held up (checked)
- Customers can't set the format.
recordFormatis read only from the definition config.DestinationDefinitionT{ID,Name,DisplayName,Config}has noOptions, soconfigwas the right home.- Absent, unknown, non-string, case-variant or padded values all resolve to classic, which fails safe.
- No release order sends
records_v2early.
- The classic body is correct.
recordsis the comma-joined SHA-256 values, one identifier per record.- Order is kept, and an email+MAID row becomes 2 records.
- Each request holds one list and one operation.
- Hex values can't contain commas, and no raw PII or values appear in errors or logs.
- The KSUID
rudderAccountIdrule compiles under config-backend's Ajv (strictTypes)."", 26-character, non-base62 and trailing-newline ids are rejected, and a 27-character KSUID is accepted.- It is enforced on create and update (
VALIDATION_ENABLED=truein every environment). - The workspace-scoped account lookup is unchanged.
- info always seeds classic, and
/listFieldsreturns EMAIL+MAID. - Mutations: 27 of 31 were killed by tests. The 4 survivors are the test gaps listed in the nits.
- Tests pass in every repo:
- transformer 91/91 + 16/16 component on the merge head;
- info 73/73;
- config 6,451/6,451;
- webapp: 459 tests across 45 suites under
forms/**andconfigurationV2; - Lookout 123 + 80.
- The mapper fix applies
MappingCellto all four cells. Long labels truncate and keep their nativetitletooltip. #10280 changes exactly 12 forms frombaselinetoalignItemsCenter, and no column-option Flex is left onbaseline. - Merge resolutions keep both sides. The transformer has
PINTEREST_AUDIENCE+HS_AUDIENCE; the webapp registry has Pinterest + HubSpot. Everything except CustomerIO Source - addl. event support #966 merges cleanly against its base.
Limits
- Codex was unavailable (
AZURE_FOUNDRY_KEYmissing from the runtime), so there was no second-model lane. records_v2success can't be shown until Pinterest enables it for app 1624584 (request filed).- No live check that MAIDs in a
list_type: EMAILlist actually match. Pinterest's counters only confirm receipt.
…ilent PHONE drop - resolveRecordFormat: "RECORDS_V2", " records_v2", "records_v2 " and null stay classic, so a forgiving resolver (trim/lowercase) can no longer switch to records_v2 unnoticed. - D20 now spies on stats.increment with a too-short phone, so it fails if PHONE reaches processAudienceRecord under the classic format instead of being dropped first. - config.ts: P1 ran on 2026-10-16 (>= 10,000 classic identifiers accepted); the MAX_RECORDS_PER_REQUEST comment no longer calls it provisional. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review feedback: a 401 whose body did not match the auth pattern was retried with the same token, which cannot succeed and only burned router retries. Every 401 now returns authExpired (REFRESH_TOKEN). A refresh that was not needed is harmless, a revoked grant fails the refresh and is handled by rudder-auth, and the provisional auth-message pattern (probe P5) is no longer needed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tant Review on rudder-integrations-config#2839: `recordFormat` is Pinterest-specific and should not be declared in the shared definition schema. The body format is now `RECORD_FORMAT` in config.ts (classic `records`) instead of the definition's `config.recordFormat`. The `records_v2` path stays; switching to it is a code change released with the info and UI steps in spec D15. Unit tests switch the format with `jest.replaceProperty`, and D19 now proves a `recordFormat` on the definition is ignored. Component and delivery fixtures use the classic body only. The records_v2 duplicate of the mixed-identifier case is dropped, and D7 now uses an invalid email. Co-Authored-By: Claude Opus 5.5 <[email protected]>
am6010
left a comment
There was a problem hiding this comment.
Reviewed with a small panel: one read-only reviewer that ran the tests in its own worktree, plus a challenger that tried to refute each should-fix. Reviewed at b6b8f3c21, then re-checked at d49aa9637, where the record format became a code constant.
Nits
- The "every 401 refreshes" behaviour has only unit tests. The thread reply says component tests were updated, but the only dataDelivery 401 case (
dataDelivery/data.ts:107) still sends the auth body{code:2,"Authentication failed."}. Add one empty-body 401 case that expectsREFRESH_TOKEN. The old non-auth branch would have aborted, so this is the case worth pinning. delivery.ts:56-59: the 403 message usesmessageOf()where the other branches useextractPinterestErrorMessage(), so the top-level reason never shows Pinterest's code. It always says "Check the connected account still has access to ad account X". That points the wrong way for code 29, the expected refusal when the constant is switched torecords_v2before Pinterest enables it. UseextractPinterestErrorMessage, and optionally add a code-29 hint.- The PR body says "unit 79/79". At
b6b8f3c21there were 78, and the count has changed again since.
Verified
- 205/205 unit tests (including the batching framework) and 16/16 component tests pass at
b6b8f3c21. - A 1001-row probe split into 1000 + 1, with each job output exactly once and in order.
- Emails are trimmed and lowercased, and MAIDs are validated and lowercased.
- PHONE is dropped before validation under classic.
- 429 still falls back to throttled (D16), and 403/404/400/1001/1018 abort.
- No raw PII appears in errors.
secretPathsmasksAuthorization.- The required connection fields match what info #800's
/setupwrites.
|
|
Post-merge review (this PR merged on 2026-10-20 at the reviewed head). None of these blocks; they are follow-ups. These are LLM findings, needs human review. Each was checked by an Opus and a Codex validator that tried to refute it.
|



feat(pinterest_audience): router destination on the batching framework
DestinationIntegration, router only, registered asPINTEREST_AUDIENCE: { routerTransform, batching }. The proxy is on by default.PATCH /v5/ad_accounts/{ad}/customer_lists/{list}, withoperation_typeADD (insert/update) or REMOVE (delete) and the body format set byRECORD_FORMATinconfig.ts(classicrecordsstring;records_v2rows are kept for later, see Record format below).records_v2; the classic body drops PHONE. Then SHA-256, controlled by the connection'sisHashRequired.headers.Authorization. The CI check passes against integrations-configmain.MAX_RECORDS_PER_REQUEST=1000stays. The 2026-10-16 probe accepted ≥10,000 identifiers in one request.authExpired(REFRESH_TOKEN), so it refreshes and retries. A same-token retry can't succeed (review feedback, b6b8f3c), so no auth-body pattern is needed.live.ts, which follows with the CI secret.--testPathPattern=pinterest_audience) and component 16/16, including mixed connections, a hashing mismatch, and both record formats.Spec: rudder-specs #224, at
lookout-audiences-initiative/activations/pinterest-audience/spec.md. Tickets: ACT2-1194 and ACT2-1195. Customer: Crate & Barrel.Review: this went through a pre-PR review panel (security, correctness, product, ops, coherence, plus 4 adversarial checks). The verdict was Approve with follow-ups, with nothing blocking, and all fixes have been applied and re-reviewed. The record is
verify/2026-10-15-review-panel.mdin the spec PR.Second panel (2026-10-19, D15 delta): Approve with follow-ups, nothing blocking. See the review comment on this PR.
Verified on mini against a real Pinterest account:
state)./setupfor an existing audience.verify/2026-10-19-full-pass.md): a web-app create sent 150/150 adds as classicrecords(EMAIL + MAID), and removing 5 members sent 5/5 removes.403 · 29was never the Trial tier. Standard access was granted on 2026-10-16 and the error stayed. Pinterest enables the multi-fieldrecords_v2body per app, and ours isn't enabled yet (request filed). That's why v1 sends the classic format (D15).records_v2was refused 0/145 with403 · 29, andrecordsdelivered 145/145. The switch is now the transformer constantRECORD_FORMAT(review on config chore(deps): bump docker/build-push-action from 4.1.1 to 5.1.0 #2839).Merge order (spec §10):
hidden: true)@rudderlabs/icons0.6.0)RS_ACCOUNTS_OAUTH_DEFINITIONShidden: false(Standard was granted 2026-10-16)Record format (D15): the body is the classic
recordsstring (SHA-256 values joined by commas, one identifier per record, PHONE dropped).RECORD_FORMATinconfig.tsselects it, and therecords_v2multi-field path stays for when Pinterest enables it for our app. Why: on 2026-10-16 Pinterest returned 403 code 29 forrecords_v2and 200 forrecordson the same list for app 1624584 on Standard. An earlier revision read the format from the definition'sconfig.recordFormat; integrations review on config #2839 moved it into code, so the shared definition schema stays Pinterest-free. ArecordFormaton the definition is ignored (test D19).🤖 Generated with Claude Code