572 Commits

Author SHA1 Message Date
Braden MacDonald
3fa779479e feat: update openedx-core: new catalog models + backfill migration (#38023)
Some checks failed
Pylint Checks / pylint xmodule (push) Has been cancelled
Quality checks / Quality Others (20, ubuntu-24.04, 3.11) (push) Has been cancelled
Semgrep code quality / Semgrep analysis (ubuntu-latest, 3.11) (push) Has been cancelled
ShellCheck / shellcheck (ubuntu) (push) Has been cancelled
static assets check for lms and cms / static-assets-check (7.0, 20, 10.7.x, ubuntu-24.04, 3.11) (push) Has been cancelled
unit-tests / xmodule-with-cms(py=3.11,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / xmodule-with-lms(py=3.11,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / cms-1(py=3.11,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / cms-2(py=3.11,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / common-with-cms(py=3.11,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / common-with-lms(py=3.11,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / lms-1(py=3.11,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / lms-2(py=3.11,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / lms-3(py=3.11,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / lms-4(py=3.11,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / lms-5(py=3.11,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / lms-6(py=3.11,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / openedx-1-with-cms(py=3.11,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / openedx-1-with-lms(py=3.11,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / openedx-2-with-cms(py=3.11,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / openedx-2-with-lms(py=3.11,dj=pinned,mongo=7.0) (push) Has been cancelled
ShellCheck / shellcheck (macos) (push) Has been cancelled
Javascript tests / JS (20, ubuntu-latest, 3.11) (push) Has been cancelled
Pylint Checks / pylint cms (push) Has been cancelled
Lint Python Imports / Lint Python Imports (push) Has been cancelled
Lockfile Version check / version-check (push) Has been cancelled
Check Django Migrations / check migrations (pinned, 7, 8, ubuntu-24.04, 3.11) (push) Has been cancelled
Pylint Checks / pylint common (push) Has been cancelled
units-test-scripts-common / test (3.12) (push) Has been cancelled
units-test-scripts-user-retirement / test (3.12) (push) Has been cancelled
Verify Dunder __init__.py Files / Verify __init__.py Files (push) Has been cancelled
Pylint Checks / pylint lms-1 (push) Has been cancelled
Pylint Checks / pylint lms-2 (push) Has been cancelled
Pylint Checks / pylint openedx-1 (push) Has been cancelled
Pylint Checks / pylint openedx-2 (push) Has been cancelled
unit-tests / cms-1(py=3.12,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / cms-2(py=3.12,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / common-with-cms(py=3.12,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / common-with-lms(py=3.12,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / lms-1(py=3.12,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / lms-2(py=3.12,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / lms-3(py=3.12,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / lms-4(py=3.12,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / lms-5(py=3.12,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / lms-6(py=3.12,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / openedx-1-with-cms(py=3.12,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / openedx-1-with-lms(py=3.12,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / openedx-2-with-cms(py=3.12,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / openedx-2-with-lms(py=3.12,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / xmodule-with-cms(py=3.12,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / xmodule-with-lms(py=3.12,dj=pinned,mongo=7.0) (push) Has been cancelled
unit-tests / collect-and-verify (push) Has been cancelled
Pylint Checks / Pylint checks successful (push) Has been cancelled
Check Django Migrations / Migrations checks successful (push) Has been cancelled
unit-tests / Unit tests successful (push) Has been cancelled
unit-tests / compile-warnings-report (push) Has been cancelled
unit-tests / merge-artifacts (push) Has been cancelled
unit-tests / coverage (3.11) (push) Has been cancelled
Upgrade Requirements / call-upgrade-python-requirements-workflow (push) Has been cancelled
* feat: use new version of openedx-core
* feat: Use openedx_catalog app, backfill it with all known courses
* feat: properly set "created" timestamp on course runs during backfill
* fix: better normalization of language codes
* feat: keep courses in sync with CourseRun/CatalogCourse
* feat: delete CourseRun/CatalogCourse when deleting a course
* refactor: course_id -> course_key, run -> run_code, display_name -> title
* fix: don't use SplitModulestoreCourseIndex for getting list of all courses
2026-03-09 17:24:02 -07:00
Muhammad Waleed
11840267f0 Fix: Create SearchAccess on library creation for course creator search access (#38091)
* fix: create SearchAccess on library creation for course creator search access

When a course creator creates a new library, the SearchAccess record must exist immediately so their JWT token can include the library's access_id. Without this, course creators cannot see newly added components in search results until the page is refreshed.

This issue doesn't affect superusers who bypass access_id filtering.

* test: verify SearchAccess is created automatically on library creation

---------

Co-authored-by: Usama Sadiq <usama7274@gmail.com>
2026-03-05 15:21:42 +05:00
Feanil Patel
8143796b26 docs: update references from setup.py to pyproject.toml
Update documentation, comments, and docstrings throughout the codebase
to reflect the migration from setup.py to pyproject.toml:

- Transformer class docstrings: changed to reference "entry point name
  in the package configuration" for better future-proofing
- Block structure module docs: updated to reference pyproject.toml
- Test file comments: updated entry point references
- Config files (tox.ini, pytest.ini): updated references
- Documentation (extension_points.rst, course apps ADRs): updated to
  reference pyproject.toml with inclusive language for external packages
- Requirements documentation (github.in): updated with inclusive language
- edxmako README: modernized install command to use pip install

Historical ADRs and references to external packages that may still use
setup.py were intentionally left unchanged or updated with inclusive
language acknowledging both pyproject.toml and setup.py.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-03 10:46:16 -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
Muhammad Qasim Gulzar
d847d222b2 fix: migrations to make postgresql compatible. (#35762)
This commit introduces several improvements to database migration
scripts to enhance compatibility between MySQL and PostgreSQL, ensure
case-sensitive behavior where needed, and improve migration safety and
correctness. The changes include dynamic SQL generation based on the
database engine, improved transaction handling, and adjustments to
field types and adapters for better cross-database support.

Database compatibility and case sensitivity improvements:

- Migration scripts in split_modulestore_django and learning_sequences
  now dynamically generate SQL statements for altering column case
  sensitivity and uniqueness based on whether the database is MySQL or
  PostgreSQL, ensuring correct behavior across both backends.
  - common/djangoapps/split_modulestore_django/migrations/0001_initial.py
  - openedx/core/djangoapps/content/learning_sequences/migrations/0001_initial.py

- The courseware.fields module now checks for "postgresql" in the
  database engine string instead of a specific backend name, improving
  compatibility with different PostgreSQL drivers.
  - lms/djangoapps/courseware/fields.py

- The 0011_csm_id_bigint migration in courseware now supports both MySQL
  and PostgreSQL for altering column types, with specific SQL for each
  backend.
  - lms/djangoapps/courseware/migrations/0011_csm_id_bigint.py

- The 0009_readd_facebook_url migration in course_overviews now
  introspects the table structure using backend-specific SQL for MySQL
  and PostgreSQL, ensuring correct detection of existing fields.
  - openedx/core/djangoapps/content/course_overviews/migrations/0009_readd_facebook_url.py

Migration safety and correctness:

- Service user creation and deletion in the commerce app is now wrapped
  in atomic transactions to ensure database consistency.
  - lms/djangoapps/commerce/migrations/0001_data__add_ecommerce_service_user.py

- The move_overrides_to_edx_when migration in courseware now specifies
  a no-op reverse migration, preventing accidental data loss on migration
  rollback.
  - lms/djangoapps/courseware/migrations/0008_move_idde_to_edx_when.py

Adapter registration and code cleanup:

- The common_initialization app now registers custom adapters for
  CourseLocator and related classes in psycopg2 when using PostgreSQL,
  ensuring proper serialization of these types.
  - openedx/core/djangoapps/common_initialization/apps.py

- Minor code cleanup and formatting improvements in migration files,
  including import order and field formatting for readability.
  - lms/djangoapps/grades/migrations/0015_historicalpersistentsubsectiongradeoverride.py
2026-02-12 14:02:46 -05: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
Muhammad Arslan
328b3ee3fa fix: remove the branch/version while building BS (#37866)
This commit updates the logic in the build_block_structure function to
ensure that block locations are consistently normalized by removing
branch and version information. This change addresses issues when
creating a BlockStructure from modulestore using the published_only
branch. Without this change, we end up comparing versioned keys to
unversioned ones later on, which always yields False.
2026-01-14 20:26:45 -05:00
Taylor Payne
7111e8b18c refactor: bring common settings into common module (#37746) 2026-01-09 09:20:59 -07:00
Ahtisham Shahid
9d2bbb1797 refactor: removed all references to CourseNotificationPreference (#37768) 2025-12-29 15:11:56 +05:00
Braden MacDonald
4690913a04 feat: remove "experimental" param from reindex_studio (#37546) 2025-10-29 13:52:06 -07:00
Tarun Tak
18d5abb2f6 chore: Replace pytz with zoneinfo for UTC handling - Part 1 (#37523)
First PR to replace pytz with zoneinfo for UTC handling across codebase.

This PR migrates all UTC timezone handling from pytz to Python’s standard
library zoneinfo. The pytz library is now deprecated, and its documentation
recommends using zoneinfo for all new code. This update modernizes our
codebase, removes legacy pytz usage, and ensures compatibility with
current best practices for timezone management in Python 3.9+. No functional
changes to timezone logic - just a direct replacement for UTC handling.

https://github.com/openedx/edx-platform/issues/33980
2025-10-28 16:23:22 -04:00
Daniel Wong
6deb4f8d05 fix: add to search index when creating library from archive (#37526)
Implement full re-index process when creating a library.
2025-10-27 17:53:07 -04:00
Navin Karkera
8aaae4604a fix: index and entity link sync issues on parent block deletion (#37541)
Meilisearch index documents were not synced properly when any block with children blocks like units, subsections, sections etc. were being deleted as the `XBLOCK_DELETED` is only triggered for the deleted block.
This PR fixes it by deleting all index documents that contain the deleted block in its `breadcrumbs` field as only blocks that are children of this block will have it its breadcrumbs field.

Similarly, the entity links that store links between course and library blocks was not synced properly due to children `ContainerLinks` not being deleted.
2025-10-27 13:44:36 -05:00
Chris Chávez
3f5ac6ddbc fix: Update on_commit_changes_to of modulestore to check MySQL transaction [FC-0097] (#37485)
- `handle_update_xblock_upstream_link` is called asynchronously with celery. In `update_upstream_downstream_link_handler`, the xblock has the updated version, but when calling `handle_update_xblock_upstream_link` inside Celery, the xblock is outdated in a previous version, which is why the error occurs. This happens because `on_commit_changes_to` is executed before the MySQL transaction ends.
- Added `ImmediateOnCommitMixin` to be used in tests that need to call `on_commit_changes_to`. See https://github.com/openedx/edx-platform/pull/37485#issuecomment-3412979170  for more info
2025-10-20 17:02:04 -05:00
Abdul-Muqadim-Arbisoft
e5b497cbba fix: prevent None entrance_exam_minimum_score_pct from breaking CourseOverview sync (#37339)
* fix: prevent None entrance_exam_minimum_score_pct from breaking CourseOverview sync

When entrance exams are disabled in Studio, the field
`entrance_exam_minimum_score_pct` was set to `None`. This caused silent failures
when saving `CourseOverview` because the database column requires a float (NOT NULL).

This patch ensures that:
- CourseOverview sanitizes None values by falling back to
  `settings.ENTRANCE_EXAM_MIN_SCORE_PCT` (default=50).
- Studio avoids writing `None` and instead applies the configured default.

Impact:
- Prevents IntegrityErrors and silent failures when updating course settings.
- Restores proper syncing between modulestore (Mongo) and CourseOverview (MySQL).
- Fixes reported issues such as display name changes not persisting and course
  start dates not syncing.

Closes: https://github.com/openedx/edx-platform/issues/37319#

* refactor: clean up entrance_exam_minimum_score_pct handling

- Consolidate logic to avoid repeated assignments
- Centralize None fallback and int/float normalization
- Improve readability with inline comment and consistency with Open edX style

* test: update entrance exam deletion test to expect default min score

- Adjusted `test_entrance_exam_created_updated_and_deleted_successfully` to check for
  `settings.ENTRANCE_EXAM_MIN_SCORE_PCT` instead of `None` after exam deletion
- Added handling for both int and float defaults (`/100` for integer case)
2025-10-08 15:26:00 +05:00
Braden MacDonald
245b861e01 fix: reindex_studio could crash if an XBlock child isn't loadable (#37177)
Co-authored-by: Chris Chávez <xnpiochv@gmail.com>
2025-10-02 18:22:28 -07:00
Muhammad Arslan
51ac947caf fix: always generate block structure from "published-only" branch (#37335)
Block structures are meant to be an optimization for the LMS, meaning
that they should always be collecting from the published branch of
modulestore. This is what happens by default when it's run from the LMS
celery process, but this code is sometimes invoked from a Studio worker
(e.g. development mode celery, running in immediate in-proc mode).

---------

Co-authored-by: Peter Pinch <pdpinch@mit.edu>
2025-09-26 20:58:12 -04:00
Awais Qureshi
ec83b2aa64 fix: Updated tuple unpacking of signal receivers to match current structure in django52. (#37249) 2025-08-27 17:38:08 +05:00
Navin Karkera
617b6447cc feat: reindex course and recreate upstream links post import and course re-run (#37237)
Index the newly created course after import and course re-run. Also recreate upstream links after course re-run.

We make use of newly created COURSE_RERUN_COMPLETED signal to run post re-run processes.
2025-08-21 18:15:55 +00:00
Daniel Wong
f114399e12 fix: update resolve_storage_backend function and fix tests 2025-08-06 13:25:10 -06:00
Daniel Wong
2b9fb55231 feat: deprecate get_storage_class 2025-08-06 13:25:10 -06:00
Navin Karkera
b27c41cc8c fix: updating search index on container delete and restore (#36956)
Update children and parents index data on container delete and restore.
2025-06-30 17:59:07 +00:00
Chris Chávez
2759d15cca feat: Support to sections/subsections dict to containers objects in index [FC-0090] (#36806)
- Adds the subsections dict in the search index to be used by units
- Adds the sections dict in the search index to be used by sections.
- Rename `get_containers_contains_component` to `get_containers_contains_item` and add support to subsections/sections 
- Call `CONTENT_OBJECT_ASSOCIATIONS_CHANGED` for sections and subsections in `update_container_children`
2025-06-02 12:41:07 -05:00
Chris Chávez
c2eb913dcb feat: Basic CRUD support for sections/subsections as containers [FC-0090] (#36762)
- Refactor of `test_containers.py` 8b9731dfa1
- Updates the `content_libraries/api/containers` and `content_libraries/rest_api` to support:
    - Basic CRUD for sections and subsections as containers
    - Basic CRUD support for section and subsection children
- Updates the `content/search` to support:
    - Basic CRUD for sections and subsections as containers in the search index
    - Basic CRUD support for section and subsection children in the search index
- Updates the `content_libraries/tests/test_containers.py` to test the new support
- Updates the `content/search/tests` to test the new support.
- I verified that the add/remove to collection works without major changes. Tests updated
2025-05-28 21:05:45 +00:00
Chris Chávez
27c4ea44f2 feat: Add units dict to index [FC-0083] (#36650)
* Adds the units dict to the component search documents.
* Send CONTENT_OBJECT_ASSOCIATIONS_CHANGED signal when add/remove components in units.
2025-05-19 17:34:39 +00:00
Usama Sadiq
956a28996a fix: refactor index_together to indexes for Django 5.2 support (#36693) 2025-05-12 11:46:47 +05:00
Braden MacDonald
2e91a05112 fix: Bugs with "Publish All Changes" in Library [FC-0083] (#36640)
* fix: "[created] received a naive datetime"
* fix: leaky "isolation" of events was causing test failures
* fix: make lib events more specific, emit them async, handle hierarchy correctly
* chore: bump openedx-events to 10.2.0 for new library PUBLISHED events
2025-05-08 11:57:07 -07:00
Jillian
5b3caa93e2 feat: store content.child_usage_keys in Container search document [FC-0083] (#36528)
* feat: store content.child_usage_keys in Container search document
  Stores the draft children + published children (if applicable)

Related fixes:
* fix: lib_api.get_container does not take a "user" arg
* refactor: fetch_customizable_fields_from_container does not need a "user" arg
* refactor: moves tags_count into LibraryItem
   because anything that appears in a library may be tagged.
* refactor: remove get_container_from_key from public API
   API users must use get_container and ContainerMetadata.
* refactor: made set_library_item_collections take an entity_key string instead of
  a PublishableEntity instance, so we don't need to fetch a Container object to call it.
* refactor: changed ContainerLink.update_or_create to take the container PK
  instead of a Container object, since this is enough.
  Added container_pk to ContainerMetadata to support this.
2025-05-02 10:47:25 +09:30
Navin Karkera
c2d9e40be4 refactor: update sync model helper function docs and minor cleanup (#36599)
* refactor: update sync model helper function docs

Adds some comments to explain certain confusing sections

* refactor: sync library content method

* feat: use edited_on block field

* test: modified field in course block index

* fix: extract uncommon methods to child class from base
2025-04-30 13:40:52 -07:00
Braden MacDonald
867e246606 chore: bump opaque-keys to v3, update content libraries key usages (#36588)
See https://github.com/openedx/opaque-keys/pull/379
2025-04-23 22:03:01 +00:00
Chris Chávez
f5e0500854 feat: Add new publish field on container search document (#36551)
* Added publish_display_name and last_published on container search document.
* This change is used in feat: Add unit from library in course [FC-0083] frontend-app-authoring#1829 to show only published units in the unit picker, also to show the published_display_name in the picker, and avoid empty titles.
* Which edX user roles will this change impact? "Developer".
2025-04-22 16:58:57 +00:00
Rômulo Penido
1047ed4d5b feat: collections support for containers [FC-0083] (#36504)
Adds support for adding Containers to Collections.
2025-04-15 13:12:51 -05:00
Jillian
11bab7d2ed refactor!: use LibraryCollectionLocator and LibraryContainerLocator [FC-0083] (#36476)
efactors the content_libraries.api to use LibraryCollectionLocator and LibraryContainerLocator keys, instead of passing separate LibraryUsageKeyV2 keys along with the collection/container locators.

Renames misleading uses of collection_usage_key to collection_locator, including in the content_libraries.api and content.search.api method names and parameters.

This change impacts Developers, but should not affect end users.

This refactoring seems reasonable to do without going through deprecation, given the minimal use of these APIs.
2025-04-11 10:21:58 -05:00
Chris Chávez
dc4144ec95 feat: add restore container API, delete index when deleting container (#36464) 2025-04-10 15:15:53 -07:00
Muhammad Umar Khan
b9556211be chore: fix cache content size calculation error (#36511)
Co-authored-by: M Umar Khan <umar.khan@A006-01609.local>
2025-04-10 15:22:28 +05:00
Rômulo Penido
a0d99315ad feat: container support for tags [FC-0083] (#36484)
* feat: container tag support

* fix: fixes from review

* docs: fix typo
2025-04-10 11:14:54 +05:30
Chris Chávez
1c14c3a518 feat: Update containers in search index on components update/delete [FC-0083] (#36432)
* feat: Added get_containers_contains_component in containers api with tests

* feat: Add publish_status to containers search document

* feat: Add LIBRARY_CONTAINER_UPDATED whend deleted a component inside a container

* feat: Send LIBRARY_CONTAINER_UPDATED signal when updating component of container

* fix: Bugs sending LIBRARY_CONTAINER_UPDATED signal

* feat: Add publish_status of container as PublishStatus.Never by default

* refactor: ContentLibraryContainersTest to use update_container_children to add components

* style: Clean code after fix conflicts

* fix: Broken lint

* fix: lint
2025-04-02 18:46:41 +05:30
Navin Karkera
bcaa79cc38 feat: api for adding, removing and updating components in container (#36434)
* feat: add components to container api

* feat: remove and replace components in container api

* refactor: container childern api

* chore: fix lint issues

* temp: install openedx-learning dev branch

* feat: update publish_status and children count in index

* chore: fix mypy issues

* test: fix reindex test

* refactor: rebase and fix conflicts

* test: update test to check signals

* docs: document can_stand_alone flag

* chore: bump openedx-learning version
2025-03-31 17:40:17 +05:30
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 Umar Khan
ae6b9c1b4a chore: add monitoring on blockstructure_size (#36424)
Co-authored-by: M Umar Khan <umar.khan@A006-01609.local>
2025-03-21 14:41:19 +05:00
Muhammad Umar Khan
4195186b04 chore: skip data caching for blockstructure content more than or equal to 2MB (#36397)
Co-authored-by: M Umar Khan <umar.khan@A006-01609.local>
2025-03-18 14:05:10 +05:00
Braden MacDonald
f700c89357 refactor: convert content libraries python API from attr.s to dataclass, fix types [FC-0083] (#36381)
* refactor: convert libraries API from attr.s to dataclass, fix types
* fix: make corresponding updates to 'search' code
2025-03-18 02:40:55 +10:30
Daniel Valenzuela
182bfc4031 feat: add publish status to library meilisearch index [FC-0076] (#36031)
Adds the publish status field to the libraries v2 meilisearch index in order to support filtering by component publish status: published, modified, never.
2025-02-05 17:30:19 +00:00
Navin Karkera
cd9b90fc21 feat: show math in plain text in library cards (#36055)
Converts mathjax equations to unicode to be rendered as plain text in library card previews
2025-01-13 13:09:47 -05:00
Kyle D. McCormick
50944e9d75 build: Very explicitly annotate a model field so that it passes mypy
This clunky yet type-safe workaround to this django-stubs issue, which
arose when we upgraded django-stubs in the previous commits:
https://github.com/typeddjango/django-stubs/issues/1802
2025-01-02 14:42:09 -05:00
Navin Karkera
971afe6095 feat: api to restore soft-deleted component [FC-0076] (#35993)
Adds API to handle restoring soft-deleted library blocks.
2024-12-13 13:17:46 -05:00
Tim McCormack
b6774f59f3 docs: Remove mention of storage_backing_for_cache flag
The Waffle switch `block_structure.storage_backing_for_cache` was removed in https://github.com/openedx/edx-platform/pull/35185 -- this is just a lingering reference in a setting comment.
2024-12-09 17:20:34 -05:00
Daniel Valenzuela
b07464ba2d feat: incremental reindex_studio management command (#35864)
This allows large instances to run an (interruptable, resumable) reindex task that can cover thousands of courses.
2024-12-06 12:30:38 -08:00
Chris Chávez
d5850c812c fix: keep library collection card component count in sync (#35734)
Fixed component counter synchronization in these cases:

* When deleting a component inside a collection.
* With the library published, when adding a new component in a collection and reverting library changes.
* With the library published, when deleting a component inside a collection and reverting library changes.

Also adds a published > num_counts field in collections in the search index.
2024-11-19 15:45:34 -05:00