Require **extra in Analytics Events Documentation#6052
Merged
zachmargolis merged 3 commits intomainfrom Mar 14, 2022
Merged
Conversation
This reverts commit 1f6e314.
**Why**: To prevent undocumented params from causing errors [skip changelog]
b3608e3 to
b2910f4
Compare
jmhooper
reviewed
Mar 14, 2022
| error_details: nil, | ||
| email_addresses: nil | ||
| email_addresses: nil, | ||
| **extra |
Contributor
There was a problem hiding this comment.
If this is going to become a pattern, is there an easy way to log what the extra attributes are? That way it's easy to hunt them down later.
Contributor
Author
There was a problem hiding this comment.
maybe we could add something like undocumented_keys: extra.keys to the payload?
Contributor
Author
There was a problem hiding this comment.
I had some metaprogramming ideas, none of which panned out quickly, so I filed LG-5969 to follow up
jmhooper
approved these changes
Mar 14, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With our old freeform analytics, there was no enforcement of params. If there are keys that are logged in production, but not covered in our test suite, we'll get UnknownArgument errors. #6050 was the result of letting one of those slip through to production.
This PR adds and enforces
**extraon**extrais passed along, so the attributes won't be skippedI'd love to discourage the freeform param in the future, so one idea could be that new methods go in
AnalyticsEventsNewwhich would not need**extraand the ones we migrate go toAnalyticsEventsOldor something... but that's an exploration for anther time. This PR should help us run our transition more smoothly in the meantime