@devries-cameron20 / composio-1 / commits / 64acec65b
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.

ci(ts): fix next push trigger and cache reuse (#3971)

This PR: - fixes the `ts.build.yml` push trigger, which still pointed at `master`: the repo's default branch is `next`, so the workflow has not run on push since 2025-10-24 and never populated the turbo/pnpm caches that PR runs restore from (GitHub cache isolation lets PRs read base-branch caches, but not other PRs') - fixes the same stale `master` push trigger in `py.check.yaml` (all other workflows already list `next`) - adds a `cache-save` input (default `'true'`, preserving current behavior for every other consumer) to the `setup-node-pnpm-bun` composite action, swapping `actions/cache` for `actions/cache/restore` (same repo, same v6.1.0 SHA pin) when disabled - wires `cache-save` in `ts.build.yml` so only push runs on `next` persist caches: PR-scoped saves are invisible to other branches, so they only cost post-job time and evict default-branch entries from the 10 GB repo cache quota ## Context Measured on run [30364148082](https://github.com/ComposioHQ/composio/actions/runs/30364148082) (PR run, ~90s wall time): | Step | Time | |---|---| | Checkout | 5s | | Setup Node.js, pnpm, Bun | 34s (mise 1s, setup-node 5s, setup-bun 2s, pnpm 2s, **pnpm store restore 18s** for 658 MB, turbo restore 1s) | | `pnpm install --frozen-lockfile` | 14s | | `pnpm lint` | 1s | | `pnpm run build:packages` | 24s, **0/19 turbo cache hits** | | Post-job cache saves | ~11s (turbo save + a 658 MB pnpm store save that failed with "Unable to reserve cache", racing the parallel ts.* jobs on the same PR) | The build restored a turbo cache only via the fallback restore-key `Linux-turbo-build-` from an unrelated branch, hence 0 hits. Once push runs fire on `next` again, every merge saves a fresh `Linux-turbo-build-<sha>` cache that PR runs match through the restore-key prefix, so unchanged packages become turbo hits (up to ~20s off the build step) and the ~11s post-job save disappears from PR runs. The per-commit key suffix is kept intentionally: the turbo cache accumulates, so each default-branch save needs a fresh key and readers match via the prefix (documented inline in the action).

Alberto Schiabel committed Jul 28, 2026 at 19:53 UTC 64acec65b6956413bd735a1b88bad2000eb23900
3 files changed +36 -4
.github/actions/setup-node-pnpm-bun/action.yml
+30 -2
@@ -18,6 +18,13 @@ inputs:
18 description: 'Cache .turbo build outputs'
19 required: false
20 default: 'false'
21 + cache-save:
22 + description: >-
23 + Persist pnpm/turbo caches in the post-job phase. Set to 'false' on runs
24 + whose caches other branches cannot restore (e.g. pull_request runs) to
25 + skip the post-job save and avoid evicting default-branch caches.
26 + required: false
27 + default: 'true'
28
29 outputs:
30 node-version:
@@ -84,7 +91,7 @@ runs:
91 echo "NODE_VERSION=$(node --version | sed 's/^v//')" >> "$GITHUB_OUTPUT"
92
93 - name: Cache pnpm store
87 - if: inputs.enable-caching == 'true'
94 + if: inputs.enable-caching == 'true' && inputs.cache-save == 'true'
95 uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
96 with:
97 path: ${{ steps.pnpm-store.outputs.STORE_PATH }}
@@ -92,13 +99,34 @@ runs:
99 restore-keys: |
100 ${{ runner.os }}-node${{ steps.pnpm-store.outputs.NODE_VERSION }}-pnpm-store-
101
102 + - name: Restore pnpm store (read-only)
103 + if: inputs.enable-caching == 'true' && inputs.cache-save != 'true'
104 + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
105 + with:
106 + path: ${{ steps.pnpm-store.outputs.STORE_PATH }}
107 + key: ${{ runner.os }}-node${{ steps.pnpm-store.outputs.NODE_VERSION }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
108 + restore-keys: |
109 + ${{ runner.os }}-node${{ steps.pnpm-store.outputs.NODE_VERSION }}-pnpm-store-
110 +
111 - name: Cache turbo build outputs
96 - if: inputs.enable-caching == 'true' && inputs.enable-turbo-cache == 'true'
112 + if: inputs.enable-caching == 'true' && inputs.enable-turbo-cache == 'true' && inputs.cache-save == 'true'
113 uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
114 with:
115 path: .turbo/cache
116 # Keyed per job: concurrent jobs save different task graphs under the
117 # same commit, and actions/cache is first-writer-wins on exact keys.
118 + # The per-commit suffix is intentional even though it never exact-hits:
119 + # the turbo cache accumulates, so every save must use a fresh key and
120 + # readers match through the restore-keys prefix.
121 + key: ${{ runner.os }}-turbo-${{ github.job }}-${{ github.sha }}
122 + restore-keys: |
123 + ${{ runner.os }}-turbo-${{ github.job }}-
124 +
125 + - name: Restore turbo build outputs (read-only)
126 + if: inputs.enable-caching == 'true' && inputs.enable-turbo-cache == 'true' && inputs.cache-save != 'true'
127 + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
128 + with:
129 + path: .turbo/cache
130 key: ${{ runner.os }}-turbo-${{ github.job }}-${{ github.sha }}
131 restore-keys: |
132 ${{ runner.os }}-turbo-${{ github.job }}-
.github/workflows/py.check.yaml
+1 -1
@@ -2,7 +2,7 @@ name: Checks
2 on:
3 push:
4 branches:
5 - - master
5 + - next
6 paths:
7 - 'python/**/*.py'
8 - '.github/actions/setup-python-uv/action.yml'
.github/workflows/ts.build.yml
+5 -1
@@ -2,7 +2,7 @@ name: Build Typescript SDK
2
3 on:
4 push:
5 - branches: [master]
5 + branches: [next]
6 paths:
7 - 'ts/**'
8 - '.oxlintrc.json'
@@ -53,6 +53,10 @@ jobs:
53 uses: ./.github/actions/setup-node-pnpm-bun
54 with:
55 enable-turbo-cache: 'true'
56 + # Only push runs on next save caches: PR-scoped caches are invisible
57 + # to other branches, so saving them costs post-job time and evicts
58 + # reusable default-branch caches from the 10 GB repo quota.
59 + cache-save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/next' }}
60
61 - name: Install Dependencies
62 run: pnpm install --frozen-lockfile