Skip to content

Commit

Permalink
feat: backport event bus configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
wowkalucky committed Mar 13, 2024
1 parent 59f5042 commit 17101ac
Show file tree
Hide file tree
Showing 8 changed files with 227 additions and 12 deletions.
46 changes: 44 additions & 2 deletions credentials/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"drf_yasg",
"hijack",
"xss_utils",
"openedx_events",
]

PROJECT_APPS = [
Expand Down Expand Up @@ -541,8 +542,49 @@
FAVICON_URL = "https://edx-cdn.org/v3/default/favicon.ico"
LOGO_POWERED_BY_OPEN_EDX_URL = "https://edx-cdn.org/v3/prod/open-edx-tag.svg"

# .. toggle_name: USE_LEARNER_RECORD_MFE
# .. toggle_implementation: DjangoSetting
# Event Bus Settings
EVENT_BUS_PRODUCER = "edx_event_bus_redis.create_producer"
EVENT_BUS_CONSUMER = "edx_event_bus_redis.RedisEventConsumer"
EVENT_BUS_REDIS_CONNECTION_URL = "redis://:[email protected]:6379/"
EVENT_BUS_TOPIC_PREFIX = "dev"
# .. setting_name: EVENT_BUS_PRODUCER_CONFIG
# .. setting_default: all events disabled
# .. setting_description: Dictionary of event_types mapped to dictionaries of topic to topic-related configuration.
EVENT_BUS_PRODUCER_CONFIG = {
# .. setting_name: EVENT_BUS_PRODUCER_CONFIG['org.openedx.learning.program.certificate.awarded.v1']
# ['learning-program-certificate-lifecycle']['enabled']
# .. toggle_implementation: DjangoSetting
# .. toggle_default: False
# .. toggle_description: Enables sending PROGRAM_CERTIFICATE_AWARDED events over the event bus.
# .. toggle_warning: The default may be changed in a later release.
# .. toggle_use_cases: opt_in
# .. toggle_creation_date: 2023-10-13
# .. toggle_tickets: https://github.com/openedx/credentials/issues/2241
"org.openedx.learning.program.certificate.awarded.v1": {
"learning-program-certificate-lifecycle": {
"event_key_field": "program_certificate.program.uuid",
"enabled": False,
},
},
# .. setting_name: EVENT_BUS_PRODUCER_CONFIG['org.openedx.learning.program.certificate.revoked.v1']
# ['learning-program-certificate-lifecycle']['enabled']
# .. toggle_implementation: SettingToggle
# .. toggle_default: False
# .. toggle_description: Enables sending PROGRAM_CERTIFICATE_REVOKED events over the event bus.
# .. toggle_warning: The default may be changed in a later release.
# .. toggle_use_cases: opt_in
# .. toggle_creation_date: 2023-10-13
# .. toggle_tickets: https://github.com/openedx/credentials/issues/2241
"org.openedx.learning.program.certificate.revoked.v1": {
"learning-program-certificate-lifecycle": {
"event_key_field": "program_certificate.program.uuid",
"enabled": False,
},
},
}

# .. toggle_name: LOG_INCOMING_REQUESTS
# .. toggle_implementation: WaffleSwitch
# .. toggle_default: False
# .. toggle_description: Determines if the Credentials IDA should redirect to the Learner Record MFE when navigating
# between the program detail page and program list pages.
Expand Down
38 changes: 37 additions & 1 deletion requirements/all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@ astroid==2.12.10
# -r requirements/dev.txt
# pylint
# pylint-celery
async-timeout==4.0.3
# via
# -r requirements/dev.txt
# -r requirements/production.txt
# redis
attrs==22.1.0
# via
# -r requirements/dev.txt
# -r requirements/production.txt
# edx-ace
# jsonschema
# openedx-events
# pytest
backoff==1.10.0
# via
Expand Down Expand Up @@ -154,8 +160,10 @@ django==3.2.20
# edx-django-sites-extensions
# edx-django-utils
# edx-drf-extensions
# edx-event-bus-redis
# edx-i18n-tools
# edx-toggles
# openedx-events
# xss-utils
django-appconf==1.0.5
# via
Expand Down Expand Up @@ -281,24 +289,31 @@ edx-django-utils==5.1.0
# -r requirements/dev.txt
# -r requirements/production.txt
# edx-drf-extensions
# edx-event-bus-redis
# edx-rest-api-client
# edx-toggles
# openedx-events
edx-drf-extensions==8.3.1
# via
# -r requirements/dev.txt
# -r requirements/production.txt
edx-event-bus-redis @ git+https://github.com/openedx/[email protected]
# via
# -r requirements/dev.txt
# -r requirements/production.txt
edx-i18n-tools==0.9.1
# via
# -r requirements/dev.txt
# -r requirements/production.txt
# edx-credentials-themes
edx-lint==5.3.0
# via -r requirements/dev.txt
edx-opaque-keys==2.3.0
edx-opaque-keys[django]==2.3.0
# via
# -r requirements/dev.txt
# -r requirements/production.txt
# edx-drf-extensions
# openedx-events
edx-rest-api-client==5.5.0
# via
# -r requirements/dev.txt
Expand All @@ -307,12 +322,18 @@ edx-toggles==5.0.0
# via
# -r requirements/dev.txt
# -r requirements/production.txt
# edx-event-bus-redis
factory-boy==3.2.1
# via -r requirements/dev.txt
faker==15.0.0
# via
# -r requirements/dev.txt
# factory-boy
fastavro==1.9.4
# via
# -r requirements/dev.txt
# -r requirements/production.txt
# openedx-events
filelock==3.8.0
# via
# -r requirements/dev.txt
Expand Down Expand Up @@ -428,6 +449,11 @@ openapi-codec==1.3.2
# -r requirements/dev.txt
# -r requirements/production.txt
# django-rest-swagger
openedx-events @ git+https://github.com/raccoongang/[email protected]
# via
# -r requirements/dev.txt
# -r requirements/production.txt
# edx-event-bus-redis
packaging==21.3
# via
# -r requirements/dev.txt
Expand Down Expand Up @@ -604,6 +630,11 @@ pyyaml==5.4.1
# docker-compose
# edx-django-release-util
# edx-i18n-tools
redis==5.0.3
# via
# -r requirements/dev.txt
# -r requirements/production.txt
# walrus
requests==2.28.1
# via
# -r requirements/dev.txt
Expand Down Expand Up @@ -765,6 +796,11 @@ virtualenv==20.16.5
# via
# -r requirements/dev.txt
# tox
walrus==0.9.3
# via
# -r requirements/dev.txt
# -r requirements/production.txt
# edx-event-bus-redis
webencodings==0.5.1
# via
# -r requirements/dev.txt
Expand Down
4 changes: 4 additions & 0 deletions requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ xss-utils

# TODO Install in configuration
git+https://github.com/openedx/[email protected]#egg=edx_credentials_themes==0.1.121
git+https://github.com/openedx/[email protected]

# TODO: switch to upstream once PR is merged: https://github.com/openedx/openedx-events/pull/303
git+https://github.com/raccoongang/[email protected]
29 changes: 26 additions & 3 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ analytics-python==1.4.0
# via -r requirements/base.in
asgiref==3.5.2
# via django
async-timeout==4.0.3
# via redis
attrs==22.1.0
# via edx-ace
# via
# edx-ace
# openedx-events
backoff==1.10.0
# via analytics-python
bleach==5.0.1
Expand Down Expand Up @@ -69,8 +73,10 @@ django==3.2.20
# edx-django-sites-extensions
# edx-django-utils
# edx-drf-extensions
# edx-event-bus-redis
# edx-i18n-tools
# edx-toggles
# openedx-events
# xss-utils
django-appconf==1.0.5
# via django-statici18n
Expand Down Expand Up @@ -135,20 +141,29 @@ edx-django-utils==5.1.0
# via
# -r requirements/base.in
# edx-drf-extensions
# edx-event-bus-redis
# edx-rest-api-client
# edx-toggles
# openedx-events
edx-drf-extensions==8.3.1
# via -r requirements/base.in
edx-event-bus-redis @ git+https://github.com/openedx/[email protected]
# via -r requirements/base.in
edx-i18n-tools==0.9.1
# via edx-credentials-themes
edx-opaque-keys==2.3.0
edx-opaque-keys[django]==2.3.0
# via
# -r requirements/base.in
# edx-drf-extensions
# openedx-events
edx-rest-api-client==5.5.0
# via -r requirements/base.in
edx-toggles==5.0.0
# via -r requirements/base.in
# via
# -r requirements/base.in
# edx-event-bus-redis
fastavro==1.9.4
# via openedx-events
future==0.18.2
# via pyjwkest
idna==3.4
Expand Down Expand Up @@ -181,6 +196,10 @@ oauthlib==3.2.1
# social-auth-core
openapi-codec==1.3.2
# via django-rest-swagger
openedx-events @ git+https://github.com/raccoongang/[email protected]
# via
# -r requirements/base.in
# edx-event-bus-redis
packaging==21.3
# via drf-yasg
path==16.5.0
Expand Down Expand Up @@ -237,6 +256,8 @@ pyyaml==5.4.1
# code-annotations
# edx-django-release-util
# edx-i18n-tools
redis==5.0.3
# via walrus
requests==2.28.1
# via
# -r requirements/base.in
Expand Down Expand Up @@ -302,6 +323,8 @@ uritemplate==4.1.1
# drf-yasg
urllib3==1.26.12
# via requests
walrus==0.9.3
# via edx-event-bus-redis
webencodings==0.5.1
# via bleach
xss-utils==0.4.0
Expand Down
20 changes: 20 additions & 0 deletions requirements/common_constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@
# See BOM-2721 for more details.
# Below is the copied and edited version of common_constraints

# This is a temporary solution to override the real common_constraints.txt
# In edx-lint, until the pyjwt constraint in edx-lint has been removed.
# See BOM-2721 for more details.
# Below is the copied and edited version of common_constraints

# This is a temporary solution to override the real common_constraints.txt
# In edx-lint, until the pyjwt constraint in edx-lint has been removed.
# See BOM-2721 for more details.
# Below is the copied and edited version of common_constraints

# This is a temporary solution to override the real common_constraints.txt
# In edx-lint, until the pyjwt constraint in edx-lint has been removed.
# See BOM-2721 for more details.
# Below is the copied and edited version of common_constraints

# This is a temporary solution to override the real common_constraints.txt
# In edx-lint, until the pyjwt constraint in edx-lint has been removed.
# See BOM-2721 for more details.
# Below is the copied and edited version of common_constraints

# A central location for most common version constraints
# (across edx repos) for pip-installation.
#
Expand Down
Loading

0 comments on commit 17101ac

Please sign in to comment.