Repository navigation
ci: enable copy-pr-bot and add self-hosted runner PR workflow - #2121
Conversation
📝 WalkthroughWalkthroughAdded two GitHub Actions YAMLs: a copy-pr-bot config enabling the bot (auto-sync ready PRs, drafts disabled) and a new self-hosted workflow Changes
Sequence Diagram(s)sequenceDiagram
participant GH as GitHub Actions
participant Runner as Self-hosted Runner
participant Docker as Docker Engine
participant Artifact as Actions Artifact Storage
participant Repo as Repository (test/)
GH->>Runner: trigger `pr-self-hosted` on push to pull-request/*
Runner->>GH: run `get-pr-info` job (fetch PR metadata)
Runner->>Docker: check GHCR base image
alt base missing
Runner->>Docker: build `Dockerfile.base`
end
Runner->>Docker: build production image
Runner->>Docker: build sandbox test image (`test/Dockerfile.sandbox`)
Runner->>Artifact: upload gzipped images (`sandbox-test-image`, `isolation-image`)
par e2e jobs
Runner->>Artifact: download relevant image artifact
Runner->>Docker: load image tarball
Runner->>Repo: mount `test/` at `/opt/test`
Runner->>Docker: run `/opt/test/e2e-test.sh` or `bash test/e2e-gateway-isolation.sh`
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/pr-self-hosted.yaml (1)
37-37: Pin external action to an immutable ref.Line 37 references
nv-gha-runners/get-pr-info@main; mutable refs can change behavior unexpectedly and weaken supply-chain guarantees. Prefer a commit SHA (or immutable release tag).🔒 Suggested change
- - id: get-pr-info - uses: nv-gha-runners/get-pr-info@main + - id: get-pr-info + uses: nv-gha-runners/get-pr-info@<pinned-commit-sha>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/pr-self-hosted.yaml at line 37, The workflow currently uses the external action reference "nv-gha-runners/get-pr-info@main" which is mutable; update that reference to an immutable ref (a specific commit SHA or an immutable release tag) by replacing "@main" with the chosen commit SHA or tag for the nv-gha-runners/get-pr-info action, and ensure any other occurrences are updated consistently so the workflow always runs against a fixed, auditable version.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/pr-self-hosted.yaml:
- Line 37: The workflow currently uses the external action reference
"nv-gha-runners/get-pr-info@main" which is mutable; update that reference to an
immutable ref (a specific commit SHA or an immutable release tag) by replacing
"@main" with the chosen commit SHA or tag for the nv-gha-runners/get-pr-info
action, and ensure any other occurrences are updated consistently so the
workflow always runs against a fixed, auditable version.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 08b622d6-4cfe-45e6-98ca-ab353794cc83
📒 Files selected for processing (2)
.github/copy-pr-bot.yaml.github/workflows/pr-self-hosted.yaml
| timeout-minutes: 15 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 |
There was a problem hiding this comment.
All actions/docker images/etc. should pin to a specific SHA rather than tag.
| needs: build-sandbox-images | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 |
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Download image artifact | ||
| uses: actions/download-artifact@v4 |
brandonpelfrey
left a comment
There was a problem hiding this comment.
Minor requests, otherwise looks good
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/pr-self-hosted.yaml (1)
31-38:get-pr-infois currently dead code and can fail the workflow for no benefit.Line 31-Line 38 defines
pr-info, but nothing consumes it. If this job fails, the workflow turns red even when build/test jobs are fine. Either wire it into dependent jobs or remove it.♻️ Proposed simplification
jobs: - get-pr-info: - runs-on: ubuntu-latest - outputs: - pr-info: ${{ steps.get-pr-info.outputs.pr-info }} - steps: - - id: get-pr-info - uses: nv-gha-runners/get-pr-info@090577647b8ddc4e06e809e264f7881650ecdccf # main - build-sandbox-images: runs-on: linux-amd64-cpu4🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/pr-self-hosted.yaml around lines 31 - 38, The get-pr-info job is unused and can fail CI; either delete the entire job block named get-pr-info (including its step id get-pr-info and output pr-info) or make downstream jobs declare needs: get-pr-info and reference its output via needs.get-pr-info.outputs.pr-info so the output is actually consumed; pick one approach and update the workflow to remove dead code or wire the pr-info output into dependent jobs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/pr-self-hosted.yaml:
- Around line 31-38: The get-pr-info job is unused and can fail CI; either
delete the entire job block named get-pr-info (including its step id get-pr-info
and output pr-info) or make downstream jobs declare needs: get-pr-info and
reference its output via needs.get-pr-info.outputs.pr-info so the output is
actually consumed; pick one approach and update the workflow to remove dead code
or wire the pr-info output into dependent jobs.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: e1a6ba7d-f567-48fd-86ee-cfcbaabf3b66
📒 Files selected for processing (1)
.github/workflows/pr-self-hosted.yaml
Enable copy-pr-bot on this repo so that PR code is only pushed to pull-request/* branches after maintainer vetting (trusted NVIDIA employees with signed commits auto-sync; community PRs require an explicit '/ok to test <SHA>' from a maintainer). Add pr-self-hosted.yaml which triggers on push to pull-request/* branches and runs the heavier sandbox image builds and E2E tests on NVIDIA self-hosted runners (linux-amd64-cpu4). The existing pr.yaml workflow continues to run lightweight lint and unit tests on GitHub-hosted runners for all PRs. Refs: https://docs.gha-runners.nvidia.com/platform/onboarding/overview/
Address review feedback from brandonpelfrey — pin all actions/checkout, actions/upload-artifact, actions/download-artifact, and nv-gha-runners/get-pr-info to their commit SHAs with the human-readable tag retained as a trailing comment.
98d0692 to
53ca97b
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
.github/workflows/pr-self-hosted.yaml (2)
31-38:get-pr-infois currently unused and adds avoidable failure surface.Lines [31-38] define outputs that no downstream job consumes. Consider removing this job (or wiring it into
needs/conditions) to reduce workflow flakiness and runtime.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/pr-self-hosted.yaml around lines 31 - 38, The workflow defines an unused job "get-pr-info" (job id: get-pr-info) that exposes output "pr-info" from the step with id "get-pr-info" (uses nv-gha-runners/get-pr-info@0905776...), which no downstream job consumes; either remove the entire "get-pr-info" job block to eliminate the unused output and reduce failure surface, or wire its output into consumers by adding appropriate "needs: get-pr-info" references and using "${{ needs.get-pr-info.outputs.pr-info }}" in downstream job conditions/steps so the output is actually consumed.
48-53: Prefer digest pinning over:latestfor base image reproducibility.Line [48] pulls a mutable tag. A digest-pinned reference avoids nondeterministic CI behavior and strengthens supply-chain guarantees.
Suggested direction
- if docker pull ghcr.io/nvidia/nemoclaw/sandbox-base:latest 2>/dev/null; then - echo "BASE_IMAGE=ghcr.io/nvidia/nemoclaw/sandbox-base:latest" >> "$GITHUB_ENV" + # Use an immutable digest published by your image pipeline + if docker pull ghcr.io/nvidia/nemoclaw/sandbox-base@sha256:<digest> 2>/dev/null; then + echo "BASE_IMAGE=ghcr.io/nvidia/nemoclaw/sandbox-base@sha256:<digest>" >> "$GITHUB_ENV"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/pr-self-hosted.yaml around lines 48 - 53, The workflow currently pulls the mutable tag "ghcr.io/nvidia/nemoclaw/sandbox-base:latest" and writes BASE_IMAGE with that tag; change this to use a digest-pinned reference instead: obtain the image digest (e.g., via `docker pull` + `docker inspect --format='{{index .RepoDigests 0}}'` or `docker manifest inspect` / registry API) and write BASE_IMAGE using the digest form "ghcr.io/nvidia/nemoclaw/sandbox-base@sha256:<digest>"; update the conditional that sets BASE_IMAGE (the docker pull/echo lines) so the fallback/local build still sets BASE_IMAGE to the digest-pinned name (or to a clearly named local image like "nemoclaw-sandbox-base-local") to ensure reproducible CI runs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/pr-self-hosted.yaml:
- Line 21: The branch filter string "pull-request/[0-9]+" is using a regex-style
quantifier that doesn't work in GitHub Actions glob syntax; update the branch
filter pattern to "pull-request/*" so branches like pull-request/123 will match
(replace the existing "pull-request/[0-9]+" entry with "pull-request/*").
---
Nitpick comments:
In @.github/workflows/pr-self-hosted.yaml:
- Around line 31-38: The workflow defines an unused job "get-pr-info" (job id:
get-pr-info) that exposes output "pr-info" from the step with id "get-pr-info"
(uses nv-gha-runners/get-pr-info@0905776...), which no downstream job consumes;
either remove the entire "get-pr-info" job block to eliminate the unused output
and reduce failure surface, or wire its output into consumers by adding
appropriate "needs: get-pr-info" references and using "${{
needs.get-pr-info.outputs.pr-info }}" in downstream job conditions/steps so the
output is actually consumed.
- Around line 48-53: The workflow currently pulls the mutable tag
"ghcr.io/nvidia/nemoclaw/sandbox-base:latest" and writes BASE_IMAGE with that
tag; change this to use a digest-pinned reference instead: obtain the image
digest (e.g., via `docker pull` + `docker inspect --format='{{index .RepoDigests
0}}'` or `docker manifest inspect` / registry API) and write BASE_IMAGE using
the digest form "ghcr.io/nvidia/nemoclaw/sandbox-base@sha256:<digest>"; update
the conditional that sets BASE_IMAGE (the docker pull/echo lines) so the
fallback/local build still sets BASE_IMAGE to the digest-pinned name (or to a
clearly named local image like "nemoclaw-sandbox-base-local") to ensure
reproducible CI runs.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 5455002b-0b7f-441e-86bf-93233dbd58f3
📒 Files selected for processing (2)
.github/copy-pr-bot.yaml.github/workflows/pr-self-hosted.yaml
✅ Files skipped from review due to trivial changes (1)
- .github/copy-pr-bot.yaml
| on: | ||
| push: | ||
| branches: | ||
| - "pull-request/[0-9]+" |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
In GitHub Actions, does on.push.branchesuse glob patterns or regex? Willpull-request/[0-9]+match a branch namedpull-request/123?
💡 Result:
In GitHub Actions, on.push.branches uses glob patterns, not regex. The pattern pull-request/[0-9]+ will not match the branch named pull-request/123 because + in glob patterns matches one or more of the preceding character (here, the literal /), not one or more digits as in regex. To match branches like pull-request/123, use the glob pattern pull-request/[0-9]* (matches zero or more digits) or pull-request/[1-9][0-9]* (matches one or more digits, avoiding leading zero).
Citations:
- 1: https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions
- 2: https://docs.github.com/en/[email protected]/actions/using-workflows/workflow-syntax-for-github-actions
- 3: https://zenn.dev/gloriali/scraps/aa4cbe7e387dc8
- 4: https://stackoverflow.com/questions/68078004/why-doesnt-my-github-action-trigger-on-a-regex-tag
Fix branch filter syntax; current pattern won't match mirrored PR branches.
Line 21 uses glob-style syntax [0-9]+, but in GitHub Actions glob patterns, + matches one or more of the preceding character (the /), not digits. This prevents the workflow from triggering on pull-request/123 branches.
Use the glob pattern pull-request/* to match numeric PR branches:
Suggested fix
- - "pull-request/[0-9]+"
+ - "pull-request/*"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - "pull-request/[0-9]+" | |
| - "pull-request/*" |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/pr-self-hosted.yaml at line 21, The branch filter string
"pull-request/[0-9]+" is using a regex-style quantifier that doesn't work in
GitHub Actions glob syntax; update the branch filter pattern to "pull-request/*"
so branches like pull-request/123 will match (replace the existing
"pull-request/[0-9]+" entry with "pull-request/*").
|
Re: CodeRabbit's comment about GitHub Actions filter patterns support This is confirmed by:
No change needed. |
…flow (#2294) ## Summary Switch `test-e2e-sandbox` from `linux-amd64-cpu4` (NVIDIA self-hosted) to `ubuntu-latest` (GitHub-hosted) in the `pr-self-hosted` workflow. The snapshot rollback test fails 100% on the self-hosted runner but passes reliably on GitHub-hosted runners. ## Related Issue Unblocks all PRs gated on `pr-self-hosted` — the workflow has never had a passing run since it was added in #2121. ## Changes - **`.github/workflows/pr-self-hosted.yaml`**: Change `test-e2e-sandbox` `runs-on` from `linux-amd64-cpu4` to `ubuntu-latest` - Other E2E jobs (`build-sandbox-images`, `test-e2e-gateway-isolation`) remain on `linux-amd64-cpu4` since they pass there ### Diagnosis The `rollbackFromSnapshot()` function in `nemoclaw/src/blueprint/snapshot.ts` does `renameSync` + `cpSync` on `/sandbox/.openclaw` (which contains symlinks to `.openclaw-data`). On the self-hosted runner's Docker environment, one of these operations throws — but the bare `catch {}` swallows the error and returns `false`, producing the "Rollback returned false" failure with no diagnostic output. Confirmed in PR #2288 by temporarily switching the runner — `test-e2e-sandbox` passed immediately on `ubuntu-latest`. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Verification - [ ] `npx prek run --all-files` passes - [ ] `npm test` passes - [x] Tests added or updated for new or changed behavior - [x] No secrets, API keys, or credentials committed - [ ] Docs updated for user-facing behavior changes ## AI Disclosure - [x] AI-assisted — tool: Claude Code (pi agent) --- Signed-off-by: Julie Yaunches <[email protected]> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated test environment configuration for improved compatibility and reliability of end-to-end snapshot tests. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Julie Yaunches <[email protected]>
Summary
Enable NVIDIA GHA self-hosted runners for PR testing by adding:
.github/copy-pr-bot.yaml— activates copy-pr-bot on this repo.github/workflows/pr-self-hosted.yaml— runs heavier CI jobs on self-hosted runnersHow it works
pr.yaml, triggered bypull_requestevents — unchanged, runs for all PRslinux-amd64-cpu4), triggered only when copy-pr-bot pushes topull-request/*branchesSecurity model (copy-pr-bot)
pull-request/<number>→ self-hosted CI runs/ok to test <SHA>This ensures community PRs never execute on self-hosted runners without explicit maintainer approval.
copy-pr-bot config
Onboarding checklist
Per GHA Runners onboarding guide:
nvidia-runner-mgmtGitHub app (org-level, separate from this PR)nv-gha-runners/enterprise-runner-configurationTesting
This PR is additive-only — no existing workflows are modified. The new
pr-self-hosted.yamlworkflow will only activate once copy-pr-bot is installed and this config is merged tomain.Summary by CodeRabbit