Skip to content

feat: enhance mapping with missing fields of app event_source and the batching logic with grouping - #4501

Merged
ItsSudip merged 4 commits into
fix/tiktok_ads_v2from
feat/enhanceMents
Jul 18, 2025
Merged

ItsSudip merged 4 commits into
fix/tiktok_ads_v2from
feat/enhanceMents

Conversation

@ItsSudip

@ItsSudip ItsSudip commented Jul 16, 2025 •

Copy link
Copy Markdown
Member

What are the changes introduced in this PR?

We have added logic to group by event_source before batching and added missing mapping for app related fields.

What is the related Linear task?

Resolves INT-3933

Please explain the objectives of your changes below

Put down any required details on the broader aspect of your changes. If there are any dependent changes, mandatorily mention them here

Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?

N/A

Any new dependencies introduced with this change?

N/A

Any new generic utility introduced or modified. Please explain the changes.

Introduced grouping logic depending on event_source and added the missing mapping for app event_source.

Any technical or performance related pointers to consider with the change?

N/A

@coderabbitai review


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?

Reviewer checklist

  • Is the type of change in the PR title appropriate as per the changes?

  • Verified that there are no credentials or confidential data exposed with the changes.

@ItsSudip
ItsSudip requested review from a team and sivashanmukh as code owners July 16, 2025 09:57
@ItsSudip
ItsSudip requested review from a team, maheshkutty and manish339k and removed request for a team July 16, 2025 09:57
@coderabbitai

coderabbitai Bot commented Jul 16, 2025

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@codecov

codecov Bot commented Jul 16, 2025 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.

Project coverage is 91.22%. Comparing base (6c61d87) to head (aec79ab).
Report is 1 commits behind head on fix/tiktok_ads_v2.

Files with missing lines Patch % Lines
src/v0/destinations/tiktok_ads/transformV2.js 90.90% 1 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##           fix/tiktok_ads_v2    #4501      +/-   ##
=====================================================
- Coverage              91.23%   91.22%   -0.01%     
=====================================================
  Files                    640      640              
  Lines                  33721    33720       -1     
  Branches                7954     7955       +1     
=====================================================
- Hits                   30765    30762       -3     
- Misses                  2691     2693       +2     
  Partials                 265      265              

☔ 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.

@ItsSudip ItsSudip changed the title feat: enhance mapping with missing fields of app event_source and enhance the batching logic with grouping feat: enhance mapping with missing fields of app event_source and the batching logic with grouping Jul 16, 2025
body: {
output: [
{
batched: true,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

without batched true, how it was working before ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It was there. Actually, 'batched: true' was in the line below. I have refactored the test case.

@@ -2651,7 +2651,7 @@ export const data: RouterTestData[] = [
{

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

too many changes in test cases at the field level whereas changes are majorly on the batching logic - can you throw some light ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I have refactored the test case for minimal changes.

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@sonarqubecloud

Copy link
Copy Markdown

if (event.message.statusCode) {
// already transformed event
getEventChunks(event, trackResponseList, eventsChunk);
getEventChunks(event, trackResponseList, processedEvents);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
getEventChunks(event, trackResponseList, processedEvents);
getProcessedEvents(event, trackResponseList, processedEvents);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Going to address this in the next pr.

});
}
// Grouping events by event_source
const groupedEventChunks = await groupByInBatches(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const groupedEventChunks = await groupByInBatches(
const groupedEvents = await groupByInBatches(

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Going to address this in the next pr.

@ItsSudip
ItsSudip merged commit 5ac78b0 into fix/tiktok_ads_v2 Jul 18, 2025
@ItsSudip
ItsSudip deleted the feat/enhanceMents branch July 18, 2025 05:40
ItsSudip added a commit that referenced this pull request Jul 23, 2025
… batching logic with grouping (#4501)

* feat: enable group by event_source before batching

* feat: add missing parameter for app event_source

* chore: refactor test cases

* chore: revert unwanted changes to test cases

---------

Co-authored-by: Sudip Paul <[email protected]>
koladilip pushed a commit that referenced this pull request Aug 16, 2025
… batching logic with grouping (#4501)

* feat: enable group by event_source before batching

* feat: add missing parameter for app event_source

* chore: refactor test cases

* chore: revert unwanted changes to test cases

---------

Co-authored-by: Sudip Paul <[email protected]>
ItsSudip added a commit that referenced this pull request Aug 18, 2025
* fix: add mapping of event_source instead of static

* feat: enhance mapping with missing fields of app event_source and the batching logic with grouping  (#4501)

* feat: enable group by event_source before batching

* feat: add missing parameter for app event_source

* chore: refactor test cases

* chore: revert unwanted changes to test cases

---------

Co-authored-by: Sudip Paul <[email protected]>

* feat: add missing params and refactor (#4527)

* feat: add missing parameters and refactor code

* chore: fix as per cursor review

* chore: add test cases to increase coverage

* feat: add support of mapping to consider default eventSource

---------

Co-authored-by: Sudip Paul <[email protected]>

* chore: refactor code

* chore: address comments

* chore: address coderabbit comments

---------

Co-authored-by: Sudip Paul <[email protected]>
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.

3 participants