Skip to content

chore: migrate google sheets test to new format - #4432

Merged
maheshkutty merged 5 commits into
developfrom
chore.sheets_new_test
Jul 4, 2025
Merged

maheshkutty merged 5 commits into
developfrom
chore.sheets_new_test

Conversation

@maheshkutty

@maheshkutty maheshkutty commented Jun 25, 2025 •

Copy link
Copy Markdown
Contributor

What are the changes introduced in this PR?

New custom test types for the processor and router were added specifically for streaming destination types. eg: googlesheets, Kafka, Kinesis, etc.
We need to define a new test type because the streaming destination is not following the existing types.
Added new array STREAMING_DEST_WITH_UPDATED_TEST_STRUCTURE to enable different Zod validation for streaming destinations

What is the related Linear task?

Resolves INT-3762

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 a review from a team June 25, 2025 12:39
@coderabbitai

coderabbitai Bot commented Jun 25, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Introduced new validation schemas for streaming responses, enhancing support for streaming data formats.
  • Refactor

    • Improved code maintainability by consolidating shared schema logic and standardizing error messages.

Summary by CodeRabbit

  • New Features

    • Added new validation support for streaming processor and router responses.
    • Introduced array validation for lists of streaming responses.
  • Refactor

    • Improved schema structure for response validation by reusing common components and error messages.

Walkthrough

This update introduces new Zod schemas for validating streaming response objects and their lists in the codebase. Specifically, schemas for processor and router streaming responses are added, each with custom validation logic to ensure appropriate fields are present based on the HTTP status code.

Changes

File(s) Change Summary
src/types/zodTypes.ts Added ProcessorStreamingResponseSchema, ProcessorStreamingResponseListSchema, RouterStreamingResponseSchema, and RouterStreamingResponseListSchema with custom .refine() validations for streaming response validation; introduced a shared error message constant for validation consistency.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Validator (Zod Schemas)
    Client->>Validator (ProcessorStreamingResponseSchema): Validate streaming response
    alt Status code is 2XX
        Validator->>Validator: Check 'output' is present and non-empty
    else Status code is not 2XX
        Validator->>Validator: Check 'statTags' or 'error' is present and non-empty
    end
    Validator-->>Client: Validation result

    Client->>Validator (RouterStreamingResponseSchema): Validate streaming response
    alt Status code is 2XX
        Validator->>Validator: Check 'batchedRequest' is present and non-empty
    else Status code is not 2XX
        Validator->>Validator: Check 'statTags' or 'error' is present and non-empty
    end
    Validator-->>Client: Validation result
Loading

Suggested reviewers

  • sivashanmukh
  • krishna2020

Suggestions for Improvements:

  • Add unit tests targeting the new streaming response schemas to ensure validation logic behaves as expected across various scenarios.
  • Verify the naming consistency of schema constants to avoid typos (e.g., confirm ProcessorStreamingResponseSchema spelling).
  • Include inline documentation or comments explaining the purpose and usage of these new schemas to aid future maintainers and onboarding developers.

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 98a2244d88e9336df4d76c4b975f4155b3a39c2b and 01fe962.

⛔ Files ignored due to path filters (5)
  • test/integrations/component.test.ts is excluded by !**/test/**
  • test/integrations/destinations/googlesheets/processor/data.ts is excluded by !**/test/**
  • test/integrations/destinations/googlesheets/router/data.ts is excluded by !**/test/**
  • test/integrations/testTypes.ts is excluded by !**/test/**
  • test/integrations/testUtils.ts is excluded by !**/test/**
📒 Files selected for processing (1)
  • src/types/zodTypes.ts (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/types/zodTypes.ts
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Code Coverage
  • GitHub Check: test_and_publish
  • GitHub Check: UT Tests
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (go)
✨ Finishing Touches
  • 📝 Generate Docstrings

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 Jun 25, 2025 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 82.75862% with 5 lines in your changes missing coverage. Please review.

Project coverage is 91.21%. Comparing base (915d0bb) to head (01fe962).
Report is 4 commits behind head on develop.

Files with missing lines Patch % Lines
src/types/zodTypes.ts 82.75% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4432      +/-   ##
===========================================
- Coverage    91.22%   91.21%   -0.01%     
===========================================
  Files          639      639              
  Lines        33588    33611      +23     
  Branches      7931     7937       +6     
===========================================
+ Hits         30640    30658      +18     
- Misses        2681     2716      +35     
+ Partials       267      237      -30     

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8f87ba0 and 9df5a7a77c228992bfe5599858a8cc22ee24f93b.

⛔ Files ignored due to path filters (5)
  • test/integrations/component.test.ts is excluded by !**/test/**
  • test/integrations/destinations/googlesheets/processor/data.ts is excluded by !**/test/**
  • test/integrations/destinations/googlesheets/router/data.ts is excluded by !**/test/**
  • test/integrations/testTypes.ts is excluded by !**/test/**
  • test/integrations/testUtils.ts is excluded by !**/test/**
📒 Files selected for processing (1)
  • src/types/zodTypes.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: maheshkutty
PR: rudderlabs/rudder-transformer#4380
File: src/v0/destinations/google_adwords_remarketing_lists/config.js:3-5
Timestamp: 2025-06-04T07:24:58.591Z
Learning: User maheshkutty prefers to handle Google Ads API version upgrades for different destinations in separate pull requests rather than bundling multiple destinations together in a single PR.
🧬 Code Graph Analysis (1)
src/types/zodTypes.ts (1)
src/v0/util/index.js (1)
  • isDefinedAndNotNullAndNotEmpty (52-52)
🪛 GitHub Actions: Verify
src/types/zodTypes.ts

[error] 43-43: ESLint: Define a constant instead of duplicating this literal 4 times (sonarjs/no-duplicate-string)

⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Code Coverage
  • GitHub Check: test_and_publish
  • GitHub Check: UT Tests
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (go)
🔇 Additional comments (3)
src/types/zodTypes.ts (3)

283-319: Verify intentional difference in batchedRequest field structure.

The batchedRequest field in this streaming schema is defined as z.record(z.unknown()) (required), while in RouterTransformationResponseSchema it's optional and can be either an array or single ProcessorTransformationOutputSchema.

Please verify this structural difference is intentional for streaming responses.


321-321: LGTM!

Follows the established pattern for list schemas correctly.


244-321: Verify PR scope matches actual changes.

The PR objectives mention migrating "Google Sheets test to new format," but the actual changes are adding new Zod schemas for streaming responses. Please verify that these changes align with the intended scope of the PR.

Likely an incorrect or invalid review comment.

Comment thread src/types/zodTypes.ts Resolved
Comment thread src/types/zodTypes.ts Resolved
Comment thread src/types/zodTypes.ts Resolved
@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

1 similar comment
@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:

@maheshkutty
maheshkutty requested a review from utsabc June 27, 2025 07:50
Comment thread src/types/zodTypes.ts Resolved
Comment thread src/types/zodTypes.ts Resolved
Comment thread src/types/zodTypes.ts Resolved
@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@maheshkutty
maheshkutty force-pushed the chore.sheets_new_test branch from a328f5a to 98a2244 Compare July 3, 2025 04:39
@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@maheshkutty
maheshkutty force-pushed the chore.sheets_new_test branch from 98a2244 to 01fe962 Compare July 4, 2025 05:06
@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@sonarqubecloud

sonarqubecloud Bot commented Jul 4, 2025

Copy link
Copy Markdown

@maheshkutty
maheshkutty merged commit abd3d47 into develop Jul 4, 2025
@maheshkutty
maheshkutty deleted the chore.sheets_new_test branch July 4, 2025 06:20
vinayteki95 pushed a commit that referenced this pull request Jul 8, 2025
* chore: migrate google sheets test to new format

* feat: add zod test for streaming dest

* feat: add zod test for streaming dest

* chore: review comments

* fix: review comments
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.

4 participants