DataTalksClub / DataTalksClub/website

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

Open
#345 18 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug courses data-migration P0
Dominant language
Python
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Plan context: CI run 34189057638 (87fd3f4f) 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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with courses/models/cohort.py:192 and courses/migrations/0005_shared_current_curriculum.py, inventorying every archive field AddField and its target model. Run the migration-drift check, then trace the Course creation path that omits archive_commit_sha, including the listed failing modules. Done means the drift check, listed modules, full Django suite, and post-merge django CI gate all pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python, sqlite
Domain
backend, database, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.