feat: command to migrate v1 to v2 lib references#825
Conversation
|
Marked this as WIP, Will move to review after the upstream PR is merged openedx/openedx-platform#38865 |
|
@arslanashraf7, this should be ready for review. |
arslanashraf7
left a comment
There was a problem hiding this comment.
Just a couple of small changes.
|
@arslanashraf7, I have added the review changes, an enhancement to validate that the course exists, and also added tests for the command. This should be good for another look. |
There was a problem hiding this comment.
Pull request overview
Adds a CMS management command in ol_openedx_course_sync to queue migration of legacy (v1) library_content blocks to v2 item bank references, with supporting utility/helpers, documentation, and test coverage.
Changes:
- Introduces
migrate_legacy_library_blocks_to_item_bankmanagement command with--course-ids,--all-source-courses, and--persist-publish-stateoptions. - Adds
get_all_source_courses()utility plus unit tests for it. - Adds command docs to the plugin README and bumps plugin version to
1.0.1.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ol_openedx_course_sync/ol_openedx_course_sync/management/commands/migrate_legacy_library_blocks_to_item_bank.py | Adds the new CMS management command that queues the edx-platform migration task. |
| src/ol_openedx_course_sync/ol_openedx_course_sync/utils.py | Adds get_all_source_courses() helper used by the command. |
| src/ol_openedx_course_sync/tests/test_migrate_legacy_library_blocks_to_item_bank.py | Adds tests covering command argument handling and task queuing behavior. |
| src/ol_openedx_course_sync/tests/test_utils.py | Adds tests for get_all_source_courses() and updates imports for new test setup. |
| src/ol_openedx_course_sync/README.rst | Documents command usage, options, and examples. |
| src/ol_openedx_course_sync/pyproject.toml | Bumps plugin version for the new feature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
40411ec to
5a4fa86
Compare
arslanashraf7
left a comment
There was a problem hiding this comment.
Approving with an important comment.
…ommands/migrate_legacy_library_blocks_to_item_bank.py Co-authored-by: Arslan Ashraf <34372316+arslanashraf7@users.noreply.github.com>
What are the relevant tickets?
https://github.com/mitodl/hq/issues/12148
Description (What does it do?)
Adds a command to update v1 library references to v2 library
How can this be tested?
asad/v1-v2-lib-migration-fixes-and-commandfor edx-platform branch./manage.py cms migrate_legacy_library_blocks_to_item_bank --course-ids <SOURCE_COURSE_ID> --persist-publish-state