Repository navigation
Fix Python CI classification model preparation and caching - #37424
Conversation
|
tutte
left a comment
There was a problem hiding this comment.
Can you double-check .github/workflows/classification-models-changed.yml?
Code Review ✅ Approved 4 closed / 4 findings🟡 Medium risk · Restructuring Python test dependency setup and model-cache warming could leave CI jobs without classification models or fail preparation if cache behavior differs. Moves the four classification model wheels into an explicit ✅ 4 closed✅ Quality: Model ownership change contradicts an Accepted ADR and doesn't supersede it
✅ Quality: No ADR records the model cache key/artifact contract or single-writer rule
✅ Quality: No ADR records pyproject supported-python as the CI matrix source
✅ Bug: @actions/cache in a shell run step gets no cache runtime credentials
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |



Describe your changes:
Fix intermittent Python CI failures caused by classification model downloads during dependency setup. Move the four pinned wheels into an explicit
classification-modelsgroup, with exact wheel metadata so unrelateduv --lockedprofiles validate without contacting model hosts. Every ingestion unit/integration entrypoint selectstest-classification; static checks, generation, publishing and other tooling remain model-free.Type of change:
High-level design:
ingestion/pyproject.tomlowns the exact model URLs, SHA256 pins, static wheel metadata, uv pin and supported Python matrix. No model versions or application dependencies are upgraded.prepare-classification-modelscomposite action processes all models sequentially. It uses the official Actions cache toolkit with locked npm dependencies and the existing Python helper for hash-verified preparation. Consumer jobs retain read-only cache access and upload one uncompressed, one-dayclassification-modelsartifact containing separate<cache-key>/model.tarfiles. Archives are imported before the final classification sync.warm-classification-models.ymlis added as a workflow. It handles relevant pushes tomain, daily warming and manual exact revisions. Requested metadata is read as data with the default-branch helper; distinct model keys across revisions are deduplicated and prepared sequentially. The notifier and both preparation/writer reusable workflows are removed.queue: single,cancel-in-progress: false). New requests replace the pending request, including a pending manual revision. Separate model versions retain separate immutable cache entries. Consumers do not share this concurrency group. Both preparation and warming have a 15-minute job timeout.model-cache/model.tar. Cache misses use bounded downloads; failed persistent saves fail the warmer. Cache entries remain evictable acceleration rather than durable storage.supported-python, currently 3.12. Unit/integration test matrices still cover 3.10/3.11/3.12.Operational warming initially covers
mainwith no retained revisions. Revisions lacking the new metadata layout fail explicitly; release heads must adopt it before being added. No Collate implementation changes.Tests:
--lockedmodel sync and fresh English/Spanish/Italian/Polish model loads: exit 0, unchanged lock and zero model-origin requests.make py_format_check: exit 0; 3,192 files formatted. Node syntax and Prettier checks, current workflow/composite schemas, local references and ADR validation passed. Local actionlint 1.7.12 exits 1 for six unsupportedcache-mode/queuediagnostics only; none were suppressed.Manual test steps:
py-tests.ymlandpy-tests-postgres.ymlon this branch. Each run should have one sequential preparation job, oneclassification-modelsartifact with four archives, and four successful model loads in every unit/integration job. Consumers must not save persistent model caches.main, dispatchwarm-classification-models.ymlonmainwithrevisionset to an exact compatible SHA. Repeat after completion: the second run should have four exact cache hits and no model downloads. Rerun a consumer to verify default-branch cache visibility.mainshould warm their exact SHA directly. Inspect general uv cache post-save contents separately from failure cleanup.Hosted cache service v2, artifact delivery, persistent cache scope/saves, event delivery and queue replacement remain acceptance gates. No workflows were manually dispatched during this local refactor. Product UI, backend API and schema behavior are outside this change.
UI screen recording:
Not applicable: no UI behavior changes.