Skip to content

chore: update klaviyo version to 2024-10-15, remove config restricted changes - #4387

Merged
yashasvibajpai merged 1 commit into
developfrom
fix.klaviyo.version.update.20241015
Jun 13, 2025
Merged

yashasvibajpai merged 1 commit into
developfrom
fix.klaviyo.version.update.20241015

Conversation

@yashasvibajpai

Copy link
Copy Markdown
Contributor

What are the changes introduced in this PR?

This pull request removes support for the 2024-06-15 and 2024-10-25 Klaviyo API revisions, consolidating all references to a single 2024-10-15 revision. Additionally, it removes temporary metrics and configuration options related to the 2024-10-25 revision. The changes simplify the codebase and update relevant tests.

What is the related Linear task?

Resolves INT-3787

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.

@yashasvibajpai
yashasvibajpai marked this pull request as ready for review June 8, 2025 23:29
@yashasvibajpai
yashasvibajpai requested review from a team and sivashanmukh as code owners June 8, 2025 23:29
@yashasvibajpai
yashasvibajpai requested review from a team, sandeepdsvs and vinayteki95 June 8, 2025 23:29
@coderabbitai

coderabbitai Bot commented Jun 8, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Refactor
    • Consolidated API version handling by updating to a single revision value for Klaviyo integrations.
    • Simplified request logic to always use the latest revision, removing conditional checks for previous or future versions.
  • Chores
    • Removed obsolete metrics and internal flags related to older Klaviyo revision tracking.

Walkthrough

This change removes support for the separate October 2024 Klaviyo API revision and the associated Prometheus metric. The code now always uses a single revision constant set to '2024-10-15', eliminating conditional logic and metrics related to the previous dual-revision approach.

Changes

File(s) Summary
src/util/prometheus.js Removed the klaviyo_revision_oct2024_requests_total metric definition from Prometheus metrics.
src/v0/destinations/klaviyo/config.js Consolidated revision constant to '2024-10-15'; removed revisionOct2024 export.
src/v0/destinations/klaviyo/util.js Removed all logic for useNewKlaviyoRevisionVersion, revisionOct2024, and related metrics.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant KlaviyoUtil
    participant Config

    Client->>KlaviyoUtil: buildRequest(payload, destination)
    KlaviyoUtil->>Config: Get revision
    Config-->>KlaviyoUtil: '2024-10-15'
    KlaviyoUtil->>Client: Return request with revision header '2024-10-15'
Loading

Possibly related PRs

Suggested reviewers

  • sivashanmukh
  • krishna2020
  • koladilip

Suggestions for improvement:
Consider adding a migration note or documentation update to clarify that the October 2024 revision is now the default and only supported version. This will help users and maintainers understand the rationale for the removal of conditional logic and metrics.


📜 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 7b7129e and ce9bd0d.

