openedx / openedx/openedx-events
Update and use case for the COURSE_CERTIFICATE_CONFIG_CHANGED event
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 13
- Forks
- 33
- Avg merge
- 14h 37m
- Merged PRs (30d)
- 4
Description
Background
The Credentials IDA is responsible for storing course certificate configurations, which include data on when a certificate becomes available to learners and may be displayed on their Learner Record.
Currently, Credentials receives certificate configuration updates via Celery tasks and REST endpoints. When a course run is published, the system (edx-platform) checks whether the Certificate Display Behavior (CDB) or Certificate Available Date (CAD) has changed. If so, it emits the COURSE_CERT_DATE_CHANGE signal.
This signal is handled by the Programs Django app, which enqueues an update_certificate_available_date_on_course_update Celery task. When executed, this task makes a REST call to Credentials to update its records.
Problem
Instead of relying on Celery tasks and REST calls, we would like Credentials to receive this data via the Event Bus. However, there is currently no Event Bus event that supports passing CDB or CAD updates.
Proposal
The COURSE_CERTIFICATE_CONFIG_CHANGED event exists but is not currently used and is marked for deprecation. Instead of deprecating it, we propose an update and repurposing it.
We could introduce a new CertificateDisplayOptionsData class to encapsulate CDB and CAD details:
{
"display_behavior": type=str,
"available_date": type=datetime,
}
Then, modify the CertificateConfigData class to include display options data:
{
certificate_type: type=str,
course_key: type=CourseKey,
title: type=str,
signatories: type=List[CertificateSignatoryData],
is_active: type=bool,
display_options: type=CertificateDisplayOptionsData,
}
Last, emit the COURSE_CERTIFICATE_CONFIG_CHANGED event in the same location where the COURSE_CERT_DATE_CHANGE signal is currently triggered.
This approach would make the event more useful and align it with a use case for the Credentials IDA.
Appreciate any thoughts or concerns!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating CertificateConfigData, the proposed CertificateDisplayOptionsData, and the code path that emits COURSE_CERT_DATE_CHANGE. Review how existing event schemas are defined and tested, then determine how COURSE_CERTIFICATE_CONFIG_CHANGED should carry display_behavior and available_date and where it should be emitted. Done means the event supports these updates and its schema and emission behavior are covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100