Skip to content

refactor: remove the ENABLE_COMPETENCY_MASTERY_TRACKING setting - #39351

Merged
ormsbee merged 1 commit into
openedx:masterfrom
alezconsultant:alezconsultant/924-remove-competency-tracking-setting
Nov 10, 2026
Merged

ormsbee merged 1 commit into
openedx:masterfrom
alezconsultant:alezconsultant/924-remove-competency-tracking-setting

Conversation

@alezconsultant

Copy link
Copy Markdown
Contributor

Description

Removes the Django setting ENABLE_COMPETENCY_MASTERY_TRACKING and the guard it controlled in _record_competency_status (lms/djangoapps/grades/subsection_grade.py). A learner's competency criterion status is now recorded on every subsection grade write, on both the single-grade path and the bulk path, with no setting to switch it on.

The setting was added by #39179 as a short-lived gate while the feature was validated. In a deployment with no competency criteria, the call into openedx-core (record_graded_object_statuses) runs one SELECT on the criteria table that returns no rows, writes nothing, and queues no roll-up task, so the gate saved one query per scored subsection grade write and added a configuration step an operator could miss. The transaction blocks, the roll-up enqueue on commit, and the grade-calculated event are unchanged; the setting never gated them.

The two tests that asserted setting-off behavior are removed, and the override_settings decorators that switched the setting on for the remaining competency tests are gone, so those tests now run against the unconditional path.

User roles affected: Operator. Learners and course authors see no change.

Supporting information

Testing instructions

There is no manual QA path; the change removes a setting and a guard, and the behavior it exposes is already covered by the grades unit tests. Covered by:

  • lms/djangoapps/grades/tests/test_subsection_grade.py (SubsectionGradeCompetencyStatusTest and SubsectionGradeCompetencyIntegrationTest), which assert that the competency write runs on both grade paths without any setting, that a status write failure rolls the grade back, and that a roll-up is queued only after commit.
  • lms/djangoapps/grades/tests/test_api.py::OverrideSubsectionGradeTests::test_override_without_existing_grade_records_competency_status
  • lms/djangoapps/grades/rest_api/v1/tests/test_gradebook_views.py::GradebookBulkUpdateViewTest::test_override_for_unattempted_learner_records_competency_status

To check the removal by hand, grep -rn ENABLE_COMPETENCY_MASTERY_TRACKING lms cms openedx common returns nothing.

Other information

  • Operators who deploy from master and never set the flag now run the competency write on every subsection grade write. Any ENABLE_COMPETENCY_MASTERY_TRACKING value left in a settings file is ignored. A competency storage failure fails the grade write, as the design in openedx-core's ADR 0004 (competency mastery concurrency) requires; there is no switch for this.
  • Each scored subsection grade write now runs one additional SELECT. The hard-coded query counts in lms/djangoapps/grades/tests/test_tasks.py and test_course_grade_factory.py are raised accordingly.
  • The setting shipped in no named release (added 2026-11-02 on master), so no deprecation ticket is needed under OEP-21.
  • No dependency change: the code already imports record_graded_object_statuses from openedx-core 1.21.0, which is the current pin.
  • This change does not depend on any other open PR.
  • AI usage: written with Claude Code (Claude Fable 5.1); reviewed and tested by the author.

Related to openedx/openedx-core#924

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Nov 4, 2026
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @alezconsultant!

This repository is currently maintained by @openedx/wg-maintenance-openedx-platform-oncall.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@mgwozdz-unicon mgwozdz-unicon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude and I both approve.

@ormsbee
ormsbee enabled auto-merge (rebase) November 10, 2026 16:32
Record a learner's competency criterion status on every subsection grade
write, with no setting to switch it on. In a deployment with no competency
criteria the core call is one SELECT that returns no rows and queues no
roll-up task, so the gate saved almost nothing and added a configuration
step an operator could miss.

The setting was added by openedx#39179 and shipped in no named release. Operators
tracking master who never set it now run the competency write on every
grade, and a competency storage failure fails the grade write, as the
design requires.

Each scored subsection grade write now runs one extra SELECT, and the
query-count assertions in the grades tests are raised to match.

Related to openedx/openedx-core#924

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants