Skip to content

[Follow-up BE] Remove the ENABLE_COMPETENCY_MASTERY_TRACKING setting #924

Closed

Description

@thelmick-unicon

User Story

As a platform operator, I want a learner's competency criterion status recorded on every subsection grade write without a setting to switch on, in order to have mastery tracked as soon as criteria are attached to content, with no configuration step to miss.

Description

openedx/openedx-platform#39179 gated the competency status write on the subsection grade path behind the Django setting ENABLE_COMPETENCY_MASTERY_TRACKING, default False, but upon further inspection, this isn't necessary per the PR comment discussion. Essentially, with no competency criteria in a deployment, record_graded_object_statuses in openedx-core runs one indexed query that returns no rows and queues no roll-up task, so a deployment that does not use competencies pays one SELECT per subsection grade write and nothing else, so there is no reason to have an extra flag to prohibit this call for non-CBE instances.

Remove the setting and run the competency call unconditionally. The change is in openedx-platform.

Context

Acceptance Criteria

  • ENABLE_COMPETENCY_MASTERY_TRACKING and its toggle annotation block are gone from lms/envs/common.py.
  • _record_competency_status in lms/djangoapps/grades/subsection_grade.py calls record_graded_object_statuses without consulting any setting, and its docstring no longer describes a tracking-off case.
  • No test in lms/djangoapps/grades overrides the setting, the tests that asserted setting-off behavior are removed, and the rest of the grades test suite passes.
Technical Details

This is a suggested approach, not the source of truth. The User Story, Description, and Acceptance Criteria define what must be true when the work is done.

Approach

  1. Delete the ENABLE_COMPETENCY_MASTERY_TRACKING assignment and the .. toggle_name: annotation block above it from lms/envs/common.py.
  2. In lms/djangoapps/grades/subsection_grade.py, remove the if not settings.ENABLE_COMPETENCY_MASTERY_TRACKING: return [] guard at the top of _record_competency_status and update its docstring. Leave the transaction.atomic() blocks, the on_commit enqueue, and the event emission as they are; the setting never gated them.
  3. Remove test_setting_off_saves_grades_without_calling_core and test_setting_off_does_not_enqueue from lms/djangoapps/grades/tests/test_subsection_grade.py, and remove every @override_settings(ENABLE_COMPETENCY_MASTERY_TRACKING=True) decorator from test_subsection_grade.py, tests/test_api.py, and rest_api/v1/tests/test_gradebook_views.py. The tests under those decorators keep running, now against the unconditional path.

Files to create and modify

File Change
lms/envs/common.py modified: remove the setting and its annotation block
lms/djangoapps/grades/subsection_grade.py modified: drop the setting guard in _record_competency_status
lms/djangoapps/grades/tests/test_subsection_grade.py modified: remove the two setting-off tests and the override decorators
lms/djangoapps/grades/tests/test_api.py modified: remove the override decorator
lms/djangoapps/grades/rest_api/v1/tests/test_gradebook_views.py modified: remove the override decorator

Activity

  1. moved this from Needs additional details to Ready for Community Review in Competency Criteria and Student Progresson Nov 3, 2026
  2. moved this from Ready for Community Review to Unicon Code Review in Competency Criteria and Student Progresson Nov 4, 2026
  3. moved this from Unicon Code Review to Community Code Review in Competency Criteria and Student Progresson Nov 4, 2026
  4. moved this from Community Code Review to Final Axim Review in Competency Criteria and Student Progresson Nov 9, 2026
  5. thelmick-unicon commented on Nov 9, 2026

    @thelmick-unicon
    Author

    The discussion period for this ticket is now complete, and we appreciate all the feedback. We'll be moving forward with development based on the current ticket, pending final Axim sign-off. That said, the conversation doesn't have to stop. If you still have feedback, please continue to add to this ticket. We'll review anything new and determine whether it fits within the current timeline or makes more sense as its own ticket for future work. Thanks again for helping make this better!

    @ormsbee This is ready for your final review. Thank you!

  6. moved this from Final Axim Review to Ready for QA in Competency Criteria and Student Progresson Nov 11, 2026
  7. dvarenikqaconsultant commented on Nov 11, 2026

    @dvarenikqaconsultant

    Test report

    Environment: Master Sandbox (https://master.openedx.io, https://studio.master.openedx.io)
    Test user: dmitryvarenikqa (staff)
    Test type: API check of deployed Django settings, plus a review of the code and tests in openedx/openedx-platform#39351
    Result: ✅ All acceptance criteria are met. No bugs found.

    Setting removal on Master Sandbox

    # Check Expected result Actual result Status
    1 GET https://master.openedx.io/api/toggles/v0/state/ as a staff user, search the django_settings list for ENABLE_COMPETENCY_MASTERY_TRACKING The setting is absent No setting containing COMPETENC is listed. The neighboring ENABLE_COURSE_ASSESSMENT_GRADE_CHANGE_SIGNAL is still listed (false), so the list itself is complete. ✅ Pass
    2 Compare the same endpoint before and after the deploy of openedx/openedx-platform#39351 The setting disappears after the deploy Before the deploy, the setting was listed with is_active: false. After the deploy, it is gone. ✅ Pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions