Rubocop linter for "enhanced" analytics events#10264
Rubocop linter for "enhanced" analytics events#10264matthinz wants to merge 0 commit intomatthinz/12617-profile-loggingfrom
Conversation
zachmargolis
left a comment
There was a problem hiding this comment.
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
68996f8 to
a773b46
Compare
286d294 to
51370b7
Compare
0f82087 to
a0a6db3
Compare
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:
**extraWhat this PR does
This PR adds a Rubocop Cop that looks at analytics_events.rb and verifies all of these "enhanced" arguments are:
track_eventproperly@paramdocumentation 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_METHODSrubocop --cache false app/services/analytics_events.rbrubocop --cache false -a app/services/analytics_events.rb