Skip to content

Use native Depot runner registry auth - #20

Merged
ndizazzo merged 1 commit into
mainfrom
agent/use-depot-runner-registry-auth
Aug 3, 2026
Merged

Use native Depot runner registry auth#20
ndizazzo merged 1 commit into
mainfrom
agent/use-depot-runner-registry-auth

Conversation

@ndizazzo

@ndizazzo ndizazzo commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • route trusted cache-enabled release jobs to Depot runners
  • use Depot runner short-lived registry credentials instead of project pull tokens
  • preserve the exact canonical-main trust boundary and verify the Depot organization identity

Validation

  • node --experimental-strip-types --test --test-concurrency=1 tests/release-workflow.test.ts tests/image-matrix.test.ts
  • actionlint .github/workflows/package-image-row.yml
  • git diff --check

Summary by CodeRabbit

  • Improvements

    • Improved container image publishing and build workflows by applying registry caching only when the required environment and build conditions are met.
    • Streamlined registry authentication using short-lived, pre-authenticated build credentials.
    • Added validation to ensure mirrored base images resolve correctly before builds begin.
  • Documentation

    • Updated publishing guidance with the latest authentication, organization verification, and image validation steps.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The release workflow now uses conditional, architecture-specific Depot runners with pre-authenticated registry access. It validates the Depot organization, removes per-job registry login steps, and updates documentation and tests for the new authentication flow.

Changes

Depot runner authentication

Layer / File(s) Summary
Runner selection and registry access
.github/workflows/package-image-row.yml
package, dry-image, and stage-image select eligible Depot runners, validate DEPOT_ORG_ID, and remove explicit Depot registry login steps.
Documentation and workflow validation
docs/publishing.md, tests/release-workflow.test.ts
The documentation and tests describe and verify pre-authenticated Depot runners, trusted GitHub context, and the absence of per-job registry credentials and login.

Estimated code review effort: 3 (Moderate) | ~20 minutes

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 main change: using native Depot runner registry authentication for release jobs.
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/use-depot-runner-registry-auth

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 merged commit 8a22f28 into main Aug 3, 2026
1 of 2 checks passed
@ndizazzo
ndizazzo deleted the agent/use-depot-runner-registry-auth branch August 3, 2026 01:00

@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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
tests/release-workflow.test.ts (1)

90-101: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Assert the routing contract, not only marker strings.

The test checks an error message and broad substrings. It does not prove the expected DEPOT_ORG_ID comparison, the arm64 to depot-ubuntu-24.04-arm mapping, or fallback for a non-main or non-release context. The current runner assertion also matches the ARM label because depot-ubuntu-24.04 is a substring.

Assert the exact identity comparison, both architecture branches, and at least one negative trust-boundary case.

Suggested assertions
+assert.match(
+  packageJob,
+  /\[\[ "\$\{DEPOT_ORG_ID:-\}" == 1ntz5vlngn \]\]/,
+);

 for (const job of [packageJob, dry, stage]) {
+  assert.match(
+    job,
+    /fromJSON\(inputs\.row_json\)\.arch == 'arm64'[\s\S]*'depot-ubuntu-24\.04-arm'[\s\S]*'depot-ubuntu-24\.04'/,
+  );
   assert.match(job, /depot-ubuntu-24\.04/);
 }
