-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add receivedAt and requestIP in payload [PIPE-1135] #4764
Conversation
WalkthroughThe recent changes introduce new functionalities to the Changes
Sequence Diagram(s) (Beta)sequenceDiagram
participant Client
participant Gateway
participant PayloadHandler
Client->>Gateway: Send event payload
Gateway->>PayloadHandler: Check and fill `receivedAt`
PayloadHandler-->>Gateway: Return modified payload
Gateway->>PayloadHandler: Check and fill `requestIP`
PayloadHandler-->>Gateway: Return modified payload
Gateway->>Client: Acknowledge receipt
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4764 +/- ##
==========================================
- Coverage 74.69% 74.64% -0.06%
==========================================
Files 414 414
Lines 48606 48620 +14
==========================================
- Hits 36308 36290 -18
- Misses 9923 9954 +31
- Partials 2375 2376 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- gateway/gateway_test.go (2 hunks)
- gateway/handle.go (2 hunks)
Additional context used
golangci-lint
gateway/handle.go
81-81: undefined: userWorkerBatchRequestT (typecheck)
82-82: undefined: batchUserWorkerBatchRequestT (typecheck)
83-83: undefined: RequestHandler (typecheck)
84-84: undefined: RequestHandler (typecheck)
90-90: undefined: userWebRequestWorkerT (typecheck)
132-132: undefined: userWebRequestWorkerT (typecheck)
148-148: undefined: userWebRequestWorkerT (typecheck)
180-180: undefined: userWebRequestWorkerT (typecheck)
275-275: undefined: webRequestT (typecheck)
162-162: undefined: batchWebRequestT (typecheck)
183-183: undefined: webRequestT (typecheck)
188-188: undefined: sourceDebugger (typecheck)
194-194: gw.NewSourceStat undefined (type *Handle has no field or method NewSourceStat) (typecheck)
201-201: undefined: errRequestDropped (typecheck)
204-204: undefined: errRequestSuppressed (typecheck)
220-220: undefined: sourceDebugger (typecheck)
234-234: undefined: userWorkerBatchRequestT (typecheck)
303-303: undefined: jobFromReq (typecheck)
316-316: undefined: batchEvent (typecheck)
379-379: undefined: semverRegexp (typecheck)
442-442: undefined: errRequestDropped (typecheck)
447-447: undefined: errRequestSuppressed (typecheck)
509-509: undefined: customVal (typecheck)
521-521: undefined: extractEvent (typecheck)
535-535: undefined: delimiter (typecheck)
631-631: undefined: webRequestT (typecheck)
677-677: gw.newReqTypeStatsTagsWithReason undefined (type *Handle has no field or method newReqTypeStatsTagsWithReason) (typecheck)
684-684: gw.newReqTypeStatsTagsWithReason undefined (type *Handle has no field or method newReqTypeStatsTagsWithReason) (typecheck)
703-703: gw.newReqTypeStatsTagsWithReason undefined (type *Handle has no field or method newReqTypeStatsTagsWithReason) (typecheck)
721-721: gw.newReqTypeStatsTagsWithReason undefined (type *Handle has no field or method newReqTypeStatsTagsWithReason) (typecheck)
792-792: gw.newSourceStatTagsWithReason undefined (type *Handle has no field or method newSourceStatTagsWithReason) (typecheck)
851-851: undefined: customVal (typecheck)
Additional comments not posted (1)
gateway/gateway_test.go (1)
1898-1990
: Ensure correct handling ofreceivedAt
andrequestIP
in payloads.The tests in the
extractJobsFromInternalBatchPayload
context correctly verify that thereceivedAt
andrequestIP
fields are not overridden if they already exist in the payload, and are added if they are absent. This aligns with the PR's objective to manage these fields appropriately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range and nitpick comments (5)
gateway/gateway_test.go (5)
Line range hint
2135-2135
: The functionwithContentType
is undefined in the provided context. Ensure that this function is either implemented or imported correctly.
Line range hint
1416-1416
: The typewebRequestT
is undefined in the provided context. Ensure that this type is either defined or imported correctly to avoid compilation errors.Also applies to: 1429-1429, 1453-1453, 1475-1475, 1499-1499, 1536-1536, 1558-1558, 1581-1581, 1605-1605, 1617-1617
Line range hint
246-246
: The typeHandle
is undefined in the provided context. Ensure that this type is either defined or imported correctly to avoid compilation errors.Also applies to: 281-281, 416-416, 427-427, 449-449, 535-535, 544-544, 568-568, 870-870
Line range hint
229-229
: The functiongetUsersPayload
is undefined in the provided context. Ensure that this function is either implemented or imported correctly.
Line range hint
568-568
: The variablecustomVal
is undefined in the provided context. Ensure that this variable is either defined or imported correctly to avoid runtime errors.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- gateway/gateway_test.go (2 hunks)
Additional context used
golangci-lint
gateway/gateway_test.go
2098-2098: undefined: Handle (typecheck)
2151-2151: undefined: Handle (typecheck)
229-229: undefined: getUsersPayload (typecheck)
246-246: undefined: Handle (typecheck)
281-281: undefined: Handle (typecheck)
416-416: undefined: Handle (typecheck)
427-427: undefined: Handle (typecheck)
449-449: undefined: Handle (typecheck)
535-535: undefined: Handle (typecheck)
544-544: undefined: Handle (typecheck)
568-568: undefined: customVal (typecheck)
870-870: undefined: Handle (typecheck)
1416-1416: undefined: webRequestT (typecheck)
1429-1429: undefined: webRequestT (typecheck)
1453-1453: undefined: webRequestT (typecheck)
1475-1475: undefined: webRequestT (typecheck)
1499-1499: undefined: webRequestT (typecheck)
1536-1536: undefined: webRequestT (typecheck)
1558-1558: undefined: webRequestT (typecheck)
1581-1581: undefined: webRequestT (typecheck)
1605-1605: undefined: webRequestT (typecheck)
1617-1617: undefined: webRequestT (typecheck)
2135-2135: undefined: withContentType (typecheck)
Additional comments not posted (4)
gateway/gateway_test.go (4)
19-19
: Added import ofgithub.com/rudderlabs/rudder-schemas/go/stream
is appropriate for handling the new payload fields.
1898-1993
: The test cases inextractJobsFromInternalBatchPayload
correctly handle scenarios wherereceivedAt
andrequestIP
are either present or need to be added. This aligns with the PR's objective to ensure these fields are correctly managed in payloads.
Line range hint
1416-1416
: The typewebRequestT
is undefined in the provided context. Ensure that this type is either defined or imported correctly to avoid compilation errors.
Line range hint
1416-1416
: The typewebRequestT
is undefined in the provided context. Ensure that this type is either defined or imported correctly to avoid compilation errors.
Description
add receivedAt and requestIP in payload for internal batch endpoint.
Linear Ticket
https://linear.app/rudderstack/issue/PIPE-1135/[rudder-server]-fix-internalreplay-endpoint-to-start-honouring
Security
Summary by CodeRabbit
receivedAt
andrequestIP
fields if they are missing. This ensures more accurate and complete data processing.