Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PADV-1346: Backport edx-platform changes needed for Event Bus to work on our olive instance. #124

Merged
merged 1 commit into from
May 30, 2024

Conversation

Serafin-dev
Copy link

@Serafin-dev Serafin-dev commented May 29, 2024

Ticket

https://agile-jira.pearson.com/browse/PADV-1346

Description

This PR aims to add the changes made in upstream to our edx-platform repository in order for Event Bus to work with the Credly project integration. Changes add:

  • openedx-events app to LMS
  • Event Bus Producer settings for LMS
  • Add settings needed in CMS for initialization.
  • Add badges feature to conditionally allow events from the producer configuration.

Changes made

Cherrypick the follwing commits from upstream https://github.com/openedx/edx-platform:

How to test?

Config

  • Add this configfuration to your lms/envs/devstack.py file :
INSTALLED_APPS += ['debug_toolbar', 'edx_event_bus_redis']
EVENT_BUS_PRODUCER = 'edx_event_bus_redis.create_producer'
EVENT_BUS_REDIS_CONNECTION_URL = 'redis://:[email protected]:6379/'
EVENT_BUS_CONSUMER = 'edx_event_bus_redis.RedisEventConsumer'
EVENT_BUS_TOPIC_PREFIX = 'dev'
FEATURES['BADGES_ENABLED'] = True

Consuming events

  • Start consuming an event from another service. For that first install openedx-events in your service with the version we are using, then add it to your IDA INSTALLED_APPS+='openedx_events', and set EVENT_BUS_CONSUMER, EVENT_BUS_REDIS_CONNECTION_URL, EVENT_BUS_TOPIC_PREFIX as the example above. Then run this command within this service container shell:
 ./manage.py consume_events --topic learning-badges-lifecycle --group_id test_group --extra '{"consumer_name": "test_group.c1"}'
  • checkout to this edx-platform branch in devstack.

Produce event

  • In your lms shell run this command :
./manage.py lms produce_event --signal openedx_events.learning.signals.COURSE_PASSING_STATUS_UPDATED --topic learning-badges-lifecycle --key-field user.id --data '{"course_passing_status": {"is_passing": true, "user": {"pii": {"username": "testuser", "email": "[email protected]", "name": "Test User"}, "id": 123, "is_active": true}, "course": {"course_key": "course-v1:edX+DemoX+Demo_Course", "display_name": "Demo Course"}}}'

@Serafin-dev Serafin-dev merged commit 60444ea into pearson-release/olive.stage May 30, 2024
5 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants