Repository navigation
chore(release): pull main into develop post release v1.101.1 - #4377
Conversation
* fix: handle newline for slack * fix: update slack tests
…chore.pull-main-to-develop-2
This reverts commit af6e580.
Summary by CodeRabbit
Summary by CodeRabbit
WalkthroughThe changes introduce support for a new Klaviyo API revision ( Changes
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
Possibly related PRs
Suggested reviewers
Suggestions for improvement: 📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (5)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
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-15src/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 completeAlso applies to: 608-608
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (5)
CHANGELOG.mdis excluded by!**/*.mdpackage-lock.jsonis excluded by!**/package-lock.json,!**/*.jsonpackage.jsonis excluded by!**/*.jsontest/integrations/destinations/klaviyo/processor/identifyTestDataV2.tsis excluded by!**/test/**test/integrations/destinations/slack/processor/data.tsis 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.jssrc/v0/destinations/klaviyo/util.jssrc/v0/destinations/klaviyo/batchUtil.jssrc/util/prometheus.jssrc/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
revisionOct2024constant 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
revisionOct2024constant alongside the existingrevision, enabling conditional API version selection.
39-39: Good practice: Destructuring config values for clarity.Extracting
useNewKlaviyoRevisionVersionandprivateApiKeyfrom 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.jsfor 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.jsandutil.jsuse the sameuseNewKlaviyoRevisionVersion ? revisionOct2024 : revisionpattern for therevisionheader. 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
revisionOct2024constant 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
|
Allure Test reports for this run are available at:
|
Codecov ReportAttention: Patch coverage is
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. 🚀 New features to boost your workflow:
|
|
Allure Test reports for this run are available at:
|
|



Original PR ref: https://github.com/rudderlabs/rudder-transformer/pull/4375/commits