Skip to content

chore(release): pull main into develop post release v1.101.1 - #4377

Merged
utsabc merged 9 commits into
developfrom
chore.pull-main-to-develop-2
Jun 3, 2025
Merged

utsabc merged 9 commits into
developfrom
chore.pull-main-to-develop-2

Conversation

@utsabc

@utsabc utsabc commented Jun 3, 2025

Copy link
Copy Markdown
Contributor

@utsabc
utsabc requested review from a team and sivashanmukh as code owners June 3, 2025 09:34
@utsabc
utsabc requested review from a team, koladilip and yashasvibajpai June 3, 2025 09:34
@coderabbitai

coderabbitai Bot commented Jun 3, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added support for a new Klaviyo API revision version (October 2024), including a configuration flag to enable it.
    • Introduced telemetry tracking for requests using the new Klaviyo revision.
    • Added a custom Handlebars helper to insert newline characters in Slack message templates.
  • Bug Fixes

    • Improved debug logging for phone number validation errors in Klaviyo integration.

Summary by CodeRabbit

  • New Features
    • Added support for a new Klaviyo API revision version (October 2024), including conditional request header handling and configuration options.
    • Introduced a Prometheus metric to track requests using the new Klaviyo revision, with additional labeling for request type and destination.
    • Added a custom Handlebars helper for inserting newline characters in Slack message templates.

Walkthrough

The changes introduce support for a new Klaviyo API revision (2024-10-15) across configuration, batching, and utility modules. Conditional logic and metrics were added to handle this new revision, including a Prometheus counter for tracking its usage. Additionally, a custom Handlebars helper for inserting newlines was registered in the Slack transformation logic.

Changes

File(s) Change Summary
src/v0/destinations/klaviyo/config.js Added and exported the new revisionOct2024 constant for Klaviyo API versioning.
src/v0/destinations/klaviyo/batchUtil.js, src/v0/destinations/klaviyo/util.js Added support for the new revision with conditional header setting, config flag usage, and telemetry.
src/util/prometheus.js Introduced a new Prometheus counter for tracking requests using the new Klaviyo revision.
src/v0/destinations/slack/transform.js Registered a new Handlebars helper to insert newline characters in templates.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant KlaviyoUtil
    participant Config
    participant Prometheus

    Client->>KlaviyoUtil: buildRequest(payload, destination, category)
    KlaviyoUtil->>Config: Get revision, revisionOct2024
    alt useNewKlaviyoRevisionVersion is true
        KlaviyoUtil->>Prometheus: Increment klaviyo_revision_oct2024_requests_total
        KlaviyoUtil->>Client: Return request with revisionOct2024 header
    else
        KlaviyoUtil->>Client: Return request with standard revision header
    end
Loading

Possibly related PRs

  • rudderlabs/rudder-transformer#4357: Also modifies src/v0/destinations/slack/transform.js to add the "newline" Handlebars helper, indicating a direct connection in Slack template logic.

Suggested reviewers

  • sivashanmukh
  • maheshkutty
  • koladilip

Suggestions for improvement:
To strengthen the robustness of this feature, consider adding unit and integration tests that verify the conditional use of the new Klaviyo revision header and the correct incrementing of the Prometheus metric. Also, documenting the new configuration flag useNewKlaviyoRevisionVersion and the purpose of the klaviyo_revision_oct2024_requests_total metric in the developer guides would aid future maintainers and users in understanding and utilizing these additions effectively. Lastly, a brief example or note on using the new "newline" Handlebars helper in Slack templates could enhance usability.


📜 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 9cbf28d and 7fc5e4e.

📒 Files selected for processing (1)
  • src/v0/destinations/klaviyo/util.js (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/v0/destinations/klaviyo/util.js
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • 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.

@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/v0/destinations/klaviyo/config.js (1)

96-97: Fix comment discrepancy with constant value.

The comment mentions "2024-10-25" but the actual constant value is "2024-10-15". This inconsistency could confuse future developers.

Apply this diff to fix the comment:

-// add revision for 2024-10-25
+// add revision for 2024-10-15
src/v0/destinations/klaviyo/util.js (1)

352-352: Consider documenting the temporary nature of the telemetry.

The comments indicate this is "temporary stats" - consider adding a TODO or tracking issue reference to ensure this telemetry is cleaned up appropriately once the migration is complete.

- // temporary stats for oct 2024 revision
+ // TODO: Remove temporary stats after oct 2024 revision migration is complete

Also applies to: 608-608

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9c3938e and 9cbf28d.

⛔ Files ignored due to path filters (5)
  • CHANGELOG.md is excluded by !**/*.md
  • package-lock.json is excluded by !**/package-lock.json, !**/*.json
  • package.json is excluded by !**/*.json
  • test/integrations/destinations/klaviyo/processor/identifyTestDataV2.ts is excluded by !**/test/**
  • test/integrations/destinations/slack/processor/data.ts is excluded by !**/test/**
📒 Files selected for processing (5)
  • src/util/prometheus.js (1 hunks)
  • src/v0/destinations/klaviyo/batchUtil.js (2 hunks)
  • src/v0/destinations/klaviyo/config.js (2 hunks)
  • src/v0/destinations/klaviyo/util.js (4 hunks)
  • src/v0/destinations/slack/transform.js (1 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/v0/destinations/slack/transform.js
  • src/v0/destinations/klaviyo/util.js
  • src/v0/destinations/klaviyo/batchUtil.js
  • src/util/prometheus.js
  • src/v0/destinations/klaviyo/config.js
🧬 Code Graph Analysis (1)
src/v0/destinations/klaviyo/batchUtil.js (3)
src/v0/destinations/klaviyo/config.js (3)
  • BASE_ENDPOINT (3-3)
  • revisionOct2024 (97-97)
  • revision (95-95)
src/v0/destinations/klaviyo/util.js (8)
  • destination (149-149)
  • destination (150-150)
  • destination (339-339)
  • destination (453-453)
  • destination (518-518)
  • destination (519-519)
  • destination (593-593)
  • getSubscriptionPayload (566-582)
src/v0/util/constant.js (1)
  • JSON_MIME_TYPE (11-11)
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • 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 ARM64
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Code Coverage
  • GitHub Check: test_and_publish
  • GitHub Check: UT Tests
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (go)
🔇 Additional comments (10)
src/v0/destinations/slack/transform.js (1)

22-23: LGTM! Clean implementation of newline helper.

The custom Handlebars helper for newlines is well-implemented and provides a useful utility for templates that need explicit newline insertion.

src/v0/destinations/klaviyo/config.js (1)

111-111: LGTM! Properly exported new revision constant.

The new revisionOct2024 constant is correctly added to the module exports, making it available for use in other Klaviyo files.

src/util/prometheus.js (1)

583-588: LGTM! Well-defined metric for tracking new Klaviyo revision usage.

The new Prometheus counter metric follows established patterns and provides appropriate labels for tracking requests using the October 2024 Klaviyo API revision.

src/v0/destinations/klaviyo/batchUtil.js (3)

4-10: LGTM! Proper import of new revision constant.

The import statement correctly includes the new revisionOct2024 constant alongside the existing revision, enabling conditional API version selection.


39-39: Good practice: Destructuring config values for clarity.

Extracting useNewKlaviyoRevisionVersion and privateApiKey from the destination config improves readability and follows good destructuring practices.


47-51:

Details

✅ Verification successful

Verify consistency with similar Klaviyo files.

The conditional revision header implementation looks correct. Ensure this pattern matches the implementation in src/v0/destinations/klaviyo/util.js for consistency across the Klaviyo destination.


🏁 Script executed:

#!/bin/bash
# Description: Verify consistent implementation of revision conditional logic across Klaviyo files

# Check if util.js has similar conditional revision logic
rg -A 5 -B 5 "useNewKlaviyoRevisionVersion.*revisionOct2024|revisionOct2024.*useNewKlaviyoRevisionVersion" src/v0/destinations/klaviyo/

# Check for any Prometheus metric incrementing related to the new revision
rg -A 3 -B 3 "klaviyo_revision_oct2024" src/v0/destinations/klaviyo/

Length of output: 3718


Revision header conditional logic is consistent across Klaviyo modules

I’ve confirmed that both batchUtil.js and util.js use the same useNewKlaviyoRevisionVersion ? revisionOct2024 : revision pattern for the revision header. No discrepancies were found in how the header is set, so no further updates are needed here.

src/v0/destinations/klaviyo/util.js (4)

6-6: LGTM! Stats module import added correctly.

The import of the stats module enables telemetry tracking for the new API revision feature.


33-33: LGTM! New revision constant imported correctly.

The revisionOct2024 constant import aligns with the conditional revision logic implemented below.


339-339: LGTM! Conditional revision support implemented correctly.

The implementation properly:

  • Extracts the feature flag from destination config
  • Conditionally sets the revision header based on the flag
  • Tracks usage with appropriate telemetry tags

The pattern is clean and follows good feature flag practices.

Also applies to: 348-348, 352-358


593-593: LGTM! Consistent implementation across subscription functions.

The changes mirror the pattern used in buildRequest, ensuring consistent behavior across all request building functions. The telemetry includes the operation type which provides valuable insight into usage patterns.

Also applies to: 600-600, 608-614

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@codecov

codecov Bot commented Jun 3, 2025 •

Copy link
Copy Markdown

Codecov Report

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

Project coverage is 91.13%. Comparing base (c684b65) to head (7fc5e4e).
Report is 19 commits behind head on develop.

Files with missing lines Patch % Lines
src/v0/destinations/klaviyo/util.js 90.90% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4377      +/-   ##
===========================================
+ Coverage    91.12%   91.13%   +0.01%     
===========================================
  Files          636      638       +2     
  Lines        33400    33464      +64     
  Branches      7896     7894       -2     
===========================================
+ Hits         30435    30497      +62     
- Misses        2696     2728      +32     
+ Partials       269      239      -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.

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@sonarqubecloud

sonarqubecloud Bot commented Jun 3, 2025

Copy link
Copy Markdown

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.

6 participants