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): harden e2e image builds and deflake the CLI analytics install-id test (#4987)
### Why CI on Docker-based jobs has been failing intermittently across branches (including `next`): `docker buildx build` resolves base images from `public.ecr.aws/docker/library/*`, and on a cold GitHub Actions buildx cache that resolution hits ECR Public's anonymous rate limit (`429 Too Many Requests`). Whether a job passes is currently a function of cache warmth, not code — e.g. on PR #4973 the `bash`/`zsh` install jobs passed while `fish` failed, and `E2E Test Node.js 24/25` failed while 22 passed. The same 429 killed the daily 07:00 UTC install-e2e run on `next`. Separately, one load-sensitive CLI test (`analytics.dispatch.test.ts`) can fail the entire umbrella "Test Typescript SDK" job. This PR: - retries each image build up to three times inside `.github/actions/build-e2e-image` through `docker/build-push-action` (`build-retries`, validated to 1–3; 10s/20s backoff between attempts), with the final retry overriding `BASE_REGISTRY=mirror.gcr.io/library` to clear persistent ECR throttling from a different IP pool. The builds stay inside the action (not raw `docker buildx build`) because the GHA cache backend authenticates through the action context - digest-pins the e2e base images (`debian:bookworm-slim`, `node:{22.22.3,24.17.0,25.9.0}-slim`) for supply-chain integrity, with digests verified against ECR Public and recorded in `toolchain-versions.json` (`nodeDigests`), consumed by the workflows and the local `pnpm test:e2e:*` scripts - adds `ci.prewarm-e2e-images.yml` (daily 04:00 UTC + `workflow_dispatch`), which rebuilds every cache scope the e2e jobs restore from (`e2e-install-{bash,zsh,fish}`, `e2e-node-*`, `e2e-cli`) so PR jobs start from a warm cache; the node/cli entries refresh only the toolchain-stage cache via the action's new `cache-only` input (their final stages COPY host-built `dist/` a bare checkout cannot provide) - fixes the race behind the flaky analytics test: a process whose bounded state-lock wait expired minted a fresh `install_id` without adopting the one another process had already persisted; the fallback now adopts persisted state first (`adoptOrMintInstallId`), so concurrent first-run events converge on one identity. Adds a regression test for the expiry-adopt path. The bounded-wait-then-give-up behavior for stale locks is unchanged - splits `@composio/cli` tests into a dedicated `test-cli` job in `ts.test.yml` (umbrella "Test Typescript SDK" keeps its name and now excludes the CLI suite), so one CLI flake no longer fails the whole matrix ### Verification | Check | Result | | --- | --- | | `actionlint` on all touched workflows + composite action | clean | | cache restore verified on PR CI after the fix (`importing cache manifest from gha:…` + `CACHED` on install and node e2e pre-builds) | pass | | `docker buildx imagetools inspect` per base ref (ECR Public) | digests recorded in `toolchain-versions.json` | | local build of `Dockerfile.install` with pinned digest (`--load`) | passes | | `imagetools inspect` of all 4 pins vs ECR + mirror.gcr.io | byte-identical digests | | independent reviewer pass over the full diff (wiring, GH Actions expressions, bash, TS) | no defects found | | `vitest run test/src/analytics.dispatch.test.ts` x10 (+3 under full CPU load) | 10/10 + 3/3 pass (37 tests) | | `pnpm --filter @composio/cli typecheck` | pass | | `pnpm --filter @composio/cli run lint:effect` | 0 diagnostics | | oxlint + prettier on touched TS files | clean | | `pnpm --filter @composio/cli test` (full suite) | 183 files, 2020 passed, 1 skipped | | `turbo run test --dry-run` filter checks (umbrella excl. CLI / CLI only) | task lists verified | ### Notes - No changeset: CI workflows and `@composio/cli` (Changesets-excluded) only; the CLI src change is analytics-internal with no public API or user-visible behavior change. - `mirror.gcr.io` final-attempt fallback: implemented. All four base-image digests were verified byte-identical between `public.ecr.aws` and `mirror.gcr.io` via `docker buildx imagetools inspect` (the pinned digests resolve on both), so the retry loop's last attempt rebuilds with `BASE_REGISTRY=mirror.gcr.io/library` to ride out persistent ECR throttling from a different IP pool. - After merge, the first scheduled prewarm run (04:00 UTC) will warm the cold scopes; until then a cold-scope job may still need the retry to ride out a 429 window.