Skip to content

feat(user-account-merge): add account merge tracking and edX/MIT Learn user mapping #2474

Open
rachellougee wants to merge 2 commits into
mainfrom
feat/user-account-merge-mapping
Open

feat(user-account-merge): add account merge tracking and edX/MIT Learn user mapping #2474
rachellougee wants to merge 2 commits into
mainfrom
feat/user-account-merge-mapping

Conversation

@rachellougee

@rachellougee rachellougee commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

What are the relevant tickets?

https://github.com/mitodl/hq/issues/12430

Description (What does it do?)

  • New staging models for the MITx Online courserunenrollment/programenrollment audit tables.
  • bridge_user_account_link: tracks MITx Online account merges and cross-platform account links (edX.org), derived from enrollment/program audit history.
  • edxorg_mitlearn_user_mapping: a standalone reporting table giving a stable edX.org ↔ MIT Learn crosswalk (both connect to MITx Online internally).

A stable way to look up a learner's edX.org and MIT Learn accounts, since usernames/emails on both platforms can change over time.

How can this be tested?

  dbt build --select \                                                                                                                                           
    stg__mitxonline__app__postgres__courses_courserunenrollmentaudit \                                                                                           
    stg__mitxonline__app__postgres__courses_programenrollmentaudit \                                                                                             
    bridge_user_account_link \                                                                                                                                  
    edxorg_mitlearn_user_mapping \

Additional Context

Copilot AI review requested due to automatic review settings July 23, 2026 20:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds dbt models to support cross-platform identity tracking by deriving MITx Online account-merge redirects from enrollment audit history and exposing a stable edX.org ↔ MIT Learn crosswalk via MITx Online.

Changes:

  • Introduces new staging models (and source definitions) for MITx Online course run/program enrollment audit logs.
  • Adds bridge_user_account_merge dimensional bridge table to track verified MITx Online account-merge redirects.
  • Adds edxorg_mitlearn_user_mapping reporting model (with schema docs) for stable cross-platform user mapping.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/ol_dbt/models/staging/mitxonline/stg__mitxonline__app__postgres__courses_programenrollmentaudit.sql New staging model for program enrollment audit history.
src/ol_dbt/models/staging/mitxonline/stg__mitxonline__app__postgres__courses_courserunenrollmentaudit.sql New staging model for course run enrollment audit history.
src/ol_dbt/models/staging/mitxonline/_stg_mitxonline__models.yml Adds schema docs/tests for the new staging audit models.
src/ol_dbt/models/staging/mitxonline/_mitxonline__sources.yml Registers the new raw audit tables as dbt sources.
src/ol_dbt/models/reporting/edxorg_mitlearn_user_mapping.sql New reporting crosswalk between edX.org and MIT Learn via MITx Online (+ merge redirects).
src/ol_dbt/models/reporting/_reporting__models.yml Adds schema docs for the new reporting model.
src/ol_dbt/models/dimensional/bridge_user_account_merge.sql New bridge table deriving merge redirects from audit history.
src/ol_dbt/models/dimensional/_bridge_tables.yml Adds schema docs/tests for bridge_user_account_merge.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/ol_dbt/models/reporting/edxorg_mitlearn_user_mapping.sql
@github-actions

Copy link
Copy Markdown

🔎 ol-dbt impact — column-level blast radius

0 breaking, 0 warning, 5 info across 5 changed model(s).

Details
  • ℹ️ bridge_user_account_linkfrom_platform, from_user_id, observed_on, to_platform, to_user_id → 0 downstream model(s)
  • ℹ️ bridge_user_account_mergemerged_on, platform, platform_user_id_after, platform_user_id_before → 0 downstream model(s)
  • ℹ️ edxorg_mitlearn_user_mappingedxorg_user_id, mitlearn_application_user_id, mitxonline_openedx_user_id → 0 downstream model(s)
  • ℹ️ stg__mitxonline__app__postgres__courses_courserunenrollmentauditacting_user_id, courserunenrollment_id, enrollmentaudit_created_on, enrollmentaudit_data_after, enrollmentaudit_data_before, enrollmentaudit_id, enrollmentaudit_updated_on → 0 downstream model(s)
  • ℹ️ stg__mitxonline__app__postgres__courses_programenrollmentauditacting_user_id, enrollmentaudit_created_on, enrollmentaudit_data_after, enrollmentaudit_data_before, enrollmentaudit_id, enrollmentaudit_updated_on, programenrollment_id → 0 downstream model(s)

Posted by ol-dbt impact (annotate-only — does not block merge).

@KatelynGit KatelynGit self-assigned this Jul 24, 2026

@KatelynGit KatelynGit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The builds ran clean, the SQL looked ok to me, but the definitions are odd- they don't look like full sentences, are a bit confusing, and often contain strange characters I'd probably just give them a read through before merging.

@pdpinch

pdpinch commented Jul 24, 2026

Copy link
Copy Markdown
Member

I just want to emphasize @KatelynGit's comments. The descriptions are meant to be read by our end data platform end users. I know these tables are bit esoteric, but we could at least start with a high-level general statement about what the table is for, before getting into the details about how they are constructed. Perhaps Claude can help.

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.

4 participants