-
Notifications
You must be signed in to change notification settings - Fork 2
Ignore edx failures variable usage #3260
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
Open
cp-at-mit
wants to merge
20
commits into
main
Choose a base branch
from
ignore-edx-failures-variable-usage
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The create_run_enrollments function now defaults the keep_failed_enrollments parameter to the IGNORE_EDX_FAILURES feature flag if not explicitly set. Added tests to verify that the function respects both the parameter and the feature flag.
Change deactivate_run_enrollment so keep_failed_enrollments defaults to None and, when None, is set from the IGNORE_EDX_FAILURES feature flag (is_enabled(features.IGNORE_EDX_FAILURES)). Update the function docstring accordingly and add tests (test_deactivate_run_enrollment_feature_flag) to verify behavior for None and explicit True/False values by mocking is_enabled and unenroll_edx_course_run.
Replace direct calls to mitol.olposthog.features.is_enabled with settings.FEATURES.get(features.IGNORE_EDX_FAILURES, False) across courses serializers and views to read the IGNORE_EDX_FAILURES flag from Django settings. Remove unused is_enabled imports and add django.conf.settings imports where needed. In users.views, add logging and robust error handling around queuing edX tasks: failures are logged and will only propagate when the IGNORE_EDX_FAILURES flag is disabled. Add tests to verify behavior of user update when edX task queuing fails and the feature flag is toggled. Files changed include courses/api.py, courses/serializers/v1/courses.py, courses/views/v1/__init__.py, courses/views/v2/__init__.py, users/views.py and users/views_test.py.
Add logging and error handling around syncing enrollments with edX in UserEnrollmentsApiViewSet.list. The view now catches exceptions from sync_enrollments_with_edx, logs the failure, and will re-raise only if the FEATURES flag IGNORE_EDX_FAILURES is not set. Also add parameterized tests to verify behavior across combinations of SYNC_ON_DASHBOARD_LOAD, IGNORE_EDX_FAILURES, and sync failures.
OpenAPI ChangesShow/hide ## Changes for v0.yaml:Unexpected changes? Ensure your branch is up-to-date with |
for more information, see https://pre-commit.ci
Add import of mitol.olposthog.features.is_enabled to courses.views v1 and v2. Update tests: remove an obsolete 404 assertion in courses/views/v2/views_test.py, and change users/views_test.py to mock settings.FEATURES.get (with updated comment) instead of users.views.is_enabled. These changes align imports and test mocking with the app's feature-flag handling.
…om/mitodl/mitxonline into ignore-edx-failures-variable-usage
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…om/mitodl/mitxonline into ignore-edx-failures-variable-usage
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What are the relevant tickets?
NA
Description (What does it do?)
How can this be tested?