🤖 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/release-workflow.test.ts` around lines 90 - 101, Strengthen the routing
assertions in the release workflow test around the existing packageJob, dry, and
stage checks: verify the exact DEPOT_ORG_ID identity comparison, assert both
amd64 and arm64 runner mappings including depot-ubuntu-24.04-arm, and add a
negative case covering non-main or non-release context. Replace the broad
depot-ubuntu-24.04 substring check with an assertion that cannot also match the
ARM label, while preserving the existing forbidden credential checks.
🤖 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.

Inline comments:
In @.github/workflows/package-image-row.yml:
- Around line 269-282: Add the Depot runner identity validation to both the
dry-image and stage-image jobs before their registry/cache-dependent
depot/build-push-action steps, and gate it on
needs.package.outputs.registry_cache_selected == 'true'. Reuse the existing
DEPOT_ORG_ID check from deps, fail closed on a mismatch, and ensure the
validation runs before either job can access cached bases.

---

Nitpick comments:
In `@tests/release-workflow.test.ts`:
- Around line 90-101: Strengthen the routing assertions in the release workflow
test around the existing packageJob, dry, and stage checks: verify the exact
DEPOT_ORG_ID identity comparison, assert both amd64 and arm64 runner mappings
including depot-ubuntu-24.04-arm, and add a negative case covering non-main or
non-release context. Replace the broad depot-ubuntu-24.04 substring check with
an assertion that cannot also match the ARM label, while preserving the existing
forbidden credential checks.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b11a36c2-7e87-45e7-a877-08b0072ca944

📥 Commits

Reviewing files that changed from the base of the PR and between f470296 and fa8086e.

📒 Files selected for processing (3)
  • .github/workflows/package-image-row.yml
  • docs/publishing.md
  • tests/release-workflow.test.ts

Comment on lines +269 to +282
runs-on: >-
${{
vars.DEPOT_REGISTRY_CACHE_ENABLED == 'true'
&& github.repository == 'Mesh-LLM/mesh-packaging'
&& github.ref == 'refs/heads/main'
&& github.workflow_ref == 'Mesh-LLM/mesh-packaging/.github/workflows/images-release.yml@refs/heads/main'
&& (github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch')
&& (
fromJSON(inputs.row_json).arch == 'arm64'
&& 'depot-ubuntu-24.04-arm'
|| 'depot-ubuntu-24.04'
)
|| fromJSON(fromJSON(inputs.row_json).runner_labels)
}}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== locate file =="
git ls-files | rg '(^|/)\package-image-row\.ya?ml$|(^|/)\package-image-row\.ya?ml$' || true

echo "== file lines around concern =="
if [ -f .github/workflows/package-image-row.yml ]; then
  wc -l .github/workflows/package-image-row.yml
  sed -n '230,320p' .github/workflows/package-image-row.yml
  echo "== lines around 340-405 =="
  sed -n '340,410p' .github/workflows/package-image-row.yml
fi

echo "== DEPOT_ORG_ID and registry cache references =="
rg -n "DEPOT_ORG_ID|DEPOT_REGISTRY_CACHE_ENABLED|registry_cache_selected|runtime_base_image|dry-image|stage-image|packages: write|attestations: write" .github/workflows/package-image-row.yml .github/workflows || true

echo "== workflow jobs overview =="
python3 - <<'PY'
from pathlib import Path
p=Path(".github/workflows/package-image-row.yml")
if p.exists():
    text=p.read_text()
    lines=text.splitlines()
    in_jobs=False
    for i,l in enumerate(lines,1):
        if l.rstrip()=="jobs:":
            in_jobs=True
            continue
        if in_jobs and l and not l.startswith(" ") and not l.startswith("\t") and l.endswith(":"):
            job=l.rstrip().rstrip(":")
            print(f"{i}: job={job}")
            # print next 40 lines indented for job
            for j in range(i+1, min(len(lines), i+70)+1):
                print(f"  {j}: {lines[j-1]}")
                if lines[j-1].rstrip() and not lines[j-1].startswith(" ") and not lines[j-1].startswith("\t") and j>i+1:
                    break
PY

Repository: Mesh-LLM/mesh-packaging

Length of output: 15103


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== deps package job =="
sed -n '1,160p' .github/workflows/package-image-row.yml

echo "== dry-image remaining steps =="
sed -n '300,345p' .github/workflows/package-image-row.yml

echo "== stage-image full step block =="
sed -n '420,530p' .github/workflows/package-image-row.yml

echo "== all Depot steps and RUNTIME_BASE_IMAGE usage =="
python3 - <<'PY'
from pathlib import Path
for path in [Path(".github/workflows/package-image-row.yml"), Path(".github/workflows/images-release.yml")]:
    if not path.exists():
        continue
    lines=path.read_text().splitlines()
    print(f"FILE {path}")
    for i,l in enumerate(lines,1):
        if "depot/" in l or "RUNTIME_BASE_IMAGE" in l or "runtime_base_image" in l or "DEPOT_ORG_ID" in l or "registry_cache_selected" in l:
            start=max(1,i-5); end=min(len(lines),i+8)
            print(f"-- around line {i} --")
            for j in range(start,end+1):
                print(f"{j}: {lines[j-1]}")
PY

echo "== repo dependency files =="
git ls-files | rg '(^|/)(package(-lock)?\.json|pnpm-lock\.yaml|yarn\.lock|bun\.lockb?|tsconfig\.json)$|\.gitmodules$' || true

Repository: Mesh-LLM/mesh-packaging

Length of output: 41026


🌐 Web query:

Depot GitHub Actions runners assigned per job workflow DEPOT_ORG_ID documentation

💡 Result:

In Depot GitHub Actions runners, the DEPOT_ORG_ID is automatically set and managed by the system for jobs running on Depot infrastructure [1]. You do not need to manually assign or configure this environment variable in your GitHub Actions workflow file to "assign" a job to a Depot runner [2][3]. To use Depot runners, you simply change the runs-on label in your workflow YAML file to the appropriate Depot-provided label (e.g., runs-on: depot-ubuntu-24.04) [4][2][5]. Key points regarding DEPOT_ORG_ID and Depot Runners: * Automatic Configuration: When a job runs on a Depot GitHub Actions runner, the runner environment is pre-configured with necessary variables, including DEPOT_ORG_ID, automatically [1]. * Usage: DEPOT_ORG_ID is primarily used by the infrastructure to provide context for services like Depot Cache, Turborepo remote caching, or when using specific CLI tools that require identification of the organization [1][6][7][8]. * Manual Assignment: Manual configuration of DEPOT_ORG_ID is generally not required for standard runner operation [2]. If you are using specific integrations—such as configuring local cache tools like Gradle, Bazel, or sccache outside of the automatically configured runner environment—you might need to reference the DEPOT_ORG_ID, which can be found in your Depot dashboard under organization settings [6][7][8]. * Workflow Setup: To enable the runners, you connect your GitHub organization to Depot via the Depot dashboard and install the Depot GitHub App [4][5][3]. Once connected, the runner infrastructure handles the registration and job execution dynamically [3]. For detailed configuration of runner sizes or specific OS types, you should use the designated single-label format, such as depot-ubuntu-24.04-4, rather than attempting to inject organization identifiers manually [5].

Citations:


Add a Depot runner identity check to the image jobs when using pull-through cache.

deps checks DEPOT_ORG_ID, but Depot runners are selected per job and dry-image / stage-image also select Depot runners independently. Gate the check on needs.package.outputs.registry_cache_selected == 'true' and fail closed before either job starts the registry/cache-dependent depot/build-push-action so later jobs cannot use cached bases from an unexpected runner.

🤖 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 @.github/workflows/package-image-row.yml around lines 269 - 282, Add the
Depot runner identity validation to both the dry-image and stage-image jobs
before their registry/cache-dependent depot/build-push-action steps, and gate it
on needs.package.outputs.registry_cache_selected == 'true'. Reuse the existing
DEPOT_ORG_ID check from deps, fail closed on a mismatch, and ensure the
validation runs before either job can access cached bases.

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