feat: allow block publish if was published before Library v2 migration#38865
feat: allow block publish if was published before Library v2 migration#38865asadali145 wants to merge 1 commit into
Conversation
|
Thanks for the pull request, @asadali145! 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. 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. |
4db4e90 to
4f8a913
Compare
4f8a913 to
b59b9e4
Compare
b59b9e4 to
1962ae8
Compare
|
@arslanashraf7 this should be good for another look. |
|
Does this need Product review? I feel like @jmakowski1123 told me once that there was some concern about having blocks published as part of the migration process. |
@pdpinch, we are not changing the default behavior. It is still the same after the changes. I would like to know more about the concerns about publishing the migrated blocks. |
|
Also FYI @kdmccormick |
kdmccormick
left a comment
There was a problem hiding this comment.
I can see the value in reducing number of clicks authors need to do in order to migrate, but I am wary of introducing a bug by publishing in non-standard way.
1962ae8 to
3b9c887
Compare
|
Marking as Draft so that the management command can be added. |
cdec8f2 to
c9538c3
Compare
There was a problem hiding this comment.
Pull request overview
Adds an opt-in path for the legacy library-content-block → Library v2 migration flow to keep already-published legacy library content blocks published by re-publishing them after upstream references are updated, plus a Studio management command to dispatch migrations for selected/all courses.
Changes:
- Add
persist_publish_stateflag toLegacyLibraryContentBlock.v2_update_children_upstream_versionto optionally re-publish after migration updates. - Thread the new flag through the existing Celery migration task.
- Introduce a Studio management command (and tests) to dispatch the migration task for specific courses or all courses.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
xmodule/library_content_block.py |
Adds persist_publish_state behavior to optionally re-publish migrated blocks. |
cms/djangoapps/contentstore/tasks.py |
Extends the migration task to accept/forward persist_publish_state. |
cms/djangoapps/contentstore/management/commands/migrate_course_legacy_library_blocks_to_item_bank.py |
New management command to queue migrations for course lists or all courses. |
cms/djangoapps/contentstore/management/commands/tests/test_migrate_course_legacy_library_blocks_to_item_bank.py |
Tests management command option validation and task dispatch arguments. |
xmodule/tests/test_library_content.py |
Adds coverage for publishing behavior under different prior-publish/flag combinations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c9538c3 to
d49e237
Compare
Description
This PR adds the ability to publish a library content block if it was published before the V2 migration. This would be helpful for anyone having too many courses and libraries.
Testing instructions
content -> library update -> Review content updatesand update the library references.