The docs settings file needed an update for a new djangoapp that was
added. Long term we need to probably think more deeply about how we want
the LMS/CMS docs builds to work. Do we want to separate them, or make
it easier to have a django settings file that will work with both. For
now, we have a single settings file that is referenced for the docs
build so it needs to have all the installed apps from both.
With the settings re-organization the docs settings file was missing a
setting needed to properly run django. This wasn't caught in CI because
the docs build is slow enough that we don't run it on every PR.
These app models get pulled in when trying to build the OpenAPI docs so
we need their relevant apps installed into the environment used to
generate the docs.
* feat: add more authentication information to swagger
* updates the `docs-settings` to make the generated swagger
`securityDefinitions` include both JWT and CSRF methods, as well as
basic. A few linter fixes happened as a side effect.
* Put in wordier descriptions for all three, since we don't have great
shared documentation about authn/authz.
* Added CSRF to `login_session`, which also serves as a proof of concept
for other endpoits
* Also regenerated the swagger doc, which picked up some extra changes.
Generated swagger now has help and allows extra auth methods so some
preveiously unusable endpoints can be hit.
FIXES: APER-3554
The V2 libraries project had a few past iterations which were never
launched. This commit cleans up pieces from those which we don't need
for the real Libraries Relaunch MVP in Sumac:
* Remove ENABLE_LIBRARY_AUTHORING_MICROFRONTEND,
LIBRARY_AUTHORING_FRONTEND_URL, and
REDIRECT_TO_LIBRARY_AUTHORING_MICROFRONTEND, all of which are obsolete
now that library authoring has been merged into
https://github.com/openedx/frontend-app-authoring.
More details on the new Content Libraries configuration settings are
here: https://github.com/openedx/frontend-app-authoring/issues/1334
* Remove dangling support for syncing V2 (learning core-backed) library
content using the LibraryContentBlock. This code was all based on an
older understanding of V2 Content Libraries, where the libraries were
smaller and versioned as a whole rather then versioned by-item.
Reference to V2 libraries will be done on a per-block basis using
the upstream/downstream system, described here:
https://github.com/openedx/edx-platform/blob/master/docs/decisions/0020-upstream-downstream.rst
It's important that we remove this support now so that OLX course
authors don't stuble upon it and use it, which would be buggy and
complicate future migrations.
* Remove the "mode" parameter from LibraryContentBlock. The only
supported mode was and is "random". We will not be adding any further
modes. Going forward for V2, we will have an ItemBank block for
randomizing items (regardless of source), which can be synthesized
with upstream referenced as described above. Existing
LibraryContentBlocks will be migrated.
* Finally, some renamings:
* LibraryContentBlock -> LegacyLibraryContentBlock
* LibraryToolsService -> LegacyLibraryToolsService
* LibrarySummary -> LegacyLibrarySummary
Module names and the old OLX tag (library_content) are unchanged.
Closes: https://github.com/openedx/frontend-app-authoring/issues/1115
Refactors and reworks the LibraryContentBlock so that its
sync-from-library operations are asynchronous and work with
V2 content libraries. This also required us to make
library_content block duplication asynchronous, as that
involves syncing from the source library.
For the sake of clarity, this PR includes two major method renames:
* update_children(...) -> sync_from_library(...)
* refresh_library(...) -> sync_from_library(upgrade_to_latest=True, ...)
an an XBlock HTTP handler rename:
/refresh_children -> /upgrade_and_sync
There are still a couple issues with import or duplication
of library_content blocks referencing V2 libraries other than
latest. These will be resolved in an upcoming PR.
Part of: https://openedx.atlassian.net/wiki/spaces/COMM/pages/3820617729/Spec+Memo+Content+Library+Authoring+Experience+V2
Follow-up work: https://github.com/openedx/edx-platform/issues/33640
Co-authored-by: Connor Haugh <chaugh@2u.com>
Co-authored-by: Eugene Dyudyunov <evgen.dyudyunov@raccoongang.com>
Instead of trying to use the devstack settings file for building docs,
use the common settings file as the base for all settings. The
devstack settings file builds on top of the production settings file
which are both oriented around reading settings from a yaml file and
getting them loaded in sanely into the dev and production environment.
For documentation, start with the common settings files which should be
sufficient to get a default version of the system up and running.
Note: We still leave the loop that enables all the feature flags as a way
of finding conditionally included API endpoints.
The docs configuration files previously had to account
for the fact that lms/djangoapps, cms/djangoapps, and
common/djangoapps were hacked into sys.path. As of ~Lilac,
this is no longer the case.
Unrelated cleanup: devstack_docker and devstack
are now aliases, so we can simplify a conditional import
in docs_settings.py
API docs generation was being blocked by missing values in the doc
settings. We wanted to update the swagger.yml to get the toggle state
("/toggles/v0/state/") endpoint in the docs.