Extending the Open edX platform sustainably through the Open edX Events and Filters framework

Meta

Date: April 27, 2022 at 2:00pm, Room -115

Speaker: Felipe Montoya

Intro

https://open-edx-proposals.readthedocs.io/en/latest/architectural-decisions/oep-0050-hooks-extension-framework.html

https://github.com/openedx/openedx-events

https://github.com/openedx/openedx-filters

Blended project led by edunext with edX as a collaborator.

Nutmeg will have the full implementation.

Hooks are a stable list of places in the life cycle of the learners and authors where externally defined functions can take place.

Example: Start > Register > Enroll > Learn > Certificate. Hooks can happen immediately before and after each of the >s.

Depending on what’s expected from them, there are two types of hooks: events and filters.

Events:

  • Features:

    • Doesn’t halt the application execution

    • Sent to receivers after performing an action

    • The main design goal of openedx-events is stability

    • They live in a separate Python library (openedx-events)

    • Definitions are versioned to increase their reliability

    • Documented with key information using in-line documentation

  • Implementation:

    • Open edX standardized Django signals

    • An event sends Data Attribute classes instead of in-memory obejcts

    • Events run in-process but the Event Bus will take them everywhere

    • The event bus is one of the reasons why they are named after the OEP-41

Filters:

  • Features:

    • Affect the application execution

    • Give the Open edX developer total control over the process where it runs, allowing them to manipulate in-memory objects

    • The main design goal of openedx-filters is flexibility

    • The definitions are documented with key information using in-line documentation

    • Definitions are versioned to increase reliability

  • Implementation:

    • They live in a separate Python library (openedx-filters)

    • Executes a list of functions just before performing an action

    • The filters tooling is based on a pipeline mechanism inspired by the Social Core pipeline

    • Named after OEP-41

    • Configured using Django settings

List of current event/filters

https://github.com/openedx/openedx-events/blob/main/openedx_events/learning/signals.py#L44-L53

https://github.com/openedx/openedx-filters/blob/main/openedx_filters/learning/filters.py (still under implementation)

Example

https://github.com/eduNEXT/openedx-filters-samples

How to create new events/filters

  • Creating an Open edX Event

    • Create the data attributes for the event (OEP-49)

    • Create the event definition

    • Integrate into service

  • Creating an Open edX Filter

    • Create the filter definition

    • Integrate into service