Skip to content

Commit

Permalink
fix: [ACI-901] use customized openedx-events package to prevent CI fa…
Browse files Browse the repository at this point in the history
…ilures (#2535)

* ci: [ACI-901] change standard events to cuztomized to prevent ci failing

* fix: [ACI-901] few fixes for ci

* refactor: [ACI-901] refactor code to pass ci checks

* style: [ACI-901] adjust style to pep8

---------

Co-authored-by: Andrii <[email protected]>
  • Loading branch information
2 people authored and kyrylo-kh committed Apr 15, 2024
1 parent 3b6e039 commit fe1729c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
13 changes: 12 additions & 1 deletion cms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,14 @@
# .. toggle_creation_date: 2024-03-22
# .. toggle_tickets: https://github.com/openedx/edx-platform/pull/33911
'ENABLE_GRADING_METHOD_IN_PROBLEMS': False,

# .. toggle_name: FEATURES['BADGES_ENABLED']
# .. toggle_implementation: DjangoSetting
# .. toggle_default: False
# .. toggle_description: Set to True to enable the Badges feature.
# .. toggle_use_cases: open_edx
# .. toggle_creation_date: 2024-04-10
'BADGES_ENABLED': False,
}

# .. toggle_name: ENABLE_COPPA_COMPLIANCE
Expand Down Expand Up @@ -2927,7 +2935,10 @@ def _should_send_learning_badge_events(settings):
"enabled",
)

# If the consumer encounters this many consecutive errors, exit with an error. This is intended to be used in a context where a management system (such as Kubernetes) will relaunch the consumer automatically.
# If the consumer encounters this many consecutive errors, exit with an error.
# This is intended to be used in a context where a management system (such as Kubernetes)
# will relaunch the consumer automatically.

#EVENT_BUS_REDIS_CONSUMER_CONSECUTIVE_ERRORS_LIMIT (defaults to None)

# How long the consumer should wait for new entries in a stream.
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/grades/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def course_grade_now_failed(user, course_id):
else:
COURSE_PASSING_STATUS_UPDATED.send_event(
course_passing_status=CoursePassingStatusData(
status = CoursePassingStatusData.FAILING,
status=CoursePassingStatusData.FAILING,
user=UserData(
pii=UserPersonalData(
username=user.username,
Expand Down
4 changes: 2 additions & 2 deletions lms/djangoapps/grades/tests/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def test_persistent_grade_event_emitted(self):
)


class CoursePassingStatusEventsTest(SharedModuleStoreTestCase, OpenEdxEventsTestMixin):
class CoursePassingStatusEventsTest(SharedModuleStoreTestCase, OpenEdxEventsTestMixin): # pylint: disable=missing-class-docstring
ENABLED_OPENEDX_EVENTS = [
"org.openedx.learning.course.passing.status.updated.v1",
]
Expand Down Expand Up @@ -169,7 +169,7 @@ def test_course_passing_status_updated_emitted(self):
)


class CCXCoursePassingStatusEventsTest(
class CCXCoursePassingStatusEventsTest( # pylint: disable=missing-class-docstring
SharedModuleStoreTestCase, OpenEdxEventsTestMixin
):
ENABLED_OPENEDX_EVENTS = [
Expand Down
5 changes: 4 additions & 1 deletion lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -5434,6 +5434,7 @@ def _should_send_certificate_events(settings):
EVENT_BUS_REDIS_CONNECTION_URL = "redis://:[email protected]:6379/"
EVENT_BUS_TOPIC_PREFIX = "dev"


def _should_send_learning_badge_events(settings):
return settings.FEATURES['BADGES_ENABLED']

Expand Down Expand Up @@ -5540,7 +5541,9 @@ def _should_send_learning_badge_events(settings):
"enabled",
)

# If the consumer encounters this many consecutive errors, exit with an error. This is intended to be used in a context where a management system (such as Kubernetes) will relaunch the consumer automatically.
# If the consumer encounters this many consecutive errors, exit with an error.
# This is intended to be used in a context where a management system (such as Kubernetes)
# will relaunch the consumer automatically.
#EVENT_BUS_REDIS_CONSUMER_CONSECUTIVE_ERRORS_LIMIT (defaults to None)

# How long the consumer should wait for new entries in a stream.
Expand Down
3 changes: 3 additions & 0 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,6 @@ optimizely-sdk<5.0
# lxml 5.1.0 introduced a breaking change in unit test shards
# This constraint can probably be removed once lxml==5.1.1 is released on PyPI
lxml<5.0
# openedx-events>0.13.0 causes test failures due to breaking changes
# These broken tests will be fixed in a separate PR
-e git+https://github.com/raccoongang/[email protected]#egg=openedx_events

0 comments on commit fe1729c

Please sign in to comment.