Lint against imports of openedx_catalog internals in openedx-core
Los mantenedores suelen responder en 1 día
@ufedaseyeuconsultant ya está trabajando en esto.
Desde el 9/10/2026.
- #861 de @ufedaseyeuconsultant — abierto
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Description
Add an import-linter contract to openedx-core that only lets other apps import openedx_catalog's public modules (api, models_api, data, tests), matching the rule openedx-platform already enforces. That way an import of openedx_catalog's internals fails CI in openedx-core instead of surfacing later, when openedx-platform installs a new openedx-core release.
Context
- openedx/openedx-core#853 fixed an import of
openedx_catalog.modelsin CBE code. openedx-platform's import linter caught it during openedx/openedx-platform#39199, the PR bumping openedx-core's version there; openedx-core's own linter had no rule against it. - @ormsbee asked for this contract in his review of #853 and agreed it should be a separate follow-up PR so the version bump wasn't held up.
- Only
openedx_catalogis in scope. Other apps, such asopenedx_tagging, have nomodels_api.pyyet, so adding them would need a separate design decision.
Acceptance Criteria
-
.importlinterhas a contract that treatsopenedx_catalogas an isolated app: code outsideopenedx_catalogmay import only itsapi,models_api,data, andtestsmodules. -
lint-importspasses onmainwith the new contract. Today the only import ofopenedx_catalogfrom another app isfrom openedx_catalog.models_api import CourseRunincriteria.py, which is allowed. - The PR description shows that the contract catches a real violation: temporarily changing that
criteria.pyline back tofrom openedx_catalog.models import CourseRunmakeslint-importsfail and name that line. -
openedx_taggingand the other apps are not added to the contract.
Technical Details
This is a suggested approach, not the source of truth. The User Story, Description, and Acceptance Criteria define what must be true when the work is done.
Approach
- Copy openedx-platform's
IsolatedAppsContract(openedx/testing/importlinter/isolated_apps_contract.py, about 60 lines) into openedx-core. It has to be a copy because openedx-core must never import from openedx-platform. Put it in the root-leveltest_utilspackage (for exampletest_utils/importlinter.py) rather than undersrc/, so the published package doesn't ship lint tooling. - Register it in
.importlinterwithcontract_types = isolated_apps: test_utils.importlinter.IsolatedAppsContractin the[importlinter]section, then add a contract withisolated_apps = openedx_catalogandallowed_modules = api, models_api, data, tests, matching openedx-platform's contract so the two repos enforce the same rule. - Add a short comment above the new contract explaining why it exists: openedx-platform enforces the same rule, so a violation here would otherwise only surface when openedx-platform installs a new openedx-core release.
lint-imports already runs in CI through tox -e quality, so no workflow change is needed.
Additional context
- openedx-platform's contract definition: the
isolated_appsblock in openedx-platform'spyproject.toml.
- Lenguaje dominante
- Python
- Estrellas
- 10
- Forks
- 33
- Merge medio
- 2 d 23 h
- PR fusionados (30 d)
- 22
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de openedx/openedx-core
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
openedx/openedx-core#831 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
openedx/openedx-core#827 ·
Los mantenedores suelen responder en 1 día
-
Implement devstack-only support for viewing Assets in the content libraries UI [Optional] [FC-0138]Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
openedx/openedx-core#891 ·
Los mantenedores suelen responder en 1 día
-
Implement shared assets in openedx_content [FC-0138]Posiblemente ocupada @bradenmacdonald la tomó hace 1 día. Abierto
openedx/openedx-core#890 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[Bug] Competency Management page: the course panel doesn't match the competency tree's height and grows with its contentPosiblemente ocupada @AShatsila la tomó hace 5 días. Abierto
openedx/openedx-core#873 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de openedx/openedx-core
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
anchore/grype-db#1149 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Bug]: `hermes plugins update` clones an entire monorepo twice - `subdir` is resolved but dropped at both catalog-update call sitesPosiblemente ocupada @HootRock la tomó hoy. Abiertocomp/cli P2 type/perf
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
NousResearch/hermes-agent#142417 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
SMC SPEC
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
tenstorrent/tt-oca-harness#3287 ·
Los mantenedores suelen responder en 1 día
-
bug enhancement python
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
DewaldOosthuizen/tech-cheat-sheets-and-notes#392 ·
Los mantenedores suelen responder en 1 día
-
Critical advisories on mainAbiertosecurity
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
fabriziosalmi/wildbox#801 ·
Los mantenedores suelen responder en 1 día