[BD-13] [BB-5967] refactor: deprecate get_module and descriptor_runtime attributes from ModuleSystem#30436
Conversation
|
Thanks for the pull request, @kaustavb12! I've created BLENDED-1233 to keep track of it in Jira. More details are on the BD-13 project page. This is currently a draft pull request. When it is ready for our review and all tests are green, click "Ready for Review", or remove "WIP" from the title, as appropriate. |
c6976aa to
8ef2622
Compare
a99af04 to
db4a335
Compare
|
Update: we're moving this to the point when we'll be merging the |
|
@kaustavb12 Just checking if this is still needs to be a draft. Do you know when this will be ready for a review? |
|
@natabene Sorry for not responding here .. I somehow missed the ping. @Agrendalath Thanks |
|
Closing, as this is handled in #31472. |
|
@kaustavb12 Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future. |
Description
Builds on the shim added by #29190 to deprecate the following
ModuleSystemattributes:get_module: in favour of the newModuleServicedescriptor_runtime: TheDescriptorSystemobject was passed toModuleSystemusing this attribute.This was used to access the
id_reader,id_generatorandget_blockproperties of the theDescriptorSystemfrom theModuleSystem. Each of these are now being handled differently as explained below and so thisdescriptor_runtimeattribute has been removed and has not been replaced with anything else.How the properties of
DescriptorSystemwhich were accessed fromModuleSystemare now being handled:id_reader: This property of theDescriptorSystemwas fetched to set theid_readerkeyword argument of theModuleSystemin its__init__method as this is required by the baseRuntimeclass. This is now being supplied during initialization as keyword argument from the calling functions.id_generator: Same asid_readerget_block: This property of theDescriptorSystemwas invoked from theget_blockmethod of theModuleSystemto fetch the block descriptor based onblock_idandfor_parent. This descriptor was then passed toget_modulemethod (being deprecated) to bind the user data and module system.As part of the PR, we have removed the
get_blockmethod from theModuleSystemand created a newget_blockmethod in theCombinedSystemclass. Here, theget_blockmethod of the descriptor_system is invoked to fetch the block. Further, its checked if the_module_systemis initalized and if it contains the newModuleService. If so, then this service is used to bind the user data and module system to the block descriptor.This change should not affect any user of edx-platform
Supporting information
BB-5967 - OpenCraft internal ticket
Testing instructions
LMS: https://pr30436.sandbox.opencraft.hosting/
Studio: https://studio.pr30436.sandbox.opencraft.hosting/
LMS:
Studio: