Repository navigation
Allow checking out other repos in CI - #1780
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>
…ef }) Adds repo and ref to checkout() and files(), resolved to a commit once per run, with the CheckoutSource list, once() and localRepo(). 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>
The first lookup mints a token narrowed to the repository under the run's own installation. For a repository outside that installation GitHub answers 422, which wasn't swallowed, so the installation lookup never ran. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A malformed `repo` in `files()` only failed when the run resolved it. It now throws CiUsageError where the pipeline is defined, so it fails at boot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Enterprise Managed User accounts (`name_shortcode`) own repositories, and `repo` accepted them before the owner pattern was added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
checkout() has two ways to fill the machine, the local working tree and a GitHub clone. The CheckoutSource/CheckoutPlan abstraction existed for a speculative third. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The commit lookup accepts HEAD, so a repository with no ref resolves in its one ref step. This drops the separate default-branch step, its run-scope map and its step name. Step IDs for a repo without a ref are now `github › ref:owner/name@HEAD`; the branch is unreleased, so no in-flight run depends on the old IDs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Turn the repeated checkout, installation, local-run and files() cases in source.test.ts into test.each tables and merge near-duplicate tests. The same behaviours are covered. fakeGitHub.handle stays: the installation fallback test replies by Authorization header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 9c9fedc 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.
🟡 Changes recommended
External refs are not pinned across invoked cache-build runs, and empty source options can be silently discarded.
2 open findings
What changed in this PR
Adds cross-repository and ref-aware checkout and cache-file resolution to @inngest/ci.
Changes:
- Adds memoized repository/ref resolution with installation-aware authentication.
- Extends
checkout()andfiles()with{ repo, ref }. - Adds tests, documentation, and a changeset.
| File | Description |
|---|---|
.changeset/ci-checkout-repo.md |
Records the minor release. |
packages/ci/README.md |
Documents cross-repository usage. |
packages/ci/src/cache/cache.ts |
Resolves and hashes files from selected sources. |
packages/ci/src/checkout/checkout.ts |
Checks out resolved external sources. |
packages/ci/src/github/README.md |
Lists the new source module. |
packages/ci/src/github/auth.ts |
Adds repository-scoped installation authentication. |
packages/ci/src/github/source.test.ts |
Tests source resolution and authentication. |
packages/ci/src/github/source.ts |
Implements memoized source resolution. |
packages/ci/src/index.ts |
Exports FilesOptions. |
packages/ci/src/pipeline/names.ts |
Names ref-resolution steps. |
packages/ci/src/pipeline/pipeline.ts |
Initializes source memoization. |
packages/ci/src/pipeline/scope.ts |
Stores resolved sources per run. |
packages/ci/src/testing/fakeGitHub.ts |
Supports request-aware fake responses. |
packages/ci/src/types.ts |
Defines file source options. |
packages/ci/src/util.ts |
Adds repository parsing and memoization helpers. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
…o/ref in files() Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he invoker's commits Narrower files() patterns cannot help: the whole recursive tree is fetched and rejected when GitHub truncates it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Summary
Allows checking out any repository, branch, tag, or commit from a
ci.job(), as well as key a cache on another repository's files.checkout()now acceptscheckout({ repo, ref })files("...")now acceptsfiles("...", { repo, ref })refis resolved to a single commit and memoised per runChecklist
Added a docs PR that references this PRN/A Later bump