Repository navigation
feat: onboard google developer token - #4613
Conversation
Summary by CodeRabbit
WalkthroughCentralizes Google Ads developer token retrieval via a new getDeveloperToken() (reads GOOGLE_ADS_DEVELOPER_TOKEN), removes per-message developer-token extraction across Enhanced Conversions, Offline Conversions, and Remarketing Lists, updates responseBuilder signature and tests, enables Jest setupFiles, and adds a PR-review guideline document. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Transformer
participant Dest as DestinationLogic
participant NH as NetworkHandler
participant GU as googleUtils.getDeveloperToken
participant GAds as GoogleAdsAPI
Transformer->>Dest: build payload (no per-message token)
Dest->>NH: make request / init SDK
NH->>GU: getDeveloperToken()
GU-->>NH: developerToken or throw
alt token present
NH->>GAds: send/init with headers['developer-token']
GAds-->>NH: response
NH-->>Dest: return response
else missing token
NH-->>Dest: throw PlatformError (missing env token)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Suggestions for improvements:
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
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. Comment |
|
Allure Test reports for this run are available at:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4613 +/- ##
========================================
Coverage 91.78% 91.79%
========================================
Files 642 642
Lines 33974 33998 +24
Branches 8043 8035 -8
========================================
+ Hits 31184 31207 +23
- Misses 2538 2561 +23
+ Partials 252 230 -22 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/v0/destinations/google_adwords_remarketing_lists/config.js (1)
27-41: Token export: add validation and minimize leak surface.Same concerns as other configs: validate presence and avoid exporting raw secrets on shared config objects. Prefer a getter as shown in the enhanced_conversions/config.js suggestion.
Consider a shared helper (e.g., src/v0/destinations/google_ads/token.js) exporting getDeveloperToken() to DRY this across all Google Ads destinations.
🧹 Nitpick comments (1)
src/v0/destinations/google_adwords_offline_conversions/config.js (1)
71-71: Do not expose secrets on module.exports unless necessary.If any code logs or serializes this config object, the token may leak. Prefer exporting a function that returns the token.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (12)
test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.tsis excluded by!**/test/**test/integrations/destinations/google_adwords_enhanced_conversions/router/data.tsis excluded by!**/test/**test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/business.tsis excluded by!**/test/**test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/oauth.tsis excluded by!**/test/**test/integrations/destinations/google_adwords_offline_conversions/network.tsis excluded by!**/test/**test/integrations/destinations/google_adwords_offline_conversions/processor/data.tsis excluded by!**/test/**test/integrations/destinations/google_adwords_offline_conversions/router/data.tsis excluded by!**/test/**test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/business.tsis excluded by!**/test/**test/integrations/destinations/google_adwords_remarketing_lists/network.tsis excluded by!**/test/**test/integrations/destinations/google_adwords_remarketing_lists/processor/data.tsis excluded by!**/test/**test/integrations/destinations/google_adwords_remarketing_lists/router/data.tsis excluded by!**/test/**test/setup.tsis excluded by!**/test/**
📒 Files selected for processing (8)
jest.config.typescript.js(1 hunks)src/v0/destinations/google_adwords_enhanced_conversions/config.js(1 hunks)src/v0/destinations/google_adwords_enhanced_conversions/transform.js(2 hunks)src/v0/destinations/google_adwords_offline_conversions/config.js(2 hunks)src/v0/destinations/google_adwords_offline_conversions/utils.js(2 hunks)src/v0/destinations/google_adwords_remarketing_lists/config.js(2 hunks)src/v0/destinations/google_adwords_remarketing_lists/recordTransform.js(2 hunks)src/v0/destinations/google_adwords_remarketing_lists/transform.js(2 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_enhanced_conversions/transform.jsjest.config.typescript.jssrc/v0/destinations/google_adwords_remarketing_lists/config.jssrc/v0/destinations/google_adwords_offline_conversions/config.jssrc/v0/destinations/google_adwords_remarketing_lists/recordTransform.jssrc/v0/destinations/google_adwords_offline_conversions/utils.jssrc/v0/destinations/google_adwords_enhanced_conversions/config.jssrc/v0/destinations/google_adwords_remarketing_lists/transform.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/recordTransform.js
🧬 Code graph analysis (5)
src/v0/destinations/google_adwords_remarketing_lists/config.js (2)
src/v0/destinations/google_adwords_enhanced_conversions/config.js (1)
process(12-12)src/v0/destinations/google_adwords_offline_conversions/config.js (1)
process(50-50)
src/v0/destinations/google_adwords_offline_conversions/config.js (2)
src/v0/destinations/google_adwords_enhanced_conversions/config.js (1)
process(12-12)src/v0/destinations/google_adwords_remarketing_lists/config.js (1)
process(27-27)
src/v0/destinations/google_adwords_remarketing_lists/recordTransform.js (2)
src/v0/destinations/google_adwords_remarketing_lists/transform.js (7)
require(1-5)require(7-12)require(14-14)require(15-19)require(20-20)require(21-21)developerToken(124-124)src/v0/destinations/google_adwords_remarketing_lists/util.js (5)
require(3-3)require(4-11)require(13-13)require(14-14)require(15-22)
src/v0/destinations/google_adwords_enhanced_conversions/config.js (2)
src/v0/destinations/google_adwords_offline_conversions/config.js (1)
process(50-50)src/v0/destinations/google_adwords_remarketing_lists/config.js (1)
process(27-27)
src/v0/destinations/google_adwords_remarketing_lists/transform.js (2)
src/v0/destinations/google_adwords_remarketing_lists/recordTransform.js (7)
require(1-6)require(7-14)require(15-15)require(16-20)require(21-21)require(22-26)developerToken(74-74)src/v0/destinations/google_adwords_remarketing_lists/util.test.js (4)
require(1-1)require(2-2)require(3-3)developerToken(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 AMD64
- GitHub Check: Build 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 User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
- GitHub Check: Code Coverage
- GitHub Check: UT Tests
- GitHub Check: test_and_publish
- GitHub Check: Analyze (go)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (4)
src/v0/destinations/google_adwords_offline_conversions/utils.js (2)
33-33: LGTM: Clean import additionThe addition of
GOOGLE_ADS_DEVELOPER_TOKENto the config import maintains the existing import structure and follows the centralization pattern.
188-188: LGTM: Proper header configurationThe replacement of metadata-based token retrieval with the centralized constant in the request headers is correctly implemented and improves maintainability.
src/v0/destinations/google_adwords_remarketing_lists/transform.js (2)
15-19: LGTM: Clean import restructuringThe addition of
GOOGLE_ADS_DEVELOPER_TOKENto the config import maintains consistency with the established pattern across all Google Ads destinations.
124-124: LGTM: Consistent token assignmentThe replacement of
getValueFromMessage(metadata, 'secret.developer_token')with the centralized constant provides better consistency and maintainability across the codebase.
|
Allure Test reports for this run are available at:
|
|
Allure Test reports for this run are available at:
|
|
Allure Test reports for this run are available at:
|
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
src/v0/destinations/google_adwords_remarketing_lists/networkHandler.js (1)
28-30: Guard against undefined consent to avoid runtime TypeErrorObject.keys(params.consent) will throw if consent is undefined.
- if (Object.keys(params.consent).length > 0) { + if (params.consent && Object.keys(params.consent).length > 0) { customerMatchUserListMetadata.consent = params.consent; }src/v0/destinations/google_adwords_offline_conversions/networkHandler.js (1)
285-287: Typo in destType ("gogole" → "google") impacts observability tagsThis breaks consistency in metrics/log labeling and any filtering on destType.
- destType: 'gogole_adwords_offline_conversions', + destType: 'google_adwords_offline_conversions',src/v0/destinations/google_adwords_remarketing_lists/util.js (1)
33-57: responseBuilder signature change — OK; default consent and fix brace style
- Default consent to {} so downstream code can safely read keys.
- Add braces to satisfy common ESLint "curly" rule and improve readability.
- response.params = { - listId: audienceId, - customerId: filteredCustomerId, - consent: consentBlock, - }; + response.params = { + listId: audienceId, + customerId: filteredCustomerId, + consent: consentBlock || {}, + }; - if (Config.subAccount) - if (Config.loginCustomerId) { - const filteredLoginCustomerId = removeHyphens(Config.loginCustomerId); - response.headers['login-customer-id'] = filteredLoginCustomerId; - } else throw new ConfigurationError(`loginCustomerId is required as subAccount is true.`); + if (Config.subAccount) { + if (Config.loginCustomerId) { + const filteredLoginCustomerId = removeHyphens(Config.loginCustomerId); + response.headers['login-customer-id'] = filteredLoginCustomerId; + } else { + throw new ConfigurationError(`loginCustomerId is required as subAccount is true.`); + } + }
🧹 Nitpick comments (3)
src/v0/destinations/google_adwords_remarketing_lists/networkHandler.js (1)
11-11: Injecting developer-token in headers — OK; avoid mutating input headersGood move to pull from env. Consider cloning headers to prevent side effects on the request object.
- headers['developer-token'] = getDeveloperToken(); + const hdrs = { ...headers, 'developer-token': getDeveloperToken() }; - const firstResponse = await createJob({ endpoint, headers, method, params, metadata }); + const firstResponse = await createJob({ endpoint, headers: hdrs, method, params, metadata }); - const secondResponse = await addUserToJob({ endpoint, headers, method, jobId, body, metadata }); + const secondResponse = await addUserToJob({ endpoint, headers: hdrs, method, jobId, body, metadata }); - const thirdResponse = await runTheJob({ endpoint, headers, method, jobId, metadata }); + const thirdResponse = await runTheJob({ endpoint, headers: hdrs, method, jobId, metadata });Also applies to: 115-116
src/v0/destinations/google_adwords_offline_conversions/config.js (1)
1-1: Guarded getter for GOOGLE_ADS_DEVELOPER_TOKEN — solid; consider de-duplicationImplementation matches the pattern used in other modules and fails fast with a clear message. Consider centralizing this getter in a shared Google Ads helper to remove duplication across destinations.
Also applies to: 51-60, 80-81
src/v0/destinations/google_adwords_offline_conversions/networkHandler.js (1)
17-22: Env-backed token wiring — good; call getter once and reuseImport and usage look correct. Minor polish: avoid calling getDeveloperToken() twice.
- headers['developer-token'] = getDeveloperToken(); - params.developerToken = getDeveloperToken(); + const devToken = getDeveloperToken(); + headers['developer-token'] = devToken; + params.developerToken = devToken;Also applies to: 212-214
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (12)
test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/business.tsis excluded by!**/test/**test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/oauth.tsis excluded by!**/test/**test/integrations/destinations/google_adwords_enhanced_conversions/network.tsis excluded by!**/test/**test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.tsis excluded by!**/test/**test/integrations/destinations/google_adwords_enhanced_conversions/router/data.tsis excluded by!**/test/**test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/business.tsis excluded by!**/test/**test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/oauth.tsis excluded by!**/test/**test/integrations/destinations/google_adwords_offline_conversions/network.tsis excluded by!**/test/**test/integrations/destinations/google_adwords_offline_conversions/processor/data.tsis excluded by!**/test/**test/integrations/destinations/google_adwords_offline_conversions/router/data.tsis excluded by!**/test/**test/integrations/destinations/google_adwords_remarketing_lists/network.tsis excluded by!**/test/**test/integrations/destinations/google_adwords_remarketing_lists/processor/data.tsis excluded by!**/test/**
📒 Files selected for processing (13)
jest.config.js(1 hunks)src/v0/destinations/google_adwords_enhanced_conversions/config.js(2 hunks)src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js(2 hunks)src/v0/destinations/google_adwords_enhanced_conversions/transform.js(0 hunks)src/v0/destinations/google_adwords_offline_conversions/config.js(3 hunks)src/v0/destinations/google_adwords_offline_conversions/networkHandler.js(2 hunks)src/v0/destinations/google_adwords_offline_conversions/utils.js(0 hunks)src/v0/destinations/google_adwords_remarketing_lists/config.js(3 hunks)src/v0/destinations/google_adwords_remarketing_lists/networkHandler.js(2 hunks)src/v0/destinations/google_adwords_remarketing_lists/recordTransform.js(1 hunks)src/v0/destinations/google_adwords_remarketing_lists/transform.js(0 hunks)src/v0/destinations/google_adwords_remarketing_lists/util.js(1 hunks)src/v0/destinations/google_adwords_remarketing_lists/util.test.js(0 hunks)
💤 Files with no reviewable changes (4)
- src/v0/destinations/google_adwords_remarketing_lists/util.test.js
- src/v0/destinations/google_adwords_offline_conversions/utils.js
- src/v0/destinations/google_adwords_enhanced_conversions/transform.js
- src/v0/destinations/google_adwords_remarketing_lists/transform.js
🚧 Files skipped from review as they are similar to previous changes (3)
- src/v0/destinations/google_adwords_remarketing_lists/config.js
- src/v0/destinations/google_adwords_remarketing_lists/recordTransform.js
- src/v0/destinations/google_adwords_enhanced_conversions/config.js
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js
⚙️ CodeRabbit configuration file
Focus on ESLint errors (max 3) and warnings (max 5).
Files:
jest.config.jssrc/v0/destinations/google_adwords_enhanced_conversions/networkHandler.jssrc/v0/destinations/google_adwords_remarketing_lists/networkHandler.jssrc/v0/destinations/google_adwords_remarketing_lists/util.jssrc/v0/destinations/google_adwords_offline_conversions/networkHandler.jssrc/v0/destinations/google_adwords_offline_conversions/config.js
🧬 Code graph analysis (5)
src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js (1)
src/v0/destinations/google_adwords_enhanced_conversions/config.js (1)
getDeveloperToken(14-22)
src/v0/destinations/google_adwords_remarketing_lists/networkHandler.js (1)
src/v0/destinations/google_adwords_remarketing_lists/config.js (1)
getDeveloperToken(28-36)
src/v0/destinations/google_adwords_remarketing_lists/util.js (2)
src/v0/destinations/google_adwords_enhanced_conversions/transform.js (2)
responseBuilder(35-77)accessToken(50-50)src/v0/destinations/google_adwords_remarketing_lists/util.test.js (3)
accessToken(5-5)body(6-29)consentBlock(42-45)
src/v0/destinations/google_adwords_offline_conversions/networkHandler.js (2)
src/adapters/network.js (1)
headers(386-386)src/v0/destinations/google_adwords_offline_conversions/config.js (1)
getDeveloperToken(51-59)
src/v0/destinations/google_adwords_offline_conversions/config.js (2)
src/v0/destinations/google_adwords_enhanced_conversions/config.js (4)
require(1-1)require(2-2)getDeveloperToken(14-22)process(15-15)src/v0/destinations/google_adwords_remarketing_lists/config.js (4)
require(1-1)require(2-2)getDeveloperToken(28-36)process(29-29)
⏰ 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 User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
- 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: UT Tests
- GitHub Check: test_and_publish
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
🔇 Additional comments (3)
jest.config.js (1)
134-134: Ensure the setup file exists and update Jest config
- The referenced
<rootDir>/test/setup.tsis missing—either add that file or correct the path to your actual setup file.- To avoid TS transform issues in
setupFiles, move your setup tosetupFilesAfterEnvin bothjest.config.jsandjest.config.typescript.js, or convert it to JS. For example:- setupFiles: ['<rootDir>/test/setup.ts'], + setupFilesAfterEnv: ['<rootDir>/test/setup.js'],Likely an incorrect or invalid review comment.
src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js (1)
13-13: Centralized token usage via getDeveloperToken — LGTMConstructor now sources the token from env through the guarded getter. Matches the new config contract and fails fast if missing.
Also applies to: 90-90
src/v0/destinations/google_adwords_remarketing_lists/util.js (1)
33-33: responseBuilder calls updated to 5-arg signature; no developerToken usage detected
|
Allure Test reports for this run are available at:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/v0/util/googleUtils/index.js (1)
142-158: Harden token retrieval: trim and validate non-empty input.Avoid accepting whitespace-only values; fail fast on blank tokens.
Apply this diff:
-const getDeveloperToken = () => { - const { GOOGLE_ADS_DEVELOPER_TOKEN } = process.env; - if (GOOGLE_ADS_DEVELOPER_TOKEN) { - return GOOGLE_ADS_DEVELOPER_TOKEN; - } - throw new ConfigurationError( - 'GOOGLE_ADS_DEVELOPER_TOKEN is not set, please reach out to support', - ); -}; +const getDeveloperToken = () => { + const raw = process.env.GOOGLE_ADS_DEVELOPER_TOKEN; + const token = raw && raw.trim(); + if (!token) { + throw new ConfigurationError('GOOGLE_ADS_DEVELOPER_TOKEN is required'); + } + return token; +};Also ensure downstream logging redacts this header/value in network adapters.
Happy to add a unit test asserting the error on missing/blank tokens—want me to draft it?
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
.cursor/rules/pr-review-comments.mdc(1 hunks)src/v0/destinations/google_adwords_enhanced_conversions/config.js(1 hunks)src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js(2 hunks)src/v0/destinations/google_adwords_offline_conversions/networkHandler.js(2 hunks)src/v0/destinations/google_adwords_remarketing_lists/networkHandler.js(2 hunks)src/v0/util/googleUtils/index.js(3 hunks)
✅ Files skipped from review due to trivial changes (1)
- .cursor/rules/pr-review-comments.mdc
🚧 Files skipped from review as they are similar to previous changes (3)
- src/v0/destinations/google_adwords_remarketing_lists/networkHandler.js
- src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js
- src/v0/destinations/google_adwords_offline_conversions/networkHandler.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_enhanced_conversions/config.jssrc/v0/util/googleUtils/index.js
🧬 Code graph analysis (1)
src/v0/util/googleUtils/index.js (3)
src/v0/destinations/google_adwords_offline_conversions/networkHandler.js (8)
require(4-8)require(9-9)require(10-14)require(15-15)require(17-17)require(18-18)require(19-22)require(24-24)src/v0/destinations/google_adwords_remarketing_lists/networkHandler.js (6)
require(1-1)require(3-3)require(4-4)require(5-8)require(10-10)require(11-11)src/v0/destinations/google_adwords_remarketing_lists/transform.js (2)
require(1-5)process(140-140)
⏰ 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). (8)
- 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: test_and_publish
- GitHub Check: UT Tests
- GitHub Check: Analyze (go)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
src/v0/destinations/google_adwords_enhanced_conversions/config.js (1)
12-12: No functional change — OK to keep.Blank line insertion only; no ESLint concerns introduced.
src/v0/util/googleUtils/index.js (1)
7-7: Good choice using ConfigurationError.Consistent with existing error semantics.
|
Allure Test reports for this run are available at:
|
|
Allure Test reports for this run are available at:
|
|
Allure Test reports for this run are available at:
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/v0/destinations/google_adwords_offline_conversions/networkHandler.js (1)
18-18: Consolidate googleUtils requires into one importAvoid duplicate requires from the same module; it’s cleaner and can prevent linter warnings in some setups.
Apply:
-const { getDeveloperToken } = require('../../util/googleUtils'); +const { getDeveloperToken, getAuthErrCategory } = require('../../util/googleUtils');…and remove the separate
getAuthErrCategoryrequire at Line 24.Also applies to: 24-24
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js(2 hunks)src/v0/destinations/google_adwords_offline_conversions/networkHandler.js(2 hunks)src/v0/destinations/google_adwords_remarketing_lists/networkHandler.js(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js
- src/v0/destinations/google_adwords_remarketing_lists/networkHandler.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/networkHandler.js
🧬 Code graph analysis (1)
src/v0/destinations/google_adwords_offline_conversions/networkHandler.js (2)
src/v0/util/googleUtils/index.js (1)
getDeveloperToken(149-155)src/adapters/network.js (1)
headers(372-372)
⏰ 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 User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
- 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: UT Tests
- GitHub Check: test_and_publish
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
🔇 Additional comments (2)
src/v0/destinations/google_adwords_offline_conversions/networkHandler.js (2)
208-209: Header injection looks correct and aligns with the “headers-only” approachMatches prior feedback to keep the developer token only in request headers.
208-209: Harden header mutation (default + avoid mutating request.headers)File: src/v0/destinations/google_adwords_offline_conversions/networkHandler.js Lines: 208-209
headers['developer-token'] = getDeveloperToken()will throw ifrequest.headersis undefined and mutating the incoming headers can produce side‑effects. Default and copy:
- Minimal (safer default):
const { method, endpoint, headers = {}, params, body, metadata } = request;- Optional (avoid mutation; pass forward):
const headersWithToken = { ...headers, 'developer-token': getDeveloperToken() };Verification: ripgrep did not locate adapter code that guarantees
headersis always present — verify adapter behavior or apply the change above.
|
Allure Test reports for this run are available at:
|
|
Allure Test reports for this run are available at:
|
|
Allure Test reports for this run are available at:
|
|




What are the changes introduced in this PR?
This pull request refactors how the Google Ads Developer Token is handled in the Google AdWords integrations. Instead of extracting the token from each message's metadata, the code now consistently uses the
GOOGLE_ADS_DEVELOPER_TOKENenvironment variable across all relevant destinations. Corresponding test data has been updated to reflect this change, and a Jest setup file has been added for test configuration.Environment Variable Refactor:
google_adwords_enhanced_conversions,google_adwords_offline_conversions,google_adwords_remarketing_lists) to use theGOOGLE_ADS_DEVELOPER_TOKENfrom environment variables instead of reading from message metadata. This affects config files, utility functions, and all request builders. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]Test Data and Configuration Updates:
Testing Infrastructure:
test/setup.ts) to the Jest configuration to ensure consistent test environment setup.