Skip to content

Conversation

@abhandage
Copy link
Contributor

@abhandage abhandage commented Dec 15, 2025

This pull request introduces versioning constants for API endpoints in the Customer.io, FullStory, and HubSpot destination actions, and refactors all relevant code to use these constants instead of hardcoded API versions. This change improves maintainability and makes future API upgrades easier. The update touches endpoint construction throughout the codebase, ensuring consistency and centralizing API version management.

Key changes by theme:

API Versioning Constants

  • Added versioning-info.ts files for each integration (customerio, fullstory, hubspot) to define version constants such as CUSTOMERIO_TRACK_API_VERSION, CUSTOMERIO_CUSTOMERS_API_VERSION, FULLSTORY_API_VERSION, HUBSPOT_CRM_API_VERSION, HUBSPOT_CRM_ASSOCIATIONS_API_VERSION, and HUBSPOT_OAUTH_API_VERSION. [1] [2]

Customer.io Integration

  • Refactored all API endpoint constructions in customerio to use the new version constants, replacing hardcoded /v1/ and /v2/ paths in batch, entity, and customer deletion endpoints. [1] [2] [3]
  • Imported and used CUSTOMERIO_CUSTOMERS_API_VERSION and CUSTOMERIO_TRACK_API_VERSION where needed. [1] [2]

FullStory Integration

  • Updated custom event and user property request parameter builders to use FULLSTORY_API_VERSION in endpoint paths instead of hardcoded values. [1] [2]
  • Added import and definition for FULLSTORY_API_VERSION. [1] [2]

HubSpot Integration

  • Refactored all endpoint paths in the HubSpot integration (including core API, custom events, dynamic fields, and authentication) to use the new version constants, replacing hardcoded /v3/, /v4/, and /v1/ with the appropriate constant. [1] [2] [3] [4] [5] [6] F2373949L44R45, F2373949L90R91, F2373949L143R147, [7] [8] [9]
  • Added and used imports for the new version constants throughout HubSpot-related files. [1] [2] [3] [4] [5]

These changes standardize API version management and make it significantly easier to update API versions in the future.

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 PR refactors API versioning across five destinations (Salesforce, LinkedIn Audiences, HubSpot, FullStory, and Customer.io) to use a centralized versioning-info module pattern. This is part of a broader tier-1/batch-3 refactoring effort to standardize how API versions are managed across the action-destinations codebase.

Key Changes:

  • Creates new versioning-info.ts files at the root of each destination with well-documented API version constants
  • Updates all references from inline version strings or local constants to use the centralized versioning-info exports
  • Maintains backward compatibility by keeping version values unchanged (no breaking changes)

Reviewed changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/destination-actions/src/destinations/salesforce/versioning-info.ts Introduces SALESFORCE_API_VERSION constant ('v53.0') with documentation
packages/destination-actions/src/destinations/salesforce/sf-operations.ts Removes local API_VERSION constant and imports from versioning-info
packages/destination-actions/src/destinations/salesforce/__tests__/*.test.ts Updates all test files to import SALESFORCE_API_VERSION from versioning-info
packages/destination-actions/src/destinations/linkedin-audiences/versioning-info.ts Introduces LINKEDIN_AUDIENCES_API_VERSION constant ('202505') for API header
packages/destination-actions/src/destinations/linkedin-audiences/constants.ts Re-exports version from versioning-info module
packages/destination-actions/src/destinations/linkedin-audiences/api.ts Adds Linkedin-Version header using centralized constant
packages/destination-actions/src/destinations/hubspot/versioning-info.ts Introduces three version constants for different HubSpot API endpoints (CRM v3, Associations v4, OAuth v1)
packages/destination-actions/src/destinations/hubspot/**/*.ts Updates all HubSpot files to use centralized version constants in URL construction
packages/destination-actions/src/destinations/fullstory/versioning-info.ts Introduces FULLSTORY_API_VERSION constant ('v1')
packages/destination-actions/src/destinations/fullstory/request-params.ts Updates URL construction to use centralized version constant
packages/destination-actions/src/destinations/customerio/versioning-info.ts Introduces two version constants for track API (v2) and customers API (v1)
packages/destination-actions/src/destinations/customerio/utils.ts Updates batch and single request methods to use centralized version constants
packages/destination-actions/src/destinations/customerio/index.ts Updates onDelete method to use centralized version constant

@codecov
Copy link

codecov bot commented Dec 15, 2025

Codecov Report

❌ Patch coverage is 83.87097% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.04%. Comparing base (b362495) to head (f816ae1).

Files with missing lines Patch % Lines
.../upsertObject/functions/dynamic-field-functions.ts 12.50% 7 Missing ⚠️
...ation-actions/src/destinations/customerio/index.ts 50.00% 1 Missing ⚠️
...t/customEvent/functions/dynamic-field-functions.ts 50.00% 1 Missing ⚠️
...tination-actions/src/destinations/hubspot/index.ts 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3472      +/-   ##
==========================================
+ Coverage   80.02%   80.04%   +0.01%     
==========================================
  Files        1226     1231       +5     
  Lines       22769    22792      +23     
  Branches     4525     4525              
==========================================
+ Hits        18222    18244      +22     
- Misses       3711     3712       +1     
  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.

@abhandage abhandage marked this pull request as ready for review December 18, 2025 12:09
@abhandage abhandage requested a review from a team as a code owner December 18, 2025 12:09
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