[BD-13][BB-6735] refactor: Unify XBlock naming - #31113
Conversation
|
Thanks for the pull request, @0x29a! When this pull request is ready, tag your edX technical lead. |
7319287 to
d8af31b
Compare
36d9603 to
993bd0a
Compare
Agrendalath
left a comment
There was a problem hiding this comment.
@0x29a, the code looks good to me, but how can I test it locally? I followed the steps defined here, purged all caches, and recreated my devstack, but I keep getting the following exception:
Traceback (most recent call last):
File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python3.8/contextlib.py", line 75, in inner
return func(*args, **kwds)
File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/utils/decorators.py", line 130, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/util/maintenance_banner.py", line 42, in _decorated
return func(request, *args, **kwargs)
File "/edx/app/edxapp/edx-platform/common/djangoapps/student/views/dashboard.py", line 652, in student_dashboard
errored_courses = modulestore().get_errored_courses()
File "/edx/app/edxapp/edx-platform/xmodule/modulestore/django.py", line 330, in modulestore
_MIXED_MODULESTORE = create_modulestore_instance(
File "/edx/app/edxapp/edx-platform/xmodule/modulestore/django.py", line 303, in create_modulestore_instance
return class_(
File "/edx/app/edxapp/edx-platform/xmodule/modulestore/mixed.py", line 160, in __init__
store = create_modulestore_instance(
File "/edx/app/edxapp/edx-platform/xmodule/modulestore/django.py", line 303, in create_modulestore_instance
return class_(
File "/edx/app/edxapp/edx-platform/xmodule/modulestore/split_mongo/split.py", line 659, in __init__
class_ = getattr(import_module(module_path), class_name)
File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'xmodule.hidden_module'|
@Agrendalath, ah, I forgot to mention this in the PR description. You have to run |
@0x29a, this one did the trick. Thanks! |
|
@0x29a, could you please rebase the PR? |
9ba4cba to
a3b48cf
Compare
a3b48cf to
3252e1c
Compare
This also handles the AttributeError in the default XBlock class fallback.
1375842 to
ae1dcbe
Compare
|
@0x29a 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
|
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. |
|
This is awesome. Great work to everyone involved in getting this point 🎸⚡ |
Description
Since the XModules framework legacy code is being removed, it's time to unify the terms used to refer to XBlocks.
As there are tens of thousands occurrences of
module,descriptoranditemacross the platform code, this PR covers getting rid of themoduleterm in the context of renaming XBlocks files in thexmodule/directory.Specifically, this PR:
xmodule/annotatable_module.py->xmodule/annotatable_block.pyxmodule/capa_module.py->xmodule/capa_block.pyxmodule/conditional_module.py->xmodule/conditional_block.pyxmodule/course_module.py->xmodule/course_block.pyxmodule/editing_module.py->xmodule/editing_block.pyxmodule/error_module.py->xmodule/error_block.pyxmodule/hidden_module.py->xmodule/hidden_block.pyxmodule/html_module.py->xmodule/html_block.pyxmodule/library_content_module.py->xmodule/library_content_block.pyxmodule/lti_module.py->xmodule/lti_block.pyxmodule/mako_module.py->xmodule/mako_block.pyxmodule/poll_module.py->xmodule/poll_block.pyxmodule/randomize_module.py->xmodule/randomize_block.pyxmodule/raw_module.py->xmodule/raw_block.pyxmodule/seq_module.py->xmodule/seq_block.pyxmodule/template_module.py->xmodule/template_block.pyxmodule/word_cloud_module.py->xmodule/word_cloud_block.pyxmodule/wrapper_module.py->xmodule/wrapper_block.pyxmodule/xml_module.py->xmodule/xml_block.pyxmodule/video_module->xmodule/video_blockandxmodule/video_module/video_module.py->xmodule/video_block/video_block.pyxmodule/split_test_module.py->xmodule/split_test_block.pycourse module/course_module/coursemodulein comments, string constants and function names (where it's safe).*.pofiles.Supporting information
- ❗ Can be breaking, asWe have introduced a fallback mechanism when theMODULESTOREDjango setting has to be updated to reflect the changedHiddenBlockpath.default_classcannot be imported.Testing instructions
Use https://extpr31113.sandbox.opencraft.hosting (email:
staff@example.com, password:edx) to perform general testing.