Commit Graph

65 Commits

Author SHA1 Message Date
Taylor Payne
a98dd3f748 refactor: move explicitly shared settings into new common module 2025-07-21 08:08:34 -04: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
Navin Karkera
1cd73d1b96 feat: support for syncing units from libraries to courses (#36553)
* feat: library unit sync
* feat: create component link only for component xblocks
* feat: container link model
* feat: update downstream api views
* feat: delete extra components in container on sync (not working)
* fix: duplicate definitions of LibraryXBlockMetadata
* test: add a new integration test suite for syncing
* feat: partially implement container+child syncing
* fix: blockserializer wasn't always serializing all HTML block fields
* feat: handle reorder, addition and deletion of components in sync

Updates children components of unit in course based on upstream unit,
deletes removed component, adds new ones and updates order as per
upstream.

* feat: return unit upstreamInfo and disallow edits to units in courses that are sourced from a library (#773)
* feat: Add upstream_info to unit
* feat: disallow edits to units in courses that are sourced from a library (#774)

---------

Co-authored-by: Jillian Vogel <jill@opencraft.com>
Co-authored-by: Rômulo Penido <romulo.penido@gmail.com>

* docs: capitalization of XBlock

Co-authored-by: David Ormsbee <dave@axim.org>

* refactor: (minor) change python property name to reflect type better

* fix: lots of "Tried to inspect a missing...upstream link" warnings

when viewing a unit in Studio

* docs: mention potential REST API for future refactor

* fix: check if upstream actually exists before making unit read-only

* chore: fix camel-case var

* fix: test failure when mocked XBlock doesn't have UpstreamSyncMixin

---------

Co-authored-by: Braden MacDonald <braden@opencraft.com>
Co-authored-by: Chris Chávez <xnpiochv@gmail.com>
Co-authored-by: Jillian Vogel <jill@opencraft.com>
Co-authored-by: Rômulo Penido <romulo.penido@gmail.com>
Co-authored-by: Braden MacDonald <mail@bradenm.com>
Co-authored-by: David Ormsbee <dave@axim.org>
2025-04-24 11:41:47 -07:00
Braden MacDonald
ce00b16be7 test: Enforce application layering using import linter (#36581)
* test: add import linters to promote clean dependencies

* docs: update a few comments / todos
2025-04-23 00:28:30 -04:00
Irtaza Akram
a8a8ae3286 fix: replace pkg_resources with importlib.resources (#36213) 2025-02-13 17:43:07 +05:00
Jesper Hodge
1f43d17b21 Revert "Replace pkg_resources with importlib.resources" (#36208) 2025-02-05 08:51:50 -05:00
Irtaza Akram
acdbff8b4c fix: remove pkg_resources 2025-01-08 16:45:19 +05:00
David Ormsbee
23c4276ec6 test: add data.py to acceptable isolated app imports
Per OEP-49, both api.py and data.py are allowed to be imported into
other apps:

https://open-edx-proposals.readthedocs.io/en/latest/best-practices/oep-0049-django-app-patterns.html#api-py
2024-10-17 13:57:09 -04:00
Feanil Patel
4085066fea Merge pull request #34417 from qasimgulzar/qasim/DEPR/git-issue-34342
[DEPR]: Remove Neo4J Support #34342
2024-05-28 10:25:33 -04:00
David Ormsbee
be03938377 refactor: update to use Learning Core's new public API
This also bumps our openedx-learning dependency to 0.10.0 (the first
version with the new openedx_learning.api package).
2024-05-21 16:05:56 -04:00
qasim.gulzar
48cdbce893 refactor: [DEPR]: Neo4J Support #34342 2024-05-17 18:55:16 +05:00
Zachary Hancock
10805a6a24 feat: remove old proctoring settings url (#33679)
This flag was introduced to gate the rollout of moving the UI component for proctoring settings into the pages and resources view and was never cleaned up. At this point we should always be linking the the new page for proctoring settings.
2023-11-09 08:54:28 -05:00
Daniel Valenzuela
398c84e1bc chore: ignore 'etree' is deprecated
Related issue: https://github.com/openedx/edx-platform/issues/32888
2023-11-01 00:18:40 -03:00
Daniel Valenzuela
9752da2b03 chore: ignore warning from pkg_resources.declare_namespace
Related issue: https://github.com/openedx/edx-platform/issues/33592
2023-11-01 00:18:40 -03:00
Daniel Valenzuela
ef0a9c00af chore: ignore import ABCs from 'collections' warning
related issue: https://github.com/openedx/edx-platform/issues/33584

note: this warning is from a third party library (libsass)
2023-11-01 00:18:40 -03:00
Daniel Valenzuela
d2f427a672 chore: ignore HTTPResponse.getheaders() deprecation warning
related issue: https://github.com/openedx/edx-platform/issues/33584

note: this warning is rased from a third party library (elasticsearch)
2023-11-01 00:18:40 -03:00
Daniel Valenzuela
66c5be8c02 chore: ignore default_app_config warning
related issue: https://github.com/openedx/edx-platform/issues/33572
2023-11-01 00:18:40 -03:00
Muhammad Soban Javed
2732934e74 fix: re-enable Django deprecation warnings (#32277)
* fix: re-enable Django deprecation warnings
---------

Co-authored-by: UsamaSadiq <usama7274@gmail.com>
2023-08-07 22:08:00 +05:00
connorhaugh
00b1ce28b9 feat: add library copy management command (#32598)
This PR introduces the "copy" management command, which copies v1 libraries into v2 libraries.
2023-07-10 15:45:18 -04:00
connorhaugh
57fd22ba58 feat: ignore v2 xblocks in independence contract (#32602)
* feat: ignore v2 xblocks in independance contract

* docs: add documentation as to failure point
2023-06-29 16:08:14 -04:00
ruzniaievdm
96b8ba5d6a feat: Create DRF for course settings and course details views out of current Django views (#32397) 2023-06-08 11:07:29 -04:00
Braden MacDonald
8ee1f66ffb feat: Paste Components (OLX) into any Unit in Studio (#31969)
* feat: Implement paste button

* chore: improve docs and add tests for python API

* fix: drive-by fix to use a better API for comparing XML

* feat: track which XBlock something was copied from

* feat: add tests

* feat: enable import linter so content_staging's public API is respected

* fix: error seen when trying to paste drag-and-drop-v2 blocks

* fix: use strip_text=True consistently for XML comparisons

* refactor: rename get_user_clipboard_status to get_user_clipboard

* feat: Better error reporting when pasting in Studio

* chore: convert new test suite to pytest assertions

* refactor: push READY status check into the API per review suggestion

* fix: use strip_text=True consistently for XML comparisons

* fix: store "copied_from_block" as a string to avoid Reference field issues

* fix: minor lint error

* refactor: move data types to data.py per OEP-49
2023-04-27 09:58:04 -07:00
Braden MacDonald
dd927c7fee chore: consolidate two different implementations for serializing XBlocks 2023-04-24 12:16:42 -07:00
Braden MacDonald
626f11f608 test: Import linter: optionally enforce usage of a package's public API (#31903)
* test: warn about dependencies from cms->openedx->lms and vice versa

* test: warn about importing from package's internal implementation code

* chore: Update some imports to use public APIs only

* chore: Update 'bookmarks' app to have stricter public API

* fix: we are sharing 'adapters' from olx_rest_api to content_staging
2023-04-20 11:34:51 -07:00
0x29a
d338f00e39 refactor: rename module (or item) -> block within cms 2023-01-30 18:15:23 +01:00
Muhammad Umar Khan
9c279444df build: add import linter check (#31062)
* build: add import linter check
2022-12-07 12:07:09 +05:00
Kyle McCormick
25df9ca420 refactor: make safe_lxml an ordinary folder in openedx/core/lib (#25689) 2022-05-24 15:35:23 +05:00
Ned Batchelder
66eae81add docs: comments about how pytest finds settings (#29623)
It took a while for me to understand why my setup.cfg setting was only
applying to some tests.  Hopefully these comments will save someone else
some confusion.
2021-12-21 10:47:59 -05:00
Ned Batchelder
e39f9c503a build: suppress Django deprecation warnings (#29528)
Suppress them both in tests (via setup.py and pytest.ini)
and in management command & application runs
(via logsettings.py).

Developers aren't looking at these warnings; they'll be dealt with in a
formal process for upgrading Django.  Suppress them for now so that
important information isn't lost in the noise.
2021-12-15 10:45:12 -05:00
Ned Batchelder
d67a16452f Ensure setup.cfg is only ASCII. CRI-169
I don't understand why this file needs to be ASCII, or why it was only a
problem recently for one installer, since this has been in this file
since 2014.  But CRI-169 has a stack trace, and it's easy enough to make
the file ASCII.
2020-05-01 16:00:53 -04:00
Jeremy Bowman
59768e7498 Fix more deprecation warnings (#23061) 2020-02-10 13:17:25 -05:00
Manjinder Singh
6c69b6d435 Adding code to output pytest warnings. (#22570)
* Added pytest-json-report plugin
	- modifying app-opts in setup.cfg
	- adding hook to all conftest.py files in repo
	- setting report to be saved to test_root/log/warnings.json
	- Writing custom logic to save json report to avoid overwrite if pytest called twice
This was created to allow us to easily parse through test warnings in jenkins
2020-01-02 10:01:52 -05:00
Calen Pennington
b4fe3474e7 Fix/ignore errors caused by a pycodestyle upgrade 2018-10-31 12:34:50 -04:00
Jeremy Bowman
9477ad23d1 TE-2528 Upgrade testing dependencies 2018-04-25 16:37:29 -04:00
Jeremy Bowman
28d291dce7 TE-2527 Move test and dev dependencies out of base.in 2018-04-18 14:44:31 -04:00
Jeremy Bowman
11e134c552 PLAT-1916 Ignore existing usage of deprecated field_data 2018-02-02 16:12:00 -05:00
Jeremy Bowman
7d436a18ee PLAT-1858 Better capture of deprecation warnings 2018-01-12 18:04:32 -05:00
Jeremy Bowman
1dbdee9c54 Revert "PLAT-1858 Better capture of deprecation warnings" 2017-12-18 21:18:02 -05:00
Jeremy Bowman
b26fe5fd24 PLAT-1858 Better capture of deprecation warnings 2017-12-18 14:59:05 -05:00
Ned Batchelder
8b02ce8394 Skip safe_lxml/etree.py in future isorts 2017-12-12 19:39:35 -05:00
Jeremy Bowman
0f51a397cb Exclude .tox directory from quality checks 2017-10-26 13:48:22 -04:00
Jeremy Bowman
ca97e946a6 Switch to pytest for unit tests 2017-09-22 16:07:53 -04:00
Jeremy Bowman
9e3f35db22 PLAT-1676 Use pytest for bok-choy tests 2017-08-14 11:49:39 -04:00
Andy Armstrong
79acb5c5be Reorder LMS imports using isort 2017-06-11 21:48:06 -04:00
Calen Pennington
2690c044c6 Only generate xunit files during CI builds, so that pudb works during development 2016-06-28 10:46:53 -04:00
Calen Pennington
8b3ef8725c In order to minimize contention for the mongodb global lock, use one database per process in tests 2016-05-18 14:39:00 -04:00
Calen Pennington
299b2659c6 Allow tests to run in verbose mode and multiprocess mode (by turning off TestId mode as needed) 2016-05-18 14:39:00 -04:00
Calen Pennington
5249504edc Use xunitmp by default, rather than standard xunit 2016-05-18 14:10:29 -04:00
Calen Pennington
6ebda5ea1f Set standard nose-multiprocessing options 2016-05-18 14:10:29 -04:00
Calen Pennington
9c6e404bd1 Disable rednose, which is incompatible with multiprocessing 2016-05-18 14:10:29 -04:00