Skip to content

chore: migrate some streaming destination to new test format - #4435

Merged
maheshkutty merged 4 commits into
developfrom
chore.migrate_streaming_dest
Jul 24, 2025
Merged

maheshkutty merged 4 commits into
developfrom
chore.migrate_streaming_dest

Conversation

@maheshkutty

@maheshkutty maheshkutty commented Jun 27, 2025 •

Copy link
Copy Markdown
Contributor

What are the changes introduced in this PR?

This PR includes a range of updates, such as improved type definitions, refined logic for the EventBridge destination.
Additionally, it migrates the following destinations to the new testing format:

  • EventBridge
  • Kinesis
  • Personalize
  • Kafka

Type Definition Updates:

  • Added an optional ResponseRules field to the DestinationDefinition type in src/types/controlPlaneConfig.ts to support additional configuration capabilities.

Logic Improvements:

  • Updated the process function in src/v0/destinations/eventbridge/transform.js to handle cases where the Config object is empty, using the newly imported isEmptyObject utility.
  • Enhanced imports in src/v0/destinations/eventbridge/transform.js by adding isEmptyObject from ../../util.

Test Case Enhancements:

EventBridge Integration:

  • Migrated and optimized test cases in test/integrations/destinations/eventbridge/processor/data.ts, including adding metadata, workspace-related fields, and success criteria for better test coverage and clarity. [1] [2] [3] [4] [5] [6] [7] [8]

Kafka Integration:

  • Migrated and optimized test cases in test/integrations/destinations/kafka/batch/data.ts, improving metadata structure, adding workspace-related fields, and enhancing integration configurations for Kafka scenarios. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]

Test Configuration Updates:

  • Expanded the list of streaming destinations with updated test structures in test/integrations/component.test.ts, adding support for kafka, kinesis, personalize, and eventbridge.

What is the related Linear task?

Resolves INT-3892

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.

N/A

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.

@maheshkutty
maheshkutty requested review from a team and sivashanmukh as code owners June 27, 2025 07:40
@maheshkutty
maheshkutty requested review from a team, chandumlg and krishna2020 June 27, 2025 07:40
@coderabbitai

