rjgoyln opened a new pull request, #72489: URL: https://github.com/apache/airflow/pull/72489
## Summary The prek stash is keyed on a Python version that each caller formats for itself, and the callers disagree. The two jobs that save it key on the host interpreter's full version, so the stash lands under `python3.10.21`, while `generate-constraints` and both `test-providers` jobs ask for `python3.10` and `build-prod-packages` asks for an empty segment, because it reads `matrix.python-version` in a job that declares no matrix. Those restores cannot hit, so on every run those jobs reinstall every hook environment before doing any work — which is also what makes them depend on every hook's upstream being reachable at that moment. In [33525573182](https://github.com/apache/airflow/actions/runs/33525573182) a transient 500 from go.dev took out `Generate constraints for 3.10` and `Compat 3.1.8:P3.10`, while the job that saves the cache was warm and sailed past it. Reading the version off the interpreter that installs the hooks takes away the caller's ability to describe it wrongly. The four jobs above ran `install-prek` before Breeze had set up Python and so had no host interpreter to name at all; they now run it afterwards. Major.minor is the granularity at which a hook environment actually changes, so a runner image moving from 3.10.21 to 3.10.22 no longer discards the stash, and `cache-prek-v9` becomes `v10` so the old differently shaped entries are not consulted. ## Effect Against [33741573194](https://github.com/apache/airflow/actions/runs/33741573194), every affected job instance on a PR run goes from cold to warm, and ten of fourteen on a canary run. The four that stay cold are the `generate-constraints` 3.11–3.14 legs, which key on their own interpreter and have no stash saved under it — unchanged from today. That leaves the cold-cache case, which #72382 covers: any `.pre-commit-config.yaml` or uv version change invalidates the key for everyone, and `prek install-hooks` still has no retry when a toolchain download fails. Neither change subsumes the other. --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Opus 5) Generated-by: Claude Code (Opus 5) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
