The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(ci): remove legacy uv cache compatibility
ethernet4cc2b7bab573
diff --git a/.github/actions/save-pm-cache/README.md b/.github/actions/save-pm-cache/README.mdindex 25b0cb6e6f9..f6f51420112 100644--- a/.github/actions/save-pm-cache/README.md+++ b/.github/actions/save-pm-cache/README.md@@ -15,16 +15,12 @@ Snapshots use a run ID, attempt, and producer job suffix because Actions cachesare immutable. Sibling bundle workflows in one caller run must not race to savedifferent contents under the same key.Restore tries the current dependency set's rolling snapshots first, then the-compatible prefix, which also admits the existing pre-change caches. This lets+compatible v2 prefix. There is no fallback to older cache formats. This letsa retry add wheels to a snapshot saved by a partially failed build. The ordinaryautomatic cache path and its exact-hit smoke tests remain available.-New smoke snapshots use a separate `setup-pm-uv-isolated-` prefix, outside-production's restore prefix. Their run suffix stays at the end so the existing-PM Toolchain cleanup still removes them. Pre-change smoke snapshots retain-their old keys until that cleanup or GitHub's retention removes them; preserving-legacy production caches also preserves the possibility of matching those old-smoke entries during migration.+Smoke namespaces precede the native/dependency identity, outside production's+restore prefix. PM Toolchain cleanup removes its run-scoped snapshots.Before saving, `uv cache prune` removes dangling entries. It does not use`--ci`: that option discards downloaded wheels, while bundles copy the fulldiff --git a/.github/actions/setup-pm/action.yml b/.github/actions/setup-pm/action.ymlindex 2f0f53bb656..51ad688fa5a 100644--- a/.github/actions/setup-pm/action.yml+++ b/.github/actions/setup-pm/action.yml@@ -130,11 +130,11 @@ runs:uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0with:path: ${{ steps.install.outputs.uv-cache-path }}- key: setup-pm-uv-${{ inputs.cache-suffix != '' && 'isolated-' || '' }}v1-${{ steps.prepare.outputs.target }}-${{ steps.prepare.outputs.os-version }}-${{ steps.prepare.outputs.python-version }}-${{ inputs.prune-python-cache }}-${{ hashFiles(inputs.python-cache-dependency-glob) || 'no-dependency-glob' }}-${{ inputs.cache-suffix }}+ key: setup-pm-uv-v2-${{ inputs.cache-suffix || 'production' }}-${{ steps.prepare.outputs.target }}-${{ steps.prepare.outputs.os-version }}-${{ steps.prepare.outputs.python-version }}-${{ inputs.prune-python-cache }}-${{ hashFiles(inputs.python-cache-dependency-glob) || 'no-dependency-glob' }}# Isolated writes also need a distinct prefix: production's broad# fallback must not restore a smoke run's partial dependency set.- restore-keys: ${{ inputs.cache-suffix == '' && format('setup-pm-uv-v1-{0}-{1}-{2}-{3}-', steps.prepare.outputs.target, steps.prepare.outputs.os-version, steps.prepare.outputs.python-version, inputs.prune-python-cache) || '' }}+ restore-keys: ${{ inputs.cache-suffix == '' && format('setup-pm-uv-v2-production-{0}-{1}-{2}-{3}-', steps.prepare.outputs.target, steps.prepare.outputs.os-version, steps.prepare.outputs.python-version, inputs.prune-python-cache) || '' }}- name: Restore uv dependencies for an explicit saveid: python-cache-restore@@ -144,10 +144,10 @@ runs:path: ${{ steps.install.outputs.uv-cache-path }}# Caches are immutable. Each producer needs its own snapshot, even# when a caller run contains both PM Bundle and Desktop Release.- key: setup-pm-uv-${{ inputs.cache-suffix != '' && 'isolated-' || '' }}v1-${{ steps.prepare.outputs.target }}-${{ steps.prepare.outputs.os-version }}-${{ steps.prepare.outputs.python-version }}-${{ inputs.prune-python-cache }}-${{ hashFiles(inputs.python-cache-dependency-glob) || 'no-dependency-glob' }}-${{ inputs.cache-suffix }}-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}+ key: setup-pm-uv-v2-${{ inputs.cache-suffix || 'production' }}-${{ steps.prepare.outputs.target }}-${{ steps.prepare.outputs.os-version }}-${{ steps.prepare.outputs.python-version }}-${{ inputs.prune-python-cache }}-${{ hashFiles(inputs.python-cache-dependency-glob) || 'no-dependency-glob' }}-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}restore-keys: |- setup-pm-uv-${{ inputs.cache-suffix != '' && 'isolated-' || '' }}v1-${{ steps.prepare.outputs.target }}-${{ steps.prepare.outputs.os-version }}-${{ steps.prepare.outputs.python-version }}-${{ inputs.prune-python-cache }}-${{ hashFiles(inputs.python-cache-dependency-glob) || 'no-dependency-glob' }}-${{ inputs.cache-suffix }}-- ${{ inputs.cache-suffix == '' && format('setup-pm-uv-v1-{0}-{1}-{2}-{3}-', steps.prepare.outputs.target, steps.prepare.outputs.os-version, steps.prepare.outputs.python-version, inputs.prune-python-cache) || '' }}+ setup-pm-uv-v2-${{ inputs.cache-suffix || 'production' }}-${{ steps.prepare.outputs.target }}-${{ steps.prepare.outputs.os-version }}-${{ steps.prepare.outputs.python-version }}-${{ inputs.prune-python-cache }}-${{ hashFiles(inputs.python-cache-dependency-glob) || 'no-dependency-glob' }}-+ ${{ inputs.cache-suffix == '' && format('setup-pm-uv-v2-production-{0}-{1}-{2}-{3}-', steps.prepare.outputs.target, steps.prepare.outputs.os-version, steps.prepare.outputs.python-version, inputs.prune-python-cache) || '' }}# Post steps run in reverse registration order: prune before cache save.- name: Register uv cache pruningdiff --git a/scripts/ci/cleanup_pm_toolchain_caches.py b/scripts/ci/cleanup_pm_toolchain_caches.pyindex 6c276ef3bec..3ae3eb7e5f3 100644--- a/scripts/ci/cleanup_pm_toolchain_caches.py+++ b/scripts/ci/cleanup_pm_toolchain_caches.py@@ -15,7 +15,8 @@ def cleanup_run_caches(run_id: str, request, *, page_size: int = 100) -> list[inif run["status"] != "completed" or run["path"] != ".github/workflows/pm-toolchain.yml":raise ValueError("cleanup requires a completed PM Toolchain run")pattern = re.compile(- rf"^(?:setup-pm-|node-cache-).*-smoke(?:-prune|-consumers)?-{run_id}-[1-9][0-9]*$"+ rf"^(?:(?:setup-pm-tools-|node-cache-).*-smoke(?:-prune|-consumers)?-{run_id}-[1-9][0-9]*"+ rf"|setup-pm-uv-v2-smoke(?:-prune|-consumers)?-{run_id}-[1-9][0-9]*-.+)$")def collect():diff --git a/tests-js/setup-pm-cache.test.mjs b/tests-js/setup-pm-cache.test.mjsindex f2d7dd565f3..cad3935ccaf 100644--- a/tests-js/setup-pm-cache.test.mjs+++ b/tests-js/setup-pm-cache.test.mjs@@ -10,8 +10,7 @@ it('restores compatible wheels without freezing a partial build under its dependconst cached = setup.runs.steps.find(step => step.id === 'python-cache')const restored = setup.runs.steps.find(step => step.id === 'python-cache-restore')const prefixes = restored.with['restore-keys'].trim().split('\n')- // An exact legacy entry wins over prefix matching. Prefer rolling entries- // first so the next attempt can use additions from the last failed build.+ // Prefer this dependency set before falling back across dependency changes.const rollingPrefix = prefixes[0]expect(restored.with.key).toBe(`${rollingPrefix}\${{ github.run_id }}-\${{ github.run_attempt }}-\${{ github.job }}`)expect(rollingPrefix).toBe(`${cached.with.key}-`)@@ -29,14 +28,14 @@ it('restores compatible wheels without freezing a partial build under its depend// A suffix-only namespace isolates smoke reads but still lets production// restore smoke writes through its broad dependency fallback.- const namespace = "${{ inputs.cache-suffix != '' && 'isolated-' || '' }}"+ const namespace = "${{ inputs.cache-suffix || 'production' }}"for (const template of [cached.with.key, restored.with.key, rollingPrefix]) {- const production = template.replace(namespace, '')- const smoke = template.replace(namespace, 'isolated-')- expect(production.startsWith('setup-pm-uv-v1-')).toBe(true)- expect(smoke.startsWith('setup-pm-uv-isolated-v1-')).toBe(true)- expect(smoke.startsWith('setup-pm-uv-v1-')).toBe(false)- expect(production.startsWith('setup-pm-uv-isolated-v1-')).toBe(false)+ const production = template.replace(namespace, 'production')+ const smoke = template.replace(namespace, 'smoke-42-1')+ expect(production.startsWith('setup-pm-uv-v2-production-')).toBe(true)+ expect(smoke.startsWith('setup-pm-uv-v2-smoke-42-1-')).toBe(true)+ expect(smoke.startsWith('setup-pm-uv-v2-production-')).toBe(false)+ expect(production.startsWith('setup-pm-uv-v2-smoke-42-1-')).toBe(false)}})diff --git a/tests/ci/test_cleanup_pm_toolchain_caches.py b/tests/ci/test_cleanup_pm_toolchain_caches.pyindex ff6d36244b7..e6b85c1c45f 100644--- a/tests/ci/test_cleanup_pm_toolchain_caches.py+++ b/tests/ci/test_cleanup_pm_toolchain_caches.py@@ -10,7 +10,7 @@ def test_cleanup_collects_all_pages_then_deletes_only_its_run():rows = [{"id": 1, "key": "setup-pm-tools-x64-smoke-42-1"},{"id": 2, "key": "node-cache-Windows-x64-smoke-42-2"},- {"id": 3, "key": "setup-pm-uv-isolated-v1-x64-smoke-prune-42-1"},+ {"id": 3, "key": "setup-pm-uv-v2-smoke-prune-42-1-linux-x64-os-python-true-lock"},{"id": 4, "key": "setup-pm-tools-x64-smoke-consumers-42-1"},{"id": 5, "key": "setup-pm-tools-x64-smoke-420-1"},{"id": 6, "key": "node-cache-Windows-x64-normal"},