Skip to content

chore(release): pull main into develop post release v1.97.1 - #4268

Merged
yashasvibajpai merged 7 commits into
developfrom
main
Apr 21, 2025
Merged

yashasvibajpai merged 7 commits into
developfrom
main

Conversation

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

👑 An automated PR

@coderabbitai

coderabbitai Bot commented Apr 21, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes

    • Improved reliability in event processing by safely handling cases where certain data fields may be missing or undefined, preventing potential runtime errors.
    • Enhanced payload construction to ensure fields are only included when relevant data is present.
  • Chores

    • Updated internal workflow logic and added comments for better maintainability.

Walkthrough

This update introduces conditional property inclusion and safer property access in workflow and utility files. In the Userpilot workflow YAML, the payload construction is refined to only include the "company" field if a specific trait exists and is not null, and the event field key is renamed in the tracking step. Payload cleaning is also made more explicit. In the Shopify pixel utility JavaScript, optional chaining is added to prevent runtime errors when accessing deeply nested properties, ensuring robustness against undefined or null intermediate objects.

Changes

File(s) Change Summary
src/cdk/v2/destinations/userpilot/procWorkflow.yaml Imports isDefinedAndNotNull utility. In the identify payload, conditionally includes "company" field. Changes event field key in track payload from "event" to "event_name". Explicitly assigns cleaned payload to response body. Adds comments in group payload step.
src/sources/shopify/webpixelTransformations/pixelUtils.js Implements optional chaining when accessing nested properties in event builder functions to prevent runtime errors.

Suggested reviewers

  • sivashanmukh
  • utsabc
  • manish339k
  • krishna2020
  • yashasvibajpai

Suggestions for improvement:
Consider adding unit tests to verify the new conditional logic and optional chaining behaviors, especially for edge cases with missing or null fields. Additionally, documenting these changes in the relevant developer guides would help maintain clarity for future contributors.

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.
✨ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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

@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: 0

🧹 Nitpick comments (2)
src/cdk/v2/destinations/userpilot/procWorkflow.yaml (2)

39-40: Guard company.id presence using null-safety check
Leveraging $.isDefinedAndNotNull(.message.context.traits.company.id) ensures the company field is only included when its id exists, reducing payload bloat. However, if company can be undefined, consider using optional chaining (.message.context.traits.company?.id) to avoid template evaluation errors.


44-44: Remove trailing spaces to satisfy YAMLlint
The line defining $.context.payload.metadata has trailing spaces, which triggers lint errors. Removing them will clear the warning:

-      $.context.payload.metadata = $.removeUndefinedAndNullValues(traits);      
+      $.context.payload.metadata = $.removeUndefinedAndNullValues(traits);
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 44-44: trailing spaces

(trailing-spaces)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between cbfa641 and 881ff97.

⛔ Files ignored due to path filters (10)
  • CHANGELOG.md is excluded by !**/*.md
  • package-lock.json is excluded by !**/package-lock.json, !**/*.json
  • package.json is excluded by !**/*.json
  • test/integrations/component.test.ts is excluded by !**/test/**
  • test/integrations/destinations/userpilot/commonConfig.ts is excluded by !**/test/**
  • test/integrations/destinations/userpilot/maskedSecrets.ts is excluded by !**/test/**
  • test/integrations/destinations/userpilot/processor/data.ts is excluded by !**/test/**
  • test/integrations/destinations/userpilot/processor/groupTestData.ts is excluded by !**/test/**
  • test/integrations/destinations/userpilot/processor/identifyTestData.ts is excluded by !**/test/**
  • test/integrations/destinations/userpilot/processor/trackTestData.ts is excluded by !**/test/**
📒 Files selected for processing (2)
  • src/cdk/v2/destinations/userpilot/procWorkflow.yaml (4 hunks)
  • src/sources/shopify/webpixelTransformations/pixelUtils.js (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.js`: Focus on ESLint errors (max 3) and warnings (max 5).

**/*.js: Focus on ESLint errors (max 3) and warnings (max 5).

  • src/sources/shopify/webpixelTransformations/pixelUtils.js
🪛 YAMLlint (1.35.1)
src/cdk/v2/destinations/userpilot/procWorkflow.yaml

[error] 44-44: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Code Coverage
  • GitHub Check: UT Tests
  • GitHub Check: test_and_publish
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (8)
src/sources/shopify/webpixelTransformations/pixelUtils.js (3)

85-85: Ensure safe access to cart_id with optional chaining
Using inputEvent.data?.cart?.id prevents errors when data or cart is missing. This change aligns with the rest of the file’s optional chaining usage.


166-166: Use optional chaining for checkout_id
Switching to inputEvent?.data?.checkout?.token guards against undefined intermediate objects, reducing the risk of runtime exceptions.


178-178: Apply optional chaining for query
Accessing inputEvent?.data?.searchResult?.query safely handles cases where searchResult or its parent objects are nullish.

src/cdk/v2/destinations/userpilot/procWorkflow.yaml (5)

6-7: Add binding for isDefinedAndNotNull utility
Including isDefinedAndNotNull alongside removeUndefinedAndNullValues allows conditional inclusion of nested fields in payloads. This supports the enhanced null-safety added elsewhere.


31-32: Comment lines for documentation; no action required.


47-47: Comment header for the track payload step; no changes to logic.


56-56: Rename event to event_name in track payload
Updating the key to "event_name" matches the Userpilot API contract and avoids ambiguity with the reserved event field.


83-83: Clean payload before assignment
Assigning response.body.JSON = $.removeUndefinedAndNullValues($.context.payload) ensures no undefined/null values are sent. This makes the response payload more robust.

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor Author

Allure Test reports for this run are available at:

@codecov

codecov Bot commented Apr 21, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.21%. Comparing base (f990bf6) to head (881ff97).
Report is 14 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4268      +/-   ##
===========================================
+ Coverage    91.17%   91.21%   +0.04%     
===========================================
  Files          632      632              
  Lines        33079    33057      -22     
  Branches      7831     7826       -5     
===========================================
- Hits         30160    30154       -6     
- Misses        2674     2688      +14     
+ Partials       245      215      -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

@yashasvibajpai
yashasvibajpai merged commit 857577d into develop Apr 21, 2025
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