Skip to content

Restore the green release matrix: Course creation hits NOT NULL on courses_course.archive_commit_sha #345

Description

@alexeygrigorev

Plan context: CI run 34189057638 (87fd3f4) is the first completed django verdict on main since Sep 5 (earlier runs were cancelled by the container/quality failures fixed in #337/#319/#341/#343): quality, container, playwright and screenshots now pass, but the django job fails and ci-gate reports failure. Dozens of tests ERROR at setup with sqlite3.IntegrityError: NOT NULL constraint failed: courses_course.archive_commit_sha. Introduced by the shared-curriculum merge (#320).

Symptom

  • Failing modules include courses.tests.test_course_list_ordering, courses.tests.test_course_list_metadata, courses.tests.test_course_list_assignments, courses.tests.test_homework_optional_fields, courses.tests.test_local_question_seed, courses.tests.test_local_project_review_seed, studio_courses.tests (course/homework/project views), core.tests.test_course_platform_vendor_assets, review_import.tests.test_workflow.
  • The model field (courses/models/cohort.py:192) declares default="", and the visible 0005 AddField declares default="" too, yet some INSERT into courses_course omits the column entirely.
  • The visible AddField in courses/migrations/0005_shared_current_curriculum.py names model cohort, while the failing table is courses_course; a missing or default-less AddField for the course model is the prime suspect.

Direction

  • Inventory every archive field AddField in migration 0005 and which model each targets; run the migration-drift check.
  • Identify the creation path that bypasses the model default (missing AddField, bulk/raw insert, or fixture) and fix it at the root per the model's documented semantics: empty string for current cohorts, full 40-hex commit SHA for github_archive cohorts; the archive identity check constraint stays intact.

Scope

  • The smallest change that makes Course creation safe everywhere the model default was assumed. No product behavior changes beyond what the model already specifies. No workflow or quality-contract edits.

Acceptance criteria

  • The migration-drift check passes.
  • All modules listed above pass locally.
  • The full Django suite passes locally.
  • Post-merge CI on main: the django job passes and the run reaches a green ci-gate verdict with no cancellations.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Must-have or release-blockingbugSomething isn't workingcoursesArea: coursesdata-migrationArea: data-migration

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions