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

feat: create runtime mapping for v1 lib keys to v2 #33604

Conversation

connorhaugh
Copy link
Contributor

@connorhaugh connorhaugh commented Oct 26, 2023

https://2u-internal.atlassian.net/browse/TNL-11138

DO not merge yet, dependent on #33511

Testing instructions.

  1. Create several V1 libraries.
  2. Make sure you can create a v2 library
  3. associate all of those libraries with library content blocks in one or more courses.
  4. Run ./manage.py cms --settings=production copy_libraries_from_v1_to_v2 '11111111-2111-4111-8111-111111111111' ./list_of--library-locators.csv --all
  5. make sure things function as normal (they should)
  6. enable the waffle flag content_libraries.map_v1_lib_keys_to_v2_keys
  7. make sure libraries function as normal.
  8. Update a v2 library that has been copied over.
  9. see that those changes have been reflected in your library content block (it gives a message telling you to upgrade the block)

@connorhaugh connorhaugh changed the base branch from master to feat--Library-Content-Block-Reference October 26, 2023 18:46
@connorhaugh connorhaugh marked this pull request as ready for review December 7, 2023 21:00
@connorhaugh connorhaugh changed the title Feat create runtime mapping for v1 lib keys to v2 feat: create runtime mapping for v1 lib keys to v2 Dec 8, 2023
@connorhaugh connorhaugh force-pushed the feat--create-runtime-mapping-for-v1-lib-keys-to-v2 branch from a2a5cf7 to d926bbb Compare December 8, 2023 14:46
fix: type annotation for modulestore

fix: bad conditioanl

fix: remove an obvious flumox

fix: another dumb error

final order fix

fix: final lint fixes

fix: static typing

fix: I learn to do static checks locally
@connorhaugh connorhaugh force-pushed the feat--create-runtime-mapping-for-v1-lib-keys-to-v2 branch from 6de0e25 to 4e5f490 Compare December 8, 2023 15:49
Copy link
Member

@jesperhodge jesperhodge left a comment

Choose a reason for hiding this comment

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

As far as I could tell, everything looks very good and logical.
Not sure where the update behavior is coming from, that when you enable the waffle flag, updates in V2 libraries show in the course - I assume that's not directly part of the code here.
I just made a comment about the tests. It does look like the TODO says, that a few more tests would be good. I suggested an integration test as well but see what you think the best way to go is.

I'll approve this as it does not go directly into master and the tests may be done within one of the other issues, for example.

"""
Tests for getting Libraries behavior, given the MAP_V1_LIBRARIES_TO_V2_LIBRARIES flag.

TODO: tests need to be made for more of the methods in this API.
Copy link
Member

Choose a reason for hiding this comment

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

Yes.

A thought: It would also be nice to see some kind of integration test here, if possible. Less for the specific migration task and more for the end result after migration is done. Basically have an actual course - whether by actually calling the database or by just faking everything - and then test the behavior you described in the testing instructions:

  • course includes the mapped library key for V2
  • updates made to V2 library pop up in course.

Not sure if that's unreasonable or too difficult, it's simply a suggestion if it makes sense.

@kdmccormick kdmccormick added the content libraries misc Libraries Overhaul tech work not captured in the stories label May 15, 2024
@kdmccormick
Copy link
Member

Closing since we will not be doing a 1-1 mapping between v1 and v2 libraries.

@kdmccormick kdmccormick deleted the feat--create-runtime-mapping-for-v1-lib-keys-to-v2 branch May 15, 2024 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content libraries misc Libraries Overhaul tech work not captured in the stories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants