refactor: rename ModuleStore runtimes now that XModules are gone (#35523)

* Consolidates and renames the runtime used as a base for all the others:
  * Before: `xmodule.x_module:DescriptorSystem` and
            `xmodule.mako_block:MakoDescriptorSystem`.
  * After:  `xmodule.x_module:ModuleStoreRuntime`.

* Co-locates and renames the runtimes for importing course OLX:
  * Before: `xmodule.x_module:XMLParsingSystem` and
            `xmodule.modulestore.xml:ImportSystem`.
  * After:  `xmodule.modulestore.xml:XMLParsingModuleStoreRuntime` and
            `xmodule.modulestore.xml:XMLImportingModuleStoreRuntime`.
  * Note: I would have liked to consolidate these, but it would have
          involved nontrivial test refactoring.

* Renames the stub Old Mongo runtime:
  * Before: `xmodule.modulestore.mongo.base:CachingDescriptorSystem`.
  * After: `xmodule.modulestore.mongo.base:OldModuleStoreRuntime`.

* Renames the Split Mongo runtime, the which is what runs courses in LMS and CMS:
  * Before: `xmodule.modulestore.split_mongo.caching_descriptor_system:CachingDescriptorSystem`.
  * After: `xmodule.modulestore.split_mongo.runtime:SplitModuleStoreRuntime`.

* Renames some of the dummy runtimes used only in unit tests.
This commit is contained in:
Kyle McCormick
2025-10-29 15:46:07 -04:00
committed by GitHub
parent 31b1e6ecc4
commit 834cb9482d
42 changed files with 327 additions and 310 deletions

View File

@@ -304,7 +304,7 @@ class XmlMixin:
Returns (XBlock): The newly parsed XBlock
"""
from xmodule.modulestore.xml import ImportSystem # done here to avoid circular import
from xmodule.modulestore.xml import XMLImportingModuleStoreRuntime # done here to avoid circular import
if keys is None:
# Passing keys=None is against the XBlock API but some platform tests do it.
@@ -361,9 +361,10 @@ class XmlMixin:
if "filename" in field_data:
del field_data["filename"] # filename should only be in xml_attributes.
if isinstance(runtime, ImportSystem):
# we shouldn't be instantiating our own field data instance here, but there are complex inter-depenencies
# between this mixin and ImportSystem that currently seem to require it for proper metadata inheritance.
if isinstance(runtime, XMLImportingModuleStoreRuntime):
# we shouldn't be instantiating our own field data instance here, but there are complex
# inter-depenencies between this mixin and XMLImportingModuleStoreRuntime that currently
# seem to require it for proper metadata inheritance.
kvs = InheritanceKeyValueStore(initial_values=field_data)
field_data = KvsFieldData(kvs)
xblock = runtime.construct_xblock_from_class(cls, keys, field_data)