Skip to content
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

[FC-0049] feat: Serialize tag data in OLX for blocks #34145

Conversation

yusuf-musleh
Copy link
Member

@yusuf-musleh yusuf-musleh commented Jan 30, 2024

Description

This PR serializes applied tags on various blocks and includes them in the OLX when they are copied. The format of the serialized tags are based on openedx/modular-learning#174

Supporting information

Related Ticket:

Testing instructions

  1. Start you localdev stack on this branch
  2. Make sure you have Taxonomy/Tags data setup locally: https://github.com/open-craft/taxonomy-sample-data/
  3. Once you have a course with a bunch of units and blocks with tags applied, trying copying units and various types of blocks
  4. For each copy, double check that staged content contains the tags data and there are no issues with pasting
  5. Also confirm that when copying a unit/block that contains no tag, the tags-v1 is not included in the OLX
  6. Finally, make sure the tests cover the various cases.
  7. For the OpenAssessmentBlock to work, you should setup [FC-0049] feat: Serialize tag data in OpenAssessmentBlocks edx-ora2#2171 locally

Private-ref: FAL-3605

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jan 30, 2024
@openedx-webhooks
Copy link

Thanks for the pull request, @yusuf-musleh! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@ChrisChV
Copy link
Contributor

ChrisChV commented Jan 31, 2024

@yusuf-musleh I tested with an openassessment block and the tags are not saved in the OLX (on the Sample Taxonomy Course > Unit 2.1.1)

@yusuf-musleh yusuf-musleh force-pushed the yusuf-musleh/serialize-tag-data-in-olx branch 11 times, most recently from dd0e575 to 0980c09 Compare February 1, 2024 16:19
setup.cfg Outdated Show resolved Hide resolved
@yusuf-musleh yusuf-musleh force-pushed the yusuf-musleh/serialize-tag-data-in-olx branch 4 times, most recently from daeeeff to e5a7f5b Compare February 4, 2024 19:57
@yusuf-musleh yusuf-musleh force-pushed the yusuf-musleh/serialize-tag-data-in-olx branch 3 times, most recently from 7b66704 to 2cd2f09 Compare February 5, 2024 13:22
@yusuf-musleh
Copy link
Member Author

yusuf-musleh commented Feb 5, 2024

@ChrisChV I fixed the issued for OpenAssessmentBlocks, turns out we needed to make changes to the edx-ora2 repo, not sure if that is the best approach or not, but it works. There's just some test coverage that is missing. To test it out, you'd need to setup openedx/edx-ora2#2171 locally for it to work.

I've added a test case for it as well.

@yusuf-musleh yusuf-musleh force-pushed the yusuf-musleh/serialize-tag-data-in-olx branch 4 times, most recently from 19ba8b0 to 39ff436 Compare February 12, 2024 10:44
@yusuf-musleh yusuf-musleh changed the title feat: Serialize tag data in OLX for blocks [FC-0049] feat: Serialize tag data in OLX for blocks Feb 12, 2024
Copy link
Contributor

@ChrisChV ChrisChV left a comment

Choose a reason for hiding this comment

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

@yusuf-musleh Thanks for this work! 👍

  • I tested this: I followed the testing instructions.
  • I read through the code and considered the security, stability and performance implications of the changes.
  • Includes tests for bugfixes and/or features added.
  • Includes documentation

@@ -992,7 +992,7 @@ optimizely-sdk==4.1.1
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/base.txt
ora2==6.0.31
ora2 @ git+https://github.com/open-craft/edx-ora2@yusuf-musleh/serialize-tag-data-in-openassessment-olx
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you remove this change from the diff for now? We can merge them independently.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I see, this has tests that depend on that PR. OK, we'll have to wait. Please ping me when the other PR has merged, and then I can merge this one.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup, will do.

@yusuf-musleh yusuf-musleh force-pushed the yusuf-musleh/serialize-tag-data-in-olx branch from 39ff436 to 9a2bdaa Compare February 14, 2024 11:08
@yusuf-musleh
Copy link
Member Author

yusuf-musleh commented Feb 14, 2024

@bradenmacdonald The ora2 PR has been merged, and the requirements in this PR are updated. It should be should be good to go.

edit: Accidentally clicked on close PR, my bad.

@bradenmacdonald bradenmacdonald merged commit 6e0bc66 into openedx:master Feb 14, 2024
90 checks passed
@bradenmacdonald bradenmacdonald deleted the yusuf-musleh/serialize-tag-data-in-olx branch February 14, 2024 18:30
@openedx-webhooks
Copy link

@yusuf-musleh 🎉 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

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

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

"""
)

def test_tagged_openassessment_block(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

@yusuf-musleh @bradenmacdonald @ChrisChV

This test, relies on the openassessment block which comes from ora2 and having this test here caused an interesting issue. When new attributes got added to the block in the edx-ora2 repo, it broke this test because the expected OLX in this repo did not have the new attributes. This seems like bad coupling across repos and my instinct would be to move/remove this specific test. But I'm not sure what the specific goals of this test and how important it is. Can we remove this from the edx-platform repo?

Copy link
Member Author

Choose a reason for hiding this comment

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

@feanil The implementation/tests got updated since and now tags are no longer serialized and included in the actual OLX. So we could actually change the test case, namely changing this assert to just check that there is no tags data in the OLX, and we can get rid of EXPECTED_OPENASSESSMENT_OLX since we would no longer need it.

That way it wouldn't cause issues when attributes are added/removed from the ora2, and avoids removing the test case, does that sound like a reasonable approach?

Copy link
Contributor

Choose a reason for hiding this comment

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

@yusuf-musleh that sounds great, please make that change and add a link to the PR here.

Copy link
Member Author

Choose a reason for hiding this comment

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

@feanil Sure thing, here it is #34782

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants