D3.1 phase 1: Additive extension schema (courses.LearnerProfile + accounts_ext)
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 領域
- backend, databases, testing-qa
調査の方向性
まず accounts/models.py と _docs/specs/09-migration-rollout-roadmap.md を読み、続いて既存のマイグレーション状態と現在の CustomUser 定義を確認します。Issue に記載された追加モデル、accounts_ext アプリ、SeparateDatabaseAndState による移動、冪等なデータマイグレーションを実装します。make django-check、make migrations-check、make test が成功し、マイグレーションテストでコピーされた値とテーブルが保持されていることを確認できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Part of the D3.1 umbrella (#334): phase 1 of 6. Implements playbook P7 DTC steps 1-2 (expand only) and step 3's schema, against current main, refreshed from #334's original 2026-09-08 grooming.
Normative sources
| Source | What it governs |
|---|---|
community-base repo: docs/plan/phase-3.md, C3.1a/D3.1; docs/03-playbooks.md P7 DTC steps 1-3 |
Field table and migration procedure (unchanged from #334; not relitigated here) |
accounts/models.py (current main) |
Source definitions this phase mirrors verbatim |
_docs/specs/09-migration-rollout-roadmap.md |
Expand-and-contract rollout policy |
Goal
Land the target extension schema as pure additions: no CustomUser field is read, written, or removed by this issue. manage.py check and the full suite pass before and after with zero behavior change. This is the "safe to merge and forget" foundation phase: later phases build on it without redoing it, even if they take a while against a fast-moving main.
Scope
courses.LearnerProfile: new model,userOneToOneField(related_name="learner_profile"), mirroring today'sCustomUserdefinitions verbatim (same max lengths, null/blank, choices, help text) for:role(CharField(10), choicesstudent/instructor, defaultstudent),certificate_name,country,region,registration_role,github_url,linkedin_url,personal_website_url,about_me,dark_mode.accounts_extapp: new Django app, added toINSTALLED_APPS.accounts_ext.IdentityState(userOneToOneField):normalized_email,identity_state, plus the conditional unique constraintaccounts_active_normalized_email_unique, mirrored verbatim fromaccounts.models.CustomUser. Importaccounts/identity_values.normalize_account_emailrather than copying it.- Move six models from
accountstoaccounts_extviaSeparateDatabaseAndStatewithdb_tablepinned to their existing table names, so no table is renamed, rebuilt, or has rows touched:AccountIdentityAlias,AccountIdentityQuarantine,AccountReconciliationRun,CmpLearnerImportProgress, plus two models added toaccounts/models.pyafter #334 was originally groomed —CmpLearnerImportBindingandCmpLearnerClaim(same script-owned import-provenance family asCmpLearnerImportProgress; verify currentaccounts/models.pyfor their exact current shape before writing the migration).MailchimpSubscriptionImportRun(also added since original grooming) stays inaccounts— it is generic import provenance, not identity state; its disposition is an explicit non-goal here, not a silent decision. - Repoint
AccountIdentityAlias.survivor's FK (and any other identity-model FK) at the auth-model setting, not a hardcodedaccounts.CustomUserlabel.
- Data migrations: one
LearnerProfilerow and oneIdentityStaterow per existing user, values copied verbatim (nulls stay null). Idempotent on re-run.
Non-goals
- No reader is switched to the new models (phases 2-3).
CustomUserkeeps every field unchanged. - No removal of any
CustomUserfield or constraint (phase 4). - No
RenameModel/AUTH_USER_MODELchange (phase 5). - No AISL-origin field additions (phase 6).
- No decision on
MailchimpSubscriptionImportRun's eventual home.
Dependencies
- Depends on: none (first phase).
- Blocks: #391, #392 (both need
LearnerProfile/IdentityStateto exist before any reader can be switched).
Acceptance criteria
Django and integration
-
make django-checkpasses. -
make migrations-checkpasses. -
make test(full suite) passes with zero behavior change (no test asserts against the new models beyond this issue's own). -
courses.LearnerProfileexists with the ten fields listed above,userOneToOne, mirroringCustomUser's current definitions field-for-field. -
accounts_extapp exists, is installed, and declaresIdentityStateplus the six moved models with their original table names (\d accounts_accountidentityaliasetc. via a migration-state assertion, not a live table rename). - A migration test seeds users with varied values (null
certificate_name/URLs, both roles, everyIdentityState.choicesmember) and asserts exactly oneLearnerProfilerow and oneIdentityStaterow per user afterward, with identical field values. -
CustomUserstill declares all twelve fields untouched; nothing reads or writes the new models outside this issue's own migration and tests. -
manage.py migrateapplies cleanly end to end on a fresh database; each new migration reverses, or documents why not.
Repository and operations
- The versioned verification plan per
_docs/ci/change-selective-ci.mdis recorded in the engineer handoff.
- 主要言語
- Python
- スター
- 0
- フォーク
- 0
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
DataTalksClub/website のほかの issue
-
bug infra operations P1 testing
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
DataTalksClub/website#329 ·
-
bug content data-migration documentation events operations P1
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
DataTalksClub/website#327 ·
-
bug frontend P0 testing
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
DataTalksClub/website#300 · コメント 7 件 ·
-
bug data-migration events P0 testing
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
DataTalksClub/website#295 · コメント 6 件 ·
-
bug needs grooming P1 testing
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
DataTalksClub/website#473 ·
DataTalksClub/website の issue をすべて見る
似ている issue
-
link-rot
難易度 1/5 1時間未満 初心者へのやさしさ 67/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
developmentseed/titiler-cmr#265 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
Insecure Brotli version <1.2.1対応中かも @jamescw19 が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
stac-utils/stac-fastapi-pgstac#438 · リアクション 1 件 ·
-
bug triage
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信