-
Notifications
You must be signed in to change notification settings - Fork 114
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
Rubocop linter for "enhanced" analytics events #10264
Rubocop linter for "enhanced" analytics events #10264
Conversation
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.
very nice! big fan of leveraging automation for this
Is this something that #9946 could cover? We currently hide most errors from that with the The main downside I see to #9946 is that it requires that something actually calls the analytics methods, but I'd expect that's just a basic test coverage problem? |
@aduth Yeah, that is a good point. I originally had in mind making large-scale changes to I'm ok not actually landing this right now, and bringing it back if we want to investigate strategies for managing |
a330ea7
to
42935e7
Compare
47b1b31
to
286d294
Compare
22b984a
to
68996f8
Compare
Summarize the history of a user's profiles in IdV analytics events changelog: Internal, Identity verification, Include profile metadata in analytics logs
Just return the levels, and use .presence to ensure falsey values are nil so they're compacted properly
It's a lot of data and we want to keep average event payload size low.
68996f8
to
a773b46
Compare
286d294
to
51370b7
Compare
Adding the following to covered methods: - active_profile_idv_level - pending_profile_idv_level - profile_history Also making sure proofing_components is documented appropriately.
0f82087
to
a0a6db3
Compare
51370b7
to
20b215e
Compare
Sprinkle all these new args around a little.
…nalyticsEvents Check each method on AnalyticsEvents that is "enhanced" by AnalyticsEventsEnhancer: 1. Includes the enhancements in its args list 2. Passes those to track_event
Look for "@param" documentation for e.g. proofing_components. Autocorrect to a "TODO"
Delegate entirely Idv::AnalyticsEventsEnhancer rather than duplicating arg lists
20b215e
to
dabec7b
Compare
6b22eee
to
98b0c2b
Compare
Closing this for now. I did find some of this useful for working on #10270 but may not be worth landing on main and committing long-term |
🛠 Summary of changes
I wrote this linter originally as part of #10230, but that PR was getting very complicated so I pulled it out here.
Background
Idv::AnalyticsEventsEnhancer will "enhance" certain analytics logging methods by automatically filling in more arguments. Currently, that is limited to
proofing_components
, but that will be expanding in the future (e.g. LG-12617).We want these "enhanced" arguments to be present in method signatures so that:
**extra
What this PR does
This PR adds a Rubocop Cop that looks at analytics_events.rb and verifies all of these "enhanced" arguments are:
track_event
properly@param
documentation lineThere is also some autocorrecting built in, since I was originally thinking I'd be making lots of changes to analytics_events.rb.
📜 Testing Plan
Provide a checklist of steps to confirm the changes.
Idv::AnalyticsEventsEnhancer::IGNORED_METHODS
rubocop --cache false app/services/analytics_events.rb
rubocop --cache false -a app/services/analytics_events.rb