Skip to content

[Google Campaign Manager 360] Canary Version Upgrade to v5#3667

Open
harsh-joshi99 wants to merge 4 commits intomainfrom
double-click-api-upgrade
Open

[Google Campaign Manager 360] Canary Version Upgrade to v5#3667
harsh-joshi99 wants to merge 4 commits intomainfrom
double-click-api-upgrade

Conversation

@harsh-joshi99
Copy link
Copy Markdown
Contributor

@harsh-joshi99 harsh-joshi99 commented Mar 16, 2026

Adds API version routing for the Google Campaign Manager 360 destination so requests can be sent to a canary dfareporting API version (v5) via a feature flag, while keeping a “stable” default version.

Changes:

Introduces versioning-info.ts and a getApiVersion(features) helper to choose between stable and canary API versions.
Updates conversion upload/adjustment actions to pass features through and use a versioned dfareporting URL.
Updates and extends unit tests to validate the stable vs canary endpoint selection behavior.

Testing

Testing cannot be completed because there is no CRM 360 test account.

The changes are behind a flag: https://flagon.segment.com/families/centrifuge-destinations/gates/cm360-canary-api-version

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'

New Destination Checklist

  • Extracted all action API versions to verioning-info.ts file. example

harsh-joshi99 and others added 2 commits March 13, 2026 09:51
…rade

- Add comprehensive tests for both v4 (stable) and v5 (canary) API versions
- Test that default behavior uses v4 API
- Test that v5 API is used when feature flag cm360-canary-api-version is enabled
- Add breaking-changes-analysis.md documenting the v4→v5 upgrade
- All 33 tests passing

Breaking changes analysis confirms v5 is backward compatible with v4.
No schema changes, no new required fields, same authentication flow.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@cc8eeb8). Learn more about missing BASE report.
⚠️ Report is 19 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3667   +/-   ##
=======================================
  Coverage        ?   80.61%           
=======================================
  Files           ?     1326           
  Lines           ?    24545           
  Branches        ?     5053           
=======================================
  Hits            ?    19788           
  Misses          ?     3830           
  Partials        ?      927           

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

@harsh-joshi99 harsh-joshi99 changed the title Double click api upgrade [Google Campaign Manager 360] Canary Version Upgrade to v5 Mar 23, 2026
@harsh-joshi99 harsh-joshi99 requested a review from Copilot March 23, 2026 13:30
Copy link
Copy Markdown
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

Adds API version routing for the Google Campaign Manager 360 destination so requests can be sent to a canary dfareporting API version (v5) via a feature flag, while keeping a “stable” default version.

Changes:

  • Introduces versioning-info.ts and a getApiVersion(features) helper to choose between stable and canary API versions.
  • Updates conversion upload/adjustment actions to pass features through and use a versioned dfareporting URL.
  • Updates and extends unit tests to validate the stable vs canary endpoint selection behavior.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/destination-actions/src/destinations/google-campaign-manager-360/versioning-info.ts Adds stable/canary API version constants.
packages/destination-actions/src/destinations/google-campaign-manager-360/utils.ts Adds feature-flag-based API version selection and uses it in request URL construction.
packages/destination-actions/src/destinations/google-campaign-manager-360/conversionUpload/index.ts Passes features through to the shared send() helper.
packages/destination-actions/src/destinations/google-campaign-manager-360/conversionUpload/tests/index.test.ts Updates nock URLs to use version constants and adds feature-flag coverage.
packages/destination-actions/src/destinations/google-campaign-manager-360/conversionAdjustmentUpload/index.ts Passes features through to the shared send() helper.
packages/destination-actions/src/destinations/google-campaign-manager-360/conversionAdjustmentUpload/tests/index.test.ts Updates nock URLs to use version constants and adds feature-flag coverage.
packages/destination-actions/src/destinations/google-campaign-manager-360/breaking-changes-analysis.md Adds upgrade analysis/rollout notes for v4 → v5.

Replace hard-coded 'v5' and 'cm360-canary-api-version' string literals
with CANARY_API_VERSION and FLAGON_NAME constants in both test files.
Remove breaking-changes-analysis.md from the codebase.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
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

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

Comment on lines 2 to 4
import { Payload as UploadPayload } from './conversionUpload/generated-types'
import { Payload as Adjustayload } from './conversionAdjustmentUpload/generated-types'
import { AuthTokens } from '@segment/actions-core/destination-kit/parse-settings'
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

The imported payload type alias Adjustayload appears to be a typo (missing "P"). Renaming it to something like AdjustPayload (and updating its uses in this file) would improve clarity and avoid confusion when working with both Upload vs Adjustment payload types.

Copilot generated this review using guidance from repository custom instructions.
@harsh-joshi99 harsh-joshi99 marked this pull request as ready for review March 23, 2026 15:49
@harsh-joshi99 harsh-joshi99 requested a review from a team as a code owner March 23, 2026 15:49
Copy link
Copy Markdown
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

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

@@ -2,6 +2,7 @@ import nock from 'nock'
import { createTestEvent, createTestIntegration } from '@segment/actions-core'
import Destination from '../../index'
import { SegmentEvent } from '@segment/actions-core/*'
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

SegmentEvent is being imported from @segment/actions-core/*, which is not a valid module path and is inconsistent with other tests in this destination. Import the type from @segment/actions-core (prefer import type { SegmentEvent } ...) so TypeScript/module resolution is correct and the import won’t be emitted at runtime.

Suggested change
import { SegmentEvent } from '@segment/actions-core/*'
import type { SegmentEvent } from '@segment/actions-core'

Copilot uses AI. Check for mistakes.
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.

4 participants