-
Notifications
You must be signed in to change notification settings - Fork 294
tier-1/batch-5: refactor API versioning to use versioning-info module #3475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.tsfiles 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 |
packages/destination-actions/src/destinations/criteo-audiences/versioning-info.ts
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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.tsfiles 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_API_VERSIONinversioning-info.tsand updatedBASE_API_URLto use this constant. [1] [2]KLAVIYO_REVISION_DATEinversioning-info.tsand updatedREVISION_DATEinconfig.tsto use this constant. [1] [2]LAUNCHDARKLY_AUDIENCES_API_VERSIONinversioning-info.tsand updatedLD_API_BASE_URLinconstants.tsto use this constant. [1] [2]MOENGAGE_API_VERSIONinversioning-info.tsand updated all API endpoint usages inidentifyUser,trackEvent, and the mainindex.tsto use this constant. [1] [2] [3] [4] [5] [6] [7] [8]OPTIMIZELY_FEATURE_EXPERIMENTATION_DELETE_API_VERSIONandOPTIMIZELY_FEATURE_EXPERIMENTATION_TRACK_API_VERSIONinversioning-info.ts, updating all relevant endpoint URLs inindex.tsandtrackEvent/index.tsto 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.
Security Review
Please ensure sensitive data is properly protected in your integration.
type: 'password'