Skip to content

Run targeted bidirectional cache compatibility checks - #545

Draft
zaniebot wants to merge 3 commits into
mainfrom
zb/cache-compatibility-regression-guard
Draft

zaniebot wants to merge 3 commits into
mainfrom
zb/cache-compatibility-regression-guard

Conversation

@zaniebot

@zaniebot zaniebot commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

The existing cache compatibility jobs only run with the broader integration suite, so the cache-format change in astral-sh#20443 merged without running them. Their source-build scenario also reused an installed package without forcing a build and did not check whether an older release could consume a newly cached local wheel.

Run Linux and macOS cache compatibility checks independently and require them for cache-sensitive changes. Exercise locally cached wheels and actual source builds in both version directions while keeping unrelated changes out of the full integration suite.

@astral-automations-bot astral-automations-bot Bot added internal A refactor or improvement that is not user-facing internal:testing Internal testing of behavior labels Aug 5, 2026
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/cache-compatibility-regression-guard branch from b00e5e8 to 780a670 Compare August 5, 2026 14:09
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/cache-compatibility-regression-guard branch from 780a670 to 313940f Compare August 12, 2026 20:33
@zaniebot zaniebot added priority:2 Important: bounded correctness, release reliability, committed work, or proven performance gains. size:2 Moderate: one subsystem with meaningful invariants, edge cases, or operational evidence to inspect. labels Sep 9, 2026
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/cache-compatibility-regression-guard branch from 313940f to 0234191 Compare September 9, 2026 22:38
@zaniebot zaniebot added the risk:2 Low, contained risk of minor incorrect behavior with straightforward recovery. label Sep 11, 2026
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/cache-compatibility-regression-guard branch from 0234191 to 0cac460 Compare September 11, 2026 18:18
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/cache-compatibility-regression-guard branch from 0cac460 to 4edb9e6 Compare October 2, 2026 20:36
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/cache-compatibility-regression-guard branch from 4edb9e6 to b8754e5 Compare October 9, 2026 19:47
Comment thread .github/workflows/test-cache.yml Outdated
required: true
type: string

permissions: {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Retain checkout permissions in the extracted workflow

The former test-integration.yml grants contents: read, but this workflow removes it without a job-level override. Consequently, actions/checkout cannot fetch a private repository. CI explicitly supports pull requests in astral-sh/uv-security, where cache-sensitive changes would now fail checkout and block the new required check. Restore contents: read at workflow or job scope.

Comment thread .github/workflows/plan.yml Outdated
[[ "$file" == ".github/workflows/build-docker.yml" || "$file" == ".github/workflows/publish-docker.yml" || "$file" == ".github/workflows/publish-docker-image.yml" ]] && docker_workflow_changed=1
[[ "$file" == ".github/workflows/bench.yml" || "$file" == scripts/codspeed-profiles.py* ]] && bench_workflow_changed=1
[[ "$file" == ".github/workflows/test-integration.yml" || "$file" =~ ^test/integration/ || "$file" == "scripts/check_registry.py" || "$file" == "scripts/check_cache_compat.py" || "$file" == "scripts/registries-test.py" ]] && integration_changed=1
[[ "$file" =~ ^crates/(uv-cache|uv-cache-info|uv-cache-key|uv-client|uv-distribution|uv-distribution-types|uv-python)/ || "$file" == ".github/workflows/test-cache.yml" || "$file" == "scripts/check_cache_compat.py" ]] && cache_compatibility_changed=1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Match the current Python cache-owning crates

crates/uv-python no longer exists at this revision. Its interpreter cache implementation now lives in crates/uv-python-interpreter/src/interpreter.rs, which serializes CachedByTimestamp<InterpreterInfo> into CacheBucket::Interpreter. A PR changing only that implementation leaves test-cache false unless an explicit label enables it. Replace the obsolete alternative with the relevant split crates, including uv-python-interpreter.

Comment thread scripts/check_cache_compat.py Outdated
Comment on lines +80 to +85
record = "".join(f"{path},,\n" for path in files)
files[f"{dist_info}/RECORD"] = f"{record}{dist_info}/RECORD,,\n"

with ZipFile(wheel, "w") as archive:
for path, contents in files.items():
archive.writestr(path, contents)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3] Reuse the existing minimal wheel fixture

test/links/ok-1.0.0-py3-none-any.whl already provides a dependency-free local wheel and is used by the path-install tests. This scenario needs no custom wheel contents, so hand-writing its metadata and RECORD adds unrelated fixture maintenance and relies on tolerance for omitted RECORD hashes. Resolve the existing fixture from __file__ and install it with installed_name="ok".

@zaniebot
zaniebot deployed to automations October 9, 2026 21:17 — with GitHub Actions Active
@zaniebot
zaniebot deployed to automations October 9, 2026 21:21 — with GitHub Actions Active
Comment thread .github/workflows/plan.yml Outdated
[[ "$file" == ".github/workflows/build-docker.yml" || "$file" == ".github/workflows/publish-docker.yml" || "$file" == ".github/workflows/publish-docker-image.yml" ]] && docker_workflow_changed=1
[[ "$file" == ".github/workflows/bench.yml" || "$file" == scripts/codspeed-profiles.py* ]] && bench_workflow_changed=1
[[ "$file" == ".github/workflows/test-integration.yml" || "$file" =~ ^test/integration/ || "$file" == "scripts/check_registry.py" || "$file" == "scripts/check_cache_compat.py" || "$file" == "scripts/registries-test.py" ]] && integration_changed=1
[[ "$file" =~ ^crates/(uv-cache|uv-cache-info|uv-cache-key|uv-client|uv-distribution|uv-distribution-types|uv-python-(discovery|interpreter|managed|types))/ || "$file" == ".github/workflows/test-cache.yml" || "$file" == "scripts/check_cache_compat.py" ]] && cache_compatibility_changed=1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Include serialized metadata owners in the cache filter

For an unlabeled PR changing only crates/uv-pypi-types/src/metadata/metadata_resolver.rs or crates/uv-distribution-filename/src/wheel.rs, the planner produces test_cache=false, confirmed by running its decision block. These files define ResolutionMetadata, serialized into wheel/source metadata caches, and WheelFilename, serialized inside Archive. Cache-format changes can therefore bypass the new required compatibility check. Include uv-pypi-types and uv-distribution-filename in the cache-sensitive paths so the guard covers the persisted types as well as their writers.

@zaniebot
zaniebot deployed to automations October 9, 2026 21:30 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
automations — 657b1eea Deployed Oct 9, 2026 by zaniebot via review-code-quality / code quality review #9361
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal:testing Internal testing of behavior internal A refactor or improvement that is not user-facing priority:2 Important: bounded correctness, release reliability, committed work, or proven performance gains. risk:2 Low, contained risk of minor incorrect behavior with straightforward recovery. size:2 Moderate: one subsystem with meaningful invariants, edge cases, or operational evidence to inspect.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants