-
Notifications
You must be signed in to change notification settings - Fork 4.2k
refactor: unify XBlock naming: item [BD-13] #31384
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
refactor: unify XBlock naming: item [BD-13] #31384
Conversation
|
Thanks for the pull request, @tecoholic! When this pull request is ready, tag your edX technical lead. |
70a0ceb to
c8c0abb
Compare
|
@Agrendalath I was able to replace Other heavy use of |
We already have the get_block which uses Regarding the name of the
There are external packages that use these methods. For example, ORA2 and LTI_Consumer use @ormsbee, what do you think about these points? |
|
@Agrendalath: I don't really have an opinion on the Absolutely agree that we cannot break compatibility by changing the modulestore functions. We can add new methods and have the old ones call into them with deprecation warnings, but I'm honestly not sure if the long term simplification is worth having both methods around for the same thing for one or two release cycles. |
|
@Agrendalath @ormsbee Thank you for your inputs. I have changes most of the
Venturing further into renaming the $ ack "load_item\(" -l
xmodule/tests/test_conditional.py
xmodule/tests/xml/__init__.py
xmodule/modulestore/split_mongo/split.py
xmodule/modulestore/split_mongo/caching_descriptor_system.py
xmodule/modulestore/xml.py
xmodule/modulestore/mongo/base.py
xmodule/x_module.py |
As a part of naming unification, the ItemFactory class in edx-platform has been renamed to BlockFactory. This commit updates the references to ItemFactory in this repo to BlockFactory. Ref: openedx/openedx-platform#31384
51ed0c5 to
2daa8ad
Compare
Agrendalath
left a 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.
👍
- I tested this: verified that XBlocks work correctly (especially the
LibraryContentBlock) - I read through the code
- I checked for accessibility issues: n/a
- Includes documentation: n/a
- I made sure any change in configuration variables is reflected in the corresponding client's
configuration-securerepository: n/a
|
@tecoholic, please rebase the PR and squash the commits into logical chunks. @ormsbee, would you mind doing a sanity check on this PR? Unlike in #31113, we're not breaking any compatibility here. The only external usage of the |
|
@Agrendalath: Looks sane to me. It's only changing test-related files, right? Nothing in the modulestore itself? Aside from the load_item -> get_block change, which is equivalent...? |
|
FWIW, this is another change that's worth broadcasting loudly, since it will likely break folks who are actively working on branches. |
|
@ormsbee, we have additionally (as described here):
These changes do not affect the modulestore, though.
Good point. I will post an announcement once we merge this. |
ef51c95 to
f8698c5
Compare
|
@Agrendalath Thanks for the review. I have squashed the commits and rebased it on the latest changes. This is ready for merging. |
7d1f581 to
5d06fec
Compare
As a part of naming unification, the ItemFactory class in edx-platform has been renamed to BlockFactory. This commit updates the references to ItemFactory in this repo to BlockFactory. Ref: openedx/openedx-platform#31384
|
@Agrendalath Gentle reminder about merging this before some conflict with the master branch is introduced. |
|
@ormsbee, I'm just checking if you had a chance to see my previous comment and if there is anything else to do before we schedule the merge. |
As a part of naming unification, the ItemFactory class in edx-platform has been renamed to BlockFactory. This commit updates the references to ItemFactory in this repo to BlockFactory. Ref: openedx/openedx-platform#31384
|
@Agrendalath: No, go ahead and schedule the merge, ty |
5d06fec to
dca23ca
Compare
This removes the "displayable_blocks" property and replaces all the usages with the "child" property.
dca23ca to
41e2f25
Compare
|
@tecoholic 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
|
Forum announcement for this change: https://discuss.openedx.org/t/refactoring-xblock-references/9194. |
|
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
|
EdX Release Notice: This PR has been deployed to the production environment. |
Description
Currently, there are various terms used to refer to XBlocks: xblocks (or blocks), descriptors, modules, or items. This makes the code a lot less approachable and understandable. Since we are getting rid of a lot of tech debt it is a good time to do a quick update of the terminology in the edx-platform to make it consistent.
In this PR:
Convert references using
itemto refer to XBlocks to useblock(e.g. in ItemFactory).Supporting information
This ticket was created from the work started with #31113
Testing instructions
There is nothing specific to be tested, as we are not adding or changing any functionality. However, we can just perform a general testing of LMS and Studio using the following sandbox.
Sandbox LMS: https://pr31384.sandbox.opencraft.hosting/
Sandbox Studio: https://studio.pr31384.sandbox.opencraft.hosting/
Deadline
"None"
Other information
Related PR: mitodl/edx-sga#332 (it's not a blocker, as these integration tests do not seem to be used anywhere).