-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat: bulk modulestore migration [FC-0097] #37381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: bulk modulestore migration [FC-0097] #37381
Conversation
Thanks for the pull request, @ChrisChV! 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. 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. |
6e1903d
to
c39836e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Thank you for your work, @ChrisChV!
- I tested this using the instructions from openedx/frontend-app-authoring#2493
- I read through the code
- I checked for accessibility issues
- Includes documentation
collection_key=modified_key, | ||
title=title, | ||
) | ||
except libraries_api.LibraryCollectionAlreadyExists as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: We are always creating new collections here. Therefore, if you migrate the same library multiple times, while the components are not duplicated (due to the default skip
strategy), the collections are.
I'm not sure if there is an easy and pretty solution for this, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is good enough for now! It worked after some tweaks (see the review).
Thanks @ChrisChV.
@shared_task(base=_MigrationTask, bind=True) | ||
# Note: The decorator @set_code_owner_attribute cannot be used here because the UserTaskMixin | ||
# does stack inspection and can't handle additional decorators. | ||
def migrate_from_modulestore( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for breaking this function into smaller ones! ❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This worked after some tweaks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I had a bunch of questions and suggestions but they're all minor / optional.
@kdmccormick did you also want to review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay!
Please let me know if you need any additional information to reproduce it. |
@rpenido, I merged this branch with master. It works for me. Maybe you need to run |
You're right @ChrisChV! It was missing the migration. Sorry for the noise! @bradenmacdonald I manually tested it and it is working as expected. |
OK, this is good to go then. |
@rpenido Thanks! Could you make another kick review of b38cbdf. There are new small requirements: openedx/frontend-app-authoring#2201 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Thank you for your work @ChrisChV!
- I tested this using the instructions from the PR
- I read through the code
- I checked for accessibility issues
- Includes documentation
This is working as expected!
I left you a comment about the datetime format.
from django.utils.translation import gettext_lazy as _ | ||
|
||
from common.djangoapps.split_modulestore_django.models import SplitModulestoreCourseIndex | ||
from common.djangoapps.util.date_utils import strftime_localized, DEFAULT_LONG_DATE_FORMAT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEFAULT_LONG_DATE_FORMAT
doesn't include time. Should we use DEFAULT_DATE_TIME_FORMAT
instead?
from common.djangoapps.util.date_utils import strftime_localized, DEFAULT_LONG_DATE_FORMAT | |
from common.djangoapps.util.date_utils import strftime_localized, DEFAULT_DATE_TIME_FORMAT |
key = slugify(title) | ||
collection = None | ||
attempt = 0 | ||
created_at = strftime_localized(datetime.now(timezone.utc), DEFAULT_LONG_DATE_FORMAT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
created_at = strftime_localized(datetime.now(timezone.utc), DEFAULT_LONG_DATE_FORMAT) | |
created_at = strftime_localized(datetime.now(timezone.utc), DEFAULT_DATE_TIME_FORMAT) |
Description
Supporting information
Testing instructions
Deadline
ASAP, before the Ulmo cut.
Other information
N/A