Commit Graph

4074 Commits

Author SHA1 Message Date
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
Tim McCormack
4c15e00611 docs: Improve docs for HIBP settings; remove duplicated cms copies (#34116)
- Clarify effects of enabling each policy.
- Document the thresholds and what policies they relate to.
- Express thresholds as floating point numbers to better hint at them not
  being intended as integer values.
- Change toggle use case from temporary to open_edx for login policies (as
  we're expecting to keep those toggles long term, as an optional feature).
- Remove links to private Jira tickets. (openedx Jira is now gone, and
  these tickets are only present in 2U's private Atlassian instance.)
- Import LMS HIBP settings into CMS (rather than duplicating them) but
  mark as unused.
2025-05-05 19:16:37 -04:00
Kyle D McCormick
4551aea70d feat: Install (sub)sections apps from openedx-learning 2025-04-22 18:51:34 -04:00
Kyle D. McCormick
e6c24bdd0d refactor: Remove now-unused static asset Django settings
Closes: https://github.com/openedx/edx-platform/issues/36407
2025-04-09 13:38:36 -04:00
sarina
1e3074a3f9 docs: Update edx.rtd.io links to docs.openedx.org 2025-04-02 12:10:56 -04:00
Braden MacDonald
1ca57ec129 Basic CRUD REST Endpoints for units in content libraries [FC-0083] (#36371)
* refactor: convert libraries API from attr.s to dataclass, fix types

* fix: make corresponding updates to 'search' code

* feat: use new version of openedx-learning with containers support

* temp: Use opencraft branch of opaquekeys

* refactor: Use LibraryElementKey instead of LibraryCollectionKey

* refactor: split libraries API & REST API up into smaller modules

* feat: new REST API for units in content libraries

* feat: python+REST API to get a unit

* feat: auto-generate slug/key/ID from title of units

* feat: generate search index documents for containers

* refactor: rename LibraryElementKey to LibraryItemKey

* fix: lint error

* feat: adds new units to search index on create/update

and when running reindex_studio.

Updates requirements for openedx-events and openedx-learning to support
these changes.

* fix: pylint

* fix: temp requirement

* fix: search index container events/tasks

* feat: add get_library_container_usage_key to libraries API

and use it when search indexing containers

* fix: index all containers during reindex_studio

* chore: bump openedx-events requirement

* fix: address review comments

* chore: bumps openedx-learning to 0.19.1

* fix: rename api method to library_container_locator

since container keys are locators, not usage keys

* chore: bumps opaque-keys dependency

* test: fix misnamed unit_usage_key

* feat: adds APIs to update or delete a container (#757)

* feat: adds python and REST APIs to update a container's display_name
* refactor: adds _get_container method to api to reduce code duplication
* feat: adds python and REST APIs to delete a container
* test: add container permission tests

---------

Co-authored-by: XnpioChV <xnpiochv@gmail.com>
Co-authored-by: Jillian Vogel <jill@opencraft.com>
Co-authored-by: Rômulo Penido <romulo.penido@gmail.com>
2025-03-28 18:55:04 +05:30
Muhammad Faraz Maqsood
9706caed6a chore: remove braze client settings from edx-platform 2025-03-26 11:21:56 +05:00
Muhammad Faraz Maqsood
fc1b608f17 Revert "chore: remove braze client settings from edx-platform"
This reverts commit d1318836ab.
2025-03-25 17:38:32 +05:00
Muhammad Faraz Maqsood
d1318836ab chore: remove braze client settings from edx-platform 2025-03-25 10:31:32 +05:00
Hassan Raza
033bcda99d Hraza/add embargo restricted country (#36398)
* feat: add country disabling feature in embargo app

* revert: disabled countries list in env

* fix: resolved linter issues

---------

Co-authored-by: Hassan Raza <h.raza@192.168.1.12>
2025-03-19 12:22:45 +05:00
Maxwell Frank
372884781f feat: remove algoliasearch package (#36403) 2025-03-18 11:33:41 -04:00
Ahtisham Shahid
e7100d813f Revert "feat: refactor country disable logic into the Embargo app (#36202)" (#36393)
This reverts commit 72959ad9d5.
2025-03-17 23:55:59 +05:00
Hassan Raza
72959ad9d5 feat: refactor country disable logic into the Embargo app (#36202)
* feat: add country disabling feature in embargo app

* revert: disabled countries list in env

* fix: resolved linter issues

---------

Co-authored-by: Hassan Raza <h.raza@192.168.1.12>
2025-03-17 16:07:18 +05:00
Feanil Patel
a7311ce55e fix: Be able to run celery tasks on baremetal.
At some point something changed in upstream config or in celery and now
a black transport is no longer valid.  You have to supply some transport
even if you are running in always eager mode.  Add enough config so that
celery tasks will execute without issues when running `runserver` on
baremetal.

Fixes the "No such transport" error:

```
File "/home/feanil/.virtualenvs/edx-platform/lib/python3.11/site-packages/celery/app/task.py", line 575, in apply_async
    with app.producer_or_acquire(producer) as eager_producer:                                                                                                                                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/feanil/.virtualenvs/edx-platform/lib/python3.11/site-packages/celery/app/base.py", line 932, in producer_or_acquire                                                                                                  producer, self.producer_pool.acquire, block=True,
              ^^^^^^^^^^^^^^^^^^
  File "/home/feanil/.virtualenvs/edx-platform/lib/python3.11/site-packages/celery/app/base.py", line 1354, in producer_pool
    return self.amqp.producer_pool                                                                                                                                                                                                        ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/feanil/.virtualenvs/edx-platform/lib/python3.11/site-packages/celery/app/amqp.py", line 591, in producer_pool
    self.app.connection_for_write()]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/feanil/.virtualenvs/edx-platform/lib/python3.11/site-packages/celery/app/base.py", line 829, in connection_for_write
    return self._connection(url or self.conf.broker_write_url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                         File "/home/feanil/.virtualenvs/edx-platform/lib/python3.11/site-packages/celery/app/base.py", line 880, in _connection
    return self.amqp.Connection(
           ^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                                                 File "/home/feanil/.virtualenvs/edx-platform/lib/python3.11/site-packages/kombu/connection.py", line 201, in __init__
    if not get_transport_cls(transport).can_parse_url:                                                                                                                                                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/feanil/.virtualenvs/edx-platform/lib/python3.11/site-packages/kombu/transport/__init__.py", line 91, in get_transport_cls                                                                                            _transport_cache[transport] = resolve_transport(transport)
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                   File "/home/feanil/.virtualenvs/edx-platform/lib/python3.11/site-packages/kombu/transport/__init__.py", line 72, in resolve_transport
    raise KeyError(f'No such transport: {transport}')                                                                                                                                                                          KeyError: 'No such transport: '

```
2025-03-11 09:35:05 -04:00
Feanil Patel
e36db6e251 feat!: Drop usage of the picturefill polyfill.
This package is no longer supported (https://www.npmjs.com/package/picturefill)
and it was a polyfill for the Picture element which is now widely
supported (https://caniuse.com/?search=Picture) and we only used it in
one spot to make things work correctly in IE.  I think it's safe to drop
as we and the world has stopped supporting IE a while ago.

BREAKING CHANGE: Program Card images on the legacy learner dashboard may
no longer load properly on IE.
2025-03-10 11:51:33 -04:00
Maxwell Frank
e1e9e1cbfa chore: remove unused values for cross product recommendations (#36328) 2025-03-05 13:58:22 -05:00
Kyle McCormick
774b7e9821 refactor: Clean up CMS production settings cruft (#36306)
This is a pure refactoring of cms/envs/production.py, removing several
redundant statements that have accrued over the years as the platform moved
from python-only, to python+json, to python+json+yaml, to today's python+yaml
setup.

This is the CMS version of:
* a81493ce7f
* (originally 15939232d5)

Also included:

* Add some more explicit structure to the both LMS's and CMS's
  production.py using big comments.

* In both LMS and CMS settings, alphabetize the production overrides,
  and remove the extraneous comments. Separate out the handful of settings
  which have useful comments. The rest of the settings' comments were not
  helpful--they were either just stating the obvious, or they were duplicative
  of what's documented in common.py.

Co-Authored-By: Feanil Patel <feanil@axim.org>

Part of: https://github.com/openedx/edx-platform/issues/36215
2025-03-05 08:24:59 -05:00
Muhammad Afaq Shuaib
b83c8495e1 chore: add TRANSCRIPT_LANG_CACHE_TIMEOUT setting variable in common setting envs (#36296)
* chore: add TRANSCRIPT_LANG_CACHE_TIMEOUT setting variable in common setting envs
* chore: bump edx-val version
2025-02-25 20:07:14 +05:00
Tim McCormack
56cf4ab9cd test: Add mock configs for testing production.py (#36237)
The values are nonsensical but this should be a fairly complete collection
of settings, both at the top level and in sub-dictionaries.

While edxapp will not work properly with these settings, the following
commands should work:

```
DJANGO_SETTINGS_MODULE=lms.envs.production LMS_CFG=lms/envs/mock.yml ./manage.py lms dump_settings
DJANGO_SETTINGS_MODULE=cms.envs.production CMS_CFG=cms/envs/mock.yml ./manage.py cms dump_settings
```
2025-02-10 14:52:34 -05: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
Kyle McCormick
e1a8b52dc2 refactor: Use derive_settings to lazy load settings. (#36205)
Some of our settings depend on the values of other settings.  Rather
than explicitly looking up each one in the YAML settings file, we can
simply derive them based on the setting in the YAML file after all the
YAML settings have been loaded.

Part of: https://github.com/openedx/edx-platform/issues/36215
Co-Authored-By: Feanil Patel <feanil@axim.org>
2025-02-05 11:45:35 -05:00
Kyle McCormick
32275662b0 feat!: A Better API for Derived Settings (#36192)
The Python API for declaring derived settings was confusing to the uninitiated
reader, and also prone to spelling mistakes. This replaces the API with one
that is more readable and more concise, and updates the implementation of
`derive_settings` to properly derive settings declared using the new API.

BREAKING CHANGE: The `derived` and `derived_collection_entry` function are
replaced with the `Derived` class. We do not expect those functions to have
been used outside of edx-platform, but if they are, this commit will cause them
to loudly ImportError.

Note that there should be NO change in behavior to the `derive_settings`
function, which we DO know to be used by some external edx-platform plugins.

Part of: https://github.com/openedx/edx-platform/issues/36215
2025-02-04 14:57:43 -05:00
David Ormsbee
2c92c703d7 feat!: remove unused email_marketing app
Quoting the README:

> If you are reading this and the 'Maple' Open edX release is out, you
> can safely delete this whole djangoapp. It only exists to hold old
> model migrations and any post-Maple installation will no longer have
> any model in the database for this app.
>
> But for some minor historical context, this djangoapp used to hold
> some integration with sailthru that we no longer needed.

We've released Sumac. This is overdue.
2025-02-03 11:24:28 -05:00
Kyle D. McCormick
0ea4bae7b3 fix: Exactly preserve legacy settings dicts; rm KEYS_WITH_MERGED_VALUES
In the near term, we wish to precisely preserve the existing values of
all Django settings exposed by lms/envs/production.py in order to avoid
breaking legacy Django plugins without a proper announcement.

That includes preserving the behavior of these old, redundant dicts:
* ENV_TOKENS
* AUTH_TOKENS
* ENV_FEATURES
* ENV_CELERY_QUEUES
* ALTERNATE_QUEUE_ENVS

Particularly, it means we need to ensure that updates to Django
settings are reflected in these dicts. The most reliable way to do that
is to change the yaml-loading logic so that these values are aliased
to the corresponding values in the global namespace rather than
deep-copied.

Finally, we remove KEYS_WITH_MERGED_VALUES from the global namespace,
and inline the remaining list. We have modified the list (specifically,
we dropped the no-op MKTG_URL_OVERRIDES). Plugins should not be counting
on the value of the list, so we remove it.
2025-01-30 08:23:09 -05:00
Kyle D. McCormick
4449f43c4e fix: SHARED_kCOOKIE_DOMAIN -> SHARED_COOKIE_DOMAIN 2025-01-30 08:23:09 -05:00
Kyle McCormick
a81493ce7f revert: revert: refactor: Clean up lms/envs/production.py cruft
This reintroduces commit 15939232d5,
which was reverted due to a typo.

The typo is fixed in the commit immediately following this one.

Co-Authored-By: Feanil Patel <feanil@axim.org>
2025-01-30 08:23:09 -05:00
Deborah Kaplan
1fe67d3f6b feat: increase frequency of scheduled notify credentials (#36180)
`notify_credentials` has 2 ways of running.
1. The manual,  one-off method  which uses `--args_from_database`  to specify what should be sent.
2. [The automated method](7316111b35/openedx/core/djangoapps/credentials/management/commands/notify_credentials.py (L157-L159)), which runs on a regular schedule, to catch anything which fell through the cracks.

The automated method does a certain amount of time/date math in order to calculate the entry point of the window based on the current runtime.  This is, I assume, why it has some hardcoded logic; it's not at all simple to have a `cron`-run  management command running on a regular cadence that can do the same time logic.

```py
        if options['auto']:
            options['end_date'] = datetime.now().replace(minute=0, second=0, microsecond=0)
            options['start_date'] = options['end_date'] - timedelta(hours=4)
```

However, it is not ideal that the actual time window of 4 hours is hardcoded directly into `edx-platform`.

This fix

* creates an overridable `NOTIFY_CREDENTIALS_FREQUENCY` that defaults to 14400 seconds (4 hours).
* pulls that frequency into the quoted code

Using seconds allows maximum flexibility.

FIXES: APER-3383
2025-01-27 22:26:00 +00:00
Feanil Patel
dd86710d9d docs: Update lms/envs/common.py 2025-01-23 16:16:19 -05:00
Marcos
747289bc1a fix: Removed JWT constants from CMS and added comments on how to generate them 2025-01-23 15:55:58 -03:00
Marcos
5d494feb01 chore: Updated defaults for token handling on CMS 2025-01-23 15:55:58 -03:00
Marcos
ca3cd45a79 chore: fix tests 2025-01-23 15:55:58 -03:00
Marcos
825931a9b4 chore: Removed edx-token-utils dep and moved necessary logic to the repo 2025-01-23 15:55:58 -03:00
Justin Hynes
92bc0fa763 feat: update default retirement states in devstack config (#36153)
We would like new devstack instances to better support the user retirement pipeline out of the box after provisioning. The first step is to update the default list of retirement states devstack is configured to add/use.
2025-01-22 13:28:45 -05:00
David Ormsbee
7635b8edcb perf: normalize LMS vs. Studio debug-toolbar settings
This change disables the profiling panel for performance reasons. It's
rarely useful anyway, given the lack of granularity in the data it
displays.

This commit also enables the Cache panel, which is import for tracking
where we're making excessive calls to redis/memcached.
2025-01-21 11:03:01 -05:00
Robert Raposa
4035aa3487 Revert "refactor: Clean up lms/envs/production.py cruft (#36115)" (#36129)
This reverts commit 15939232d5.
2025-01-17 16:16:38 +00:00
Kyle McCormick
15939232d5 refactor: Clean up lms/envs/production.py cruft (#36115)
This is a pure refactoring of lms/envs/production.py, removing several
redundant statements that have accrued over the years as the platform moved
from python-only, to python+json, to python+json+yaml, to today's python+yaml
setup.

Notes on some of the more involved refactorings:

* AWS Locals Load block is handled by the YAML loading at the very top, we
  don't need to re-load it since there were no changes to those settings
  between the YAML loading at the top and this section.

* MKTG_URL_OVERRIDES, we drop doing any overrides and remove it from the merge
  list beacuse the default value in
  lms/envs/common.py is empty.  So the update is a no-op and is the same as just
  loading this data directly from the YAML config.

* CODE_JAIL block, we've been overriding the entire dict if it is in your YAML
  config, so then going through and updating the individual values is not necessary.

* SSL_AUTH_EMAIL_DOMAIN and SSL_AUTH_DN_FORMAT_STRING are not used anywhere in
  the openedx org, looks like they were used by the old `dashboard` djangoapp
  and can probably be deleted but might be used by plugins so not removing for
  now to keep the change backward compatible.

* DEFAULT_FILE_STORAGE, previously two of the braches were no-ops so we only
  keep the one branch we need for when we want to update DEFAULT_FILE_STORAGE
  automatically if AWS keys are set.

Somewhat related to: https://github.com/openedx/open-edx-proposals/issues/587

Co-Authored-By: Feanil Patel <feanil@axim.org>
2025-01-16 15:19:47 -05:00
Kyle McCormick
343a4cad56 docs: update settings comment 2025-01-15 17:35:13 -05:00
irfanuddinahmad
f64a3a62c5 feat: Disabled MITx from program nudge emails 2025-01-15 14:17:27 +05:00
Kyle D. McCormick
88b8da3e49 docs: Remove the last couple mentions of Paver from the codebase
Part of: https://github.com/openedx/edx-platform/issues/34467
2025-01-02 14:05:15 -05:00
Muhammad Anas
0de7569b68 refactor!: remove md4 and related ENABLE_BLAKE2B_HASHING feature flag 2024-12-24 13:12:18 +05:00
Saleem Latif
9d859a8247 refactor: Removed unused django setting. 2024-12-04 14:57:07 +05:00
Muhammad Farhan Khan
f9126bfdd9 Add Django settings flags to roll out the extracted XBlocks (#35549)
chore: Add Django settings flags to roll out the extracted XBlocks
2024-12-02 20:38:40 +05:00
Tim McCormack
e9ab422101 feat: Default Celery task protocol to version 2 (by removing setting) (#35865)
We've been keeping this pinned to 1, but since we're well past the first
version of Celery that can understand both protocol versions, we can just
remove the pin. Celery should then default to protocol 2.

No action should be required from operators.
2024-11-18 11:54:33 -05:00
Demid
d4f3c37326 docs: document ORA lease expiration settings (#35818) 2024-11-12 20:55:35 +05:30
Tim McCormack
22b9ced6c0 feat: Make celery task protocol configurable via Django setting (#35789)
This will allow us to test protocol 2 in a stage environment before
removing the override to make 2 the default.

We may have seen a bug where something in celery (or an
associated library) was adding headers to a v1 message as
if it were a v2 message, which caused a bug in ddtrace; such
things may become more likely over time as code is written
with the assumption of v2 messages. Moving to v2 will avoid
those issues.

See https://github.com/edx/edx-arch-experiments/issues/800 for further details.
2024-11-06 15:54:24 -05:00
Adam Stankiewicz
d54e3bd4c1 feat: bump edx-enterprise to 4.30.0, extend system-wide roles for enrollment intentions feature (#35739) 2024-10-29 11:50:43 -04:00
farhan
8fb5b778c3 feat!: Dropping Sass support from builtin video block, replacing with vanilla CSS 2024-10-23 18:40:30 +05:00
Fatima Sohail
af69cbe671 feat: waffle flag based switch to ses for goal reminder email (#35615)
* feat: waffle based switch to ses for goal reminder email

* test: added test cases for ace message parameters

* feat: updated logic to specify channel name

* chore: update edx-ace version
2024-10-14 19:20:02 +05:00
Attiya Ishaque
319dd7f38c feat: remove all the commerce coordinator (#35527) 2024-10-14 13:12:38 +05:00
Deborah Kaplan
8c923bea24 feat!: removes deprecated v1 certificate behavior (#35562)
* feat!: removes deprecated v1 certificate behavior

this removes the long-deprecated v1  certificate behavior. This removes
the old-style date selection behavior  (ie., not a choice between
*Immediately upon passing*, *End date of course*, *A date after the course
end date*), which is no longer reliably maintained or supported in
Studio or Credentials.

FIXES: #35399
2024-10-02 12:06:57 -04:00