Repository navigation
CBE app foundation + CompetencyTaxonomy model #640
Description
EDIT:
This subtask was mixed up accidentally - it was just a copy of #641 . I had Claude fix it; but I haven't reviewed this in-depth yet.
Either way the parent ticket can be viewed as source of truth.
Description
Parent: #613. This ticket is the foundation of the three-way split: it creates the Django
app the CBE models live in and the single model that both follow-up tickets depend on,
CompetencyTaxonomy. See #613 for full background, ADR-0001
for app placement, and ADR-0002/ADR-0003 for the model.
Nothing else can start until this merges: #641 needs the app to exist and needs
CompetencyTaxonomy for CompetencyRuleProfile.competency_taxonomy_id; #642 needs the app to
exist. Once this is in, #641 and #642 can be developed in parallel.
What to build
1. The openedx_learning umbrella app and the cbe applet
ADR-0001 places CBE at src/openedx_learning/applets/cbe/, inside a new top-level
openedx_learning app that aggregates its applets into one Django app and Python API, the same
way src/openedx_content does today. That umbrella package does not exist in this repo yet —
ADR-0001 assumed the Learning Pathways workstream would have created it, and it hasn't. So this
ticket creates it:
src/openedx_learning/__init__.py,src/openedx_learning/apps.py— oneAppConfigfor the
whole app (name/label=openedx_learning), mirroringContentConfigin
src/openedx_content/apps.py. Individual applets do not get their ownapps.py.src/openedx_learning/applets/__init__.pysrc/openedx_learning/applets/cbe/__init__.py,models.py(ormodels/),admin.pysrc/openedx_learning/applets/cbe/migrations/0001_initial.py
2. Wire it up
- Add
"openedx_learning"toINSTALLED_APPSintest_settings.py. - Add
openedx_learningtoroot_packagesin.importlinter, and place it in the
src_layeringcontract aboveopenedx_tagging. The constraint that matters (agreed in
[BE] Implement CBE core data models (CompetencyTaxonomy, criteria, learner status) #613's comments and consistent with [BE] Update taxonomy Create & Import endpoints to accept Taxonomy Type #614): the CBE applet may depend onopenedx_tagging;
openedx_taggingmust never depend on or know about CBE.
django-simple-history needs no requirements work: django-simple-history==3.12.0 is already in
requirements/base.txt. #613's Technical Notes say "add if not already present" — it is present.
3. CompetencyTaxonomy
Per ADR-0002 Decision 1, a Django multi-table-inheritance subclass of openedx_tagging's
Taxonomy, marking a taxonomy as CBE-enabled:
class CompetencyTaxonomy(Taxonomy):
...taxonomy_ptr_idis both the PK and the one-to-one FK tooel_tagging_taxonomy.id. It is
created implicitly by MTI — do not declare it manually.- Not a
taxonomy_typecolumn onoel_tagging_taxonomy. The ADR rejected that. - No
HistoricalRecords(). ADR-0003 Decision 2 explicitly excludesCompetencyTaxonomy,
oel_tagging_taxonomy, andoel_tagging_tagfromdjango-simple-history.
Acceptance criteria (from #613)
Copied verbatim from #613; only the ones this ticket is responsible for.
-
CompetencyTaxonomyuses Django MTI (not ataxonomy_typecolumn);taxonomy_ptr_idis both the PK and FK tooel_tagging_taxonomy.id -
django-simple-historyis not applied tooel_tagging_tag,oel_tagging_taxonomy, orCompetencyTaxonomy - No columns exist on any model that are not defined in the ADRs
- All FK relationships match the ADR definitions exactly
Additional acceptance criteria (from splitting this out of #613)
Not in #613 verbatim; needed because #613 was split into three tickets.
- The app exists at
src/openedx_learning/applets/cbe/per ADR-0001, with a single
AppConfigforopenedx_learning, and is registered intest_settings.py
INSTALLED_APPS. -
.importlinteris updated:openedx_learningadded toroot_packagesand placed in
src_layeringaboveopenedx_tagging.lint-importspasses. The rules are not loosened
to make it pass. -
migrations/0001_initial.pycreates theCompetencyTaxonomytable and applies cleanly
against an empty database. ([BE] Implement CBE core data models (CompetencyTaxonomy, criteria, learner status) #613's "apply cleanly from scratch" is verified end-to-end
across the three merged tickets.) -
CompetencyTaxonomyis annotated.. no_pii:. This is this ticket's slice of [BE] Implement CBE core data models (CompetencyTaxonomy, criteria, learner status) #613's
PII-annotation AC; the fullmake pii_check100%-coverage gate is verified in Mastery status lookup + learner progress models #642. - No index from ADR-0002 Decision 5 lands in this ticket: none of them target
CompetencyTaxonomy. Called out so the whole-feature "all indexes present" gate (verified
in Mastery status lookup + learner progress models #642) isn't read as a miss here.
Open questions to confirm before starting
- Does this ticket really create the
openedx_learningumbrella app? ADR-0001 defers that
to the Learning Pathways workstream, which has not started and has no date. The alternative,
putting CBE underopenedx_content/applets/, was explicitly rejected by ADR-0001 (Alt 3)
because it would couple the authoring-onlyopenedx_contentapp toAUTH_USER_MODELand
runtime learner-status concerns. Creating the umbrella here is the ADR-compliant reading, but
it is more work than "add an applet" and should be confirmed. taxonomy_overrides_org. The current ADR-0002 on branchjesperhodge/competency-adr-4
adds ataxonomy_overrides_orgboolean (defaultfalse) toCompetencyTaxonomy, used only
as the org-vs-taxonomy tiebreak in Decision 4, and read by no code path in this phase. It did
not exist in the ADR revision this ticket family was written against, and ADR-0004/ADR-0005
are not yet onmain. Confirm whether this column is in scope now or lands when that ADR PR
merges.
Out of scope
The three criteria models CompetencyCriteriaGroup, CompetencyCriteria,
CompetencyRuleProfile (#641); the mastery-status lookup and learner progress models (#642);
delete protection and on_delete=PROTECT (#642); any history tracking; any REST API or UI work.
Depends on
Nothing. This is the first of the three to merge and unblocks both #641 and #642.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
test: include CompetencyTaxonomy in openedx#613's whole-feature gates
test: include CompetencyTaxonomy in openedx#613's whole-feature gates
test: include CompetencyTaxonomy in openedx#613's whole-feature gates