Skip to content
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

Document analytics methods in end-to-end sign-in flow #10736

Merged
merged 4 commits into from
May 31, 2024

Conversation

aduth
Copy link
Member

@aduth aduth commented May 31, 2024

🛠 Summary of changes

Adds missing documentation for analytics methods called in an end-to-end partner authentication for a fully-registered user authenticating with phone.

This builds upon #10571, identifying a common flow as low-hanging fruit for fixing the largest possible number of specs which only need allowed_extra_analytics due to exercising a critical user flow.

📜 Testing Plan

Verify build passes.

Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! thanks for documenting these

app/services/analytics_events.rb Outdated Show resolved Hide resolved
app/services/analytics_events.rb Outdated Show resolved Hide resolved
app/services/analytics_events.rb Outdated Show resolved Hide resolved
app/services/analytics_events.rb Outdated Show resolved Hide resolved
# @param [Integer] ialmax Whether the user registration was for an IALMax request
# @param [String] service_provider_name The friendly name of the service provider
# @param ['account-page','agency-page'] page_occurence Where the user concluded registration
# @param ['new_sp','new_attributes','reverified_after_consent'] needs_completion_screen_reason The
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't matter but I notice we are using double quotes for other string values, single quotes here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I think I saw another method where we used single quotes which is why I used them here, so we're clearly a big mess of inconsistency 🙃

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're referring to lines like:

# @param ["authentication","reauthentication","confirmation"] context User session context

Those were copied from other methods, hence the internal inconsistency.

I may follow-up to do a bulk normalization, though I feel like it's inevitable we'll regress to having some inconsistency, unless we care to enforce it somehow.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a look at rubocop-yard but unfortunately, it doesn't appear to handle string literals at all. Either way, a task for another time

Comment on lines +5222 to +5223
# @param [Array] sp_request_requested_attributes Attributes requested by the service provider
# @param [Array] sp_session_requested_attributes Attributes requested by the service provider
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we describe what the difference is between these two? I'm guessing one is per-request and the other is something else?

Copy link
Member Author

@aduth aduth May 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into this a bit, and... I think they're effectively the same? I'll double-check though. And if they are the same, maybe I'll follow-up or create a ticket to remove one or the other.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not seeing anything in the logs for the _request_ one in the last 2 weeks... very mysterious

| filter ispresent(properties.event_properties.sp_request_requested_attributes) or ispresent(properties.event_properties.sp_request_requested_attributes.0)

Copy link
Member Author

@aduth aduth May 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the issue is that value reads from service_provider_request, but service_provider_request relies on the request_id URL query parameter, which we wouldn't expect to be present in the completions controller.

I can't imagine that service_provider_request has much utility to be honest, and we should probably be calling sp_session in most places instead. I can see about following-up on that.

Comment on lines +5266 to +5267
# @param [Array] sp_request_requested_attributes Attributes requested by the service provider
# @param [Array] sp_session_requested_attributes Attributes requested by the service provider
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto about differentiation

Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>
@aduth aduth merged commit 9aadb98 into main May 31, 2024
2 checks passed
@aduth aduth deleted the aduth-doc-analytics-sign-in branch May 31, 2024 18:51
colter-nattrass pushed a commit that referenced this pull request Jun 3, 2024
* Document analytics for critical-path sign-in flow

changelog: Internal, Analytics, Document analytics for critical-path sign-in flow

* Remove unnecessary allowed_extra_analytics

* Restore allowed_extra_analytics

* Fix typos and readability

Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>

---------

Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants