Repository navigation
Conversation
rerun_course now calls copy_course_tags_and_criteria() before it marks the rerun as succeeded. The function copies the source run's content tags to the new run as editable tags and then copies its competency criteria, in one transaction. A failure reaches the existing rerun failure handling, which marks the rerun as failed and deletes the cloned course. A taxonomy that is not enabled for the new run's organization is left out, together with its criteria, and a warning is logged. The catalog CourseRun row for the new run is created when it is missing, because criteria groups reference it and the publish handler may not have created it. Related to openedx/openedx-core#694 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
copy_course_tags_and_criteria() no longer creates the new run's catalog CourseRun row. Cloning the course sends the course-published signal, and the publish handler creates that row before the copy runs, so the fallback never ran. The rerun tests now run with that signal enabled, so they take the row from the real handler and fail if a clone stops creating it. Renames _map_object_id_into_course() to _map_object_id_from_one_course_to_another(). Related to openedx/openedx-core#694 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Thanks for the pull request, @bsparks! 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:
🔘 Submit a signed contributor agreement (CLA)
If you've signed an agreement in the past, you may need to re-sign. Once you've signed the CLA, please allow 1 business day for it to be processed. 🔘 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. DetailsWhere 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
Supersedes #39372. The commits are the same as on that pull request.
Adds the
openedx-platformhalf of openedx/openedx-core#694: a new run of a course gets its own copy of the source run's content tags and competency criteria.rerun_coursecalls the newcontent_tagging.api.copy_course_tags_and_criteria(source_course_key, destination_course_key)after it sets the initial permissions and before it marks the rerun as succeeded. The author therefore sees the new run only after the copy has finished. If the copy raises, the existing failure handling inrerun_coursemarks the rerun as failed and deletes the cloned course, so the author can retry with the same run.Behavior
tag_object, so they are editable on the new run and the source run's tags are unchanged.copy_competency_criteria_for_course_rerunfromopenedx-core.CourseRunrow. Cloning the course sends the course-published signal, and the existing publish handler creates that row before the copy runs, which a rerun through the real task on a devstack confirmed. If the row is missing, the copy raises and the rerun is marked as failed.Dependencies
This needs an
openedx-corerelease that containscopy_competency_criteria_for_course_rerun. openedx/openedx-core#963 adds that function. The requirements bump is added to this PR once that release exists.Testing
pytest openedx/core/djangoapps/content_tagging/tests/test_api.py -k CopyCourseTagsAndCriteriaandpytest cms/djangoapps/contentstore/tests/test_tasks.py -k RerunCourseTaskTestCase.Manual testing
Known limits
CourseRunrow, and the copied criteria groups and criteria are deleted with that row. The copied tags remain, as they do after any course deletion. A retry with the same run creates theCourseRunrow and the criteria again and applies the same tags, so it ends with one copy.tag_objectsends its tag-changed events inside the transaction, so a copy that rolls back has already sent events for the new run's blocks. The cloned course is deleted in that case.Tagrow, and the copy reads tags withget_all_object_tags, which returns only tags that have one. Copy and paste, duplicate, and export already behave the same way.Related to openedx/openedx-core#694
🤖 Generated with Claude Code