openedx / platform-plugin-aspects

Aspects plugins for the Open edX LMS and Studio
Apache License 2.0
2 stars 8 forks source link

feat: add course enrollment sink #64

Closed Ian2012 closed 5 months ago

Ian2012 commented 5 months ago

Description

This PR creates a sink for the Course Enrollment mode. It uses the ENROLL_STATUS_CHANGE signal to listen for changes in enrollments.

Testing instructions

  1. Check out this branch on your local repository.
  2. Run Aspects migrations to create the necessary table.
  3. Enable the course enrollment sink waffle flag event_sink_clickhouse.course_enrollment.enabled.
  4. Enroll/unenroll in a course via the courseware page or in the instructor dashboard.
  5. Verify a record is stored for the enrollment.
  6. Verify the dump_data_to_clickhouse can dump old data.

Merge checklist: Check off if complete or not applicable:

openedx-webhooks commented 5 months ago

Thanks for the pull request, @Ian2012! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

github-actions[bot] commented 5 months ago

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  platform_plugin_aspects
  __init__.py
  signals.py
  platform_plugin_aspects/sinks
  __init__.py
  course_enrollment_sink.py
  serializers.py 208
Project Total  

This report was generated by python-coverage-comment-action

saraburns1 commented 5 months ago

@Ian2012 - i enrolled/unenrolled and also ran the dump to clickhouse. It looks like the ID values are not unique, is that expected?

Also, it doesn't seem to differentiate between enroll and unenroll, do we need that info?

image
Ian2012 commented 5 months ago

@saraburns1 Yes, the IDs correspond to the record on the DB and it's expected to be duplicated. We will create an MV that stores the last records per learner per course and their status. Tracking logs will be available for historical records. This will only be used to backfill data from the enrollments and know their last state. I think we can calculate enroll/unenroll with the is_active key

openedx-webhooks commented 5 months ago

@Ian2012 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.