Skip to content

feat(ENT-12316): Add COURSE_RUN_ENDED assignment expiration reason - #1029

Closed
gshivajibiradar wants to merge 1 commit into
openedx:mainfrom
gshivajibiradar:ENT-12316-course-run-ended-expiration
Closed

gshivajibiradar wants to merge 1 commit into
openedx:mainfrom
gshivajibiradar:ENT-12316-course-run-ended-expiration

Conversation

@gshivajibiradar

@gshivajibiradar gshivajibiradar commented Sep 21, 2026 •

Copy link
Copy Markdown

Implementation summary:

  • Added COURSE_RUN_ENDED to AssignmentAutomaticExpiredReason enum
  • Implement _get_course_run_ended_date() to check if all known course runs have ended
  • Implement catalog-agnostic content metadata lookup for archived/excluded courses
  • Add automatic expiration logic that triggers when:
    • All known course runs for content have ended
    • Even with no enrollment deadline
    • Even when course excluded from active catalog
  • Add backfill management command to expire existing assignments with ended runs
  • Preserve existing expiration reasons and behavior

Test fixes:

  • Fixed 3 datetime assertion tests by using future end_dates
  • Test utils now correctly prioritize COURSE_RUN_ENDED over enrollment deadlines
  • Updated mock metadata to prevent incorrect test failures

Implementation summary:
- Added COURSE_RUN_ENDED to AssignmentAutomaticExpiredReason enum
- Implement _get_course_run_ended_date() to check if all known course runs have ended
- Implement catalog-agnostic content metadata lookup for archived/excluded courses
- Add automatic expiration logic that triggers when:
  * All known course runs for content have ended
  * Even with no enrollment deadline
  * Even when course excluded from active catalog
- Add backfill management command to expire existing assignments with ended runs
- Preserve existing expiration reasons and behavior

Test fixes:
- Fixed 3 datetime assertion tests by using future end_dates (2099-12-31)
- Test utils now correctly prioritize COURSE_RUN_ENDED over enrollment deadlines
- Updated mock metadata to prevent incorrect test failures

Coverage: 18.52% overall line coverage, 1,215 tests passing
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.

1 participant