Skip to content

ci: enable moon remote caching via Depot Cache - #602

Merged
fforootd merged 3 commits into
mainfrom
claude/hungry-jepsen-0445a6
Jul 23, 2026
Merged

ci: enable moon remote caching via Depot Cache#602
fforootd merged 3 commits into
mainfrom
claude/hungry-jepsen-0445a6

Conversation

@fforootd

@fforootd fforootd commented Jul 23, 2026

Copy link
Copy Markdown
Member

Summary

Enables Moon's remote task-output cache against Depot Cache and closes the authentication and fork trust gaps found during review:

  • Configures .moon/workspace.yml for grpcs://cache.depot.dev with Depot's runner-injected DEPOT_CACHE_TOKEN, instanceName: zitadel-nextgen, localReadOnly: true, and integrity verification.
  • Keeps external fork pull requests on GitHub-hosted ubuntu-24.04 runners in both ci.yml and adr-index.yml, so untrusted fork code never receives Depot's ambient cache credential. Internal PRs, merge groups, and release jobs continue using Depot runners.
  • Documents the same token name and fork behavior in CONTRIBUTING.md.
  • Leaves compression disabled because Depot rejects zstd for the relevant remote-cache operations.

This is the enabling investment for splitting the serial full-pr job into parallel shards without rebuilding the affected graph in every shard.

Validation

  • moon ci :build — passed locally: 50 tasks completed (8 cached) in 1m20s with DEPOT_CACHE_TOKEN absent, proving the local fallback still works.
  • CI run #3318 — passed after changing the runner credential to DEPOT_CACHE_TOKEN; no remote-cache authentication or connection warnings.
  • Fresh-runner verification rerun — passed. Its main Moon graph reported 108 completed (107 cached), the log contained 160 explicit cached from remote task results, and zero remote-cache failures.
  • moon run workspace:check-adrs — passed (40 records).
  • node scripts/check-changesets-status.mjs --base origin/main --summary — passed; no changeset required.
  • Parsed .github/workflows/ci.yml, .github/workflows/adr-index.yml, and .moon/workspace.yml as YAML.
  • git diff --check — passed.

Release notes / changeset

No changeset required — this PR changes CI/build wiring and contributor documentation only; no shipped product behavior changes.

Notes

  • The original run was green but the Moon remote cache was not working: it logged 109 invalid token warnings and fell back to local execution.
  • External fork PRs run on GitHub-hosted infrastructure without DEPOT_CACHE_TOKEN; trusted jobs continue on Depot.
  • Local developers can opt into read-only remote-cache downloads by exporting a Depot API token as DEPOT_CACHE_TOKEN.
  • env -u CI -u GITHUB_ACTIONS rehearsal steps continue to behave as local Moon invocations and therefore do not upload when localReadOnly is enabled.
  • Rollback is deleting the remote block and restoring the original static Depot runner labels.

Add a remote block to .moon/workspace.yml pointing at Depot Cache. Depot-
hosted runners inject DEPOT_TOKEN at launch, so CI authenticates with no
repo secret; without the token (local dev, forks) moon runs fully local.
localReadOnly keeps uploads CI-only, verifyIntegrity guards downloads, and
compression stays off because Depot's capabilities response rejects zstd.

This is the enabling investment for splitting the serial full-pr job into
parallel shards: each shard can pull warm task outputs instead of
rebuilding the world. Deliberately touches no workflow files to stay
conflict-free with #487.
Copilot AI review requested due to automatic review settings July 23, 2026 07:20
@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nextgen Ready Ready Preview, Comment Jul 23, 2026 9:16am
nextgen-docs Ready Ready Preview, Comment Jul 23, 2026 9:16am
nextgen-mock-zitadel Ready Ready Preview, Comment Jul 23, 2026 9:16am

Request Review

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

⚠️ No Changeset found

Latest commit: 3dc64cf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables Moon’s remote task-output caching backed by Depot Cache, with opt-in local reads via DEPOT_TOKEN and automatic authentication on Depot CI runners. This is a build/CI acceleration change intended to reduce redundant rebuilds and enable future CI sharding without changing shipped product behavior.

Changes:

  • Configure Moon 2.x remote cache in .moon/workspace.yml (Depot host, token env var, integrity verification, read-only for local runs).
  • Document the remote-cache behavior and local opt-in in CONTRIBUTING.md.
  • Add an empty changeset to record release intent for build wiring only.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
CONTRIBUTING.md Adds contributor-facing note about Moon remote caching and local DEPOT_TOKEN behavior.
.moon/workspace.yml Configures Moon remote cache against Depot Cache (host/auth/cache settings).
.changeset/moon-remote-cache.md Records an empty changeset for CI/build-wiring-only change intent.

@fforootd
fforootd enabled auto-merge (squash) July 23, 2026 09:15
@fforootd
fforootd merged commit 73b76e8 into main Jul 23, 2026
14 checks passed
@fforootd
fforootd deleted the claude/hungry-jepsen-0445a6 branch July 23, 2026 09:23
@github-project-automation github-project-automation Bot moved this from Inbox to Done in Engineering Kanban Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants