-
Notifications
You must be signed in to change notification settings - Fork 4.2k
[BD-13][BB-6709] refactor: Delete XModule compatibility code from xml_module.py
#31108
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
[BD-13][BB-6709] refactor: Delete XModule compatibility code from xml_module.py
#31108
Conversation
|
Thanks for the pull request, @0x29a! When this pull request is ready, tag your edX technical lead. |
f39c6cb to
50ded66
Compare
50ded66 to
cb5e0d0
Compare
|
Posting my findings here for now, will add the most important parts to the PR description later. Initial goal of this PR was to remove the compatibility code marked with What exactly was this code for?As far as I could understand, initially the platform didn't have Studio, and all courses consisted of a handwritten OLX. Back then, OLX wasn't standardized, so when Studio was created, edX has to add this compatibility code to 1) support both pre- and post-Studio course formats, and 2) be able to migrate these courses to Studio. Specifically, the compatibility code adds the possibility to embed XML problem description right inside its tag, which should have been deprecated (example of before and after). Without the compatibility code (this, specifically), all problems have to be "pointer tags" and point at separate files. What's the problem with just removing it?It seems to be used to this day. Removing this code breaks hundreds of tests. Most of them, including each from test_import.py, rely on course fixtures in the old format. I've tried importing toy course into the modern platform, exporting it and substituting the fixture OLX with the exported one. This made almost all tests from test_import.py passing, which suggests that they cover valid cases. Another example of a failed test. It's using the problem with inline XML description, and likely tests something important, but without the compatibility code it can't be parsed, as Finally, QuestionsIs there a timeline for removing this code? I see that DataDog counters were added to track what code is using the compatibility code, but then they were removed. Also, tests with the "inline" OLX or importing cc @Agrendalath |
|
😞 Yeah, we can't break OLX as it's being used in the wild, and inline definitions like this are too pervasive at this point to deprecate. So that ability needs to stay, and probably will stay forever. |
7ac3736 to
060a5b0
Compare
| # The attributes will be removed from the definition xml passed | ||
| # to definition_from_xml, and from the xml returned by definition_to_xml | ||
|
|
||
| # Note -- url_name isn't in this list because it's handled specially on | ||
| # import and export. | ||
|
|
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 comment was referring to metadata_attributes and no longer needed.
|
@ormsbee, thank you for confirming. @Agrendalath, as you suggested, I expanded |
xml_module.pyxml_module.py
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.
| # VS[compat] -- make Ike's github preview links work in both old and | ||
| # new file layouts | ||
| # VS[compat] | ||
| # Make Ike's github preview links work in both old and new file layouts. |
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.
What does it mean? Do we still need 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.
@Agrendalath, I couldn't figure this out for sure. This was added in 932a9be, and perhaps is needed for add_staff_markup function, but I don't have any context on https://github.com/MITx to confidently say whether this is still needed. My wild guess: some courses were stored on GitHub, and this was needed to generate "edit" GitHub links for staff.
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: this changes only the comments
- I read through the code
- I checked for accessibility issues: n/a
- Includes documentation
- I made sure any change in configuration variables is reflected in the corresponding client's
configuration-securerepository: n/a
|
@ormsbee, I realized I didn't give a "formal" +1. Would you like to check if we missed anything in the expanded explanations about the compatibility? |
|
@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. |
Description
Expands
VS[compat]comments in thexml_module.pyfile.