Skip to content

chore(gaoc): add endpoint paths to transformer responses - #4667

Merged
koladilip merged 2 commits into
developfrom
chore.add-endpoint-paths-gaoc
Sep 23, 2025
Merged

koladilip merged 2 commits into
developfrom
chore.add-endpoint-paths-gaoc

Conversation

@koladilip

@koladilip koladilip commented Sep 22, 2025 •

Copy link
Copy Markdown
Contributor

Summary

This PR adds endpoint path configuration to the Google AdWords Offline Conversions (GAOC) destination to provide better visibility into API endpoints being used.

Resolves https://linear.app/rudderstack/issue/INT-4102/add-endpoint-path-details-in-rudder-transformer-for-top-15

Changes Made

  • config.js: Added endpoint path configuration for GAOC destination
  • transform.js: Updated transform logic to include endpoint path information in responses
  • utils.js: Enhanced utility functions with endpoint path handling
  • utils.test.js: Updated test cases to cover endpoint path functionality
  • test data: Added comprehensive test scenarios for endpoint path validation

Testing

  • Updated existing test cases to include endpoint path scenarios
  • Added new test data for router and processor components
  • All tests pass with the new endpoint path functionality

Related

This is part of the broader effort to add endpoint path visibility to transformer responses across destinations.

Type of Change

  • Chore (non-breaking change which doesn't affect functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

@koladilip
koladilip requested a review from a team as a code owner September 22, 2025 15:30
@coderabbitai

coderabbitai Bot commented Sep 22, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • None (no user-facing changes).
  • Bug Fixes
    • Improved handling of customer IDs and endpoint routing for Google Ads Offline Conversions, reducing misrouted or failed requests.
  • Refactor
    • Unified request/endpoint construction across click, call, store, and search stream conversions for greater reliability and traceability. No configuration changes required.
  • Tests
    • Updated tests to validate the new endpoint structure and paths, improving coverage and confidence.

Walkthrough

Reworked endpoint handling: added CUSTOMER_ID_PARAM and per-endpoint path constants; refactored config to build endpoints from base + path; updated utils/transform to produce and propagate endpointDetails ({endpoint, path}); adjusted requestBuilder signature and tests; batch responses now include endpointPath. (40 words)

Changes

Cohort / File(s) Summary of Changes
Config constants and endpoints
src/v0/destinations/google_adwords_offline_conversions/config.js
Added CUSTOMER_ID_PARAM and endpoint path constants (CLICK_CONVERSION_ENDPOINT_PATH, CALL_CONVERSION_ENDPOINT_PATH, SEARCH_STREAM_ENDPOINT_PATH, STORE_CONVERSION_ENDPOINT_PATH); refactored BASE_ENDPOINT to include customer-id placeholder and built per-feature endpoints from BASE_ENDPOINT + path; exported new constants.
Utilities: endpointDetails refactor
src/v0/destinations/google_adwords_offline_conversions/utils.js
Replaced flat endpoint strings with endpointDetails objects { endpoint, path }; changed requestBuilder signature to accept endpointDetails; updated getClickConversionPayloadAndEndpoint, getCallConversionPayload, and getStoreConversionPayload to return { payload, endpointDetails }; updated imports to use new config constants.
Transform flow integration
src/v0/destinations/google_adwords_offline_conversions/transform.js
Consolidated per-type payload/endpoint handling into convertedPayload; destructures { payload, endpointDetails } and passes endpointDetails to requestBuilder; batch handling extracts endpointPath from events and adds it to batched responses.
Tests alignment
src/v0/destinations/google_adwords_offline_conversions/utils.test.js
Updated tests to assert endpointDetails.endpoint and endpointDetails.path (using new endpoint path constants) instead of flat endpoint strings; adjusted expected outputs across cases.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Source as Source Event
  participant Transform as transform.js
  participant Utils as utils.js
  participant Config as config.js
  participant Req as requestBuilder
  participant API as Google Ads API

  Note over Transform,Utils: Endpoint metadata unified as endpointDetails {endpoint, path}

  Source->>Transform: process event (message, Config)
  Transform->>Utils: get*ConversionPayload(..., filteredCustomerId, ...)
  Utils->>Config: compose BASE_ENDPOINT + PATH (uses CUSTOMER_ID_PARAM)
  Config-->>Utils: endpointDetails { endpoint, path }
  Utils-->>Transform: { payload, endpointDetails }
  Transform->>Req: requestBuilder(payload, endpointDetails, ...)
  Req->>API: POST endpointDetails.endpoint (metadata includes endpointDetails.path)
  API-->>Req: Response
  Req-->>Transform: Request envelope
  Transform-->>Source: batchedResponse (contains endpoint and endpointPath)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • vinayteki95
  • ItsSudip
  • utsabc

Suggestion: verify all downstream consumers of requestBuilder and batched responses accept the new endpointDetails shape; add a unit test for a missing or malformed endpointDetails.path to ensure graceful handling.

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description presents a useful summary, lists changed files, and notes testing, but it does not fully follow the repository template: it is missing the required "Resolves INT-XXX" Linear task reference and does not explicitly populate the "Please explain the objectives" section or the developer checklist items expected by the template. While the "Related" and "Summary" sections partially cover objectives and scope, the absence of the template-mandated task ID and checklist means the description does not meet repository standards for completeness. Given those omissions, the description requires improvement before it can be considered fully compliant. Please add the missing "Resolves INT-XXX" Linear task reference, expand the "Please explain the objectives" section to list dependencies, behavior changes, and related work, and complete or mark the developer checklist items (tests, docs, breaking-change confirmation) so reviewers and automation can validate the PR against the repository template. If any items are not applicable, state "N/A" explicitly and include links to test artifacts or reports as evidence of passing tests.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title "chore(gaoc): add endpoint paths to transformer responses" is concise and accurately summarizes the primary change — adding endpoint path visibility to transformer responses for the GAOC destination; it clearly indicates scope (gaoc) and type (chore) and is readable for teammates scanning history. It avoids unnecessary detail and directly relates to the changes in config, transform, and utils files described in the PR. Overall it communicates the main intent of the changeset effectively.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore.add-endpoint-paths-gaoc

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@koladilip
koladilip force-pushed the chore.add-endpoint-paths-gaoc branch from 5cff390 to 2b4c4f5 Compare September 22, 2025 15:33
@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (5)
src/v0/destinations/google_adwords_offline_conversions/utils.test.js (1)

11-11: Avoid API version drift in tests.

Hardcoding API_VERSION in tests can drift from config.js. Consider importing API_VERSION from config to reduce brittleness.

src/v0/destinations/google_adwords_offline_conversions/utils.js (4)

64-85: Use exported SEARCH_STREAM_ENDPOINT_PATH instead of hardcoded string.

Avoids drift if the path changes.

-const {
+const {
   SEARCH_STREAM,
+  SEARCH_STREAM_ENDPOINT_PATH,
   CONVERSION_ACTION_ID_CACHE_TTL,
@@
-    let searchStreamResponse = await httpPOST(endpoint, data, requestOptions, {
+    let searchStreamResponse = await httpPOST(endpoint, data, requestOptions, {
       destType: 'google_adwords_offline_conversions',
       feature: 'transformation',
-      endpointPath: `/googleAds:searchStream`,
+      endpointPath: `/googleAds:${SEARCH_STREAM_ENDPOINT_PATH}`,
       requestMethod: 'POST',
       module: 'dataDelivery',
       metadata,
     });

400-404: Deduplicate product item-list construction.

You already have generateItemListFromProducts above; reuse it here to avoid copy-paste.

-  const products = get(message, 'properties.products');
-  if (Array.isArray(products)) {
-    // products is a list of items
-    const itemList = products
-      .filter((product) => Object.keys(product).length > 0)
-      .map((product) => ({
-        productId: product.product_id,
-        quantity: parseInt(product.quantity, 10),
-        unitPrice: Number(product.price),
-      }));
-
-    set(payload, 'conversions[0].cartData.items', itemList);
-  }
+  const products = get(message, 'properties.products');
+  if (Array.isArray(products)) {
+    set(
+      payload,
+      'conversions[0].cartData.items',
+      generateItemListFromProducts(products),
+    );
+  }

425-433: Guard phone hashing with isString to prevent trim() on non-strings.

Click path currently checks only isDefinedAndNotNull for phone (unlike store path which also checks isString). Align to avoid runtime errors if phone is an object.

-    phone:
-      hashUserIdentifier && isDefinedAndNotNull(phone) ? sha256(phone.trim()).toString() : phone,
+    phone:
+      hashUserIdentifier && isDefinedAndNotNull(phone) && isString(phone)
+        ? sha256(phone.trim()).toString()
+        : phone,

111-123: Unused helper generateItemListFromProducts (if not reused).

If you don’t adopt the refactor above, remove the unused helper to avoid dead code.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c6d26c4 and 2b4c4f5.

⛔ Files ignored due to path filters (2)
  • test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts is excluded by !**/test/**
  • test/integrations/destinations/google_adwords_offline_conversions/router/data.ts is excluded by !**/test/**
📒 Files selected for processing (4)
  • src/v0/destinations/google_adwords_offline_conversions/config.js (2 hunks)
  • src/v0/destinations/google_adwords_offline_conversions/transform.js (4 hunks)
  • src/v0/destinations/google_adwords_offline_conversions/utils.js (8 hunks)
  • src/v0/destinations/google_adwords_offline_conversions/utils.test.js (6 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js

⚙️ CodeRabbit configuration file

Focus on ESLint errors (max 3) and warnings (max 5).

Files:

  • src/v0/destinations/google_adwords_offline_conversions/utils.test.js
  • src/v0/destinations/google_adwords_offline_conversions/utils.js
  • src/v0/destinations/google_adwords_offline_conversions/transform.js
  • src/v0/destinations/google_adwords_offline_conversions/config.js
🧠 Learnings (2)
📚 Learning: 2025-05-29T13:29:39.436Z
Learnt from: maheshkutty
PR: rudderlabs/rudder-transformer#4359
File: src/v0/util/index.js:2272-2272
Timestamp: 2025-05-29T13:29:39.436Z
Learning: The `combineBatchRequestsWithSameJobIds` function in `src/v0/util/index.js` is used by both Mixpanel and Google AdWords Offline Conversions destinations in production. The function assumes metadata is always an array in multiple operations (forEach, filter, sort, map) and needs defensive programming to handle non-array metadata cases to prevent runtime errors.

Applied to files:

  • src/v0/destinations/google_adwords_offline_conversions/transform.js
📚 Learning: 2025-08-13T04:47:19.615Z
Learnt from: ItsSudip
PR: rudderlabs/rudder-transformer#4497
File: src/v0/destinations/tiktok_ads/transformV2.js:422-435
Timestamp: 2025-08-13T04:47:19.615Z
Learning: The getSuccessRespEvents function in src/v0/util/index.js is designed to be flexible and can accept both single request objects and arrays as the first parameter (message). It simply assigns the input directly to the batchedRequest property without processing, allowing downstream consumers to handle the appropriate format.

Applied to files:

  • src/v0/destinations/google_adwords_offline_conversions/transform.js
🧬 Code graph analysis (4)
src/v0/destinations/google_adwords_offline_conversions/utils.test.js (2)
src/v0/destinations/google_adwords_offline_conversions/config.js (1)
  • API_VERSION (3-3)
src/v0/destinations/google_adwords_offline_conversions/utils.js (3)
  • getCallConversionPayload (237-246)
  • message (253-253)
  • message (390-390)
src/v0/destinations/google_adwords_offline_conversions/utils.js (2)
src/v0/destinations/google_adwords_offline_conversions/config.js (8)
  • CUSTOMER_ID_PARAM (5-5)
  • CALL_CONVERSION (15-15)
  • CALL_CONVERSION_ENDPOINT_PATH (14-14)
  • consentConfigMap (51-54)
  • STORE_CONVERSION_CONFIG (22-22)
  • STORE_CONVERSION_ENDPOINT_PATH (21-21)
  • CLICK_CONVERSION (11-11)
  • CLICK_CONVERSION_ENDPOINT_PATH (10-10)
src/v0/util/googleUtils/index.js (1)
  • finaliseConsent (56-88)
src/v0/destinations/google_adwords_offline_conversions/transform.js (1)
src/v0/destinations/google_adwords_offline_conversions/utils.js (18)
  • getClickConversionPayloadAndEndpoint (380-462)
  • message (253-253)
  • message (390-390)
  • Config (177-177)
  • Config (254-254)
  • Config (318-318)
  • Config (388-389)
  • getStoreConversionPayload (317-331)
  • getCallConversionPayload (237-246)
  • requestBuilder (168-206)
  • payload (212-212)
  • payload (238-238)
  • payload (255-255)
  • payload (323-329)
  • payload (398-398)
  • endpointDetails (239-242)
  • endpointDetails (319-322)
  • endpointDetails (400-403)
src/v0/destinations/google_adwords_offline_conversions/config.js (1)
src/v0/destinations/google_adwords_remarketing_lists/config.js (2)
  • BASE_ENDPOINT (6-6)
  • API_VERSION (3-3)
🪛 GitHub Actions: DT Tests
src/v0/destinations/google_adwords_offline_conversions/utils.test.js

[error] 193-388: Multiple failing tests in getClickConversionPayloadAndEndpoint and related helpers. The test expectations show endpointDetails.path should be undefined, but the actual result has path: 'uploadClickConversions' (and similar for other cases). This indicates a mismatch in how endpoint.path is being constructed in getClickConversionPayloadAndEndpoint (or related utilities).

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: UT Tests
  • GitHub Check: test_and_publish
🔇 Additional comments (9)
src/v0/destinations/google_adwords_offline_conversions/transform.js (4)

37-69: Unified convertedPayload flow looks good.

Branch-specific helpers now return { payload, endpointDetails } and are funneled uniformly; this simplifies request construction.


70-80: Conversion timestamp population retained.

Still guards for conversionDateTime and formats timestamp/originalTimestamp correctly.


81-89: Propagate endpointPath via requestBuilder.

Passing endpointDetails into requestBuilder is correct and supports endpointPath in responses as intended.

Please confirm downstream consumers are tolerant of the new endpointPath field on non-store events (analytics, logging).


176-181: Batch path propagation for store sales events.

Reading endpointPath from the first message and copying it into the batched request is consistent with existing pattern.

src/v0/destinations/google_adwords_offline_conversions/config.js (2)

5-23: Good separation of base endpoint and per-operation paths.

Introducing CUSTOMER_ID_PARAM and endpoint-path constants makes composition explicit and reusable.


56-80: Exporting endpoint-path constants enables stronger test assertions.

This supports tests asserting path values instead of undefined. No issues spotted.

src/v0/destinations/google_adwords_offline_conversions/utils.js (3)

167-206: requestBuilder correctly surfaces endpoint and endpointPath.

This satisfies the PR objective; no concerns.


237-246: Keep endpointDetails.path populated for call conversions (tests must reflect this).

Behavior matches click/store helpers. Ensure tests assert CALL_CONVERSION_ENDPOINT_PATH as discussed.


317-331: Store conversion endpointDetails.path populated; consistent with transform batching.

Looks good.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/v0/destinations/google_adwords_offline_conversions/utils.test.js (1)

325-346: Unify endpoint string building: avoid hardcoding 'v19' in call-conversion tests.

Click tests use API_VERSION; call tests hardcode 'v19'. For consistency and easier future bumps, use API_VERSION in all three call-conversion expectations.

Apply:

@@
-        endpoint: 'https://googleads.googleapis.com/v19/customers/9625812972:uploadCallConversions',
+        endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadCallConversions`,
@@
-        endpoint: 'https://googleads.googleapis.com/v19/customers/9625812972:uploadCallConversions',
+        endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadCallConversions`,
@@
-        endpoint: 'https://googleads.googleapis.com/v19/customers/9625812972:uploadCallConversions',
+        endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadCallConversions`,

Also applies to: 356-379, 388-407

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2b4c4f5 and 8edf221.

📒 Files selected for processing (1)
  • src/v0/destinations/google_adwords_offline_conversions/utils.test.js (7 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js

⚙️ CodeRabbit configuration file

Focus on ESLint errors (max 3) and warnings (max 5).

Files:

  • src/v0/destinations/google_adwords_offline_conversions/utils.test.js
🧬 Code graph analysis (1)
src/v0/destinations/google_adwords_offline_conversions/utils.test.js (2)
src/v0/destinations/google_adwords_offline_conversions/config.js (4)
  • require (1-1)
  • API_VERSION (3-3)
  • CLICK_CONVERSION_ENDPOINT_PATH (10-10)
  • CALL_CONVERSION_ENDPOINT_PATH (14-14)
src/v0/destinations/google_adwords_offline_conversions/utils.js (10)
  • require (4-4)
  • require (5-9)
  • require (10-10)
  • require (11-22)
  • require (23-39)
  • require (40-40)
  • require (43-43)
  • getCallConversionPayload (237-246)
  • message (253-253)
  • message (390-390)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • 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 (4)
src/v0/destinations/google_adwords_offline_conversions/utils.test.js (4)

10-10: Good: importing endpoint path constants aligns tests with new contract.

Import looks correct and used consistently in expectations.


171-174: LGTM: asserting endpointDetails.path for click conversions.

Matches updated utils contract and avoids brittle string literals by using the exported constant.


204-207: LGTM: second click-conversion case updated to assert path.


260-263: LGTM: consent/cart case asserts path as well.

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@codecov

codecov Bot commented Sep 23, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.78%. Comparing base (e7628ec) to head (5f8cf6a).
⚠️ Report is 11 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4667   +/-   ##
========================================
  Coverage    91.78%   91.78%           
========================================
  Files          642      642           
  Lines        33974    33981    +7     
  Branches      8043     8043           
========================================
+ Hits         31184    31191    +7     
- Misses        2538     2560   +22     
+ Partials       252      230   -22     

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

@koladilip
koladilip force-pushed the chore.add-endpoint-paths-gaoc branch from 8edf221 to 09b326e Compare September 23, 2025 07:22

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
src/v0/destinations/google_adwords_offline_conversions/utils.js (3)

33-39: Avoid hardcoding searchStream endpointPath; use config constant

Keep path construction consistent with other endpoints and centralize the string.

Apply this diff:

--- a/src/v0/destinations/google_adwords_offline_conversions/utils.js
+++ b/src/v0/destinations/google_adwords_offline_conversions/utils.js
@@
   consentConfigMap,
   STORE_CONVERSION_CONFIG,
   CALL_CONVERSION,
   CUSTOMER_ID_PARAM,
   CALL_CONVERSION_ENDPOINT_PATH,
   CLICK_CONVERSION_ENDPOINT_PATH,
   STORE_CONVERSION_ENDPOINT_PATH,
+  SEARCH_STREAM_ENDPOINT_PATH,
 } = require('./config');
@@
     let searchStreamResponse = await httpPOST(endpoint, data, requestOptions, {
       destType: 'google_adwords_offline_conversions',
       feature: 'transformation',
-      endpointPath: `/googleAds:searchStream`,
+      endpointPath: `/googleAds:${SEARCH_STREAM_ENDPOINT_PATH}`,
       requestMethod: 'POST',
       module: 'dataDelivery',
       metadata,
     });

Also applies to: 74-85


170-182: Defensive guard for endpointDetails

Fail fast if endpointDetails is missing required fields to avoid undefined network calls.

Apply this diff:

 const requestBuilder = (
   payload,
   endpointDetails,
   Config,
   metadata,
   event,
   filteredCustomerId,
   properties,
 ) => {
+  if (!endpointDetails?.endpoint || !endpointDetails?.path) {
+    throw new ConfigurationError('Missing endpoint details for request');
+  }
   const { customVariables, subAccount, loginCustomerId } = Config;
   const response = defaultRequestConfig();
   response.method = defaultPostRequestConfig.requestMethod;
   response.endpoint = endpointDetails.endpoint;
   response.endpointPath = endpointDetails.path;

317-331: Remove or correct payload.event assignment in getStoreConversionPayload

getStoreConversionPayload (src/v0/destinations/google_adwords_offline_conversions/utils.js) sets payload.event = filteredCustomerId (customer id). requestBuilder already sets params.event to the mapped conversion action name (used by getConversionActionId) and the store-conversion flow uses createJobPayload/addConversionPayload from body.JSON — body.JSON.event is unused and misleading. Remove the payload.event assignment or set it to the conversion action name (eventsToConversionsNamesMapping[event]) if a field is required for compatibility.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8edf221 and 09b326e.

⛔ Files ignored due to path filters (2)
  • test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts is excluded by !**/test/**
  • test/integrations/destinations/google_adwords_offline_conversions/router/data.ts is excluded by !**/test/**
📒 Files selected for processing (4)
  • src/v0/destinations/google_adwords_offline_conversions/config.js (2 hunks)
  • src/v0/destinations/google_adwords_offline_conversions/transform.js (4 hunks)
  • src/v0/destinations/google_adwords_offline_conversions/utils.js (8 hunks)
  • src/v0/destinations/google_adwords_offline_conversions/utils.test.js (7 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/v0/destinations/google_adwords_offline_conversions/config.js
  • src/v0/destinations/google_adwords_offline_conversions/transform.js
  • src/v0/destinations/google_adwords_offline_conversions/utils.test.js
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js

⚙️ CodeRabbit configuration file

Focus on ESLint errors (max 3) and warnings (max 5).

Files:

  • src/v0/destinations/google_adwords_offline_conversions/utils.js
🧬 Code graph analysis (1)
src/v0/destinations/google_adwords_offline_conversions/utils.js (2)
src/v0/destinations/google_adwords_offline_conversions/config.js (9)
  • SEARCH_STREAM (19-19)
  • CUSTOMER_ID_PARAM (5-5)
  • CALL_CONVERSION (15-15)
  • CALL_CONVERSION_ENDPOINT_PATH (14-14)
  • consentConfigMap (51-54)
  • STORE_CONVERSION_CONFIG (22-22)
  • STORE_CONVERSION_ENDPOINT_PATH (21-21)
  • CLICK_CONVERSION (11-11)
  • CLICK_CONVERSION_ENDPOINT_PATH (10-10)
src/v0/util/googleUtils/index.js (1)
  • finaliseConsent (56-88)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Code Coverage
  • GitHub Check: test_and_publish
  • GitHub Check: UT Tests
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (go)
🔇 Additional comments (3)
src/v0/destinations/google_adwords_offline_conversions/utils.js (3)

33-39: Imports for endpoint path support look good

All newly imported constants are used and align with endpointDetails usage.


237-246: Call conversion payload + endpointDetails: LGTM

Endpoint replacement and path propagation are correct.


400-403: Click conversion endpointDetails: LGTM

Consistent endpoint replacement and path exposure; return shape matches the new contract.

Also applies to: 461-461

- Add endpoint path configuration to Google AdWords Offline Conversions destination
- Update transform logic to include endpoint path information
- Enhance utils with endpoint path handling
- Update test data to include endpoint path scenarios
- Add comprehensive test coverage for endpoint path functionality
- Add endpoint path configuration to Google AdWords Offline Conversions destination
- Update transform logic to include endpoint path information
- Enhance utils with endpoint path handling
- Update test data to include endpoint path scenarios
- Add comprehensive test coverage for endpoint path functionality
@koladilip
koladilip force-pushed the chore.add-endpoint-paths-gaoc branch from 09b326e to 5f8cf6a Compare September 23, 2025 09:56
@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 09b326e and 5f8cf6a.

⛔ Files ignored due to path filters (2)
  • test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts is excluded by !**/test/**
  • test/integrations/destinations/google_adwords_offline_conversions/router/data.ts is excluded by !**/test/**
📒 Files selected for processing (4)
  • src/v0/destinations/google_adwords_offline_conversions/config.js (2 hunks)
  • src/v0/destinations/google_adwords_offline_conversions/transform.js (4 hunks)
  • src/v0/destinations/google_adwords_offline_conversions/utils.js (8 hunks)
  • src/v0/destinations/google_adwords_offline_conversions/utils.test.js (7 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/v0/destinations/google_adwords_offline_conversions/transform.js
  • src/v0/destinations/google_adwords_offline_conversions/config.js
  • src/v0/destinations/google_adwords_offline_conversions/utils.test.js
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js

⚙️ CodeRabbit configuration file

Focus on ESLint errors (max 3) and warnings (max 5).

Files:

  • src/v0/destinations/google_adwords_offline_conversions/utils.js
🧬 Code graph analysis (1)
src/v0/destinations/google_adwords_offline_conversions/utils.js (3)
src/v0/destinations/af/deleteUsers.js (2)
  • endpoint (90-90)
  • response (30-45)
src/v0/destinations/google_adwords_offline_conversions/config.js (8)
  • CUSTOMER_ID_PARAM (5-5)
  • CALL_CONVERSION (15-15)
  • CALL_CONVERSION_ENDPOINT_PATH (14-14)
  • consentConfigMap (51-54)
  • STORE_CONVERSION_CONFIG (22-22)
  • STORE_CONVERSION_ENDPOINT_PATH (21-21)
  • CLICK_CONVERSION (11-11)
  • CLICK_CONVERSION_ENDPOINT_PATH (10-10)
src/v0/util/googleUtils/index.js (1)
  • finaliseConsent (56-88)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • 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: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Code Coverage
  • GitHub Check: UT Tests
  • GitHub Check: test_and_publish
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (6)
src/v0/destinations/google_adwords_offline_conversions/utils.js (6)

33-38: LGTM: Clean import additions for endpoint path handling.

The new imports align with the refactoring to use structured endpoint configuration with path constants and the customer ID parameter placeholder.


168-181: Well-structured endpoint details integration.

The refactor from accepting a plain endpoint parameter to endpointDetails object is clean and maintains backward compatibility by setting both response.endpoint and the new response.endpointPath fields.


237-245: Consistent endpoint details pattern for call conversions.

The function signature update and return structure align well with the overall refactoring approach. The endpoint construction and path assignment follow the established pattern.


317-330: Store conversion payload structure enhanced appropriately.

The function correctly constructs endpointDetails and maintains the existing payload structure while adding the new endpoint path information.


400-403: Click conversion endpoint details implementation looks solid.

The endpoint details construction follows the established pattern and the return structure maintains consistency with other conversion payload functions.

Also applies to: 461-461


74-74: Verify consistent parameter replacement pattern.

The endpoint construction correctly uses CUSTOMER_ID_PARAM for parameter replacement. Ensure this pattern is consistently applied across all endpoint construction calls in the codebase.

@sonarqubecloud

Copy link
Copy Markdown

@koladilip
koladilip enabled auto-merge (squash) September 23, 2025 10:31
@koladilip
koladilip merged commit e669655 into develop Sep 23, 2025
@koladilip
koladilip deleted the chore.add-endpoint-paths-gaoc branch September 23, 2025 12:28
maheshkutty pushed a commit that referenced this pull request Sep 24, 2025
* chore(gaoc): add endpoint paths to transformer responses

- Add endpoint path configuration to Google AdWords Offline Conversions destination
- Update transform logic to include endpoint path information
- Enhance utils with endpoint path handling
- Update test data to include endpoint path scenarios
- Add comprehensive test coverage for endpoint path functionality

* chore(gaoc): add endpoint paths to transformer responses

- Add endpoint path configuration to Google AdWords Offline Conversions destination
- Update transform logic to include endpoint path information
- Enhance utils with endpoint path handling
- Update test data to include endpoint path scenarios
- Add comprehensive test coverage for endpoint path functionality
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.

3 participants