Skip to content

Conversation

@abhandage
Copy link
Contributor

@abhandage abhandage commented Dec 15, 2025

This pull request refactors how API versioning is handled for several destination integrations by centralizing API version strings into dedicated constants files. This improves maintainability and consistency across the codebase. The main changes include extracting API version values into separate versioning-info.ts files for Criteo Audiences, Klaviyo, LaunchDarkly Audiences, MoEngage, and Optimizely Feature Experimentation, and updating all relevant endpoints to use these constants.

API Versioning Refactor:

  • Criteo Audiences: Moved the API version to CRITEO_AUDIENCES_API_VERSION in versioning-info.ts and updated BASE_API_URL to use this constant. [1] [2]
  • Klaviyo: Introduced KLAVIYO_REVISION_DATE in versioning-info.ts and updated REVISION_DATE in config.ts to use this constant. [1] [2]
  • LaunchDarkly Audiences: Added LAUNCHDARKLY_AUDIENCES_API_VERSION in versioning-info.ts and updated LD_API_BASE_URL in constants.ts to use this constant. [1] [2]
  • MoEngage: Created MOENGAGE_API_VERSION in versioning-info.ts and updated all API endpoint usages in identifyUser, trackEvent, and the main index.ts to use this constant. [1] [2] [3] [4] [5] [6] [7] [8]
  • Optimizely Feature Experimentation: Added OPTIMIZELY_FEATURE_EXPERIMENTATION_DELETE_API_VERSION and OPTIMIZELY_FEATURE_EXPERIMENTATION_TRACK_API_VERSION in versioning-info.ts, updating all relevant endpoint URLs in index.ts and trackEvent/index.ts to use these constants. [1] [2] [3] [4] [5] [6]

No logic changes were made to the integrations themselves; this is a structural update to centralize and standardize API version management.

Testing

Include any additional information about the testing you have completed to
ensure your changes behave as expected. For a speedy review, please check
any of the tasks you completed below during your testing.

  • Added unit tests for new functionality
  • Tested end-to-end using the local server
  • [If destination is already live] Tested for backward compatibility of destination. Note: New required fields are a breaking change.
  • [Segmenters] Tested in the staging environment
  • [Segmenters] [If applicable for this change] Tested for regression with Hadron.

Security Review

Please ensure sensitive data is properly protected in your integration.

  • Reviewed all field definitions for sensitive data (API keys, tokens, passwords, client secrets) and confirmed they use type: 'password'

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request refactors API versioning across five destinations by extracting hardcoded version strings into centralized versioning-info.ts modules. This follows the repository's established pattern of storing API version constants in dedicated files with proper documentation and API reference links. The refactoring improves maintainability by making version updates easier to manage and more consistent across the codebase.

Key Changes:

  • Created new versioning-info.ts files for Optimizely Feature Experimentation, MoEngage, LaunchDarkly Audiences, and Criteo Audiences destinations
  • Updated Klaviyo to import its existing revision date from the new versioning-info module
  • Replaced all hardcoded API version strings with named constants

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/destination-actions/src/destinations/optimizely-feature-experimentation-actions/versioning-info.ts New versioning module defining v1 and v2 API versions for track and delete endpoints
packages/destination-actions/src/destinations/optimizely-feature-experimentation-actions/trackEvent/index.ts Updated to use imported TRACK_API_VERSION constant instead of hardcoded 'v1'
packages/destination-actions/src/destinations/optimizely-feature-experimentation-actions/index.ts Updated to use imported DELETE_API_VERSION constant instead of hardcoded 'v2'
packages/destination-actions/src/destinations/moengage/versioning-info.ts New versioning module defining v1 API version
packages/destination-actions/src/destinations/moengage/trackEvent/index.ts Updated to use imported API_VERSION constant with minor formatting improvements
packages/destination-actions/src/destinations/moengage/index.ts Updated testAuthentication to use imported API_VERSION constant
packages/destination-actions/src/destinations/moengage/identifyUser/index.ts Updated to use imported API_VERSION constant with minor formatting cleanup
packages/destination-actions/src/destinations/launchdarkly-audiences/versioning-info.ts New versioning module defining v2 API version
packages/destination-actions/src/destinations/launchdarkly-audiences/constants.ts Updated LD_API_BASE_URL to use imported API_VERSION constant
packages/destination-actions/src/destinations/klaviyo/versioning-info.ts New versioning module defining the 2025-01-15 revision date
packages/destination-actions/src/destinations/klaviyo/config.ts Updated to import REVISION_DATE from versioning-info instead of local definition
packages/destination-actions/src/destinations/criteo-audiences/versioning-info.ts New versioning module defining 2023-10 API version
packages/destination-actions/src/destinations/criteo-audiences/criteo-audiences.ts Updated BASE_API_URL to use imported API_VERSION constant

@codecov
Copy link

codecov bot commented Dec 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.04%. Comparing base (b362495) to head (4f239ce).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3475      +/-   ##
==========================================
+ Coverage   80.02%   80.04%   +0.01%     
==========================================
  Files        1226     1231       +5     
  Lines       22769    22783      +14     
  Branches     4525     4524       -1     
==========================================
+ Hits        18222    18236      +14     
  Misses       3711     3711              
  Partials      836      836              

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants