Add additional logging details for partner email selection#11550
Merged
Add additional logging details for partner email selection#11550
Conversation
kevinsmaster5
approved these changes
Nov 29, 2024
Contributor
kevinsmaster5
left a comment
There was a problem hiding this comment.
Looks good. tested locally to confirm expected logging
changelog: Internal, Analytics, Add additional logging details for partner email selection
Not relevant for this flow. Unfortunate consequence of sharing event between initial account creation email confirmation, and subsequent email additions
61fa990 to
f68ea50
Compare
Avoid in logging result except where used in account email controller
UndocumentedParams checker still flags if passed as nil, avoid passing altogether Effect on user_id should be non-regressing, since user_id should only supersede default if associated with a user
Required keyword argument on add_email_confirmation, avoid regressing
Since it's shared, and only 1 place needs this in logging result, instead append to logging result from controller
Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>
MrNagoo
reviewed
Dec 3, 2024
app/forms/select_email_form.rb
Outdated
|
|
||
| def submit(params) | ||
| @selected_email_id = params[:selected_email_id] | ||
| @selected_email_id = params[:selected_email_id].try(:to_i) |
Contributor
There was a problem hiding this comment.
I think try will never fail here. to_i is always safe as far as I'm aware. nil.to_i => 0
Contributor
Author
There was a problem hiding this comment.
There's some related discussion in Slack about this change: https://gsa-tts.slack.com/archives/C0NGESUN5/p1733256901533489
Where specifically it stems from an observation that not all parameter types are safe to to_i, e.g. true
> true.to_i
(irb):1:in `<main>': undefined method `to_i' for true (NoMethodError)
Avoid logging 0 ID for empty value
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.
🛠 Summary of changes
Adds a handful of additional logging details to be able to help monitor usage with the new partner email selection feature:
from_select_email_flow(boolean) to'Add Email: Email Confirmation': Whether email was confirmed after being added as part of partner email selectionin_select_email_flow(boolean) to'Add Email Requested': Whether email is being added as part of partner email selectionin_select_email_flow(boolean) to'Add Email Address Page Visited': Whether email is being added as part of partner email selectionselected_email_id(integer) to:sp_select_email_submitted: Submitted ID value for email address record📜 Testing Plan
Repeat Testing Plan from #10951, and observe logging details above as applicable.