299 Commits

Author SHA1 Message Date
Kyle McCormick
c70bfe980a build!: Switch to openedx-core (renamed from openedx-learning) (#38011)
build!: Switch to openedx-core (renamed from openedx-learning)

Instead of installing openedx-learning==0.32.0, we install openedx-core==0.34.1.
We update various class names, function names, docstrings, and comments to
represent the rename:

* We say "openedx-core" when referring to the whole repo or PyPI project
  * or occasionally "Open edX Core" if we want it to look nice in the docs.
* We say "openedx_content" to refer to the Content API within openedx-core,
   which is actually the thing we have been calling "Learning Core" all along.
  * In snake-case code, it's `*_openedx_content_*`.
  * In camel-case code, it's `*OpenedXContent*`

For consistency's sake we avoid anything else like oex_core, OeXCore,
OpenEdXCore, OexContent, openedx-content, OpenEdxContent, etc.
There should be no more references to learning_core, learning-core, Learning Core,
Learning-Core, LC, openedx-learning, openedx_learning, etc.

BREAKING CHANGE: for openedx-learning/openedx-core developers:
You may need to uninstall openedx-learning and re-install openedx-core
from your venv. If running tutor, you may need to un-mount openedx-learning,
rename the directory to openedx-core, re-mount it, and re-build.
The code APIs themselves are fully backwards-compatible.

Part of: https://github.com/openedx/openedx-core/issues/470
2026-02-18 22:38:25 +00:00
Taylor Payne
7111e8b18c refactor: bring common settings into common module (#37746) 2026-01-09 09:20:59 -07:00
Taylor Payne
d592784b35 refactor: lift shared test settings up to common module (#37714) 2025-12-04 16:50:12 -07:00
Feanil Patel
92a47097b7 feat: Drop the ENABLE_OAUTH2_PROVIDER flag.
This setting was not actually not changing installation behavior, that
is being set by whether oauth_dispatch is in INSTALLED_APPS or not.

This flag was being used to:

* Hide enable/disable certain URL paths.
    * We need these paths on all the time in the LMS because all other
      services and MFE rely on oauth to authenticate with the LMS so we
      just end up turning this on later in the settings stack.

* We use it to only run certain oauth_dispatch tests in the LMS test
  environment because the oauth_dispatch app is not installed in the
  CMS.
    * We use the `skip_unless_lms` decorator now instead to do this or
      just run the tests in both suites because they are valid tests in
      both contexts.
2025-11-03 12:54:06 -05:00
Serhii Nanai
f018cfe70e feat: update course_about & catalog link generation 2025-09-23 20:45:01 +03:00
Feanil Patel
36e458d957 fix: Use CI oriented FakeWebpackLoader
This was added in a newer version of django-webpack loader to be used in
CI.  Previously we had some monkey patches to deal with this but they
could break when changes happen to the upstream django-webpack-loader
library.

This should be a more robust solution to keep CI working and to reduce
complexity on future upgrades.
2025-09-18 10:42:26 -04:00
coder1918
790a67a0d1 refactor: flatten FEATURES dictionary with backward compatible proxy 2025-09-09 14:11:39 -06:00
Ram Chandra Bhavirisetty
42afa1bb62 chore: remove deprecated DEFAULT_FILE_STORAGE and STATICFILES_STORAGE settings (#37002) 2025-09-05 17:52:33 -04:00
Taylor Payne
16d96565e3 refactor: move production defaults to common modules (#37045)
In the effort to simplify settings in edx-platform, as discussed in ADR 22 -
Settings Simplification, this PR brings some of the production defaults defined
in `lms/envs/production.py` and `cms/envs/production.py` up to
`openedx/envs/common.py` or `lms/envs/common.py` and `cms/envs/common.py` as
appropriate.

Bringing these defaults up from the `production.py` settings modules caused
changes in the rendered settings of the `test.py` modules, and so I have
settings to the `test.py` modules to bring the rendered settings back in line
with what is has been. I have not deeply looked at which settings are needed
for tests to pass or not, but just the differences between the rendered
settings between `master` and this branch.

ADR 22: https://github.com/openedx/edx-platform/blob/master/docs/decisions/0022-settings-simplification.rst
Fixes https://github.com/openedx/edx-platform/issues/36892.
2025-08-04 17:06:16 -04:00
Robert Raposa
f4c3575bb0 Revert "fix(settings): replace DEFAULT_FILE_STORAGE with STORAGES[default]" (#36907)
This reverts commit 39028b9500.
2025-06-13 16:57:47 +00:00
Ram Chandra Bhavirisetty
39028b9500 fix(settings): replace DEFAULT_FILE_STORAGE with STORAGES[default] 2025-06-13 11:40:56 -04:00
Awais Qureshi
be09d1cd18 fix: removing deprecated SHA1PasswordHasher from tests. (#36881) 2025-06-09 16:31:51 -04:00
Muhammad Adeel Tajamul
76f872cc1e chore: added notifications configuration in cms (#36791) 2025-05-26 13:35:48 +05:00
Feanil Patel
88c7cd7bf3 feat!: Remove Legacy Preview Functionality (#36460)
* feat!: Remove all trivial mentions of PREVIEW_LMS_BASE

There are a few more mentions but these are all the ones that don't need
major further followup.

BREAKING CHANGE: The learning MFE now supports preview functionality
natively and it is no longer necessary to use a different domain on the
LMS to render a preview of course content.

See https://github.com/openedx/frontend-app-learning/issues/1455 for
more details.

* feat: Drop the `in_preview_mode` function.

Since we're no longer using a separate domain, that check always
returned false.  Remove it and update any places/tests where it is used.

* feat: Drop courseware_mfe_is_active function.

With the removal of the preview check this function is also a no-op now
so drop calls to it and update the places where it is called to not
change other behavior.

* feat!: Drop redirect to preview from the legacy courseware index.

The CoursewareIndex view is going to be removed eventually but for now
we're focusing on removing the PREVIEW_LMS_BASE setting.  With this
change, if someone tries to load the legacy courseware URL from the
preview domain it will no longer redirect them to the MFE preview.

This is not a problem that will occur for users coming from existing
studio links because those links have already been updated to go
directly to the new urls.

The only way this path could execute is if someone goes directly to the
old Preview URL that they saved off platform somewhere.  eg. If they
bookmarked it for some reason.

BREAKING CHANGE: Saved links (including bookmarks) to the legacy preview
URLs will no longer redirect to the MFE preview URLs.

* test: Drop the set_preview_mode test helper.

This test helper was setting the preview mode for tests by changing the
hostname that was set while tests were running.  This was mostly not
being used to test preview but to run a bunch of legacy courseware tests
while defaulting to the new learning MFE for the courseware.

This commit updates various tests in the `courseware` app to not rely on
the fact that we're in preview to test legacy courseware behavior and
instead directly patches either the `_redirect_to_learning_mfe` function
or uses the `_get_legacy_courseware_url` or both to be able to have the
tests continue to test the legacy coursewary.

This will hopefully make the tests more accuarte even though hopefully
we'll just be removing many of them soon as a part of the legacy
courseware cleanup.

We're just doing the preview removal separately to reduce the number of
things that are changing at once.

* test: Drop the `_get_urls_function`

With the other recent cleanup, this function is no longer being
referenced by anything so we can just drop it.

* test: Test student access to unpublihsed content.

Ensure that students can't get access to unpublished content.
2025-05-14 08:59:11 -04:00
Deborah Kaplan
29de9b2dc4 feat!: Legacy account, profile, order history removal (#36219)
* feat!: Legacy account, profile, order history removal

This removes the legacy account and profile applications, and the order
history page. This is primarily a reapplication of #31893, which was
rolled back due to prior blockers.

FIXES: APER-3884
FIXES: openedx/public-engineering#71


Co-authored-by: Muhammad Abdullah Waheed <42172960+abdullahwaheed@users.noreply.github.com>
Co-authored-by: Bilal Qamar <59555732+BilalQamar95@users.noreply.github.com>
2025-02-10 14:39:13 -05:00
Rômulo Penido
4f13ee0171 fix: advanced editor styling on library authoring [FC-0076] (#36146)
Fixes the styles for the advanced editors (poll, survey, LTI Provider, etc). Updated the code if `xblock_v2/xblock_iframe.html` to use `course-unit-mfe-iframe-bundle.scss`
2025-01-30 17:36:21 +00:00
David Ormsbee
77e683d5b6 feat: new view & API calls to serve content library assets (#35639)
This commit adds a new view to serve static assets for content
libraries, along with Content Library API calls to add, delete, and get
metadata about these assets. These assets come from Learning Core and
should ONLY BE ACCESSED FROM STUDIO. Users must have read access to the
library in order to see an asset in that library.

This also re-implements video transcript support for content libraries
and re-enables some previously disabled tests around it.
2024-10-16 11:12:11 -04:00
Kyle McCormick
15caa9746f refactor: Completely remove Blockstore (#34739)
Blockstore and all of its (experimental) functionality has been replaced with
openedx-learning, aka "Learning Core". This commit uninstalls the now-unused
openedx-blockstore package and removes all dangling references to it.

Note: This also removes the `copy_library_from_v1_to_v2` management command,
which has been broken ever since we switched from Blockstore to Learning Core.

Part of this DEPR: https://github.com/openedx/public-engineering/issues/238
2024-05-13 09:48:18 -04:00
Kyle McCormick
140f85853d feat!: remove Content Libraries V2 index (#33888)
BREAKING CHANGE: Removes all code, tests, and settings related to
indexing of V2 (blockstore-backed) content libraries in elasticsearch.
This includes indexing of top-level library metadata as well as indexing
of library block metadata. Operators who enabled the experimental
Library Authoring MFE *and* the experimental ENABLE_CONTENT_LIBRARY_INDEX
feature may notice that sorting, filtering, and searching of V2
libraries and their blocks may now be slower and/or less powerful.
The ENABLE_CONTENT_LIBRARY_INDEX feature was already disabled by
default, so most/all operators (including edx.org) should not notice
any difference.

Removed settings include:

* FEATURES['ENABLE_CONTENT_LIBRARY_INDEX']
* ENABLE_ELASTICSEARCH_FOR_TESTS
* TEST_ELASTICSEARCH_USE_SSL
* TEST_ELASTICSEARCH_HOST
* TEST_ELASTICSEARCH_PORT

For rationale, see the updated "Status" section of:
./openedx/core/djangoapps/content_libraries/docs/decisions/0001-index-libraries-in-elasticsearch.rst
2023-12-07 14:57:31 -05:00
Kyle McCormick
27803f51c8 feat!: assume & remove BLOCKSTORE_USE_BLOCKSTORE_APP_API (#33765)
Originally, Blockstore was an independent micro-service, accessed via a REST API.
Then, we changed Blockstore so it could be installed as an in-process Django app.

To support both modes, there existed a blockstore_api wrapper library in edx-platform,
with toggles controlling whether the wrapper called out to the micro-service's REST API versus the
Django app's Python API. Now that the micro-service Blockstore implementation is deprecated,
though, this wrapper library and toggles are just unnecessary complexity.

As a first step towards cleanup, we:

* remove several toggles and settings (details below);
* remove the blocokstore_api wrapper methods which called the REST API and
  marshalled them back into Python objects; and
* remove all test cases which relied on the Blockstore micro-service (and were skippped in CI).

In the future, we will remove the content libraries indexer, 
clean up the remaining bits of blockstore_api, and flatten out all
the Blockstore-related test class hierarchies which are no longer nceessary.

BREAKING CHANGE:
* These Django settings are removed:
  * BLOCKSTORE_PUBLIC_URL_ROOT
  * BLOCKSTORE_API_URL
  * BLOCKSTORE_API_AUTH_TOKEN
  * BLOCKSTORE_USE_BLOCKSTORE_APP_API
* The blockstore.use_blockstore_app_api Waffle switch is removed.
* edx-platform will act as it did when the DJango setting BLOCKSTORE_USE_BLOCKSTORE_APP_API
  or the Waffle switch blockstore.use_blockstore_app_api were enabled. That is, any running Blockstore
  micro-service instance will be ignored, and the Blockstore package which is installed into edx-platform
  will be used instead.

Ref: https://github.com/openedx/blockstore/issues/296
2023-12-06 15:15:18 +00:00
Muhammad Abdullah Waheed
caf8e456e2 Revert "feat: Account and profile MFE legacy removal - redeployment (#31893)" (#33542)
This reverts commit 08f5e7e563.
2023-10-19 12:26:29 +05:00
Muhammad Abdullah Waheed
08f5e7e563 feat: Account and profile MFE legacy removal - redeployment (#31893)
feat: Account and profile MFE legacy removal - redeployment

* Revert "Revert "FC-0001: Account pages -> micro-frontend (#30336)" (#31888)"

This reverts commit 90c4ca6e47.

* refactor: removed filters test from user_api accounts

---------

Co-authored-by: Bilal Qamar <59555732+BilalQamar95@users.noreply.github.com>
2023-10-19 10:43:15 +05:00
Yagnesh Nayi
98d0435167 feat: remove askbot changes in depr216 (#33408)
* feat: remove askbot changes in depr216

* feat: update cms test.py

* feat: update cms test.py
2023-10-05 09:19:59 -04:00
Awais Qureshi
9db024c435 feat!: upgrading django-storages to 1.11.1 2023-08-31 14:21:24 +05:00
Awais Qureshi
3c76d6644f Revert "Revert "Revert "feat!: upgrading django-storages to 1.10.1 (#32571)" (#33109)" (#33111)" (#33113)
This reverts commit 2f8475c307.
2023-08-30 19:40:32 +05:00
Awais Qureshi
2f8475c307 Revert "Revert "feat!: upgrading django-storages to 1.10.1 (#32571)" (#33109)" (#33111)
This reverts commit 191b825a2c.
2023-08-28 14:46:21 +05:00
Awais Qureshi
191b825a2c Revert "feat!: upgrading django-storages to 1.10.1 (#32571)" (#33109)
This reverts commit 9281ea4a9a.
2023-08-28 14:05:38 +05:00
Awais Qureshi
9281ea4a9a feat!: upgrading django-storages to 1.10.1 (#32571)
* feat!: upgrading django-storages to 1.10.1
2023-08-28 13:13:28 +05:00
Yagnesh
14f90eba96 feat: BLOCK_STRUCTURES_SETTINGS['PRUNING_ACTIVE'] toggle removed depr31 2023-06-17 02:31:07 +05:30
Muhammad Abdullah Waheed
90c4ca6e47 Revert "FC-0001: Account pages -> micro-frontend (#30336)" (#31888)
This reverts commit 0f02c7b3d9.
2023-03-07 17:41:56 -05:00
Sagirov Evgeniy
0f02c7b3d9 FC-0001: Account pages -> micro-frontend (#30336)
* feat: Account pages. Learner Profile page

* feat: Account pages. Account Settings page

* feat: Account pages. Removed unused styles

* feat: Account pages. Removed unused toggles

* feat: fixed tests and pylint errors

* feat: update redirect to account settings for student_dashboard

* feat: fix pylint errors
2023-03-07 17:41:52 +05:00
Agrendalath
ae1dcbea74 refactor: rename HiddenDescriptor to HiddenBlock
This also handles the AttributeError in the default XBlock class fallback.
2022-12-19 17:48:49 +01:00
0x29a
4d8618517f refactor: xmodule/hidden_module.py -> xmodule/hidden_block.py 2022-12-19 17:48:49 +01:00
Ahtisham Shahid
73c2b1be7e Added Big Blue button as live provider (#30613)
* feat: added new live provider and fixed tests

* feat: added free_tier compatiblity

* fix: resolved linter issues and other refactors

* fix: ran makemigration to generate migrations

* fix: Implemeted key retrival for tabs

Co-authored-by: AhtishamShahid <ahtishamshahid@A006-00850.local>
2022-06-23 11:48:44 +05:00
ansabgillani
8c7059c5bb fix: reverting SSO History changes to unblock stage 2022-04-27 21:09:44 +05:00
ansabgillani
4af3d58b39 feat: Add SSO History for Support 2022-04-27 11:44:25 +05:00
Jillian Vogel
732d8cb337 fix: use mako prefix lms. when XBlock runtime renders in Studio/authoring MFE
When the XBlock runtime is used in Studio/authoring mode, it needs to
use the template path prefix "lms." in order to locate the block
templates. (In LMS view, no prefix is required.)

Fixes bug introduced by https://github.com/openedx/edx-platform/pull/29354
and removes template workaround added by
https://github.com/openedx/edx-platform/pull/29517 (see Author Notes & Concerns)
2022-04-21 09:39:59 +01:00
Jillian Vogel
8b77638bf0 test: refactors blockstore integration tests to run as unit tests.
Tests which @requires_blockstore (i.e. the Blockstore service) have
been made to run as a unit test using the installed Blockstore app, and
will be run by the platform CI.

The Blockstore service tests can still be run manually by setting
EDXAPP_RUN_BLOCKSTORE_TESTS=1

Related fixes:

* adds blockstore bundle storage settings
* let the studio devstack and test servers serve static files from
  the /media URL This allows the blockstore/content libraries API to
  serve blockstore assets in dev.
* Wrap ContentLibrary creation in an atomic transaction, so that if it
 fails, the related bundle can be deleted directly from the database
  during the exception handler. (Previously, we called a REST API which
  deleted it as part of a separate service.)
2022-04-21 09:39:59 +01:00
Tim McCormack
a251d18281 feat!: Use more-trusted IP in rate-limiting (#241)
Previously, our rate-limiting code trusted the entire `X-Forwarded-For`
header, allowing a malicious client to spoof that header and evade
rate-limiting. This commit introduces a new module and setting
allowing us to make a more conservative choice of IPs.

- Create new `openedx.core.djangoapps.util.ip` module for producing
  the IP "external chain" for requests based on the XFF header and the
  REMOTE_ADDR.
- Include a function that gives the safest choice of IPs.
- Add new setting `CLOSEST_CLIENT_IP_FROM_HEADERS` for configuring how
  the external chain is derived (i.e. setting the trust
  boundary). Currently has a default, but we may want to make it
  mandatory in the future.
- Change `django-ratelimit` code to use the proximate IP in the external
  chain -- the one just outside the trust boundary.

Also:

- Change `XForwardedForMiddleware` to use more conservative choice for
  its `REMOTE_ADDR` override
- Other adjustments to `XForwardedForMiddleware` as needed in order to
  initialize new module and support code that needs the real
  `REMOTE_ADDR` value
- Metrics for observability into the change (and XFF composition)
- Feature switch to restore legacy mode if needed

This also gives us a path forward to removing use of the django-ipware
package, which is no longer maintained and has a handful of bugs that make it
difficult to use safely.

Internal ticket: ARCHBOM-2056
2022-04-20 13:46:58 +00:00
Usama Sadiq
1cebd3ed7b Remove django-ratelimit-backend (#30054)
* fix: remove the usage of django-ratelimit-backend

Co-authored-by: Awais Qureshi <awais.qureshi@arbisoft.com>
2022-03-24 17:21:56 +05:00
Zainab Amir
bd08bc7bdc feat: add optional fields rest api (#29942) 2022-02-22 17:51:34 +05:00
Jillian Vogel
5dedba8c8e temp: adds mako templates and dirs to Studio test env
The content library tests were failing to locate templates when
rendering XBlocks, but since these tests are skipped in CI, the issue
went undetected.

This fix is marked temporary because a proper fix involves adding
lms/templates to the cms.envs.test MAKO_TEMPLATE_DIRS_BASE list. This
was tried, and caused unrelated tests to fail, and so we took this
approach instead. See PR for full details.
2022-01-20 10:35:59 +10:30
Kshitij Sobti
9f4bc9900b feat: add discussions context to course blocks API (#29300)
Add a new course blocks transformer that adds discussion context for units.
2021-12-07 11:10:48 +05:00
M. Zulqarnain
e54fb5f76e feat: New codemods on CMS (#28768) 2021-10-25 12:59:54 +05:00
Julia Eskew
7fc109ebcb fix: ES 7.10 is now the default ES version for devstack, so change the
default address for testing ES using integration tests in devstack.
2021-08-09 11:37:51 -04:00
Usama Sadiq
e25f00f35c fix: Removed unnecessary constraints (#27915)
Updated constraints of following packages:
inflect,geoip2,maxmindb,path,isort (isort>5.0.0 introduced wrong-import-order warnings so disabled the warning)
2021-07-07 13:56:18 +05:00
Jawayria
772f8cbe90 refactor: Removed unused imports
Removed unused imports from cms using 'unimport'
2021-04-06 17:47:48 +05:00
Zainab Amir
8cc5f13daf Add rate limit to registration endpoint (#27060)
Currently the registration endpoint has no rate limit. Added a new ratelimit
variable to support the change, it's value is set to 60/7d.

VAN-302
2021-03-25 16:28:30 +05:00
Usman Khalid
78cd8be24d XMLModuleStore should use HiddenDescriptor instead of RawDescriptor.
In https://github.com/edx/edx-platform/pull/25955 `HiddenDescriptor`
(which was a subclass of `RawDescriptor` with a custom `student_view()`)
was converted to an XBlock. It is used as the `default_class` by the
`CachingDescriptorSystem` classes. However `RawDescriptor` is still
being used by `XMLModuleStore`. This has been replaced by
`HiddenDescriptor` as well.
2021-03-11 22:20:33 +05:00
Kyle McCormick
bcb48525ac refactor: clean up unused ERROR_ON_DEPRECATED_EDX_PLATFORM_IMPORTS (#26900)
The setting overrides should've been cleaned up in a previous
commit, but I missed them. This change is a no-op.
2021-03-08 15:01:12 -05:00