@devries-cameron20 / composio-1 / commits / e1f47b0a1
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

fix(ci): isolate uv caches by dependencies and toolchain (#5313)

This PR: - prevents the stale uv index failure seen in https://github.com/ComposioHQ/composio/pull/5311, where a new dependency pin restored registry metadata cached for older dependencies. - routes every Python test matrix entry through the shared setup action, which restores dependency-matched caches without broad restore keys. - includes legacy `setup.py` files and `mise.lock` in cache invalidation, and isolates caches by the resolved Python version and pinned uv version. - removes the integration job's duplicate cache restore, which could overwrite the shared action's cache with an older dependency set. - validates the affected workflow paths with actionlint, checks composite YAML and upstream action input support, and verifies that SDK/provider metadata, lockfile, and toolchain changes alter the dependency fingerprint. - passes [hosted Python CI on 3.11, 3.13, and 3.15](https://github.com/ComposioHQ/composio/actions/runs/42996195685/attempts/1); a [3.15 rerun](https://github.com/ComposioHQ/composio/actions/runs/42996195685/job/130442461963) confirms an exact cache hit and another successful run. Unchanged dependencies and tool versions still reuse their cache. Dependency changes start with a fresh cache instead of falling back to older registry listings. <!-- sdk-release-note-exempt: This changes CI cache selection only and does not alter published SDK behavior. -->

Alberto Schiabel committed Nov 11, 2026 at 20:19 UTC e1f47b0a1ea5a96d08e284d78a289a89a98fde6a
2 files changed +8 -23
.github/actions/setup-python-uv/action.yml
+7 -1
@@ -17,15 +17,17 @@ inputs:
17 cache-dependency-glob:
18 description: 'Workspace-relative files used to invalidate the uv cache'
19 required: false
20 - # Mirrors setup-uv v9 defaults; recheck when updating the pinned action.
20 + # Extend setup-uv defaults with legacy package metadata and our toolchain lock.
21 default: |
22 **/*requirements*.txt
23 **/*requirements*.in
24 **/*constraints*.txt
25 **/*constraints*.in
26 **/pyproject.toml
27 + **/setup.py
28 **/uv.lock
29 **/*.py.lock
30 + mise.lock
31
32 outputs:
33 python-version:
@@ -61,6 +63,7 @@ runs:
63 echo "uv=$uv_version" >> "$GITHUB_OUTPUT"
64
65 - name: Setup Python
66 + id: python
67 uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
68 with:
69 python-version: ${{ steps.tool-versions.outputs.python }}
@@ -70,7 +73,10 @@ runs:
73 with:
74 version: ${{ steps.tool-versions.outputs.uv }}
75 enable-cache: ${{ inputs.enable-caching }}
76 + # Keep restores scoped to these dependency files and tool versions.
77 + # A fallback to older dependencies can hide newly published releases.
78 cache-dependency-glob: ${{ inputs.cache-dependency-glob }}
79 + cache-suffix: py-${{ steps.python.outputs.python-version }}-uv-${{ steps.tool-versions.outputs.uv }}
80 prune-cache: true
81
82 - name: Report versions
.github/workflows/py.test.yml
+1 -22
@@ -69,23 +69,10 @@ jobs:
69 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
70
71 - name: Set up Python ${{ matrix.python-version }}
72 - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
72 + uses: ./.github/actions/setup-python-uv
73 with:
74 python-version: ${{ matrix.python-version }}
75
76 - - name: Cache uv dependencies
77 - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
78 - with:
79 - path: ~/.cache/uv
80 - key: uv-${{ matrix.python-version }}-${{ hashFiles('python/pyproject.toml', 'mise.toml') }}
81 - restore-keys: |
82 - uv-${{ matrix.python-version }}-
83 -
84 - - name: Install UV
85 - run: |
86 - UV_VERSION="$(sed -n 's/^uv[[:space:]]*=[[:space:]]*"\([^"]*\)"/\1/p' mise.toml)"
87 - pip install "uv==${UV_VERSION}"
88 -
76 - name: Install Dependencies
77 env:
78 EXCLUDED_PACKAGES: ${{ matrix.excluded-packages }}
@@ -274,14 +261,6 @@ jobs:
261 id: setup-python
262 uses: ./.github/actions/setup-python-uv
263
277 - - name: Cache UV dependencies
278 - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
279 - with:
280 - path: ~/.cache/uv
281 - key: uv-${{ hashFiles('mise.lock') }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('python/pyproject.toml') }}
282 - restore-keys: |
283 - uv-${{ hashFiles('mise.lock') }}-py${{ steps.setup-python.outputs.python-version }}-
284 -
264 - name: Install Python Dependencies
265 working-directory: ./python
266 run: |