-
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: parse json using custom separators #5037
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5037 +/- ##
==========================================
- Coverage 74.70% 74.55% -0.15%
==========================================
Files 430 436 +6
Lines 50131 50385 +254
==========================================
+ Hits 37450 37567 +117
- Misses 10202 10321 +119
- Partials 2479 2497 +18 ☔ View full report in Codecov by Sentry. |
c1e1a12
to
9811014
Compare
This PR is considered to be stale. It has been open 20 days with no further activity thus it is going to be closed in 7 days. To avoid such a case please consider removing the stale label manually or add a comment to the PR. |
Description
A custom method(scaffolding) to parse json response from transformer.
Some associated benchmarks:
Existing transformer response unmarshal
If
Output
inTransformerResponse
wasjson.RawMessage
Unmarshal using
jsoniter.ConfigFastest
Using
jsoniter.ConfigFastest
withjson.RawMessage
Output
Using byte array separators
Although this last result looks great, we can't be sure at this point as to how it affects transformer(both runtime and the estimate about the labour required). Even within rudder-server, it'll need a decent refactor around different areas in processor - although they can be picked up irrespective of this "change", things like minimising changing event payload from
map[string]interface{}
to[]byte
and back again several times - adding some fields to/parsing(gjson etc.) the payload.Linear Ticket
Resolves PIPE-1487
Security
In hindsight this looks silly, can be done differently - using ordering of things instead of using delimiter literals.
Simple
.
separated json with things of interest (base64 etc.) encoded.Can provide a hierarchical relationship if required.