DataTalksClub / DataTalksClub/website

Restore quality coverage for newly added account and course modules

Open
#430 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P0 testing
Dominant language
Python
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Outcome

Restore the release-blocking quality contract after recent mainline merges added six Python files beneath historically excluded accounts/ and courses/ trees. All six files must be explicitly reached by Ruff lint, Ruff format-check, and strict mypy, and uv run --frozen python scripts/ci.py quality must return green without weakening the adoption guard or broadening the historical exemption.

Normative references:

Affected files

  • accounts/tests/test_d31_extension_models.py
  • accounts/tests/test_identity_state_refresh_migration.py
  • courses/models/learner_profile.py
  • courses/templatetags/project_gallery.py
  • courses/tests/test_learner_profile_refresh_migration.py
  • courses/tests/test_moved_profile_field_readers.py

Product and quality decisions

  • These files are newly authored website integration/model/test code, not historical adopted source. They belong in scripts/ci.py's explicit quality inputs and in the later pyproject.toml mypy override with ignore_errors = false.
  • ci/adoption_baseline.txt remains the frozen record of source reviewed at the BE-16 decision. None of the six files may be added to it.
  • Passing means the tools actually analyze the files. Merely silencing the adoption coverage assertion, adding a wildcard exemption, or moving the files outside its scan is not coverage.
  • Any Ruff or mypy findings in these six files are fixed narrowly without changing their runtime, migration, authorization, gallery-link, or test semantics.

Scope

  1. Add all six paths to the maintained explicit quality input in scripts/ci.py so both _run_ruff(...) and TYPECHECK_PATHS reach them.
  2. Add the six corresponding dotted module names to the strict mypy override in pyproject.toml, keeping the quality input and strict override synchronized.
  3. Resolve only the lint, formatting, or type errors that become visible in these six files after enrollment.
  4. Run the focused adoption-policy and direct-tool scenario below, followed by the repository's complete versioned quality aggregate and required verification-plan/evidence checks.

Non-goals

  • Adding the six files to ci/adoption_baseline.txt or changing the historical baseline.
  • Removing or weakening ci/tests/test_adoption_gate_coverage.py, its tree inventory, strict-module assertion, or the application-tree exclusions it polices.
  • Removing the adopted-tree Ruff exclusions or historical package-level mypy exemptions wholesale; that larger cleanup remains incremental under BE-16.
  • Adding broad # noqa, # type: ignore, per-file ignores, disabled Ruff rules, ignore_errors = true, or wildcard module exemptions to make the gate green.
  • Refactoring account/profile migrations, identity behavior, learner-profile behavior, project-gallery URLs, or unrelated tests.
  • Changing dependencies, database schema, templates, routes, browser behavior, or production data.
  • Repairing unrelated quality failures introduced after the implementation base was frozen; such drift must be attributed and coordinated separately.

Dependencies and coordination

  • No product dependency blocks this repair: the six files already exist on main, and the quality contract is currently red because their enrollment did not land with them.
  • Work from a clean, current main in an isolated worktree. Freeze and report the exact base/head because concurrent merges can add another unaccounted excluded-tree file and invalidate the result.
  • Changes to scripts/ci.py and pyproject.toml affect the shared quality contract. Coordinate with any concurrent CI/tooling work and preserve unrelated changes.
  • This is release-blocking internal CI/process work with no rendered-page impact. Screenshots and product browser scenarios are not_applicable; the generated verification plan remains authoritative if it selects any additional component.

Acceptance criteria

  • All six affected file paths are present in ADOPTION_INTEGRATION_PYTHON (or the equivalent maintained explicit input consumed by both Ruff and TYPECHECK_PATHS) exactly once and still exist on disk.
  • All six corresponding dotted modules are present in the later pyproject.toml mypy override whose ignore_errors value is false.
  • None of the six paths is added to ci/adoption_baseline.txt; no existing baseline entry, exclusion prefix, or historical opt-in is removed merely to satisfy this issue.
  • ci/tests/test_adoption_gate_coverage.py reports no unaccounted excluded-tree files, no stale/missing or baseline-overlapping opt-ins, and no opted-in module that escapes strict mypy.
  • Direct Ruff lint and format-check pass for the exact six files.
  • Direct mypy passes for the exact six files under repository configuration, proving that the package-wide ignore_errors = true exemption is overridden for them.
  • Any source edits needed to satisfy those tools are quality-only and preserve the existing behavior and test intent of each file.
  • uv run --frozen python scripts/ci.py quality completes successfully, including test-ci; the fix does not bypass or remove any quality-contract task.
  • The implementation's change-selective verification plan records the exact frozen base/head and classifies screenshots as not_applicable because no render input changes. Every required component has a valid final disposition and evidence.
  • A regression assertion continues to fail when a synthetic new Python file under an excluded application tree is neither in the baseline nor explicitly opted in; the guard remains fail-closed for the next file.

Exact focused quality scenario

Run from the candidate worktree with the six paths exactly as listed:

uv run --frozen pytest ci/tests/test_adoption_gate_coverage.py -q

uv run --frozen ruff check \
  accounts/tests/test_d31_extension_models.py \
  accounts/tests/test_identity_state_refresh_migration.py \
  courses/models/learner_profile.py \
  courses/templatetags/project_gallery.py \
  courses/tests/test_learner_profile_refresh_migration.py \
  courses/tests/test_moved_profile_field_readers.py

uv run --frozen ruff format --check \
  accounts/tests/test_d31_extension_models.py \
  accounts/tests/test_identity_state_refresh_migration.py \
  courses/models/learner_profile.py \
  courses/templatetags/project_gallery.py \
  courses/tests/test_learner_profile_refresh_migration.py \
  courses/tests/test_moved_profile_field_readers.py

uv run --frozen mypy \
  accounts/tests/test_d31_extension_models.py \
  accounts/tests/test_identity_state_refresh_migration.py \
  courses/models/learner_profile.py \
  courses/templatetags/project_gallery.py \
  courses/tests/test_learner_profile_refresh_migration.py \
  courses/tests/test_moved_profile_field_readers.py

Then run the maintained aggregate rather than treating the focused commands as release evidence:

uv run --frozen python scripts/ci.py quality

Expected result: the focused policy suite passes all adoption-coverage assertions; Ruff and mypy analyze the six named files without ignored errors; the full quality aggregate exits zero.

Verification and evidence

  1. Generate and independently recompute the versioned verification plan from the frozen base/head.
  2. Record exact commands, exit codes, test counts, and any narrow quality-only source edits.
  3. Record the final ADOPTION_INTEGRATION_PYTHON paths and strict dotted-module set so reviewers can compare them one-for-one.
  4. Report screenshots/browser checks as not_applicable unless the graph detects a render input not authorized by this issue; do not capture unrelated product pages as evidence.
  5. Leave the candidate worktree frozen and uncommitted for independent tester review. After tester pass and PM acceptance, commit with Closes #430 and follow the repository's local no-PR merge process.

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 in scripts/ci.py, pyproject.toml, and ci/tests/test_adoption_gate_coverage.py; compare the six listed files with ADOPTION_INTEGRATION_PYTHON, TYPECHECK_PATHS, and the strict mypy override. Run the focused adoption, Ruff, format, and mypy commands, then run uv run --frozen python scripts/ci.py quality. Done means all six files are explicitly analyzed, the historical baseline and guard remain unchanged, and the aggregate passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ci-cd, testing-qa, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.