Skip to content

feat: add endpointPath to Google AdWords Remarketing Lists destination - #4662

Merged
koladilip merged 1 commit into
developfrom
chore.add-endpoint-paths-garl
Sep 22, 2025
Merged

koladilip merged 1 commit into
developfrom
chore.add-endpoint-paths-garl

Conversation

@koladilip

Copy link
Copy Markdown
Contributor

Summary

This PR adds the property to the Google AdWords Remarketing Lists destination response configuration.

Changes

  • config.js: Added constant and exported it
  • util.js: Updated function to include in the response
  • util.test.js: Updated test expectations to include
  • Test data files: Updated all processor and router test data files to include in expected responses

Technical Details

The property provides better traceability and debugging capabilities by clearly identifying the specific API endpoint being used in the response object. This change ensures consistency with other destinations that include endpoint paths in their responses.

Testing

  • All existing tests pass
  • Test data has been updated to reflect the new property
  • No breaking changes to existing functionality

Files Modified

  • src/v0/destinations/google_adwords_remarketing_lists/config.js
  • src/v0/destinations/google_adwords_remarketing_lists/util.js
  • src/v0/destinations/google_adwords_remarketing_lists/util.test.js
  • test/integrations/destinations/google_adwords_remarketing_lists/processor/data.ts
  • test/integrations/destinations/google_adwords_remarketing_lists/router/data.ts

- Add OFFLINE_USER_DATA_JOBS_ENDPOINT constant to config.js
- Update responseBuilder to include endpointPath in response
- Update all test data files to include endpointPath in expected responses
- Ensure consistency across processor and router test data
@koladilip
koladilip requested a review from a team as a code owner September 22, 2025 08:56
@coderabbitai

coderabbitai Bot commented Sep 22, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Refactor
    • Standardized the Google Ads Offline User Data Jobs endpoint using a central configuration, improving consistency and reducing risk of path mismatches. No user-facing behavior changes.
  • Tests
    • Updated tests to validate the standardized endpoint path, ensuring alignment with the new configuration.

Walkthrough

Added a constant for the offline user data jobs endpoint in config, updated util to use this constant and include endpointPath in the response, and adjusted tests to expect endpointPath.

Changes

Cohort / File(s) Summary
Google Ads Remarketing Lists endpoint centralization
src/v0/destinations/google_adwords_remarketing_lists/config.js, src/v0/destinations/google_adwords_remarketing_lists/util.js, src/v0/destinations/google_adwords_remarketing_lists/util.test.js
- Introduced and exported OFFLINE_USER_DATA_JOBS_ENDPOINT = 'offlineUserDataJobs'.
- util.js: Replaced hardcoded path with the constant; added endpointPath to response; endpoint constructed as ${BASE_ENDPOINT}/${filteredCustomerId}/${OFFLINE_USER_DATA_JOBS_ENDPOINT}.
- Tests updated to expect endpointPath: 'offlineUserDataJobs'.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Caller
  participant U as util.responseBuilder
  participant CFG as config (OFFLINE_USER_DATA_JOBS_ENDPOINT)
  participant R as Response

  C->>U: Build response(payload, destination)
  U->>CFG: Read OFFLINE_USER_DATA_JOBS_ENDPOINT
  Note right of CFG: Returns 'offlineUserDataJobs'
  U->>U: Compute endpointPath = 'offlineUserDataJobs'
  U->>U: Build endpoint = BASE_ENDPOINT/filteredCustomerId/endpointPath
  U-->>R: { endpointPath, endpoint, ... }
  R-->>C: Response object
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • utsabc
  • ItsSudip
  • sivashanmukh

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly and accurately describes the primary change — adding endpointPath to the Google AdWords Remarketing Lists destination — and matches the modifications in config.js, util.js, and tests. It is concise, uses the conventional "feat:" prefix, and contains no unrelated noise or vague terms. A reviewer scanning PR history can understand the main intent from the title alone.
Description Check ✅ Passed The PR description is mostly complete: it provides a summary, lists changed files, explains technical rationale, and states testing status, which covers the template's main intent. However it is missing the required "Resolves INT-XXX" Linear task reference, contains blank placeholders where the property name should appear (e.g., "This PR adds the property" should explicitly say "endpointPath"), and the Developer checklist items are not filled out, which reduces clarity and traceability. These omissions should be corrected to fully satisfy the repository template.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ 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-garl

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.

@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: 0