coderabbitai Bot commented Jun 27, 2025 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • test/integrations/testTypes.ts is excluded by !**/test/**

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

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

Summary by CodeRabbit

  • New Features

    • Added support for an optional response rules property in destination definitions.
  • Bug Fixes

    • Improved validation to ensure destination configurations are not empty before processing, preventing events with empty configurations from being processed.

Summary by CodeRabbit

  • New Features

    • Enhanced configuration validation for event processing, ensuring events with missing or empty configurations are dropped with a clear error message.
  • Bug Fixes

    • Improved handling of destination configuration by verifying it is not empty before proceeding.
  • Chores

    • Updated internal type definitions to support an optional response rules property for destinations.

Walkthrough

The updates introduce an optional ResponseRules property to the DestinationDefinition type and enhance the configuration validation logic in the EventBridge destination's transformation process. The new validation ensures that the configuration object is not only present but also non-empty before proceeding.

Changes

File(s) Change Summary
src/types/controlPlaneConfig.ts Added optional ResponseRules?: Record<string, unknown> | null to DestinationDefinition type.
src/v0/destinations/eventbridge/transform.js Improved config validation: now checks for non-empty config using isEmptyObject utility.

Sequence Diagram(s)

sequenceDiagram
    participant Event as Incoming Event
    participant Transform as EventBridge Transform
    participant Util as Util (isEmptyObject)
    participant Error as ConfigurationError

    Event->>Transform: process(event)
    Transform->>Util: isEmptyObject(event.destination.Config)
    alt Config missing or empty
        Transform->>Error: Throw ConfigurationError ("Empty config")
        Transform-->>Event: Drop event
    else Config present and non-empty
        Transform-->>Event: Proceed with processing
    end
Loading

Estimated code review effort

2 (~15 minutes)

Suggested reviewers

  • sivashanmukh
  • krishna2020
  • utsabc

Suggestions for improvement:

  • Consider adding unit tests to cover the new configuration validation logic for better reliability.
  • Update documentation to reflect the new optional ResponseRules property in the type definition.

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:

@maheshkutty

Copy link
Copy Markdown
Contributor Author

Ref: #4432

@codecov

codecov Bot commented Jun 27, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.44%. Comparing base (5d4372a) to head (3844829).
Report is 3 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4435   +/-   ##
========================================
  Coverage    91.44%   91.44%           
========================================
  Files          639      639           
  Lines        33774    33774           
  Branches      7978     7986    +8     
========================================
  Hits         30885    30885           
+ Misses        2655     2627   -28     
- Partials       234      262   +28     

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

@maheshkutty
maheshkutty force-pushed the chore.migrate_streaming_dest branch from f7c6c7b to ac7fb0f Compare July 4, 2025 06:30
@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

Comment thread test/integrations/testTypes.ts Resolved
Comment thread src/types/controlPlaneConfig.ts Resolved
@ItsSudip
ItsSudip self-requested a review July 21, 2025 05:23
utsabc
utsabc previously approved these changes Jul 21, 2025
ItsSudip
ItsSudip previously approved these changes Jul 21, 2025
@maheshkutty
maheshkutty dismissed stale reviews from ItsSudip and utsabc via a1fb9f6 July 23, 2025 09:50
@maheshkutty
maheshkutty force-pushed the chore.migrate_streaming_dest branch from ac7fb0f to a1fb9f6 Compare July 23, 2025 09:50
@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@sonarqubecloud

Copy link
Copy Markdown

@maheshkutty
maheshkutty requested a review from ItsSudip July 24, 2025 04:43
@maheshkutty
maheshkutty requested a review from utsabc July 24, 2025 12:46
@maheshkutty
maheshkutty merged commit a59ef91 into develop Jul 24, 2025
@maheshkutty
maheshkutty deleted the chore.migrate_streaming_dest branch July 24, 2025 12:52
koladilip added a commit that referenced this pull request Jul 31, 2025
* chore: ai generated docs for airship

* chore: migrate some streaming destination to new test format (#4435)

* chore: migrate some streaming destination to new test format

* chore: rebase to develop

* fix: type

* chore: review comments

* chore: ing-svc workflow takes latest go tests

* chore: restart deployment after creating a develop image (#4528)

* chore: restart deployment after creating a develop image

* fix: review comments

* fix: add dependencies for kubectl

* chore: review comments

* chore: review comments

* chore: add another job for dedicated deployment

* chore: update sku mappings for product viewed event (#4467)

* chore: update sku mappings for product viewed event, fix skipped tests

* chore: remove skip false

---------

Co-authored-by: Mahesh Kutty <[email protected]>

* chore: add checkout step for deployment restart action (#4532)

* chore: auto create ing-svc pr for go-tests

* chore: restructure workflows

* chore: workflow add permissions

* chore: address security and compatibility issues

* refactor: remove unused marketo bulk upload metrics (#4537)

- Remove 13 unused marketo_bulk_upload metrics that were defined but not collected
- These metrics were from old implementation and not actively used
- Reduces Prometheus cardinality and improves performance
- Keeps only actively used marketo metrics: fetch_token, lead_lookup, activity

Fixes INT-3978

* chore: use latest vars for pod restart (#4538)

* chore: gitworkflow version upgrades

* chore: scan push revert to old version

* chore: add lint rules to catch invalid or unresolved imports (#4531)

* feat: onboard postscript destination (#4438)

* feat: onboard postscript destination

* chore: add nwhandler tests

* chore: add comments, update tests, fix properties inconsistencies

* chore: address comments

* chore: add util tests

* feat: onboard postscript destination

* chore: add nwhandler tests

* chore: add comments, update tests, fix properties inconsistencies

* chore: address comments

* chore: add util tests

* chore: address comments

* fix: subscriber updation logic

* chore: add tests for code coverage

* chore: address comments

* chore: address comments, add docs

* chore: remove catch

---------

Co-authored-by: Mahesh Kutty <[email protected]>
Co-authored-by: Mahesh Kutty <[email protected]>

* chore(release): 1.106.0

---------

Co-authored-by: Vinay Teki <[email protected]>
Co-authored-by: Dilip Kola <[email protected]>
Co-authored-by: Manish Kumar <[email protected]>
Co-authored-by: Mahesh Kutty <[email protected]>
Co-authored-by: Yashasvi Bajpai <[email protected]>
Co-authored-by: Mahesh Kutty <[email protected]>
Co-authored-by: GitHub Actions <[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.

5 participants