ci: use a Turborepo remote cache for the monorepo build #39

Merged
crapougnax merged 2 commits from feat/38-turbo-remote-cache into develop 2026-11-14 15:41:07 +00:00
Member

Closes #38

Change

  • turbo.json: remoteCache.signature enabled.
  • .forgejo/workflows/ci.yaml: the build step sets TURBO_CACHE so that pushes to develop and main read and write the remote cache, and every other ref only reads. The publish step sets TURBO_CACHE: local:rw.
  • guidelines/CONTRIBUTING_AGENTS.md describes the build cache.

The address and the credentials of the cache are not in this repository nor in its forge settings: the runners give them to every job (qtrn-io/cluster pull request 58). Nothing has to be configured on the organisation.

Safe to merge before the cache exists

Without the settings Turborepo prints that remote caching is disabled and builds everything, as today.

Verified locally

Against the cache server in a container:

  • A build writes its artifacts; a second build with an empty local cache restores them (3 of 3 tasks, 170 ms).
  • A read-only client restores artifacts and uploads nothing (no PUT reaches the server).
  • A client with a different signature key does not reuse the artifacts.
  • With empty settings the build runs without the cache and without error.
  • Developers without any setting are not affected by signature: true.

Against a listener that records requests, with the cache credentials present in the environment:

  • With TURBO_CACHE: local:rw Turborepo prints Remote caching disabled (by flags) and neither reads nor writes an artifact. It still sends one usage event (POST /v8/artifacts/events).

Not verified: the cache on the forge itself, which needs the server and the runner change of qtrn-io/cluster pull request 58.

🤖 Generated with Claude Code

Closes #38 ## Change - `turbo.json`: `remoteCache.signature` enabled. - `.forgejo/workflows/ci.yaml`: the build step sets `TURBO_CACHE` so that pushes to `develop` and `main` read and write the remote cache, and every other ref only reads. The publish step sets `TURBO_CACHE: local:rw`. - `guidelines/CONTRIBUTING_AGENTS.md` describes the build cache. The address and the credentials of the cache are not in this repository nor in its forge settings: the runners give them to every job (`qtrn-io/cluster` pull request 58). Nothing has to be configured on the organisation. ## Safe to merge before the cache exists Without the settings Turborepo prints that remote caching is disabled and builds everything, as today. ## Verified locally Against the cache server in a container: - A build writes its artifacts; a second build with an empty local cache restores them (3 of 3 tasks, 170 ms). - A read-only client restores artifacts and uploads nothing (no `PUT` reaches the server). - A client with a different signature key does not reuse the artifacts. - With empty settings the build runs without the cache and without error. - Developers without any setting are not affected by `signature: true`. Against a listener that records requests, with the cache credentials present in the environment: - With `TURBO_CACHE: local:rw` Turborepo prints `Remote caching disabled (by flags)` and neither reads nor writes an artifact. It still sends one usage event (`POST /v8/artifacts/events`). Not verified: the cache on the forge itself, which needs the server and the runner change of `qtrn-io/cluster` pull request 58. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ci: use a Turborepo remote cache for the monorepo build (#38)
All checks were successful
Quatrain Core Sovereign CI / Monorepo Build, Tests & Quality Audit (push) Successful in 4m25s
Quatrain Core Sovereign CI / Monorepo Build, Tests & Quality Audit (pull_request) Successful in 4m32s
Quatrain Core Sovereign CI / Publish Changed Packages to npm (push) Has been skipped
Quatrain Core Sovereign CI / Publish Changed Packages to npm (pull_request) Has been skipped
edbbc093b4
Runners are ephemeral, so every run rebuilt the 82 build tasks from
nothing. The build step of the ci job now uses a remote cache when the
forge provides its settings (variables TURBO_API and TURBO_TEAM, secrets
TURBO_TOKEN and TURBO_REMOTE_CACHE_SIGNATURE_KEY); without them it
builds as before.

Artifacts are signed. Only pushes to develop and main write to the
cache, every other ref reads it, and the publish job does not use it:
what goes to npm is built on the runner.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
ci: take the build cache settings from the runner (#38)
All checks were successful
Quatrain Core Sovereign CI / Monorepo Build, Tests & Quality Audit (push) Successful in 4m35s
Quatrain Core Sovereign CI / Monorepo Build, Tests & Quality Audit (pull_request) Successful in 4m44s
Quatrain Core Sovereign CI / Publish Changed Packages to npm (pull_request) Has been skipped
Quatrain Core Sovereign CI / Publish Changed Packages to npm (push) Has been skipped
220fe8eddc
The runners of the forge now give the address and the credentials of the Turborepo cache
to every job, so the workflow no longer reads forge variables or secrets. It keeps the two
settings that depend on the job: only develop and main write to the cache, and the publish
job disables the remote cache explicitly, since it now receives the credentials too.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
crapougnax merged commit fba1fa25d4 into develop 2026-11-14 15:41:07 +00:00
crapougnax deleted branch feat/38-turbo-remote-cache 2026-11-14 15:41:07 +00:00
Sign in to join this conversation.
No description provided.