labxchange / labxchange-xblocks

XBlocks for LabXchange
Apache License 2.0
2 stars 4 forks source link

[LX-2281] Adds BlockstoreService for when openedx is not available #31

Closed pomegranited closed 2 years ago

pomegranited commented 2 years ago

This PR allows these XBlocks to be run outside of Open edX by adding an optional "blockstore" service, which knows how to interact with the Blockstore/Content Libraries APIs to access the data that Open edX access directly.

The BlockstoreService itself is in the LabXchange code, but can be upstreamed if it's found to be broadly useful. (So far, no one else but LabXchange are using these XBlocks.)

Here, we also change the license from AGPL to Apache 2.0, so this repo can be included in the LabXchange private source code.

Testing instructions

This branch is installed as part of labxchange-dev#1632, so part of this change can be tested as part of that.

Additionally, please test that this branch works fine in the LMS/Studio by:

Automated testing:

  1. Install this branch on devstack.
  2. Follow instructions to run tests

Author notes & concerns

  1. Currently, 7 tests are failing on the master branch of this repo. These tests are still failing in this branch; I can remedy them if required.
  2. After merging, we'll tag a new release: 0.9.0
pomegranited commented 2 years ago

Oops, I meant to close https://github.com/open-craft/xblock-runtime-lib/pull/1, not this one.. 😬

pomegranited commented 2 years ago

This changes breaks lx_image, lx_document, and lx_narrative blocks because they rely on submit_studio_edits for saving changes, which comes from StudioEditableXBlockMixin.

Ach, good catch @giovannicimolin ! See https://github.com/open-craft/labxchange-xblocks/pull/31/commits/2029fb85f417810b4c52afe1dc8a0c593043eb41 -- I've maintained this dependency for when labxchange_xblocks is installed on the platform, since that's where the studio endpoints are called. We'll need to rethink how to handle these field changes as part of our migration away from Open edX.

CC @symbolist