Skip to content

refactor: move rudderId to RudderMessageSchema as optional field - #4356

Merged
koladilip merged 1 commit into
developfrom
fix.make-rudder-id-optional
May 27, 2025
Merged

koladilip merged 1 commit into
developfrom
fix.make-rudder-id-optional

Conversation

@koladilip

Copy link
Copy Markdown
Contributor

Description

This PR moves the rudderId field to RudderMessageSchema as an optional field, improving the CustomerIO types implementation.

Related Issue

Closes INT-3700

Changes

  • Moved rudderId from custom CustomerIO types to common RudderMessageSchema
  • Made rudderId field optional in the schema
  • Updated CustomerIO integration to use the common types

Testing

  • Tested locally with transformer
  • Verified one test event flows correctly

Checklist

  • Code follows the project's coding standards
  • Self-review of the code has been performed
  • Changes have been tested locally
  • No breaking changes introduced

Linear Issue: INT-3700


Pull Request opened by Augment Code with guidance from the PR author

- Move rudderId from RudderRecordV2Schema to RudderMessageSchema
- Make rudderId optional to align with transformer code assumptions
- Update test expectations to reflect optional rudderId behavior
- Fixes compatibility with existing transformer logic that treats rudderId as optional
@koladilip
koladilip requested a review from sivashanmukh as a code owner May 27, 2025 09:49
@koladilip
koladilip requested a review from a team May 27, 2025 09:49
@coderabbitai

coderabbitai Bot commented May 27, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added support for including an optional rudderId field in messages.
  • Refactor
    • Updated message structure to make rudderId optional and removed it as a required field in certain records.

Walkthrough

The change modifies the schema definitions for Rudder events by making the rudderId field optional in the base RudderMessageSchema and removing it as a required field from the RudderRecordV2Schema. This alters how and where the rudderId can be included in event messages.

Changes

File(s) Change Summary
src/types/rudderEvents.ts Made rudderId an optional property in RudderMessageSchema and removed it from RudderRecordV2Schema.

Suggestions for Improvement

  • Review all usages of RudderRecordV2Schema to ensure downstream consumers handle the absence of rudderId gracefully.
  • Update documentation and type annotations where relevant to reflect the new optionality of rudderId.
  • Consider adding tests to verify that both schemas behave as expected with and without the rudderId property.

📜 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 f3636e9 and afc91f9.

⛔ Files ignored due to path filters (1)
  • test/integrations/destinations/customerio_audience/router/data.ts is excluded by !**/test/**
📒 Files selected for processing (1)
  • src/types/rudderEvents.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Code Coverage
  • GitHub Check: UT Tests
  • GitHub Check: test_and_publish
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
src/types/rudderEvents.ts (1)

39-39: LGTM! Clean refactoring that improves schema organization.

The addition of the optional rudderId field to the base RudderMessageSchema is well-implemented. This change successfully centralizes the field definition from CustomerIO-specific types to the common schema, making it consistently available across all message types while maintaining type safety.

The field follows the same pattern as other optional fields in the schema and will be properly inherited by RudderRecordV2Schema, eliminating the need for duplicate field definitions.

✨ 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 May 27, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.12%. Comparing base (4a18dc9) to head (afc91f9).
Report is 17 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4356      +/-   ##
===========================================
+ Coverage    91.10%   91.12%   +0.01%     
===========================================
  Files          636      636              
  Lines        33378    33405      +27     
  Branches      7888     7898      +10     
===========================================
+ Hits         30410    30440      +30     
+ Misses        2729     2696      -33     
- Partials       239      269      +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.

@sonarqubecloud

Copy link
Copy Markdown

@koladilip
koladilip requested review from ItsSudip and manish339k May 27, 2025 11:27
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