Repository navigation
feat(ga4): add endpointPath field to response and update tests - #4628
Conversation
Summary by CodeRabbit
WalkthroughAdds assignment of Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Caller as deliverable builder
participant GA4 as buildDeliverablePayload
participant Config as Config.debugMode
Caller->>GA4: request buildDeliverablePayload(payload)
GA4->>Config: read debugMode
alt debugMode == true
GA4-->>Caller: set response.endpoint = DEBUG_ENDPOINT
GA4-->>Caller: set response.endpointPath = "/debug/mp/collect"
else debugMode == false
GA4-->>Caller: set response.endpoint = ENDPOINT
GA4-->>Caller: set response.endpointPath = "/mp/collect"
end
Note over Caller,GA4 #D6EAF8: downstream code continues using response.endpoint and new response.endpointPath
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks (3 passed)✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (7)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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)
✨ Finishing touches
🧪 Generate unit tests
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 |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/v0/destinations/ga4/utils.js (1)
528-534: Reduce duplication: compute endpoint and path onceMinor DRY-up to keep the two branches in sync and make future edits safer.
Apply this diff locally:
- if (Config.debugMode) { - response.endpoint = DEBUG_ENDPOINT; - response.endpointPath = '/debug/mp/collect'; - } else { - response.endpoint = ENDPOINT; - response.endpointPath = '/mp/collect'; - } + const isDebug = !!Config.debugMode; + response.endpoint = isDebug ? DEBUG_ENDPOINT : ENDPOINT; + response.endpointPath = isDebug ? '/debug/mp/collect' : '/mp/collect';Optional: export DEBUG_ENDPOINT_PATH and ENDPOINT_PATH from ./config and use them here to keep paths centralized.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (5)
test/integrations/destinations/ga4/processor/ecomTestData.tsis excluded by!**/test/**test/integrations/destinations/ga4/processor/groupTestData.tsis excluded by!**/test/**test/integrations/destinations/ga4/processor/pageTestData.tsis excluded by!**/test/**test/integrations/destinations/ga4/processor/trackTestData.tsis excluded by!**/test/**test/integrations/testUtils.tsis excluded by!**/test/**
📒 Files selected for processing (1)
src/v0/destinations/ga4/utils.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/ga4/utils.js
🧬 Code graph analysis (1)
src/v0/destinations/ga4/utils.js (2)
src/v0/destinations/clevertap/transform.js (1)
response(59-59)src/v0/destinations/ga4/transform.js (1)
response(212-212)
⏰ 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 (javascript-typescript)
- GitHub Check: Analyze (go)
🔇 Additional comments (1)
src/v0/destinations/ga4/utils.js (1)
528-535: LGTM: endpointPath correctly mirrors debug/prod endpoint selectionAdditive and backward-compatible. No ESLint concerns in this hunk.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4628 +/- ##
===========================================
- Coverage 91.78% 91.78% -0.01%
===========================================
Files 642 642
Lines 33941 33943 +2
Branches 8035 8044 +9
===========================================
+ Hits 31152 31153 +1
+ Misses 2559 2538 -21
- Partials 230 252 +22 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Add endpointPath field to GA4 utils response for both debug and production modes - Update testUtils to include endpointPath in transformResultBuilder - Update all GA4 test data files to include endpointPath in expected outputs - Ensures consistency between actual response and test expectations
31a9ee3 to
b589a8b
Compare
|
Allure Test reports for this run are available at:
|
|



What are the changes introduced in this PR?
This PR adds the
endpointPathfield to the GA4 destination response and updates all related test data to include this new field.What is the related Linear task?
Resolves https://linear.app/rudderstack/issue/INT-4102/add-endpoint-path-details-in-rudder-transformer-for-top-15
Please explain the objectives of your changes below
The changes ensure consistency between the actual GA4 destination response and the test expectations by:
endpointPathfield in the responsetransformResultBuilderfunction now includesendpointPathin the expected output structureendpointPathfield in their expected outputsAny changes to existing capabilities/behaviour, mention the reason & what are the changes ?
No breaking changes. This is purely additive - adding a new field to the response structure that was missing from the test expectations.
Any new dependencies introduced with this change?
N/A
Any new generic utility introduced or modified. Please explain the changes.
Modified
testUtils.tsto includeendpointPathin thetransformResultBuilderfunction.Any technical or performance related pointers to consider with the change?
N/A
@coderabbitai review
Developer checklist
Reviewer checklist