Skip to content

[BE] Add archived field to Competency Criteria & Group models #716

Closed

Description

@thelmick-unicon

Blocked by: #613 (the CBE data model these two models belong to).

Repo: openedx-core, single-repo. No openedx-platform changes.

Use Case

As a developer implementing CBE's archive-vs-delete behavior across several tickets (#674, #675, the create-side archived-branch guard, and eventually #681), I want CompetencyCriteriaGroup and CompetencyCriterion to have a settled archived field from the start, so that none of those tickets has to race to add it themselves or coordinate around who lands first.

Description

Current state

Neither CompetencyCriteriaGroup nor CompetencyCriterion has an archived field. Multiple downstream tickets each need it to implement ADR 0002 Decision 7's archive-only retirement rule, and were drafted with "whichever lands first adds it" coordination language instead of a single owner.

Requested change

Add archived = models.BooleanField(default=False) to both CompetencyCriteriaGroup and CompetencyCriterion, in one migration. No archived_at companion field: django-simple-history (already applied per ADR 0003) covers the "when." This ticket makes no behavior changes: nothing here sets the field to True or reads/filters on it, that's downstream tickets' scope.

Explicitly out of scope

  • Setting archived=True anywhere.
  • Filtering or checking archived anywhere.
  • Any UI.

Acceptance Criteria

There is no manual QA path. Acceptance is determined by a PR reviewer verifying the following against ADR 0002 and ADR 0003:

  • archived = models.BooleanField(default=False) exists on both CompetencyCriteriaGroup and CompetencyCriterion.
  • One migration adds both columns.
  • No archived_at column was added.
  • django-simple-history already tracks both models (per ADR 0003); the new field is captured in the history table without further changes.
  • archived is registered as non-PII, matching CompetencyRuleProfile.archived's existing category; make pii_check passes.
  • No backfill needed: greenfield field, no existing rows depend on a different default.

Context

Technical Details

Data Structures

CompetencyCriteriaGroup.archived: models.BooleanField(default=False)
CompetencyCriterion.archived: models.BooleanField(default=False)

Logic

None. This ticket only adds the columns and their migration; no function, view, or serializer changes.

Example Resolution Prompt

Add archived = models.BooleanField(default=False) to both CompetencyCriteriaGroup and CompetencyCriterion in src/openedx_learning/applets/cbe/models.py, and generate one migration for both. No archived_at companion field. Register archived as non-PII, matching CompetencyRuleProfile.archived's existing annotation. Do not add any logic that sets, reads, or filters on the field, that belongs to downstream tickets, not this one.

Files to create and modify

New files

File Purpose
src/openedx_learning/applets/cbe/migrations/000X_add_archived_field.py Adds archived to both models in one migration.

Modified files

File Nature of modification
src/openedx_learning/applets/cbe/models.py Add archived = models.BooleanField(default=False) to CompetencyCriteriaGroup and CompetencyCriterion.
PII annotation registry (per #613's own PII acceptance criteria) Register archived as non-PII on both models.

Activity

  1. moved this from Needs additional details to Ready for Community Review in Competency Criteria and Student Progresson Aug 12, 2026
  2. moved this from Ready for Community Review to Final Axim Review in Competency Criteria and Student Progresson Aug 21, 2026
  3. thelmick-unicon commented on Aug 21, 2026

    @thelmick-unicon
    Author

    The discussion period for this ticket is now complete, and we appreciate all the feedback. We'll be moving forward with development based on the current ticket pending final Axim sign-off. That said, the conversation doesn't have to stop. If you still have feedback, please continue to add to this ticket. We'll review anything new and determine whether it fits within the current timeline or makes more sense as its own ticket for future work. Thanks again for helping make this better!

    @ormsbee This is ready for your final review. Thank you!

  4. 10 remaining items

  5. jesperhodge commented on Sep 30, 2026

    @jesperhodge
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions