Repository navigation
feat: migrate the games block to xblocks-core - #316
samuelallan72 wants to merge 5 commits into
Conversation
|
Thanks for the pull request, @samuelallan72! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
ede801b to
ed81c10
Compare
fbba15d to
4a9cac9
Compare
4a9cac9 to
ce864b7
Compare
Kelketek
left a comment
There was a problem hiding this comment.
@samuelallan72 I've given this an initial pass. I think I need to do some research before merging this in (and also double-check we're clear to on the product side.) See my comments for potential pitfalls.
I see there's a bunch of encryption machinery. It doesn't appear to actually be used. Can you verify if it's used, and if it's not, rip it and its associated tests out?
| } | ||
|
|
||
| # Games XBlock specific settings | ||
| GAMESXBLOCK_STORAGE = None # Use default storage for tests |
There was a problem hiding this comment.
Noting that if we have settings like this, they should use the XBLOCKS_SETTINGS convention.
We probably need to refactor this. Using an external storage breaks import/export guarantees. We may need to do this in a follow-up-- we'd need to update the frontend and backend to handle the uploads differently. The PDF block editor in frontend-app-authoring has an example of how uploads can be handled there, and we already know how we can handle uploaded images from our experience in the exemplar blocks.
There was a problem hiding this comment.
@Kelketek Yep I figured this would be a follow up change, because it would involve deprecating the GAMESXBLOCK_STORAGE setting.
Huh it's not used. I've removed them now. Nice catch :) |
| # 'Done' XBlocks -- ones that are ready for general use today, | ||
| # and have been migrated fully from edx-platform or their original repository. | ||
| pdf = "xblock_pdf:PDFBlock" | ||
| games = "xblock_flashcards_matching:FlashcardsMatchingXBlock" |
There was a problem hiding this comment.
Please let me know if this entrypoint id should be updated. Leaving it at "games" will enable backward compatibility with any existing components. However, it may be confusing long-term.
We may also want a temporary id for testing, like some of the others above.
There was a problem hiding this comment.
@samuelallan72 It should be updated, yes. A temporary ID would be fine for now, and making sure the README is updated to indicate 'In Development' status would be important here-- which it looks like you've already done.
There was a problem hiding this comment.
Actually, it looks like we'll need to do two separate IDs for two different blocks.
I'd rather we not use temporary IDs now that I think about it, since we want the frontend authoring functionality to work with the actual names we'll be using. So this will mean we need to use 'flashcards' and 'matching' as the names. That may cause conflicts with the separate 'matching' and 'flashcards' blocks we've made for WGU, but they won't be hitting this newer version of XBlocks-core for a while (it wouldn't land until Willow) so there will be lead-time to migrate. cc @pkulkark
There was a problem hiding this comment.
@Kelketek got it, thanks.
this will mean we need to use 'flashcards' and 'matching' as the names. That may cause conflicts with the separate 'matching' and 'flashcards' blocks we've made for WGU
These names are arbitrary though, so can we namespace them and use something like "openedx_flashcards_ and "openedx_matching"?
One concern: do we want this games block to be backwards compatible with any existing components/courses?
There was a problem hiding this comment.
@samuelallan72 Now that it's split, and the names are changed, it can't be backwards-compatible. edX will have to migrate their data or else recreate the blocks in their relevant courses. However, they would have to do so anyway, as the file storage method alone will require migration work.
We will just need to keep them posted so they know what they need to do, and how they can keep the old block alive a while longer if they need to. We're already giving them a path there by making sure the name isn't overwritten, so the old block will still work for learners until they migrate. We will have to change the authoring to recognize the new names, though, and remove the 'type' switch toggle, so those old blocks will lose editability and will be frozen.
cc @jristau1984 see above
There was a problem hiding this comment.
Disappointing that we need to migrate content even before the block is fully in the core... but it appears there is nothing we can do about it, so I have no further objections.
|
@samuelallan72 Per your question on the proposal, and discussion with WGU: Yes, we'd like to bifurcate the block. Do you think you'd be able to do so in this PR or would that be too much to carry in this sprint? We will need an additional ticket for next sprint that updates frontend-app-authoring to adjust to this change. Could you create one? |
|
@Kelketek it probably makes sense to split the block is this PR; I can do that. I can also create the ticket 👍 |
|
@samuelallan72 The CI is failing, and a good part of it is untested code. Part of it is easy-to-fix lint issues, but another part is test coverage. I'm guessing a lot of the code that is uncovered is intended to be removed. We have two options here: We could just remove the soon-to-be-dead code now and add tests for what remains even if that means a non-functional block, since it will be non-functional anyway due to lack of authoring being ready. The other option would be to put this PR on ice until authoring is ready to go with it and merge them together. That option is probably cleaner. In any case there are still a couple of threads talking on the product proposal, so maybe icing it is the best way. What do you think? Anything else you think we should hit before hitting pause here, if so? |
|
@Kelketek re the missing tests, I still need to re-add tests. I removed them when I split the xblocks because of course that broke every test. I can absolutely do that, but I'm a little loath to while things are in flux still. Agreed regarding putting it on ice until authoring is sorted out, because currently it's hard to test them without authoring. It would be nice to figure out some more simplifications and modernisations too before merging - including the obfuscation which I don't think is necessary any more, and porting more things to pydantic. |
583d517 to
00a43a1
Compare
Migrate the XBlock from https://github.com/edx/gamesxblock to this repository. In the process, split them into two separate xblocks: matching and flashcards. Also do some rework on the new blocks to modernise the code, remove unused functions, etc. Private-ref: https://tasks.opencraft.com/browse/BB-11332
00a43a1 to
13db65c
Compare
- we'll use course/library asset storage for uploads, so we won't need the custom file handling here - for ease of use, the card data structure has been updated
|
Hi @feanil, @Kelketek, @samuelallan72 I'd like to understand whether this block would be a good fit for |
|
Hi @farhan ! The main product proposal for this is here. The editor for the games block is already merged into the authoring MFE, although now that it's been decided to bifurcate the games block into two separate blocks, Sam is also working on that. |
Description
Migrate the XBlock from https://github.com/edx/gamesxblock to this repository.
I've tried to keep things as close to the source as possible to make review easier. I have done some very minor refactoring (mostly renaming
gamestoxblock_gamesto match conventions and fixing lints withruff check . --fixandruff format .).Supporting information
Private-ref: https://tasks.opencraft.com/browse/BB-11332
This is being developed in tandem with openedx/frontend-app-authoring#3351
Testing instructions
pip uninstall xblocks-contribto avoid conflicting plugins when you install this branch.Merge checklist:
Check off if complete or not applicable: