Skip to content

Add measured Depot base-image caching - #16

Merged
ndizazzo merged 2 commits into
mainfrom
agent/depot-pull-through-cache
Aug 2, 2026
Merged

ndizazzo merged 2 commits into
mainfrom
agent/depot-pull-through-cache

Conversation

@ndizazzo

@ndizazzo ndizazzo commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • make the digest-pinned GitHub Actions runner base configurable
  • select a Depot Registry pull-through mirror only for trusted main staging and promotion
  • authenticate with a short-lived OIDC-backed Depot pull token
  • document the measurement threshold, scope, and rollback procedure
  • add workflow policy coverage for the trust and credential boundaries

Why

The Actions runner base is the only public container base in this repository. Pull-through caching may reduce cold pulls and registry throttling, but must remain disabled until fresh-runner measurements show at least 20% and 10 seconds of median improvement with identical digests.

Validation

  • workflow matrix and promotion contract tests
  • actionlint
  • shellcheck
  • git diff --check

The optional local Docker frontend check could not connect to the local Docker endpoint (failed to build: EOF).

Summary by CodeRabbit

  • New Features

    • Builds can now optionally use a trusted, authenticated mirror of the pinned Actions Runner base image.
    • Base-image selection is validated before staging or promotion builds.
  • Documentation

    • Added setup, eligibility, rollback, benchmarking, and security guidance for mirrored base images.
    • Updated local build instructions and clarified image pinning and caching scope.
  • Tests

    • Expanded workflow validation for image selection, authentication, configuration, and build integration.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ndizazzo, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 56 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a4507b51-73af-456a-8683-ca203f4c2e25

📥 Commits

Reviewing files that changed from the base of the PR and between fb8e1a6 and 67e842a.

📒 Files selected for processing (1)
  • tests/workflow-matrix.test.sh
📝 Walkthrough

Walkthrough

The staging workflow selects a pinned upstream or validated Depot pull-through Actions Runner image. The Dockerfile consumes the selected image through a build argument. Documentation defines the contract, operations, benchmarking, and audit rules. Tests validate workflow behavior.

Changes

Runner base image selection

Layer / File(s) Summary
Configurable runner image contract
Dockerfile, README.md, docs/AUDIT.md
The Dockerfile accepts ACTIONS_RUNNER_BASE_IMAGE. Documentation defines the pinned image, trusted mirroring, and container-base policy.
Trusted Depot image selection
.github/workflows/stage-image-family.yml, docs/OPERATIONS.md, docs/CI_BENCHMARKS.md
The workflow validates trusted conditions, authenticates with a short-lived Depot token, selects the image, and passes it to the build. Operational and benchmark rules document the same flow.
Workflow contract validation
tests/workflow-matrix.test.sh
Tests verify repository validation, authentication, cache-selection outputs, secret-free credentials, and build-argument propagation.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHub Actions
  participant Depot Registry
  participant Docker Build
  GitHub Actions->>GitHub Actions: Validate trusted workflow and registry settings
  GitHub Actions->>Depot Registry: Authenticate with OIDC pull token
  Depot Registry-->>GitHub Actions: Enable pull-through image access
  GitHub Actions->>Docker Build: Pass ACTIONS_RUNNER_BASE_IMAGE
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the PR's main change: optional Depot caching for the Actions Runner base image.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/depot-pull-through-cache

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ndizazzo
ndizazzo marked this pull request as ready for review August 2, 2026 22:39
@ndizazzo
ndizazzo enabled auto-merge (squash) August 2, 2026 22:39

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
tests/workflow-matrix.test.sh (1)

329-335: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Assert the exact authentication contract.

The current checks pass if the login condition changes to false. They also pass if a future edit sends the pull token on the command line. Require the exact cache_selected == 'true' condition and --password-stdin login form.

Proposed test assertions
 grep -Fq "depot pull-token --project \"\$DEPOT_PROJECT_ID\"" \
   "$base_image_login_step"
-grep -Fq 'steps.base_image.outputs.cache_selected' "$base_image_login_step"
+grep -Fq "if: steps.base_image.outputs.cache_selected == 'true'" \
+  "$base_image_login_step"
+grep -Fq \
+  'docker login "$DEPOT_REGISTRY_HOST" --username x-token --password-stdin' \
+  "$base_image_login_step"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/workflow-matrix.test.sh` around lines 329 - 335, Strengthen the
assertions in workflow-matrix.test.sh for the base_image_login_step: require the
exact cache_selected == 'true' condition and the depot pull-token command, and
assert that authentication uses the --password-stdin login form. Keep rejecting
secrets, DEPOT_TOKEN, and REGISTRY_PULL_TOKEN references, while ensuring
command-line token passing cannot satisfy the test.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tests/workflow-matrix.test.sh`:
- Around line 329-335: Strengthen the assertions in workflow-matrix.test.sh for
the base_image_login_step: require the exact cache_selected == 'true' condition
and the depot pull-token command, and assert that authentication uses the
--password-stdin login form. Keep rejecting secrets, DEPOT_TOKEN, and
REGISTRY_PULL_TOKEN references, while ensuring command-line token passing cannot
satisfy the test.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5307684f-d56a-4f64-9671-a0c5661e28f2

📥 Commits

Reviewing files that changed from the base of the PR and between 57eb86c and fb8e1a6.

📒 Files selected for processing (7)
  • .github/workflows/stage-image-family.yml
  • Dockerfile
  • README.md
  • docs/AUDIT.md
  • docs/CI_BENCHMARKS.md
  • docs/OPERATIONS.md
  • tests/workflow-matrix.test.sh

@ndizazzo
ndizazzo merged commit 553344f into main Aug 2, 2026
40 checks passed
@ndizazzo
ndizazzo deleted the agent/depot-pull-through-cache branch August 2, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant