Repository navigation
Temporarily pause classification model downloads and tests in CI - #37381
Conversation
| skip_classification_models = os.environ.get("OM_SKIP_CLASSIFICATION_MODELS") == "true" | ||
| # Frozen sync avoids fetching model metadata while provisioning is paused. | ||
| lock_mode = "--frozen" if skip_classification_models else "--locked" | ||
| command = [uv, "sync", lock_mode, "--project", str(INGESTION_ROOT), "--python", str(python)] | ||
| if skip_classification_models: | ||
| for model in ("en-core-web-md", "es-core-news-md", "it-core-news-md", "pl-core-news-md"): | ||
| command.extend(["--no-install-package", model]) |
There was a problem hiding this comment.
⚠️ Quality: Paused mode contradicts Accepted locked-profiles ADR without superseding
noxfile.py cites ADR:2026-10-27-local-python-environments-use-locked-profiles. That record is Accepted and says Nox "synchronizes with uv.lock using --locked". It also says "the test dependency group owns the four release-pinned classification model wheels" and that the provisioner validates the models during application setup. When OM_SKIP_CLASSIFICATION_MODELS=true, this PR switches both synchronize() and the Makefile python_tools target to --frozen. It also excludes all four model packages with --no-install-package and skips provisioning, and CI sets the variable globally. So CI no longer checks that the lockfile is fresh, and the guarded test profile is not the one the ADR describes. This isn't a bug fix whose correctness is obvious from the diff: it adds a new env-var contract and a different lock mode.
To fix it, add a revision (v3) to the ADR, or a new record that supersedes it. It would assert the rule from the description: "When OM_SKIP_CLASSIFICATION_MODELS=true, setup uses --frozen instead of --locked, omits the four classification model packages and skips provisioning, and spacy.load skips the calling test; setting it to false restores --locked, model installation and normal tests." Since the pause is temporary, the record should also name the condition or ticket for removing it. Otherwise this escape hatch can quietly become the permanent CI mode.
Amend the ADR with a v3 revision that states the pause rule and when it will be removed.:
- **Revisions:** v1 2026-10-27 (initial); v2 2026-10-28 (lock classification models); v3 2026-11 (temporary model pause)
...
- While `OM_SKIP_CLASSIFICATION_MODELS=true` (temporary, CI only; remove once spaCy model
metadata fetches are reliable — <ticket>), application setup uses `--frozen`, omits the four
classification model packages, skips provisioning, and `spacy.load` skips the calling test.
`false` restores `--locked`, model installation and the full suite.
Was this helpful? React with 👍 / 👎
Code Review
|
| Compact |
|
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source
|



Describe your changes:
Temporarily pauses classification model downloads and model-dependent tests in the shared Python CI pipeline. Environment setup can currently fail while fetching spaCy model metadata before any tests run. This is a flaky-test infrastructure fix; no linked implementation issue is required.
The existing model preparation job, cache, artifact steps, provisioning command, dependencies and tests remain available.
OM_SKIP_CLASSIFICATION_MODELS=truemakes provisioning a no-op and reports tests reaching real model loading as skipped. Model-free and mocked classification tests continue running. Set the workflow variable tofalseto restore existing behavior.Type of change:
High-level design:
--frozenwhile paused, avoiding remote model metadata validation. Nox also excludes all four model wheels from installation and skips the explicit provisioning command.spacy.loadboundary, covering model users outside the classification directories while preserving mocked loads and blank spaCy pipelines. The separate provisioning integration test is explicitly gated because it installs models in a subprocess.--locked, model installation and normal tests. Local behavior is unchanged unless the variable is enabled.Tests:
Use cases covered
Unit tests
ingestion/tests/unit/test_classification_model_pause.pyandingestion/tests/unit/test_python_tooling.py.env/activated:python -m pytest ingestion/tests/unit/test_classification_model_pause.py ingestion/tests/unit/test_python_tooling.py -k 'model_pause or classification_provisioning or paused_setup' -qResult: 5 passed, 74 deselected. The offline setup case exercises the real Make/Nox/uv entry points using a small fixture project.
Result: 756 passed, 241 skipped. Coverage percentage was not measured; no application source files changed.
Backend integration tests
Not applicable — no Java or backend API changes.
Ingestion integration tests
Result: 1 skipped, specifically because provisioning is paused. The complete unit suite, live-service integration suites and GitHub job graph have not been run locally; CI validation remains pending.
Playwright (UI) tests
Not applicable — no UI changes.
Manual testing performed
actionlint .github/workflows/py-tests-shared.ymlandgit diff --checkpassed.UI screen recording:
Not applicable — CI and test infrastructure only.
Checklist:
REVIEW.md; no unanswered blocking findings.skip-pr-checkslabel for metadata validation.Summary by Gitar
test_sample_usage.pyto create its own BigQuery service, database, schema, and tablesquery_logfixture intmp_pathand replaces the unittest class with a pytest functionThis will update automatically on new commits.