Repository navigation
Add cache.maxAge to CI - #1779
jpwilliams wants to merge 16 commits into
Conversation
Jobs, commands and extra machines become spans, CI's steps are named for what they do and marked as CI's work. A job's `name` sets its span name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every span is an entry in the `spans` catalog with a required kind, step IDs are built by `joinId`, and starting a machine is a flat staged function in `machine/start.ts`. Folds the CI half of ci2-span-kinds: commands, sandboxes, saves and attempts carry kinds, each statement on a background process is a row of its own, and a snapshot's span is passed to an SDK that takes it (feature-detected by version) and opened by CI otherwise. Names the checkout steps. Adds a `ciTest` harness. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Moving it to its own file cost more diff than it saved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The span API and a snapshot's own span are always there, so the stub, the version gate and the dual snapshot-span path are gone. The shared test harness had one user, so it is local to that test again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he lookups CI's step IDs and names move to one catalog in pipeline/names.ts, run through a thin ciRun helper that tags the step as before. Sandbox paging and snapshot deletes (machine/admin.ts), snapshot names (cache/names.ts), the cache lookup and the check-complete payload each have one implementation. No step ID, name or wire format changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A cached snapshot older than cache.maxAge counts as a miss. One usableFor predicate decides whether a snapshot may be used. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… calls A later direct call has the path `id (n)`, which is not a registry key, so its span lost the configured name. The span now takes the name from the job's config and keeps the call number. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adapt the job span name fix into the steps catalog refactor: names.ts keeps the catalog and takes traceName.job(config, path) from the base. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…al to main's helpers) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 6ec7368 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
🟢 Approval recommended
The freshness behavior, validation, race resolution, tests, and public documentation are consistent, with only a minor grammar issue noted.
1 open finding
What changed in this PR
Adds configurable cache freshness to @inngest/ci, allowing jobs to rebuild snapshots older than cache.maxAge.
Changes:
- Adds and validates the
cache.maxAgeduration option. - Applies freshness checks during cache lookup and name-conflict resolution.
- Adds tests, documentation, and a minor changeset.
| File | Description |
|---|---|
.changeset/ci-cache-max-age.md |
Records the new cache option. |
packages/ci/README.md |
Documents maxAge usage. |
packages/ci/src/cache/cache.test.ts |
Tests snapshot freshness and replacement. |
packages/ci/src/cache/cache.ts |
Implements age-aware cache usability. |
packages/ci/src/machine/machine.ts |
Passes cache configuration during snapshot naming. |
packages/ci/src/pipeline/cacheGuarantees.test.ts |
Adds end-to-end cache-age tests. |
packages/ci/src/pipeline/job.ts |
Validates durations and forwards cache settings. |
packages/ci/src/types.ts |
Exposes CacheConfig.maxAge. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Summary
Adds
cache.maxAgetoci.job()s, allowing JIT builds/caching to rebuild if the latest is not recent enough.Checklist
Added a docs PR that references this PRN/A Later bump