Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
1f917c1
docs: add the cache service v2 spec
simota Nov 21, 2026
97120a5
docs: merge the cache service v2 spec
simota Nov 21, 2026
7a934ec
docs: describe the cache service v2 API
simota Nov 21, 2026
5213829
test: run actions/cache@v4 through the cache service v2 API
simota Nov 21, 2026
75b01f8
docs: correct the cache service v2 statements against the spec
simota Nov 21, 2026
85ac7a9
test: make the cache v2 e2e independent of workspace and environment
simota Nov 21, 2026
ef77a94
feat: serve the cache service v2 API from the cache server
simota Nov 21, 2026
bcff378
fix: harden the cache service v2 API against races, retries and log l…
simota Nov 21, 2026
996d671
fix: keep artifact uploads as before and separate v1 from v2 reservat…
simota Nov 21, 2026
72bd4de
fix: give every job leg its own runtime token and refuse late v1 chunks
simota Nov 21, 2026
b7c24b6
feat: merge the cache service v2 server (unit A)
simota Nov 21, 2026
e4b8f2a
Merge branch 'factory/cache-v2' into orch/unit-b
simota Nov 21, 2026
d308356
Merge branch 'factory/cache-v2' into orch/unit-c
simota Nov 21, 2026
3385a96
test: merge the cache service v2 e2e test (unit B)
simota Nov 21, 2026
71c6d71
feat: serve the cache v2 routes to BuildKit's go-actions-cache client
simota Nov 21, 2026
f317899
feat: merge BuildKit compatibility for the cache v2 routes (unit D)
simota Nov 21, 2026
c2c1bab
Merge branch 'factory/cache-v2' into orch/unit-c
simota Nov 21, 2026
0a618e5
docs: state cache v2 behaviour under a caller's token and for BuildKit
simota Nov 21, 2026
a271417
docs: tighten cache v2 statements on defaults, ranges and reservations
simota Nov 21, 2026
1a65fee
docs: merge the cache service v2 docs (unit C)
simota Nov 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Each release's section is published as its GitHub release notes (see [RUNBOOK.md](RUNBOOK.md#releasing)).

## Unreleased

### Added

- The cache server serves the cache service v2 API used by `actions/cache@v4`, on by default for jobs (`ACTIONS_CACHE_SERVICE_V2=true`), from the same store as the v1 API. BuildKit's `type=gha` cache (`docker/build-push-action`) goes through v2 as well; that path is built from its client's source and not yet confirmed with a real BuildKit run. A job-level `env: { ACTIONS_CACHE_SERVICE_V2: "" }` keeps that job on v1.

## 0.3.0

### Added
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Pipeline: `main.rs` (CLI + config assembly) → `workflow.rs` (load YAML) → `f
- **`context.rs`**: `RepoInfo::detect` shells out to `git` to fill the `github` context (repo slug from `--remote-name`, sha, ref, default branch); `host` (`--github-instance`) drives the server/API URLs. `event_ref_and_sha` then overrides ref/sha from the event payload the way GitHub does (`refs/pull/N/merge`, release tags, push `ref`/`after`, …), and `GITHUB_*_URL` from the caller's environment win.
- **`history.rs`**: `Recorder` (in `Config.history`, unless `--no-history` or `--insecure-secrets`) writes each run to `<cache>/runs/<id>/`: `meta.json` from `main.rs` (masked argv, repo, event, jobs by stage, and `config`: env/vars/inputs masked, secret names, platforms), every `Logger::line` after masking into `log.jsonl`, and `result.json` at the end. `Summary` / `Job::feed` rebuild jobs and steps from the log's status lines (`⭐`, `✅`/`❌`/`⚠️`/`🛑`, `⏭️`, `🚀`/`🏁`, `ℹ️` notes on what a local run does not reproduce) and keeps step summaries recorded beside them, formatted and parsed by `markers.rs`, whose tests check each line parses back.
- **`dashboard.rs`**: `--dashboard` serves `dashboard.html` (one self-contained page, no build step) and a JSON API (`/api/runs`, `/api/runs/<id>`, `/api/runs/<id>/job?workflow=&job=`) through `servers::serve`.
- **`servers.rs`**: std-only HTTP/1.1 servers jobs reach through `ACTIONS_CACHE_URL` (`@actions/cache` v1 API, on by default, entries persisted in `index.json`) and `ACTIONS_RESULTS_URL` (`@actions/artifact` v2 Twirp API plus Azure-blob-style block uploads, with `--artifact-server-path`; the toolkit sends proto field names such as `workflow_run_backend_id`) plus `ACTIONS_RUNTIME_URL` (the v1 API of the v3 actions, files under `v3/<run>/`, gzipped chunks stored with a `.gz__` suffix). `ACTIONS_RUNTIME_TOKEN` is a JWT signed with a per-run key (`RuntimeAuth`, or the caller's own token) whose `scp` claim carries the run/job IDs the toolkit parses; the artifact API refuses calls without it, except the signed block URLs. The cache API lives under a random per-run prefix (`cache_token`), lowercases keys, and garbage-collects entries (`CacheStore::gc`) on start and after each upload. They bind `127.0.0.1`, or `0.0.0.0` for Apple containers (reached via the vmnet gateway); a failure to start the cache server only disables it.
- **`servers.rs`**: std-only HTTP/1.1 servers jobs reach through `ACTIONS_CACHE_URL` (`@actions/cache` v1 API, on by default, entries persisted in `index.json`) and `ACTIONS_RESULTS_URL` (`@actions/artifact` v2 Twirp API plus Azure-blob-style block uploads, with `--artifact-server-path`; the toolkit sends proto field names such as `workflow_run_backend_id`) plus `ACTIONS_RUNTIME_URL` (the v1 API of the v3 actions, files under `v3/<run>/`, gzipped chunks stored with a `.gz__` suffix). `ACTIONS_RUNTIME_TOKEN` is a JWT signed with a per-run key (`RuntimeAuth`, or the caller's own token) whose `scp` claim carries the run/job IDs the toolkit parses; the artifact API refuses calls without it, except the signed block URLs. The cache v1 API lives under a random per-run prefix (`cache_token`), lowercases keys, and garbage-collects entries (`CacheStore::gc`) on start and after each upload. They bind `127.0.0.1`, or `0.0.0.0` for Apple containers (reached via the vmnet gateway); a failure to start the cache server only disables it. The cache v2 API (`ACTIONS_CACHE_SERVICE_V2`: `actions/cache@v4`, and BuildKit's `type=gha` when it is `true`) is the Twirp `CacheService` at the root of the cache port, or forwarded from the artifact port, over the same store; Twirp responses use proto snake_case names (`signed_upload_url`, `signed_download_url`, `matched_key`, `entry_id`: the toolkit masks the signed URLs only under those names). Its blobs sit at signed `/cache-v2/upload|download/<id>` URLs (own per-run key, kinds `cache-upload` / `cache-download`): uploads are staged (`CacheStore::staging`) and only `FinalizeCacheEntryUpload` publishes them as the blob; downloads serve byte ranges (`x-ms-range` / `Range`) and `HEAD` for BuildKit's Go client (`docs/specs/cache-v2.md` section 5; not confirmed with a real BuildKit run). A second `CreateCacheEntry` for a key and version being uploaded (or complete) gets 409 `already_exists`; a reservation belongs to the token that made it (`CacheStore.owners`; tokens runthrough signs are unique per job leg through the `jti` claim, while under the caller's token all jobs share one); the v1 routes refuse upload, commit and download of a v2 reservation's id (`reserved_by_v2`), but a new v1 reservation of the same key and version still replaces a pending v2 one. Twirp calls need the run's `ACTIONS_RUNTIME_TOKEN`, which carries the job's cache-mode as the `runthrough_cache_mode` claim; a caller's own token carries none (v2 takes it as `write`), so `job_env` then sets `ACTIONS_CACHE_SERVICE_V2` to the empty string for non-`write` jobs, keeping them on v1 by default (a workflow or job that sets the variable itself overrides it, and v2 then treats the job as `write`). The toolkit drops the path of `ACTIONS_RESULTS_URL`, so with the cache server only it points at the cache origin (with `--cache-server-external-url`, that URL's origin, which the signed blob URLs use too), and with `--artifact-server-path` it stays at the artifact port.

Parity with act is measured by `scripts/act_suite.py`, which runs act's runner integration tests (`TestRunEvent`, `TestRunEventHostEnvironment` and the single-workflow tests in `pkg/runner/runner_test.go`) through runthrough; see `docs/act-parity.md`, sixth pass, for the command and the last result.

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ Every run is recorded (with secrets masked) under `~/.cache/runthrough/runs`, an
- `run` steps with `bash`, `sh`, `python`, `pwsh`, `node`, or custom `{0}` shells
- `uses`: local and remote (`owner/repo[/path]@ref`) **composite**, **node** and **docker** actions, including `pre`/`post`, and `docker://image` steps; `--local-repository owner/repo@ref=PATH` substitutes a local folder
- `actions/checkout` is emulated by copying the local repo (`--bind` mounts it instead, `--no-skip-checkout` runs the real action); other repositories are cloned
- A cache server for `actions/cache` (on by default; it also serves BuildKit's `type=gha` cache for `docker/build-push-action`) and, with `--artifact-server-path`, an artifact server for `upload-artifact` / `download-artifact` v3 and v4 (it only answers the run's own jobs, which carry its `ACTIONS_RUNTIME_TOKEN`)
- A cache server for `actions/cache` (on by default; it serves the v1 API (`ACTIONS_CACHE_URL`) and the v2 API (`ACTIONS_CACHE_SERVICE_V2`) from one store, and `cache-mode` holds on both, except that under the caller's own `ACTIONS_RUNTIME_TOKEN` only `write` jobs get v2 by default and the others are pointed at v1; BuildKit's `type=gha` cache for `docker/build-push-action` goes through v2 as well, built from its client's source but not yet confirmed with a real BuildKit run; a job's `env: { ACTIONS_CACHE_SERVICE_V2: "" }` keeps it on v1) and, with `--artifact-server-path`, an artifact server for `upload-artifact` / `download-artifact` v3 and v4 (it only answers the run's own jobs, which carry its `ACTIONS_RUNTIME_TOKEN`)
- `GITHUB_OUTPUT`, `GITHUB_ENV`, `GITHUB_PATH`, `GITHUB_STATE`, `GITHUB_STEP_SUMMARY`, and `::set-output`, `::add-mask::`, `::group::`, `::error::`… commands, and problem matchers (`::add-matcher::`, `::remove-matcher::`); secrets are masked
- `workflow_dispatch` inputs are checked before a run: `required`, `choice` `options`, `boolean` / `number` values

Steps see `RUNTHROUGH=true` and `ACT=true` (also in the `env` context, so workflows that already special-case act keep working). `setup-*` actions download once: job containers share a tool cache at `/opt/hostedtoolcache` (kept under `~/.cache/runthrough/toolcache`; jobs sharing it run their `setup-*` steps one at a time, so two installs of the same version do not overwrite each other), and private images use `container.credentials` (or the `DOCKER_USERNAME` / `DOCKER_PASSWORD` secrets).

## Not supported

A job using one of these logs a note (`ℹ️`) when it starts. The cache service v2 API (`ACTIONS_CACHE_SERVICE_V2`). `permissions` and `jobs.<id>.snapshot` are validated but have no local effect; `environment` is reported (name and `url`) without environment secrets or protection rules. `concurrency` groups span one `runthrough` invocation, and a job cancelled by `cancel-in-progress` stops before its next step.
A job using one of these logs a note (`ℹ️`) when it starts. `permissions` and `jobs.<id>.snapshot` are validated but have no local effect; `environment` is reported (name and `url`) without environment secrets or protection rules. `concurrency` groups span one `runthrough` invocation, and a job cancelled by `cancel-in-progress` stops before its next step.

## Platforms

Expand Down
4 changes: 2 additions & 2 deletions docs/act-parity.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sandbox) covers the servers, Docker and Apple `container`.
- [x] Reusable workflows (`jobs.<id>.uses`) — local and `owner/repo/path@ref`, typed `with` inputs and defaults, `secrets` mapping or `inherit`, `on.workflow_call.outputs`, matrix callers *(act support unverified)*
- [x] `actions/checkout` of another repository — shallow clone of `repository` at `ref` into `path`, with `token` passed as a header
- [x] Artifact server (`--artifact-server-path`, `--artifact-server-addr`, `--artifact-server-port`) — the `@actions/artifact` v2 API used by `upload-artifact@v4` / `download-artifact@v4`; the v3 actions' API is not served
- [x] Cache server for `actions/cache` (`--no-cache-server`, `--cache-server-path`, `--cache-server-external-url`, `--cache-server-addr`, `--cache-server-port`) — the `@actions/cache` v1 API (`ACTIONS_CACHE_URL`), on by default and persisted under `~/.cache/runthrough/cache`
- [x] Cache server for `actions/cache` (`--no-cache-server`, `--cache-server-path`, `--cache-server-external-url`, `--cache-server-addr`, `--cache-server-port`) — the `@actions/cache` v1 API (`ACTIONS_CACHE_URL`) and the v2 API used by `actions/cache@v4` (`ACTIONS_CACHE_SERVICE_V2`), sharing one store, on by default and persisted under `~/.cache/runthrough/cache`. v2 details: the toolkit uses v2 only when the job's `GITHUB_SERVER_URL` host is `github.com`, `*.ghe.com` or `*.localhost`, and v1 otherwise; jobs get `ACTIONS_CACHE_SERVICE_V2=true` while the cache server runs, except that when runthrough's own environment sets a non-empty `ACTIONS_RUNTIME_TOKEN` (every job then gets that token, which carries no cache-mode, so the v2 server takes it as `write`), jobs whose `cache-mode` is not `write` get `ACTIONS_CACHE_SERVICE_V2` set to the empty string, which overrides a value inherited from runthrough's environment and by default keeps them on v1, whose URL carries their mode (a workflow or job that sets `ACTIONS_CACHE_SERVICE_V2` itself overrides it, and v2 then treats the job as `write`; an empty caller token counts as none: runthrough signs its own); the injected value is overridden by a workflow, job or step `env:` and by `--env`, so a job-level `env: { ACTIONS_CACHE_SERVICE_V2: "" }` keeps one job on v1; the Twirp calls need the run's `ACTIONS_RUNTIME_TOKEN`, while blob uploads and downloads are authorized by their signed URLs alone; the toolkit drops the path of `ACTIONS_RESULTS_URL`, so with the cache server only it points at the cache server's origin (with `--cache-server-external-url`, that URL's origin; a proxy must forward `/twirp/` and `/cache-v2/` at its root), and with `--artifact-server-path` it stays at the artifact port, which forwards the cache calls; `--no-cache-server` sets neither `ACTIONS_CACHE_SERVICE_V2` nor a cache-derived `ACTIONS_RESULTS_URL`. BuildKit's `type=gha` cache (`docker/build-push-action`, buildx; Go client `tonistiigi/go-actions-cache`) switches to the v2 API too when the job has `ACTIONS_CACHE_SERVICE_V2=true`; the v2 routes serve what that client needs: byte-range downloads (`x-ms-range` or `Range`, `bytes=N-` / `bytes=N-M`, answered `206` when the range has data and `416` when it starts at or beyond the end), `HEAD` on the signed download URL, an `x-ms-request-id` header on every answer, and a 409 `already_exists` answer to a `CreateCacheEntry` for a key and version that exist or are being uploaded, which the client takes as "already exists". This is built from the client's source and tested at the handler level, not confirmed with a real BuildKit run (see `docs/specs/cache-v2.md`, section 5)

## Run control

Expand Down Expand Up @@ -262,7 +262,7 @@ Keys runthrough accepted but did not act on, or did not know:
- [x] `on.<event>` filters (`branches`, `branches-ignore`, `tags`, `tags-ignore`, `paths`, `paths-ignore`, `types`, `workflow_run.workflows`) decide whether a workflow runs, as on GitHub. **Differs from act**, which selects by event name only; `-j` or a single workflow file still bypasses them. Changed files come from the payload's `commits` or `before`..`after` (`pull_request`: `base.sha...head.sha`); without them `paths` passes. Without `-e`, a `push` payload's `before` is `<remote>/<branch>` when HEAD is ahead of it (what pushing now would send), so `paths` and actions such as `dorny/paths-filter` see the unpushed commits; an up-to-date, behind or new branch gets no `before`, and the checkout's `origin/<branch>` points at the commit being run, as after the push on GitHub
- [x] `steps[*].background`, `wait`, `wait-all`, `cancel`, `parallel`: background steps run on their own threads (at most 10 at once), their outputs, `GITHUB_ENV` / `GITHUB_PATH` additions and post steps apply when waited for, an implicit `wait-all` precedes the post steps, and `cancel` (or the job being cancelled, also while it waits for them) sends SIGTERM to the step's process group, then SIGKILL after 5s (a timeout kills the group; on Windows the process tree is ended with `taskkill`); on the host that group also ends when runthrough exits; `parallel` children's `pre` hooks run in the job's pre phase; rejected inside composite actions
- [x] `concurrency` (workflow and job): one holder per group (case-insensitive), the default queue replaces the pending run, `queue: max` keeps up to 100 in order, `cancel-in-progress` cancels the holder; a group an enclosing workflow or calling job already holds is cancelled as a deadlock (as GitHub does), and a called workflow's own `concurrency` applies (inside it `github.workflow` is the caller's, as on GitHub); `queue: max` with `cancel-in-progress` is a validation error. Groups span one runthrough invocation, and a cancelled holder stops before its next step
- [x] `cache-mode` (workflow and job: `read`, `write`, `write-only`, `none`) is enforced by the cache server: a denied restore is a miss, a denied save gets 403, which `@actions/cache` logs as "Failed to save" without failing the step; the upload, commit and download endpoints check the mode too, and only a pending reservation takes data
- [x] `cache-mode` (workflow and job: `read`, `write`, `write-only`, `none`) is enforced by the cache server: a denied restore is a miss, a denied save gets 403, which `@actions/cache` logs as "Failed to save" without failing the step; the upload, commit and download endpoints check the mode too, and only a pending reservation takes data. The v2 API is limited the same way for jobs that carry a token runthrough signed, which names the job's mode: a denied restore is a miss, a denied save is `ok: false` with a message, which `@actions/cache` logs as a warning without failing the step. The caller's own `ACTIONS_RUNTIME_TOKEN` names no mode, so the v2 server cannot tell the jobs apart and treats every call as `write`; non-`write` jobs are then kept on the v1 API by default, which enforces their mode (see the cache server above)
- [x] `jobs.<id>.environment`: the name is reported at job start and `url` after the steps (it may use `steps`); no deployments, environment secrets or protection rules
- [x] `services.<id>.command` and `entrypoint`
- [x] `run-name` is evaluated and printed
Expand Down
3 changes: 1 addition & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ <h3>Expressions</h3>
<article>
<h3>Props backstage</h3>
<ul>
<li>A built-in cache server for <code>actions/cache</code> and BuildKit's <code>type=gha</code> cache</li>
<li>A built-in cache server for <code>actions/cache</code> (v1 and v2 APIs), which BuildKit's <code>type=gha</code> cache also uses through v2 (not yet confirmed with a real BuildKit run)</li>
<li>An artifact server for <code>upload-artifact</code> / <code>download-artifact</code> v3 and v4</li>
<li>Service containers on a per-job network, reachable by name</li>
<li><code>setup-*</code> tools download once into a shared tool cache</li>
Expand Down Expand Up @@ -435,7 +435,6 @@ <h2>What stays different from GitHub</h2>
<p>A local rehearsal can't do everything the real stage does. These are the known gaps, and a run says so when a job uses one of them.</p>
</div>
<div class="gaps">
<div><strong>Cache service v2</strong>The <code>ACTIONS_CACHE_SERVICE_V2</code> API is not served. The v1 API is.</div>
<div><strong>Permissions</strong><code>permissions</code> is validated but has no local effect.</div>
<div><strong>Environments</strong>The name and <code>url</code> are reported. Environment secrets and protection rules are not applied.</div>
<div><strong>Concurrency</strong>Groups span a single <code>runthrough</code> invocation. A cancelled job stops before its next step.</div>
Expand Down
Loading
Loading