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

GitHub - openedx/openedx-events: Open edX events from the Hooks Extensions Framework

GitHub - openedx/openedx-filters: Open edX filters from the Hooks Extensions Framework

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

openedx-events/openedx_events/learning/signals.py at main · openedx/openedx-events

openedx-filters/openedx_filters/learning/filters.py at main · openedx/openedx-filters (still under implementation)

Example

GitHub - eduNEXT/openedx-filters-samples: Used to create Open edX Filters steps for testing purposes.

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