🧹 Nitpick comments (3)
src/v0/destinations/google_adwords_remarketing_lists/util.test.js (1)

72-72: Prefer using the exported constant in tests to avoid string drift.

Import OFFLINE_USER_DATA_JOBS_ENDPOINT and use it for both endpointPath and endpoint construction.

-const { API_VERSION } = require('./config');
+const { API_VERSION, OFFLINE_USER_DATA_JOBS_ENDPOINT } = require('./config');
@@
-  endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
-  endpointPath: 'offlineUserDataJobs',
+  endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/${OFFLINE_USER_DATA_JOBS_ENDPOINT}`,
+  endpointPath: OFFLINE_USER_DATA_JOBS_ENDPOINT,

Also applies to: 2-2, 71-71

src/v0/destinations/google_adwords_remarketing_lists/config.js (1)

5-5: Naming nit: clarify that this is a path segment, not a full endpoint.

Consider OFFLINE_USER_DATA_JOBS_PATH (or an ENDPOINTS object) to make intent explicit. Optional, no functional change.

src/v0/destinations/google_adwords_remarketing_lists/util.js (1)

19-23: Approve — endpointPath is sourced from config; update tests to use the constant and consider normalizing endpointPath format

  • Verified: src/v0/destinations/google_adwords_remarketing_lists/util.js sets response.endpointPath = OFFLINE_USER_DATA_JOBS_ENDPOINT and builds response.endpoint via BASE_ENDPOINT/.../OFFLINE_USER_DATA_JOBS_ENDPOINT (lines 45–46).
  • Found: src/v0/destinations/google_adwords_remarketing_lists/util.test.js still hardcodes 'offlineUserDataJobs' and the full endpoint (lines ~70–73). Switch tests to import/use OFFLINE_USER_DATA_JOBS_ENDPOINT to avoid duplicated literals.
  • Optional: src/v0/destinations/google_adwords_remarketing_lists/networkHandler.js contains endpointPath entries with leading slashes ('/customers/create', '/addOperations', '/run') (lines ~44,71,96) — consider standardizing whether endpointPath includes a leading slash.
📜 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 ff66dbf and 11d6e30.

⛔ Files ignored due to path filters (2)
  • test/integrations/destinations/google_adwords_remarketing_lists/processor/data.ts is excluded by !**/test/**
  • test/integrations/destinations/google_adwords_remarketing_lists/router/data.ts is excluded by !**/test/**
📒 Files selected for processing (3)
  • src/v0/destinations/google_adwords_remarketing_lists/config.js (2 hunks)
  • src/v0/destinations/google_adwords_remarketing_lists/util.js (2 hunks)
  • src/v0/destinations/google_adwords_remarketing_lists/util.test.js (1 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_remarketing_lists/util.test.js
  • src/v0/destinations/google_adwords_remarketing_lists/util.js
  • src/v0/destinations/google_adwords_remarketing_lists/config.js
🧠 Learnings (1)
📚 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_remarketing_lists/util.test.js
  • src/v0/destinations/google_adwords_remarketing_lists/util.js
🧬 Code graph analysis (1)
src/v0/destinations/google_adwords_remarketing_lists/util.js (1)
src/v0/destinations/google_adwords_remarketing_lists/config.js (2)
  • OFFLINE_USER_DATA_JOBS_ENDPOINT (5-5)
  • BASE_ENDPOINT (6-6)
⏰ 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 AMD64
  • GitHub Check: Build User 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 (javascript-typescript)
  • GitHub Check: Analyze (go)
🔇 Additional comments (1)
src/v0/destinations/google_adwords_remarketing_lists/config.js (1)

5-5: Centralizing the endpoint path looks good.

Exporting OFFLINE_USER_DATA_JOBS_ENDPOINT here keeps util.js clean and consistent.

Also applies to: 30-30

@codecov

codecov Bot commented Sep 22, 2025 •

Copy link
Copy Markdown

Codecov Report

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

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

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

@sonarqubecloud

Copy link
Copy Markdown

@koladilip
koladilip merged commit c6d26c4 into develop Sep 22, 2025
@koladilip
koladilip deleted the chore.add-endpoint-paths-garl branch September 22, 2025 15:30
maheshkutty pushed a commit that referenced this pull request Sep 24, 2025
#4662)

- Add OFFLINE_USER_DATA_JOBS_ENDPOINT constant to config.js
- Update responseBuilder to include endpointPath in response
- Update all test data files to include endpointPath in expected responses
- Ensure consistency across processor and router test data
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