Skip to content

Conversation

@kaustavb12
Copy link
Contributor

@kaustavb12 kaustavb12 commented Feb 15, 2022

Description

The following changes are incorporated in this PR:

  1. Delete XModuleDescriptorToXBlockMixin
  2. From XmlParserMixin deletes attributes metadata_traslations and _translate() and all related implementations.
  3. Remove the translations of the following pairs of deprecated OLX attributes during course imports:
    <old_attr> : <new_attr>
  • 'slug' : 'url_name'
  • 'name' : 'display_name'
  • 'id' : 'discussion_id' (discussion xblock)
  • 'for' : 'discussion_target' (discussion xblock)
  • 'attempts' : 'max_attempts' (capa)

Supporting information

OpenCraft internal ticket BB-5519

Testing instructions

LMS: https://pr29927.sandbox.opencraft.hosting/
Studio: https://studio.pr29927.sandbox.opencraft.hosting/

Studio:

  1. Login as a demo staff (staff@example.com / edx)
  2. Open any sample course or create a new course
  3. Go to Tools > Import and upload file good.tar.gz
  4. After the file has been imported verify all xblocks have loaded correctly
  5. Go to Tools > Export and download file.
  6. Verify the course is correct
  7. Again go to Tools > Import and upload file bad.tar.gz
  8. In this file, the CAPA module is malformed. Verify Error block is imported in place of the CAPA Multiple choice block

@openedx-webhooks openedx-webhooks added blended PR is managed through 2U's blended developmnt program needs triage labels Feb 15, 2022
@openedx-webhooks
Copy link

openedx-webhooks commented Feb 15, 2022

Thanks for the pull request, @kaustavb12! I've created BLENDED-1097 to keep track of it in Jira. More details are on the BD-13 project page.

When this pull request is ready, tag your edX technical lead.

@kaustavb12 kaustavb12 marked this pull request as draft February 15, 2022 14:41
@kaustavb12 kaustavb12 force-pushed the kaustav/delete_serialization_code branch 3 times, most recently from d49e998 to 48b6c91 Compare February 16, 2022 12:01
@kaustavb12 kaustavb12 marked this pull request as ready for review February 16, 2022 12:02
@Agrendalath Agrendalath force-pushed the kaustav/delete_serialization_code branch from 48b6c91 to d201b22 Compare February 21, 2022 20:34
Copy link
Member

@Agrendalath Agrendalath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go once the tests pass.

👍

  • I tested this: tested that the blocks are working within LMS, Studio and Preview; verified that the ErrorBlock is rendering correctly
  • 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-secure repository: n/a

Comment on lines +590 to +602
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: it's fine to keep the code repetition here, as we'll be removing this in a follow-up ticket.

@kaustavb12 kaustavb12 force-pushed the kaustav/delete_serialization_code branch from d201b22 to b678466 Compare February 26, 2022 09:44
@kaustavb12 kaustavb12 force-pushed the kaustav/delete_serialization_code branch from 2a2682e to e5116f0 Compare February 27, 2022 10:01
@Agrendalath
Copy link
Member

@ormsbee, would you like to review this before we merge it?

@ormsbee
Copy link
Contributor

ormsbee commented Mar 15, 2022

@Agrendalath, @kaustavb12: Could you please explain in more detail the changes you made to the OLX data files and what that implies about breaking changes to the serialization format?

@kaustavb12
Copy link
Contributor Author

Hi @ormsbee ! Thanks for reviewing the changes !

As part of this PR, we have removed the translation of legacy attributes which used to happen during course import.

I noticed a few OLX data files also contained these legacy attributes, some of which caused existing test cases to fail, after the current changes.

I have thus changed those legacy attributes to the correct ones in the OLX data files.

This would imply that import of course xmls with legacy format would not be supported after merging of this PR.

cc. @Agrendalath

@ormsbee
Copy link
Contributor

ormsbee commented Mar 16, 2022

@kaustavb12, @Agrendalath: Please spell out exactly what attribute translations will stop working after this commit, and put that information in the PR description and later on in the commit message. If there isn't a DEPR for it, we may have to make one. (It's possible it's on the DEPR board somewhere, in which case great.) We've generally been pretty cautious about breaking backwards compatibility in OLX. This is old and obscure enough where I don't think we will run into trouble, but I do think we need to inform very loudly.

FYI @pdpinch, @dianakhuang, @jristau1984, @doctoryes, @connorhaugh

@Agrendalath
Copy link
Member

@ormsbee,

If there isn't a DEPR for it, we may have to make one. (It's possible it's on the DEPR board somewhere, in which case great.)

We only have a generic DEPR for XModule to XBlock conversion: openedx/public-engineering#70. Should we put this information as a comment there or create a separate DEPR issue?

@ormsbee
Copy link
Contributor

ormsbee commented Mar 16, 2022

Separate issue please. Thank you.

@kaustavb12
Copy link
Contributor Author

kaustavb12 commented Mar 17, 2022

@ormsbee The following pairs of translations have been removed:
<old_attr> : <new_attr>

  • 'slug' : 'url_name'
  • 'name' : 'display_name'
  • 'id' : 'discussion_id' (discussion xblock)
  • 'for' : 'discussion_target' (discussion xblock)
  • 'attempts' : 'max_attempts' (capa)

cc. @Agrendalath

@Agrendalath
Copy link
Member

@ormsbee, I've created openedx/public-engineering#74. I've put dates from the BD-13 discovery, though we can adjust them if needed.
cc: @kaustavb12

@ormsbee
Copy link
Contributor

ormsbee commented Mar 22, 2022

Please set the acceptance date to two weeks from now and announce it in the DEPR section of the forums. I'm sorry if this delays this ticket or hampers other refactoring work, but we have to loudly broadcast anything that may break backwards compatibility with our import/export format, even if it's using really old 2012-compatibility features that we don't think anybody even remembers existing.

@Agrendalath
Copy link
Member

@ormsbee, oh, I've just noticed your comment, as it didn't get through my inbox filters without an explicit mention. I've created the announcement.

I'm sorry if this delays this ticket or hampers other refactoring work, but we have to loudly broadcast anything that may break backwards compatibility with our import/export format, even if it's using really old 2012-compatibility features that we don't think anybody even remembers existing.

Of course, that's understandable. Thank you for your guidance on this.

@Agrendalath Agrendalath merged commit 702866b into openedx:master Apr 21, 2022
@Agrendalath Agrendalath deleted the kaustav/delete_serialization_code branch April 21, 2022 15:15
@openedx-webhooks
Copy link

@kaustavb12 🎉 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-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR may have caused e2e tests to fail on Stage. If you're a member of the edX org, please visit #e2e-troubleshooting on Slack to help diagnose the cause of these failures. Otherwise, it is the reviewer's responsibility. E2E tests have failed. https://gocd.tools.edx.org/go/tab/pipeline/history/deploy_to_stage

@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

jawad-khan pushed a commit that referenced this pull request Jun 14, 2022
This:
1. Deletes XModuleDescriptorToXBlockMixin
2. Deletes `metadata_traslations` and `_translate()` from `XmlParserMixin`,
    and all related implementations.
3. Removes translations of deprecated OLX attributes during import/export:
    <old_attr> : <new_attr>
    - 'slug' : 'url_name'
    - 'name' : 'display_name'
    - 'id' : 'discussion_id' (Discussion XBlock)
    - 'for' : 'discussion_target' (Discussion XBlock)
    - 'attempts' : 'max_attempts' (CAPA)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blended PR is managed through 2U's blended developmnt program merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants