Repository navigation
feat!: replace username and user_id with actor_id in the course_enrollment sink - #287
felipemontoya wants to merge 2 commits into
Conversation
|
Thanks for the pull request, @felipemontoya! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||
|
Couple of items:
|
Actor_id is added while user_id and username are removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3acd66c to
93149d9
Compare
|
@bmtcril I updated this PR with the new implementation based on the Fast DEPR. After your review, I understood and became concerned about the cost this could have both in Celery and the pressure on the MySQL database if one were to dump a big enrollments table over to Clickhouse. I built a batch getter for the actor Ids and bulk setter for creating the missing ones. I ran stress tests over it and here is a summary: Setup
Full dump of about 300k enrollments
Two cold dumps at once over 10,000 new learners without an id
|
Implements the removal proposed in the DEPR openedx/tutor-contrib-aspects#1403.
CourseEnrollmentSerializerdropsusernameanduser_idand writesactor_id(the learner's xAPI actor id) instead. The sink wrote both whateverASPECTS_ENABLE_PIIsaid, and neither truncate-on-init nor user retirement cleared them.actor_id, the table holds no PII, is written whether PII is on or off, and joins the xAPI tables and the other learner sinks.actor_idis the last field because sink inserts are positional CSV.create_xapi_actor_ids: onebulk_createand one batchedexternal_iddump per batch) instead of oneget_or_createper learner, which dominated cold dumps.Breaking: apply the matching migration from openedx/tutor-contrib-aspects#1402 before upgrading. Against the old table, single-row dumps are dropped silently.
Backfill after the migration:
dump_data_to_clickhouse --object course_enrollment --forceMerge checklist:
Check off if complete or not applicable:
Conventional Commits type — they determine the
release:
fix:→ patch,feat:→ minor,!/BREAKING CHANGE:→ major