Skip to content

fix: tiktok audience role for migration#2374

Open
achettyiitr wants to merge 1 commit intodevelopfrom
fix.tiktok-audience-role
Open

fix: tiktok audience role for migration#2374
achettyiitr wants to merge 1 commit intodevelopfrom
fix.tiktok-audience-role

Conversation

@achettyiitr
Copy link
Member

@achettyiitr achettyiitr commented Mar 4, 2026

🔒 Scanned for secrets using gitleaks 8.29.1

What are the changes introduced in this PR?

  • Add role to TikTok Audience for migration.

What is the related Linear task?

  • Resolves INT-6030

Summary by CodeRabbit

  • New Features
    • Added an audience identifier field with pattern validation and a configurable "is hash required" flag (default: true) for TikTok Audience settings.
  • Chores
    • Enhanced TikTok Audience authentication metadata with a dedicated role attribute to improve integration handling.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2026

📝 Walkthrough

Walkthrough

Adds a role: "tiktok_audience" to the auth object in the TikTok audience destination configuration and two new schema properties—isHashRequired (boolean, default true) and audienceId (string with pattern)—to the destination's JSON schema.

Changes

Cohort / File(s) Summary
TikTok Audience Configuration
src/configurations/destinations/tiktok_audience/db-config.json
Added role: "tiktok_audience" inside the auth object alongside existing type: "OAuth".
TikTok Audience Schema
src/configurations/destinations/tiktok_audience/schema.json
Added new public properties: isHashRequired (boolean, default true) and audienceId (string with a compound pattern).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped into JSON, tidy and spry,
A role and two fields now live nearby,
Hashes and audiences neatly aligned,
A tiny config tweak—cheerful and kind! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete compared to the template. It provides only the changes summary and Linear task, but omits critical required sections like PR objectives, dependent changes, breaking changes assessment, and all developer/reviewer checklists. Complete the PR description by filling in all required template sections including objectives, dependent changes, breaking changes assessment, and checking off relevant developer and reviewer checklist items.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: tiktok audience role for migration' clearly and specifically summarizes the main change: adding a role field to TikTok Audience configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix.tiktok-audience-role

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@achettyiitr achettyiitr changed the title fix: tiktok audience role fix: tiktok audience role for migration Mar 4, 2026
@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (2f88f37) to head (a7b446b).

Additional details and impacted files
@@            Coverage Diff            @@
##           develop     #2374   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines           72        72           
  Branches         8         8           
=========================================
  Hits            72        72           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

🔒 Scanned for secrets using gitleaks 8.29.1
@achettyiitr achettyiitr force-pushed the fix.tiktok-audience-role branch from 53f45af to a7b446b Compare March 4, 2026 16:57
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/configurations/destinations/tiktok_audience/schema.json (1)

5-17: ⚠️ Potential issue | 🟠 Major

Add audienceId to the schema's required array.

The UI config enforces audienceId as required, but the schema validation doesn't. Other audience destinations like bingads_audience and launchdarkly_audience include audienceId in their required arrays.

🔧 Proposed fix
-    "required": ["rudderAccountId"],
+    "required": ["rudderAccountId", "audienceId"],
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/configurations/destinations/tiktok_audience/schema.json` around lines 5 -
17, The JSON schema's required array currently only lists "rudderAccountId" but
must also require "audienceId"; update the schema's "required" array to include
"audienceId" alongside "rudderAccountId" so the "audienceId" property (defined
under "properties" with pattern and type string) is validated as
mandatory—ensure you modify the "required" array entry in the same schema file
where "rudderAccountId" is declared.
🧹 Nitpick comments (1)
src/configurations/destinations/tiktok_audience/schema.json (1)

14-17: Consider adding test coverage for new schema fields.

The test fixture at test/data/validation/destinations/tiktok_audience.json doesn't include validation test cases for the new isHashRequired and audienceId fields. Consider adding test cases to validate:

  • Valid audienceId values matching the pattern
  • Invalid audienceId values (e.g., exceeding 100 chars)
  • isHashRequired boolean handling
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/configurations/destinations/tiktok_audience/schema.json` around lines 14
- 17, Add validation tests for the new schema fields by updating the
tiktok_audience validation fixture to include cases that exercise the audienceId
pattern and the isHashRequired boolean handling: add at least one valid
audienceId matching the pattern (e.g., a templated "{{...||...}}", an "env."
value, and a plain string ≤100 chars), add invalid audienceId cases (e.g., a
plain string >100 characters) to assert failure, and add tests for
isHashRequired true/false and non-boolean values to assert correct validation
behavior; make sure the test entries reference the schema keys "audienceId" and
"isHashRequired" so the existing validation harness picks them up.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/configurations/destinations/tiktok_audience/schema.json`:
- Around line 5-17: The JSON schema's required array currently only lists
"rudderAccountId" but must also require "audienceId"; update the schema's
"required" array to include "audienceId" alongside "rudderAccountId" so the
"audienceId" property (defined under "properties" with pattern and type string)
is validated as mandatory—ensure you modify the "required" array entry in the
same schema file where "rudderAccountId" is declared.

---

Nitpick comments:
In `@src/configurations/destinations/tiktok_audience/schema.json`:
- Around line 14-17: Add validation tests for the new schema fields by updating
the tiktok_audience validation fixture to include cases that exercise the
audienceId pattern and the isHashRequired boolean handling: add at least one
valid audienceId matching the pattern (e.g., a templated "{{...||...}}", an
"env." value, and a plain string ≤100 chars), add invalid audienceId cases
(e.g., a plain string >100 characters) to assert failure, and add tests for
isHashRequired true/false and non-boolean values to assert correct validation
behavior; make sure the test entries reference the schema keys "audienceId" and
"isHashRequired" so the existing validation harness picks them up.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6158a822-dfdb-416c-bce3-63112042cd73

📥 Commits

Reviewing files that changed from the base of the PR and between 53f45af and a7b446b.

📒 Files selected for processing (2)
  • src/configurations/destinations/tiktok_audience/db-config.json
  • src/configurations/destinations/tiktok_audience/schema.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/configurations/destinations/tiktok_audience/db-config.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant