Skip to content

716 archived field cc group models - #5

Closed
ufedaseyeuconsultant wants to merge 2 commits into
alezconsultant:alezconsultant/665-criterion-endpointfrom
ufedaseyeuconsultant:ufedaseyeu/feat--716-archived-field-cc-group-models
Closed

ufedaseyeuconsultant wants to merge 2 commits into
alezconsultant:alezconsultant/665-criterion-endpointfrom
ufedaseyeuconsultant:ufedaseyeu/feat--716-archived-field-cc-group-models

Conversation

@ufedaseyeuconsultant

Copy link
Copy Markdown

Description

Adds archived = models.BooleanField(default=False) to CompetencyCriteriaGroup and
CompetencyCriterion, in one migration, per ADR-0002
Decision 7's archive-only retirement rule (a group or criterion referenced by learner status is
retired by archiving, never hard-deleted). No archived_at companion field: django-simple-history
(ADR-0003) already tracks both models, covering the "when" without a separate timestamp.

This PR makes no behavior changes. Nothing here sets, reads, or filters on archived; that's
downstream tickets' scope (openedx#674, openedx#675, openedx#681). Both models' existing .. no_pii: class-level
docstring annotation already covers the new field, matching CompetencyRuleProfile.archived's
existing non-PII precedent, so no separate PII registry change was needed.

Impacted roles: Developer only. This is a schema-only change with no reachable behavior yet;
no Course Author, Learner, or Operator-facing effect until a downstream ticket starts using the
field.

Supporting information

Testing instructions

  1. Apply the migration: python manage.py migrate openedx_learning
  2. Confirm no missing migrations: python manage.py makemigrations --check --dry-run (should
    report nothing pending for openedx_learning)
  3. Run the new/updated model tests:
    pytest tests/openedx_learning/applets/cbe/test_criteria_group.py tests/openedx_learning/applets/cbe/test_criterion.py --no-cov
    — includes test_group_archived_defaults_to_false and test_criterion_archived_defaults_to_false,
    pinning the same "defaults to False" contract CompetencyRuleProfile.archived already has a test
    for
  4. Run the full CBE suite to confirm nothing else broke:
    pytest tests/openedx_learning/applets/cbe/ --no-cov
  5. Run PII annotation coverage: tox -e pii_check (or directly:
    code_annotations django_find_annotations --config_file .pii_annotations.yml --report --coverage)
    and confirm CompetencyCriteriaGroup/CompetencyCriterion are not listed among uncovered models

Other information

  • Migration rollback: trivially reversible (AddField on four tables — the two models plus their
    django-simple-history historical counterparts); no data migration involved.

🤖 Generated with Claude Code

…terion (openedx#716)

Adds archived = models.BooleanField(default=False) to both models, in one
migration, per ADR 0002 Decision 7's archive-only retirement rule. No
archived_at companion field: django-simple-history (ADR 0003) already
tracks both models, covering the "when" without a separate timestamp.

Both models' existing `.. no_pii:` class-level docstring annotation
already covers the new field, matching CompetencyRuleProfile.archived's
existing non-PII precedent; no separate registry change needed.

This ticket makes no behavior changes: nothing here sets, reads, or
filters on the field. That is downstream tickets' scope (openedx#674, openedx#675, openedx#681).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Pins the same contract CompetencyRuleProfile.archived already has a test
for (test_rule_profile.py's test_creating_a_rule_profile_persists_its_columns):
a freshly created row is not archived unless told otherwise.

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

@tbain tbain left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved from me, and Codex had no issues or comments either

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants