Repository navigation
feat: block dominance conflicts on competency taxonomy re-import - #39413
alezconsultant wants to merge 1 commit into
Conversation
TaxonomyOrgView overrides _get_import_validators() to add validate_tag_import_dominance for a competency taxonomy. The import and the import plan endpoints then reject a file that would nest two tags that both hold live criteria in the same course run, and the error names both tags and the course. Other taxonomies run no extra validator. Related to openedx/openedx-core#902 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Thanks for the pull request, @alezconsultant! This repository is currently maintained by 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 approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo 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:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 🔘 Update the status of your PRYour PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate. 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:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Description
A re-import of a competency taxonomy can move a tag under another tag. When both tags hold live criteria in the same course run, the move breaks the competency dominance rule: no ancestor or descendant of a competency tag may hold live criteria in the same course run as that tag. With this PR, Studio rejects such a re-import, in the import plan (the preview) and in the import itself. The error names both tags, the course run, and the file row of the moved tag. This affects course authors and taxonomy administrators who re-import a competency taxonomy.
TaxonomyOrgViewoverrides_get_import_validators(), the hook that openedx-core'sTaxonomyViewcalls on its two re-import endpoints. For a competency taxonomy the override addsvalidate_tag_import_dominancefromopenedx_learning.api. For any other taxonomy it returns what the parent returns, so no extra validator runs.Dependency
This PR is a draft because it needs an openedx-core release that contains openedx/openedx-core#957, which adds the hook and the validator. The pinned
openedx-core==1.26.0has neither, so the import ofvalidate_tag_import_dominancefails and CI stays red until the pin is raised. The version bump will be added to this PR once that release exists.Supporting information
Testing instructions
Automated:
openedx/core/djangoapps/content_tagging/rest_api/v1/tests/test_views.pycovers a rejected import, a rejected import plan, an import into a plain taxonomy that runs no dominance validator, and an organization administrator who sees a conflict in another organization's course run. The tests pass locally against the openedx-core branch of the linked PR.Manual, with openedx-core from the linked PR installed:
Related to openedx/openedx-core#902
🤖 Generated with Claude Code