⛔ Files ignored due to path filters (5)
  • test/integrations/destinations/klaviyo/processor/groupTestDataV2.ts is excluded by !**/test/**
  • test/integrations/destinations/klaviyo/processor/identifyTestDataV2.ts is excluded by !**/test/**
  • test/integrations/destinations/klaviyo/processor/screenTestDataV2.ts is excluded by !**/test/**
  • test/integrations/destinations/klaviyo/processor/trackTestDataV2.ts is excluded by !**/test/**
  • test/integrations/destinations/klaviyo/router/dataV2.ts is excluded by !**/test/**
📒 Files selected for processing (3)
  • src/util/prometheus.js (0 hunks)
  • src/v0/destinations/klaviyo/config.js (1 hunks)
  • src/v0/destinations/klaviyo/util.js (3 hunks)
💤 Files with no reviewable changes (1)
  • src/util/prometheus.js
🧰 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/klaviyo/config.js
  • src/v0/destinations/klaviyo/util.js
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • 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: Build Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Build 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 (3)
src/v0/destinations/klaviyo/config.js (1)

95-95: Hard-coded API revision updated. The revision constant is now set to '2024-10-15', consolidating the supported Klaviyo version. Please confirm that all downstream uses and documentation have been updated accordingly.

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

338-349: Unified request builder uses single revision header. The buildRequest function now only destructures privateApiKey and always sets the revision header from config, removing the old feature-flaged logic. Ensure any leftover useNewKlaviyoRevisionVersion checks or metrics calls have been fully cleaned up.


584-594: Streamlined subscription payload to use consistent revision. The buildSubscriptionOrUnsubscriptionPayload function now includes only the revision header and drops the previous dual-revision branching. Verify the CONFIG_CATEGORIES API paths and confirm no stale flags or stats imports remain.

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

@yashasvibajpai
yashasvibajpai requested review from ItsSudip and utsabc June 8, 2025 23:29
@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@codecov

codecov Bot commented Jun 8, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.13%. Comparing base (4f48250) to head (ce9bd0d).
Report is 7 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4387      +/-   ##
===========================================
- Coverage    91.13%   91.13%   -0.01%     
===========================================
  Files          638      638              
  Lines        33476    33468       -8     
  Branches      7904     7897       -7     
===========================================
- Hits         30509    30501       -8     
+ Misses        2728     2698      -30     
- 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

sonarqubecloud Bot commented Jun 8, 2025

Copy link
Copy Markdown

Comment thread src/v0/destinations/klaviyo/util.js Resolved
@krishna2020

Copy link
Copy Markdown
Collaborator

Ideally, we should aim for forward-compatible coding, even when rolling out to a single customer initially. In this scenario, instead of introducing code that needed to be removed later, we could have taken a progressive development approach.

For example, rather than directly modifying the existing implementation, you could have:
• Introduced a new variant (e.g., v3) for the Klaviyo integration.
• Used the destination config to switch behavior based on version (v2 or v3).
• Rolled out v3 selectively by updating the destination config per customer.
• Gradually migrated customers to v3, enabling easier rollout and safer validation.

And then deprecate and remove v2 from destination definition and transformer.

This way, we avoid code churn and create a path for progressive rollout while maintaining clean, testable, and versioned logic. Let’s aim to structure future rollouts with such extensibility in mind.

@yashasvibajpai

Copy link
Copy Markdown
Contributor Author

Ideally, we should aim for forward-compatible coding, even when rolling out to a single customer initially. In this scenario, instead of introducing code that needed to be removed later, we could have taken a progressive development approach.

For example, rather than directly modifying the existing implementation, you could have: • Introduced a new variant (e.g., v3) for the Klaviyo integration. • Used the destination config to switch behavior based on version (v2 or v3). • Rolled out v3 selectively by updating the destination config per customer. • Gradually migrated customers to v3, enabling easier rollout and safer validation.

And then deprecate and remove v2 from destination definition and transformer.

This way, we avoid code churn and create a path for progressive rollout while maintaining clean, testable, and versioned logic. Let’s aim to structure future rollouts with such extensibility in mind.

I agree with the above suggested approach, I think we were avoiding any "visual" updates in the destination config, as there was some uncertainity around the update and whether it would work.
Hence this approach eluded our discussion.

@yashasvibajpai
yashasvibajpai merged commit 19d4d3b into develop Jun 13, 2025
@yashasvibajpai
yashasvibajpai deleted the fix.klaviyo.version.update.20241015 branch June 13, 2025 04:22
koladilip added a commit that referenced this pull request Jun 30, 2025
* fix: handle empty oauth secret for multiple destination (#4295)

* fix: handle empty oauth secret for multiple destination

* fix: test

* fix: add validation for other field

* chore: add missing test

* chore: add more test

* chore: change test

* chore: misc

* feat: implement hasDynamicConfig flag support (#4321)

* feat: implement hasDynamicConfig flag support in routerTransform flow

This implements support for the hasDynamicConfig flag in the routerTransform flow to fix
the issue where events with dynamic configuration were being mixed up during transformation.
The implementation includes:

1. Added a new hasDynamicConfig flag to the Destination type in controlPlaneConfig.ts to indicate
 whether a destination's configuration contains dynamic config patterns
2. Modified the dynamicConfigParser.ts to respect the hasDynamicConfig flag:
   - Skip processing when hasDynamicConfig is explicitly false
   - Process events when hasDynamicConfig is true or undefined (for backward compatibility)
3. Enhanced groupRouterTransformEvents function in src/v0/util/index.js to:
   - Group events by destination config when hasDynamicConfig is true or undefined
   - Use fast-json-stable-stringify to ensure consistent grouping of configs with different key orders
   - Maintain backward compatibility with older server versions where the flag might not be present
4. Added comprehensive test cases for:
   - Testing behavior with hasDynamicConfig=false
   - Testing behavior with hasDynamicConfig=true
   - Testing backward compatibility with hasDynamicConfig=undefined
   - Testing mixed hasDynamicConfig flags in a batch
   - Testing configs with different key orders

This implementation resolves INT-3633 by ensuring that events with dynamic configuration are properly
 grouped and processed in the routerTransform flow, preventing event mix-up issues.

Dependencies:
- Added fast-json-stable-stringify package to ensure consistent JSON string representation regardless of key order

* fix: add hasDynamicConfig flag support in routerTransform flow

* test: add hasDynamicConfig flag to test files

fix tests

* refactor: optimize dynamicConfigParser to avoid deep cloning entire event

* fix: restore unset functionality in dynamic config parser

- Add unset-value import to properly remove extracted fields from events
- Restore unset() call after extracting dynamic config values to prevent downstream issues
- Change from shallow to deep cloning to avoid modifying original events during unset operations
- Add comprehensive test to verify unset functionality works correctly
- Add shouldGroupByDestinationConfig method to JavaScript dynamic config module
- Update groupRouterTransformEvents to use shouldGroupByDestinationConfig function
- Add environment variable tests for USE_HAS_DYNAMIC_CONFIG_FLAG in router grouping logic

This ensures that fields used in dynamic config templates (e.g., {{ message.traits.appId || 'default' }})
are properly removed from events after extraction, preventing potential conflicts in destination processing.

* refactor: optimize dynamic config parser and consolidate utilities

- Move utility functions from dynamicConfig.js to utils.js for better organization
- Optimize DynamicConfigParser with pre-compiled regex patterns and efficient loops
- Replace deep cloning with selective cloning for better performance
- Remove standalone dynamicConfig.js and dynamicConfig.test.js files
- Update imports and references across affected modules

* fix: ensure consistent ordering in batch processing for google adwords offline conversions (#4359)

- Add sorting by jobId to removeDuplicateMetadata function
- Sort final batch results by minimum jobId for consistent ordering
- Re-enable router output assertion for google_adwords_offline_conversions tests
- Update test data ordering to match new consistent batch processing behavior
- Fix unit test expectations to match new sorted metadata order

* chore: add concurrent requests and memory fencing middlewares (#4358)

* chore: migrate tiktok_ads to new test (#4342)

* chore: migrate tiktok_ads to new test

* chore: review comments

* chore: review comments

* chore: review comments

* chore: review comments

* chore: rebase

* chore: introduce deep freeze to compaction middlewares (#4365)

* feat: implement rudder-test destination with migrated tests (#4352)

- Add rudder-test destination for platform testing and development
- Implement TypeScript destination with router-only transformation
- Support Record v2 events with echo response pattern
- Add context-based test behavior control via testBehavior field
- Migrate tests to new format using migration script
- Optimize tests with generateMetadata utility and common destination
- Enable Zod validation and enhanced Allure reporting
- Add npm script 'rudder-tests' for convenient test execution
- Update README.md with comprehensive destination documentation

The rudder-test destination provides a controlled testing environment
without external dependencies, ideal for platform feature testing,
development workflows, and CI/CD reliability.

refactor: reduce code duplication in rudder_test destination

- Extract common validation and request building logic to utils.ts
- Add processor transformation function alongside existing router function
- Create comprehensive component tests for both processor and router
- Implement shared utilities for message validation, request config building, and test behavior handling
- Maintain different error handling patterns for processor (throws) vs router (returns error objects)
- Add 6 test cases covering success scenarios, error responses, and validation failures

refactor: improve type safety in rudder_test utils

- Replace 'any' types with specific Metadata and RudderTestDestination types
- Import proper types from '../../../types' for better type safety
- Enhance IntelliSense support and compile-time error detection
- Address coderabbitai bot feedback on PR #4352

feat: enhance rudder_test destination with comprehensive dynamic config testing

- Modified rudder_test destination to actually use resolved dynamic config values
- Added endpoint and apiKey resolution from destination config in utils.ts
- Updated transform.ts to pass destination config to utility functions
- Enhanced type definitions to support RudderTestConfig interface

- Added multi-event test cases for both processor and router
- Tests validate multiple events with different dynamic config values resolve correctly
- Added mixed destination ID scenarios (different hasDynamicConfig flags)
- Added compaction tests with multiple events and dynamic config
- All 20 tests now pass and actually validate dynamic config resolution

These tests will surface thread safety issues and shared state problems
in dynamic config processing by testing scenarios where multiple events
have different template variable values that must resolve independently.

docs: update rudder_test destination documentation with dynamic config features

- Added dynamic config resolution capabilities to feature list
- Updated implementation details to reflect both processor and router support
- Added comprehensive test coverage information (20 test cases)
- Included dynamic config examples with template syntax
- Added multi-event testing and thread safety testing use cases
- Updated key files list to include utils.ts and enhanced type definitions
- Corrected architecture description from router-only to dual implementation

* chore: sfmc ai generated docs (#4328)

* chore: sfmc ai generated docs

* chore: sfmc api section in docs

* chore: separate out transformer logic from main doc

* chore: vdm-v2 related faulty docs fix

* Revert "Revert "Merge branch 'develop' into main""

This reverts commit af6e580.

* fix: klaviyo error logging

* chore: optimize usage of deepFreeze in compaction middlewares (#4374)

* chore: use batch processing in transformations (#4363)

* feat: use account information on zoho (#4361)

* chore: new way of creating release

* fix: deep freeze in compaction middleware

- Add test behaviors in rudder_test transform to mutate and replace destination config
- Add router and processor component tests for both property mutation and config
  reference replacement in compacted payload flow
- Assert correct error handling and status codes when mutation is attempted on frozen config
- Ensures immutability of config is enforced and covered in both flows
- Remove unneccessary clonedeep in router transform flow by fixing code

* chore: add safe batch processing to avoid blocking in highly batched destinations

* chore: add batching in mp and source transformations

* fix(marketo): remove auth key from logs

* feat: testing tool (#4391)

* feat: testing tool

* chore: changes

* chore: code structure

* fix: eslint

* chore: review comments

* chore: review comment

* feat: add server request creation flow

* chore: bluecore add internal doc and migrate test (#4353)

* fix: blucore optin event mapping

* fix: review comments

* chore: add subscription event

* chore: add subscription event

* fix: reviews comments

* chore: blucore add internal doc and migrate test

* chore: misc

* chore: misc

* fix: readme

* chore: update docs

* fix(bluecore): address PR #4353 reviewer feedback and API documentation corrections

✅ Complete reviewer feedback resolution:
- Removed all 16 'NEEDS REVIEW' placeholders with concrete information
- Removed AI-generated optimization recommendations section
- Simplified repetitive business logic content by creating detailed businesslogic.md
- Updated documentation structure to follow rs-ai repository standards

🔧 API Documentation Corrections:
- Corrected API type from 'Transactional API' to 'Events API' throughout documentation
- Updated endpoint information to reflect actual implementation: https://api.bluecore.app/api/track/mobile/v1
- Fixed authentication method documentation (namespace token in payload vs Bearer header)
- Updated rate limiting information to reflect Events API (removed incorrect Transactional API limits)
- Updated References section with official Events API documentation link

📚 Documentation Structure Improvements:
- Created comprehensive businesslogic.md with detailed field mappings and transformation flows
- Streamlined main README by removing repetitive sections and adding cross-references
- Consolidated error handling, testing, and performance sections
- Updated RETL documentation for consistency

🔍 Code Analysis Verification:
- Verified endpoint match between code implementation and documentation
- Confirmed authentication method matches actual implementation
- Validated all API references against official Bluecore Events API documentation

Files modified:
- src/cdk/v2/destinations/bluecore/README.md (extensive updates)
- src/cdk/v2/destinations/bluecore/docs/businesslogic.md (created)
- src/cdk/v2/destinations/bluecore/docs/retl.md (updated)

The documentation now accurately reflects the actual Bluecore Events API implementation
and provides reliable information for users integrating with Bluecore through RudderStack.

* chore: docs

* chore: review comments

* fix: review comments

* fix: review comments

* fix: review comments

* chore: improve release check reliability

* fix: ensure the testing tool is cross-platform compatible (#4401)

* fix: make testing tool compatible with cross plateform

* fix: review comments

* fix: review comments

* chore: update klaviyo version to 2024-10-15, remove config restricted changes (#4387)

* chore: criteo audience api version upgrade (#4382)

* chore: criteo audience api version upgrade

* chore: add destination integration doc

* chore: resolving comments

* chore: groupEventsByType function optimization (#4398)

* fix: rt event ordering for hs (#4397)

* fix: router output ordering for tiktok_ads

* fix: test

* fix: test

* fix: test

* fix: rt event ordering for hs

* test: configure batch processing defaults for component tests

* fix: test folder structure for destinations (#4414)

* feat: update workflow to raise pr for dedicated transformer from operator (#4413)

* feat: update workflow to raise pr for dedicated transformer from operator

* Update .github/workflows/prepare-for-prod-dt-deploy.yml

Co-authored-by: Krishna Chaitanya <[email protected]>

* chore: revert rollback changes

---------

Co-authored-by: Sudip Paul <[email protected]>
Co-authored-by: Krishna Chaitanya <[email protected]>

* chore: remove broken workflow to updating dedicated deployment (#4418)

chore: remove broken updating dedicated deployment workflow

Co-authored-by: Sudip Paul <[email protected]>

* chore: update node version to 20.19.2 (#4416)

* chore(mailchimp): add router test with inputs contains different destnations (#4419)

* chore(mailchimp): add router test with inputs contains different destinations

* chore: misc

* chore(release): 1.103.0

* fix: enhance config object in ga4 v2 instead of mutating it (#4436)

* fix: enhance config object in ga4v2 instead of mutation

* chore: update changelog

---------

Co-authored-by: Utsab Chowdhury <[email protected]>
Co-authored-by: Mahesh Kutty <[email protected]>
Co-authored-by: Dilip Kola <[email protected]>
Co-authored-by: Aris Tzoumas <[email protected]>
Co-authored-by: Vinay Teki <[email protected]>
Co-authored-by: Sudip Paul <[email protected]>
Co-authored-by: Dilip Kola <[email protected]>
Co-authored-by: Yashasvi Bajpai <[email protected]>
Co-authored-by: Manish Kumar <[email protected]>
Co-authored-by: Sudip Paul <[email protected]>
Co-authored-by: Krishna Chaitanya <[email protected]>
Co-authored-by: GitHub Actions <[email protected]>
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