-
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
LG-12657: Make Idv::AnalyticsEventsEnhancer opt-out #10230
Conversation
kwrest = method.arguments.find { |a| a.kwrestarg_type? } | ||
return if !kwrest | ||
|
||
corrector.insert_before(kwrest, "#{arg_name}: nil, ") |
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.
omg major props, I don't think we have any other of our lints autocorrect
@@ -624,7 +624,7 @@ def idv_acuant_sdk_loaded( | |||
success:, | |||
use_alternate_sdk:, | |||
liveness_checking_required:, | |||
**_extra | |||
**extra |
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.
There were a few methods that accepted **extra
but didn't pass it on to track_event
. I've updated those to pass data properly.
module RuboCop | ||
module Cop | ||
module IdentityIdp | ||
class EnhancedIdvEventsLinter < RuboCop::Cop::Base |
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.
Honestly, here be dragons. But analytics_events.rb is long enough that automating large edits to it was worth the trouble.
line.is_a?(Parser::Source::Comment) && /@param/.match?(line.text) | ||
end | ||
|
||
comment = "# @param [Object] #{arg_name} TODO: Write doc comment" |
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.
I wanted this autocorrect (adding doc comment) in place so I could get all the missing @param
declarations in analytics_events.rb but would be happy to remove it if we want potentially avoid ending up with a mess of autogenerated "TODO" comments in the future
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.
(if say, a developer had a git precommit hook that automatically ran rubocop -a
and committed the results)
idv_please_call_visited | ||
idv_start_over | ||
].freeze | ||
IGNORED_METHODS = %i[ |
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.
Right now this list is just any frontend events that were not previously "opted in". Hopefully big changes to this list can come in as separate PRs.
It could be argued that many events before document_capture don't benefit from having proofing_components added automatically. However:
- We have much better back button support than we did when this events enhancer was first written, so proofing_components could have data
- I'm planning on using this events enhancer to add more properties in the future that would be relevant for those earlier events
Don't include nil values here
6e0d041
to
ea9f2c1
Compare
Update AnalyticsEventsEnhancer so that it augments any event where the _method name_ starts with `^idv_` UNLESS it has been told not to. changelog: Internal, Analytics, Add additional data to IdV analytics events by default.
ea9f2c1
to
22d6978
Compare
…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"
22d6978
to
88e00c8
Compare
Closing for now -- going to try and get this in as a few smaller PRs. |
🎫 Ticket
Link to the relevant ticket:
LG-12657
🛠 Summary of changes
In working on #10216, I realized that the list of events that
Idv::AnalyticsEventsEnhancer
enhances has gotten a little stale. Specifically, we haven't been adding new events to it.This PR:
Idv::AnalyticsEventsEnhancer
to "enhance" any method that starts withidv_
(note that this is the method name, not the event name, so old-style "IdV:" and new-style "idv_" events will be covered).track_event
Initially, the list of "opted out" methods just includes any frontend events that were not previously "opted in". The net change of this PR is that all
idv_*
events logged by the backend will now haveproofing_components
added to them (this will be expanded to additional new properties in subsequent PRs).📜 Testing Plan
Provide a checklist of steps to confirm the changes.
IdV: doc auth verify submitted
now haveproofing_components