Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

ARCH-603: (part 1) update lms_user_id via social-auth for analytics#2191

Merged
robrap merged 2 commits intomasterfrom
robrap/ARCH-603-lms-user-id-analytics
Mar 28, 2019
Merged

ARCH-603: (part 1) update lms_user_id via social-auth for analytics#2191
robrap merged 2 commits intomasterfrom
robrap/ARCH-603-lms-user-id-analytics

Conversation

@robrap
Copy link
Contributor

@robrap robrap commented Mar 26, 2019

When social-auth makes user_id available to ecommerce, uses this as the backup lms_user_id for later analytics calls.

This is part 1 of a two part change. This code will use the user_id from social-auth when it is available, but it won't yet be available in part 1. It will start writing some NewRelic metrics that can be tested.

Part 2 will require the auth-backends upgrade to actually make the user_id available via social-auth. But this upgrade requires the following:

ARCH-603

@robrap robrap force-pushed the robrap/ARCH-603-lms-user-id-analytics branch from 0ef4888 to a3da937 Compare March 26, 2019 20:42
@robrap robrap changed the title WIP: ARCH-603: update lms_user_id via social-auth for analytics ARCH-603: update lms_user_id via social-auth for analytics Mar 27, 2019
@robrap
Copy link
Contributor Author

robrap commented Mar 27, 2019

@nasthagiri @douglashall: This is ready for review with the caveat that tests may not be passing. I was having difficulty running them locally.

@robrap robrap force-pushed the robrap/ARCH-603-lms-user-id-analytics branch from 3e8be61 to b2c3c5c Compare March 28, 2019 02:38
This refactor will grab the (LMS) user_id from social-auth extra_data
in the database, if it is available, and provide it to the analytics
code as the user tracking id.

The different user ids are also added to NewRelic (temporarily) to
help ensure all is well.  The new custom metrics are:
- lms_user_id_tracking_context (only available for LMS to ecommerce calls)
- lms_user_id_social_auth (should be None until part 2, see below)
- ecommerce_user_id

This is part 1, because part 2 will include the auth-backends upgrade
that will make the user_id available from social-auth. This upgrade has
two prerequesites:
1. A fix to LMS that enable the scope user_id to work.
2. Configuring the oauth application for ecommerce sso to have access
to the user_id scope.

ARCH-603
@robrap robrap force-pushed the robrap/ARCH-603-lms-user-id-analytics branch from 631c899 to bacbd6f Compare March 28, 2019 14:52
This middleware was mistakenly added a second time, so removing it.
@robrap robrap changed the title ARCH-603: update lms_user_id via social-auth for analytics ARCH-603: (part 1) update lms_user_id via social-auth for analytics Mar 28, 2019
@robrap robrap merged commit a63ef79 into master Mar 28, 2019
@robrap robrap deleted the robrap/ARCH-603-lms-user-id-analytics branch March 28, 2019 16:59
robrap added a commit that referenced this pull request Mar 28, 2019
This is part 2 of a 2 part change to get the user_id from social-auth
during the oAuth2+SSO flow to the database, and available to ecommerce
for use with analytics.

Part 2 simply has the upgrade to auth-backends 2.0.0. This version of
auth-backends will actually store the user_id in the social-auth table,
making it available to the code from (part 1 #2191) that reads this
user_id and makes it available to the analytics code.

This upgrade has two pre-requisites:
1. A fix to LMS that enables the scope user_id to work at all.
2. Configuring the oauth application for ecommerce-sso to have access
to the user_id scope.

ARCH-603
robrap added a commit that referenced this pull request Mar 29, 2019
This is part 2 of a 2 part change to get the user_id from social-auth
during the oAuth2+SSO flow to the database, and available to ecommerce
for use with analytics.

Part 2 simply has the upgrade to auth-backends 2.0.0. This version of
auth-backends will actually store the user_id in the social-auth table,
making it available to the code from (part 1 #2191) that reads this
user_id and makes it available to the analytics code.

This upgrade has two pre-requisites:
1. A fix to LMS that enables the scope user_id to work at all.
2. Configuring the oauth application for ecommerce-sso to have access
to the user_id scope.

ARCH-603
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants