5080 Commits

Author SHA1 Message Date
Rodrigo Mendez
12a46e6463 feat: AuthZ for course authoring compatibility layer (#38013) 2026-03-06 09:35:17 -07:00
Feanil Patel
467495cb22 feanil/pycodestyle to ruff (#38076)
* feat: add ruff and configure it to match current pycodestyle rules

Adds ruff to testing requirements and configures it in pyproject.toml
to enforce the same E/W rules that pycodestyle 2.8.x was enforcing.
Two additional rules (E714, E721) that pycodestyle 2.8.x did not enforce
are explicitly ignored for now and can be cleaned up in a follow-up.

Part of the migration from pycodestyle → ruff.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat: add ruff Makefile target

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat: add ruff to quality CI workflow alongside pycodestyle

Runs ruff alongside pycodestyle so we can validate parity before
removing pycodestyle in the next commit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat: remove pycodestyle, replaced by ruff

- Remove pycodestyle from requirements
- Remove pycodestyle version constraint (pinned to <2.9.0 due to a
  false positive E275 bug that is no longer relevant)
- Remove [pycodestyle] config from setup.cfg (config now lives in
  pyproject.toml under [tool.ruff])
- Remove pycodestyle Makefile target
- Remove make pycodestyle from quality CI workflow

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* style: Apply suggestions from code review

Remove unnecessary ignores.

Co-authored-by: Braden MacDonald <braden@opencraft.com>

* style: Fix a style isusue and remove ignores.

Most of these ignores are unnecessary as we're passing them now and we
want to check them in the future. E714 only had one fixable violation so
we just fixed it.

* style: Update ruff config and workflows

* Update the call to `ruff` so that it outputs in a github friendly
manner.

* Remove ruff exclusions that are already covered by .gitignore which
  ruff respects.

* chore: Recompile requirements.

Update the requirements to drop pycodestyle and add ruff.

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Braden MacDonald <braden@opencraft.com>
2026-03-04 17:33:06 +00:00
Feanil Patel
7c9f468d56 refactor: Drop the unused legacy video upload page.
The legacy video uploads page in Studio has been replaced with a new
view in the Authoring MFE.  The legacy page has not been available for
some time, so it's all dead code. This PR removes it.

Please note that there's a waffle flag which enables the MFE version
of the video uploads page: `contentstore.new_studio_mfe.use_new_video_uploads_page`.
Unlike the other Studio MFE waffles, we're NOT going to remove this one now,
because the video uploads page has always been broken for sites other
than edx.org (or sites that have reverse-engineered their video pipeline) so
we'd like to keep the flag until it's either fixed for the community or
removed (https://github.com/openedx/openedx-platform/issues/37972).

This work is part of https://github.com/openedx/edx-platform/issues/36108

Co-Authored-By: Kyle McCormick <kyle@axim.org>
2026-02-26 15:59:57 -05:00
Braden MacDonald
12e9af4f5c fix!: split modulestore's has_course(ignore_case=True) was not working (#38044)
BREAKING CHANGE: this forces course IDs in modulestore to be unique (case insensitive). This was always supposed to be the case, but it wasn't working properly on MySQL. Upgrading past this commit may cause a migration failure if you have conflicting course IDs - see the migration 0004 docstring for details.
2026-02-25 09:05:15 -08:00
Braden MacDonald
3e522d5272 feat: bump opaque-keys to get case-sensitivity support + default max_length (#38044)
refactor: remove some 'max_length=255' to be more DRY

feat: example of making an OpaqueKeyField case_sensitive (modulestore_migrator)

test: update test now that we're using case-insensitive collation on SQLite
2026-02-25 09:05:15 -08:00
David Ormsbee
873f42ab14 refactor: update openedx_content contents -> media(#38037)
Update our calls to the openedx_content API to reflect 0.35.0's shift
in terminology from "contents" to "media".

---------

Co-authored-by: Kyle McCormick <kyle@axim.org>
2026-02-23 22:34:33 -05:00
Taylor Payne
7499a5f1e6 feat: authorize advanced settings endpoints via openedx-authz when fl… (#38009) 2026-02-19 12:03:11 -07:00
Irtaza Akram
76018183d4 Use runtime-provided XQueueService instead of constructing it in ProblemBlock (#37998)
* fix: move xqueue services
2026-02-19 11:02:00 +05:00
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
Kyle McCormick
a55c1ddabf chore: Switch to new openedx-learning import paths (#38004)
Upgrades openedx-learning from 0.31.0 to 0.32.0,
incorporating a major openedx-learning Python API
restructuring: ca0b3eb
2026-02-13 20:39:05 +00:00
Chris Chávez
ef8b03b07c fix: Typo in unsupported reason message in content libraries [FC-0114] (#38005)
- Fix a simple typo in an unsupported reason message for blocks with children in content libraries
2026-02-12 12:18:20 -05:00
salmannawaz
d20b87b180 Discussion service to enable permission and access provider (#37912)
* chore: discussion service to enable permission and access provider
2026-02-11 19:37:16 +05:00
Rodrigo Mendez
24468b6bf5 feat: Add enable_authz_course_authoring flag to course_waffle_flags endpoint (#37990) 2026-02-10 13:50:05 -07:00
Navin Karkera
8ca70db552 refactor: xblock api upstream info and course details api (#37971)
- Returns top parent key instead of boolean in upstream info api
- Adds edited_on raw time in course outline api
- Adds has_changes to course details api
2026-02-09 23:09:06 +00:00
David Ormsbee
9bf7a72a3a refactor: switch to use openedx_content app (#37924)
The openedx-learning repo was recently refactored to consolidate its
authoring apps into a single openedx_content app:

  https://github.com/openedx/openedx-platform/pull/37924

This commit makes the following changes to accommodate this:

- Bumps the openedx-learning version to 0.31.0 to get the changes.
- Creates new migrations in content_libraries, contentstore, and
  modulestore_migrator to foreign key references to authoring apps
  to point to the new openedx_content app. This is done without
  actually making database changes, since the openedx_content app
  models are taking over the existing tables that the authoring apps
  once pointed to.
- Creates new squashed migrations in these apps that create these
  foreign keys to reference openedx_content app models from the start.

The full rationale for how and why this was done is in the following
openedx-learning ADR:

  https://github.com/openedx/openedx-learning/blob/main/docs/decisions/0020-merge-authoring-apps-into-openedx-content.rst

These migrations should run fine from either a from-scratch scenario
(i.e. a new install or CI), or when upgrading from an Ulmo-or-later
database state. If you have a database state that comes from the middle
of the Ulmo development cycle (e.g. October 2025), you may encounter
migration errors in content_libraries, contentstore, or
modulestore_migrator, with an error message complaining about missing
tables. If you receive this message, run the following command:

  python manage.py lms migrate openedx_content 0001

Then try to run the migrations for the app that failed. Repeat if
necessary for multiple apps.
2026-02-04 12:41:13 -05:00
Brian Buck
c9704c28ee feat: Add Content Groups API v2 endpoints for Instructor Dashboard
- Add GET /api/instructor/v2/courses/{course_id}/group_configurations
- Add GET /api/instructor/v2/courses/{course_id}/group_configurations/{id}
- Create shared constants module for course groups
2026-01-30 11:58:51 -05:00
Kyle McCormick
497ffae5a7 docs: Add learnings about _services.copy() fix to preview.py (#37956)
Capturing what we learned in https://github.com/openedx/openedx-platform/pull/37900#issuecomment-3811194293
2026-01-28 19:50:37 +00:00
Chris Chávez
9f48073921 feat: Preview migration api [FC-0114] (#37818)
Implements a new API to get the summary preview of a migration given a library key and a source key.
2026-01-20 18:50:40 +00:00
Akanshu Aich
2d82d90279 refactor: migrated FEATURES dict settings to top-level in core files and fixed related test files. (#37389)
* refactor: moved remaining feature dicts settings into top-level settings.

* refactor: moved remaining feature dicts settings into top-level settings.

* fix: fixed the test files

* fix: fixed tehe pylint errors

* fix: fixation of the cms ci failure

* fix: fixed remaining feature settings for cms

* fix: added fix for requirements

* fix: added fix for lms tests

* fix: resolved the test views issue

* fix: configured views file and test_views

* fix: fixed lint errors and assertion issues

* fix: added fix for base url issue in test view

* fix: added fix for base_url and assertion issue

* fix: added configurations for base utl fix

* fix: handled none issue for mfe config

* fix: corrected override settings in test views

* fix: added getattr defensive technique for view settings

* fix: reverted views and test_views file

* fix: added settings in views file

* fix: added with patch within functions in test view

* fix: rearranged the features in default_legacy_config

* fix: fixing the tests  with clearing cache

* fix: reverted test views to verify the CI check

* fix: added cache clear in mfe config test

* fix: fixed the patch toggles to override settings

* fix: fixed the lint errors

* fix: changed patch toggle to override settings
2026-01-20 11:55:26 -05:00
Muhammad Arslan
68ba45a858 fix: video_config runtime service added when loading for xBlock (#37900)
Adding transcripts to Videos now goes through the new VideoConfigService
instead of direct calls from the VideoBlock. However, the VideoConfigService
was not added to Studio. This patch fixes transcript uploading by adding
the service to Studio.
2026-01-16 10:36:03 -05:00
Feanil Patel
908aca4409 fix: Remove unused bad validation for images.
The `CourseRunImageField` is a subclass of the DRF
`serializers.ImageField` serializer and that class ignores the
`default_validators` and actually just uses Django's image validation
which is already correct and does in fact validate that the image content
is correct not just that the image extension is correct.

The DRF code that does the validation:
https://github.com/encode/django-rest-framework/blob/main/rest_framework/fields.py#L1621-L1628

Which actually just calls the Django Image Validators.

The Django Field definition:
https://github.com/django/django/blob/main/django/forms/fields.py#L712

And you can see that in the
[`to_python`](https://github.com/django/django/blob/main/django/forms/fields.py#L721)
function of that class it actually checks the image content.

This function is never actually called and so it's just misleading.
2026-01-12 12:58:21 -05:00
Irtaza Akram
474dc71f0d chore: remove legacy problem studio view (#37795)
* fix: remove legacy problem studio view and resource templates
2026-01-08 13:07:15 +05:00
Muhammad Farhan Khan
0b628353ef refactor: move editor_saved to VideoConfigService (#37829)
refactor: move editor_saved to VideoConfigService (#37829)
* This moves edx-platform-specific logic out of the VideoBlock,
in preparation for the VideoBlock extraction
2026-01-08 11:50:08 +05:00
Irtaza Akram
33cc1a94ba chore: upstream ProblemBlock exceptions and shared utilities to XBlock (#37806)
* fix: add support for xblock 5.3.0
2026-01-07 13:30:53 +05:00
Ahtisham Shahid
9d2bbb1797 refactor: removed all references to CourseNotificationPreference (#37768) 2025-12-29 15:11:56 +05:00
Rômulo Penido
e26a3fb7e6 fix: add course name on collection description on import (#37817)
Co-authored-by: Chris Chávez <xnpiochv@gmail.com>
2025-12-24 18:25:09 +00:00
Navin Karkera
a37528d5ad feat: allow specifying custom page size for course list api (#37815) 2025-12-24 11:56:49 -05:00
Navin Karkera
32b7f27c46 feat: api to bulk update legacy library references (#37789)
Adds API to fetch all legacy library content blocks that are ready to be updated to use library v2 and convert to item banks.
Also adds API to update all the references via a user celery task and to fetch its status.
2025-12-22 12:49:43 -05:00
Muhammad Farhan Khan
f93322aae8 chore: remove unused copy_or_rename_transcript method
Merge pull request #37779 from openedx/farhan/remove-legace-code
2025-12-22 12:58:16 +05:00
David Ormsbee
f899c7907a fix: allow library creation by course creators
Prior to this, if ENABLE_ORGANIZATION_STAFF_ACCESS_FOR_CONTENT_LIBRARIES
was enabled, we would not return the orgs that someone had course
creator rights on, even if ENABLE_CREATOR_GROUP was enabled. (For the
moment, we are conflating "can create courses" with "can create
libraries" for a given org, even though we should probably eventually
split those apart.)
2025-12-18 22:56:33 -05:00
Kyle McCormick
91e521ef51 fix: Various fixes to modulestore_migrator (#37711)
For legacy library_content references in courses, this PR:
- **Removes the spurious sync after updating a reference to a migrated
  library**, so that users don't need to "update" their content _after_
  updating their reference, _unless_ there were real content edits that
  happened since they last synced. We do this by correctly associating a
  DraftChangeLogRecord with the ModulestoreBlockSource migration artifact,
  and then comparing that version information before offering a sync.
  (related issue:
  https://github.com/openedx/frontend-app-authoring/issues/2626).
- **Prompts users to update a reference to a migrated library with higher
  priority than prompting them to sync legacy content updates for that
  reference**, so that users don't end up needing to accept legacy content
  updates in order to get a to a point where they can update to V2 content.
- **Ensures the library references in courses always follow the correct
  migration,** as defined by the data `forwarded` fields in the data model,
  which are populated based on the REST API spec and the stated product UI
  requirements.

* For the migration itself, this PR:

- **Allows non-admins to migrate libraries**, fixing:
  https://github.com/openedx/edx-platform/issues/37774
- **When triggered via the UI, ensures the migration uses nice title-based
  target slugs instead of ugly source-hash-based slugs.** We've had this as an
  option for a long time, but preserve_url_slugs defaulted to True instead of
  False in the REST API serializer, so we weren't taking advantage of it.
- **Unifies logic between single-source and bulk migration**. These were
  implement as two separate code paths, with drift in their implementations. In
  particular, the collection update-vs-create-new logic was completely
  different for single-souce vs. bulk.
- **When using the Skip or Update strategies for repeats, it consistently
  follows mappings established by the latest successful migration** rather than
  following mappings across arbitrary previous migrations.
- **We log unexpected exceptions more often**, although there is so much more
  room for improvement here.
- **Adds more validation to the REST API** so that client mistakes more often
  become 400s with validation messages rather than 500s.

For developers, this PR:
- Adds unit tests to the REST API 
- Ensures that all migration business logic now goes through a general-purpose
  Python API.
- Ensures that the data model (specifically `forwarded`, and
  `change_log_record`) is now populated and respected.
- Adds more type annotations.
2025-12-18 23:49:36 +00:00
Navin Karkera
781feb1883 feat: suppress user task email after importing content in libraries (#37771) 2025-12-18 11:15:32 -05:00
Navin Karkera
ca78895edf chore: add end date to course outline api (#37727)
Co-authored-by: Chris Chávez <xnpiochv@gmail.com>
2025-12-17 17:22:05 +00:00
farhan
386dfe3e99 chore: remove unused copy_or_rename_transcript method 2025-12-17 21:04:15 +05:00
Jesus Balderrama
2637cc6b0f feat(numericalInput): endpoint added to validate a numerical input (#37677)
To be used in the visual Problem editor to validate numeric input. 

Part of: https://github.com/openedx/frontend-app-authoring/issues/1680
2025-12-16 17:23:31 -05:00
Chris Chávez
a032955243 feat: New states for library info icon in components in Unit page (#37735)
- Adds `upstream_name` to the `UpstreamLink` dataclass.
- Add new states to library info icon in components in Unit page
2025-12-16 19:18:24 +00:00
Feanil Patel
05d0d0936d Merge commit from fork
fix: CourseLimitedStaffRole should not be able to access studio.
2025-12-16 11:56:16 -05:00
Usama Sadiq
e1747f3844 build: add support for Python 3.12 (#37160)
* build: add support for Python 3.12
2025-12-15 12:12:29 +05:00
Navin Karkera
a3cc78a377 fix: handle PluginMissingError while migrating legacy blocks to libraries v2 (#37732)
Unhandled exception while migration legacy xblocks into new library stops the migration process abruptly causing following issues:

* Components not being collected into Collections for successful migrations
* Data being corrupted for already migrated blocks most likely due to incomplete transaction.
2025-12-12 16:47:02 +00:00
Feanil Patel
f2bb6cb2e6 fix: CourseLimitedStaffRole should not be able to access studio.
We previously fixed this when the CourseLimitedStaffRole was applied to
a course but did not handle the case where the role is applied to a user
for a whole org.  The underlying issue is that the CourseLimitedStaffRole
is a subclass of the CourseStaffRole and much of the system assumes that
subclesses are for giving more access not less access.

To prevent that from happening for the case of the CourseLimitedStaffRole,
when we do CourseStaffRole access checks, we use the strict_role_checking
context manager to ensure that we're not accidentally granting the
limited_staff role too much access.
2025-12-11 17:15:53 -05:00
Emad Rad
6a046ebe50 chore: fixed typos 2025-12-11 11:46:44 -05:00
David Ormsbee
dcd2258db4 fix: don't send emails on library backup/restore
There is no way to resume either the backup or restore library actions,
i.e. if you navigate away from it, you have to do it again. This is a
limitation of the current UI because we wanted to get something quick
and simple in for Ulmo, but it also reflects the fact that library
backup/restore should be much faster than course import/export has
historically been.

In any case, sending an email for a 5-10 second task is unnecessary and
distracting, so this commit suppresses the email.

Note: I'm using local imports to get around the fact that the
content_libraries public API is used by content_libraries/tasks.py
which defines the tasks. I can't import from content_libraries/tasks.py
directly, because that would violate import linter rules forbidding
other apps from importing things outside of api.py. This isn't ideal,
but it keeps the fix small and it keeps the logic in the
content_libraries app.
2025-12-05 12:24:00 -05:00
Muhammad Farhan Khan
b57e2ac1ea chore: move get_transcript method to video service (#37635)
https://github.com/openedx/public-engineering/issues/445
2025-12-05 17:53:10 +05:00
Chris Chávez
828d10400e feat: Add new fields in modulestore migratior serializers [FC-0112] (#37653)
`target_collection` and `task_uuid` added to migration serializers
2025-12-04 21:48:24 +00:00
Navin Karkera
562978990a feat: store information for failed block migrations (#37691)
* Updates `ModulestoreBlockMigration` table to allow storing `null` values in `target` field for blocks that failed to migrate/import.
* Adds `unsupported_reason` field to store reason for failure.
* Add number of children blocks in failed block `unsupported_reason` field. 
* Fixes issue with blocks like `openassessment` where `url_name` field is not included in its olx during serialization.
2025-11-27 12:39:20 -05:00
Muhammad Labeeb
8ad4d42e3b feat!: Remove proctortrack references; add requires_escalation_email and show_review_rules options (#37576)
BREAKING CHANGE: All references to the hardcoded 'proctortrack' string have
been removed from the codebase,  as well as the `studio.show_review_rules`
waffle flag. These were used to determine whether an escalation email is
required and whether review rules should be shown. These decisions are now made
based on the value of 'requires_escalation_email' (default False) and 'show_review_rules'
(default True) config items in the PROCTORING_BACKENDS entry.

Additionally:
* The proctoring info api will now return the list of providers which require an escalation
   email so that frontend-app-learning does not need to use a hardcoded check agaist
   the provider name 'proctortrack'.
* Removed translation commands, mock variables and user facing strings that contained
  'proctortrack'.
* Updated all test cases that were using proctortrack to use fake providers names.

Part of: https://github.com/openedx/edx-platform/issues/36329
2025-11-25 09:37:32 -05:00
Feanil Patel
b1f01ed8fa feat!: Drop the legacy Tabs UI (#37557)
This change drops the legacy studio custom pages UI aka. the tab edit
page.

This work is part of https://github.com/openedx/edx-platform/issues/36108

BREAKING CHANGE: The 'legacy_studio.custom_pages' waffle flag has been
removed and the code will work as if this flag is permanently set to
False.

Co-authored-by: Kyle McCormick <kyle@axim.org>
2025-11-20 23:36:10 +00:00
Feanil Patel
d929cdb7fa feat!: Drop the legacy studio updates page. (#37544)
Remove the legacy studio updates page and its related artifacts. They
have been replaced by API and a new UI in the authoring MFE.

This cleanup is a part of https://github.com/openedx/edx-platform/issues/36108

BREAKING CHANGE: The 'legacy_studio.updates' waffle flag will no longer
be respected. The system will behave as if the flag is set to false
permanently.
2025-11-20 23:00:13 +00:00
Feanil Patel
5d0d60d426 feat!: Drop support for the legacy textbooks page. (#37545)
The legacy textbooks page has been replaced with an authoring MFE
equivalent.  We don't need to keep the old one around.

This work is part of https://github.com/openedx/edx-platform/issues/36108

BREAKING CHANGE: With this change the `legacy_studio.textbooks` waffle
flag will no longer be respected and the system will behave as if the
flag is always set to False.
2025-11-20 17:56:11 -05:00
Feanil Patel
1253831c52 Merge pull request #37561 from kiran1415/kiran/remove-unused-task-code
fix: removed unused task code
2025-11-20 11:17:13 -05:00