Skip to content

fix(e2e): run Docker Hub auth from an immutable pinned action - #7079

Merged
cv merged 20 commits into
mainfrom
refactor/e2e-docker-auth-setup-helper
Jul 18, 2026
Merged

fix(e2e): run Docker Hub auth from an immutable pinned action#7079
cv merged 20 commits into
mainfrom
refactor/e2e-docker-auth-setup-helper

Conversation

@laitingsheng

@laitingsheng laitingsheng commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Docker Hub authentication and privileged apt host-dependency setup for live E2E jobs now run only from immutable, full-SHA-pinned first-party composite actions. The workflow keeps the trust predicates, secret expressions, and package selections visible as guarded with inputs, while the pinned actions map those inputs to the reviewed setup helpers. Alternate checkout_sha runs receive no Docker Hub credentials, and no selected target ref runs sudo with its own code.

Related Issue

Resolves #6961.

Changes

  • Add .github/scripts/docker-auth-setup.sh for a private job-scoped DOCKER_CONFIG, bounded three-attempt --password-stdin login, a protected auth-attempt marker, argument rejection, and fail-closed credential handling.
  • Add .github/actions/docker-auth-setup/action.yaml and invoke it from the shared E2E auth anchor at an immutable revision.
  • Gate auth-required, username, and token on the trusted NVIDIA repository, main, scheduled/manual execution, and an empty checkout_sha, so tested alternate checkouts never receive Docker Hub credentials.
  • Add .github/scripts/host-dependency-setup.sh and .github/actions/host-dependency-setup/action.yaml for reviewed apt installs with argument rejection, an expect/iptables allowlist guard, and the bounded apt-update retry contract.
  • Replace all five inline sudo apt-get … expect blocks (live Deep Agents Code, network-policy, cloud-onboard, issue [DGX Spark][CLI&UX] openclaw tui shows indefinite spinner with no error when inference endpoint is unreachable #4434, OpenClaw TUI) with the pinned host-dependency action, preserving each target condition and the before-workspace-prep ordering.
  • Bind both pinned actions and their helpers to reviewed immutable revisions through sha256 provenance and validate the exact input mapping and helper invocation.
  • Preserve auth-before-pull ordering and the existing always-run cleanup contract across image-consuming jobs.
  • No privileged host-setup step remains inline: sudo credential and package setup now execute only from immutable trusted action revisions, never from the tested checkout.

Type of Change

  • 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)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification: CI-internal trusted-workflow refactor with no user-facing behavior change.
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: maintainer security review covered credential provenance, trust gating, action mapping, helper execution, and negative tests.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run check:diff passed when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: npx vitest run --project e2e-support green, 1165 tests, including the Docker-auth and host-dependency workflow boundaries
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result:
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Tinson Lai tinsonl@nvidia.com

Summary by CodeRabbit

  • New Features

    • Added reusable GitHub composite actions for Docker Hub authentication and reviewed host dependency installation.
    • Improved E2E runner setup by using isolated Docker configuration and a dedicated, input-driven host dependency installer.
  • Bug Fixes

    • Strengthened Docker Hub credential handling with fail-closed behavior and controlled retry logic.
    • Hardened E2E workflow boundary validation to detect drift and prevent unauthorized changes, including stricter checks for host dependency steps and failure tolerance.

Move the anchored Docker Hub authentication body out of e2e.yaml into
.github/scripts/docker-auth-setup.sh, paired with the existing
docker-auth-cleanup.sh. The step keeps its credential predicate and
secret mapping in YAML and runs the checked-in helper from the trusted
checkout, so the ~35 lines of security-critical bash are linted, shell
-checked, and unit-tested instead of embedded in workflow YAML. The
privileged expect host installs stay inline.

Refs #6961

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 76760eec-2abc-4ab0-b04b-416cbec423a4

📥 Commits

Reviewing files that changed from the base of the PR and between 56373b0 and a032ad9.

📒 Files selected for processing (1)
  • test/e2e/support/e2e-host-dependency-workflow-boundary.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/e2e/support/e2e-host-dependency-workflow-boundary.test.ts

📝 Walkthrough

Walkthrough

The E2E workflow replaces inline Docker authentication and host dependency installation with pinned composite actions backed by checked-in scripts. Boundary validators and tests verify immutable provenance, exact wiring, credential gating, package allowlists, and fail-closed execution.

Changes

E2E helper action consolidation

Layer / File(s) Summary
Docker authentication helper implementation
.github/actions/docker-auth-setup/action.yaml, .github/scripts/docker-auth-setup.sh
Adds isolated Docker configuration, guarded credential handling, bounded login retries, and argument validation.
Host dependency helper implementation
.github/actions/host-dependency-setup/action.yaml, .github/scripts/host-dependency-setup.sh
Adds allowlisted package validation and retried apt installation through a composite action.
Workflow wiring and boundary contracts
.github/workflows/e2e.yaml, tools/e2e/workflow-boundary.mts
Replaces inline setup blocks with pinned actions and validates immutable artifacts, guarded inputs, exact action mappings, and package selections.
Boundary and execution coverage
test/e2e/support/*workflow-boundary.test.ts, ci/source-shape-test-budget.json
Adds artifact mutation, provenance, workflow mapping, allowlist, direct execution, and fail-closed tests.

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

Sequence Diagram(s)

sequenceDiagram
  participant LiveJob as GitHub Actions live job
  participant AuthAction as docker-auth-setup composite action
  participant AuthScript as docker-auth-setup.sh
  participant HostAction as host-dependency-setup composite action
  participant HostScript as host-dependency-setup.sh
  participant DockerHub as Docker Hub
  participant Apt as apt package repositories
  LiveJob->>AuthAction: Pass guarded authentication inputs
  AuthAction->>AuthScript: Execute Docker auth helper
  AuthScript->>DockerHub: Retry timed login when required
  DockerHub-->>AuthScript: Return login status
  LiveJob->>HostAction: Pass validated package list
  HostAction->>HostScript: Execute dependency helper
  HostScript->>Apt: Retry apt update and install allowlisted packages
  Apt-->>HostScript: Return installation status
Loading

Possibly related PRs

  • NVIDIA/NemoClaw#7082: Refactors and enforces the Docker authentication composite-action boundary and pinned workflow-step shape.
  • NVIDIA/NemoClaw#6100: Changes the E2E Docker Hub authentication flow and related boundary coverage.

Suggested labels: area: ci, area: security, dependencies

Suggested reviewers: jyaunches, cv

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR covers pinned Docker auth and host-dependency actions, but it does not implement the direct issue's common live-Vitest invocation helper. Add the pinned live-Vitest helper with validated inputs and preserve only the jobs that match the current contract.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change to move Docker Hub auth onto an immutable pinned action.
Out of Scope Changes check ✅ Passed The changes stay focused on E2E auth, host-dependency setup, and their supporting tests.
✨ 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 refactor/e2e-docker-auth-setup-helper

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

@github-code-quality

github-code-quality Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage remains at 96%, unchanged from the main branch.

TypeScript / code-coverage/cli

The overall coverage in the refactor/e2e-docker-... branch remains at 80%, unchanged from the main branch.

Show a code coverage summary of the most impacted files.
File main 980e348 refactor/e2e-docker-... 5409133 +/-
src/lib/domain/.../connect-env.ts 97% 89% -8%
src/lib/agent/s...store-reader.ts 90% 90% 0%
src/lib/sandbox...rce-identity.ts 91% 91% 0%

Updated July 18, 2026 19:31 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

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

Actionable comments posted: 1

🤖 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/e2e.yaml:
- Line 309: Bind Docker Hub authentication to the trusted workflow revision:
update .github/workflows/e2e.yaml lines 309-309 to disable credential mapping
for alternate checkouts or load the helper from trusted github.sha; update
tools/e2e/workflow-boundary.mts lines 95-95 so the canonical contract includes
trusted helper provenance, and lines 2002-2036 to reject credential-bearing auth
steps when checkout provenance is not trusted; add a mutation in
test/e2e/support/dockerhub-auth-workflow-boundary.test.ts lines 151-181 proving
alternate checkouts cannot receive Docker Hub credentials.
🪄 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: Enterprise

Run ID: c65999c5-9a99-4302-b500-241894a81d9b

📥 Commits

Reviewing files that changed from the base of the PR and between 0393691 and 567154c.

📒 Files selected for processing (4)
  • .github/scripts/docker-auth-setup.sh
  • .github/workflows/e2e.yaml
  • test/e2e/support/dockerhub-auth-workflow-boundary.test.ts
  • tools/e2e/workflow-boundary.mts

Comment thread .github/workflows/e2e.yaml Outdated
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Informational

Advisor assessment: Informational / high confidence
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions
Status: No actionable findings remain in the canonical review ledger.

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 2 blockers · 0 warnings · 0 suggestions
  • Model comparison: normalized findings differ; normalized E2E selections differ; Nemotron reported 2 more blockers, the same number of warnings, the same number of suggestions.

Nemotron output stays in workflow artifacts and does not change the assessment above.

E2E guidance

Advisory only. E2E / PR Gate selects and runs jobs independently.

Recommended E2E: cloud-onboard, credential-sanitization, security-posture

2 optional E2E recommendations
  • network-policy
  • issue-4434-tui-unreachable-inference

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

@laitingsheng laitingsheng added the refactor PR restructures code without intended behavior change label Jul 17, 2026
The auth helper script now runs from the checked-out working tree
instead of trusted inline workflow YAML, so a maintainer-dispatched
run against an untrusted checkout_sha could load and execute
attacker-controlled script content while still receiving real Docker
Hub credentials. Gate DOCKERHUB_AUTH_REQUIRED, DOCKERHUB_USERNAME, and
DOCKERHUB_TOKEN on inputs.checkout_sha == '', matching the existing
NVIDIA_INFERENCE_API_KEY guard in the same job.

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
Add the composite action wrapper ahead of the workflow switch so the
follow-up commit can pin the Docker Hub auth step to this commit's
immutable SHA, matching the prepare-e2e and upload-e2e-artifacts
convention.

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
Route the credential-bearing auth step through the docker-auth-setup
composite action, pinned to its introducing commit SHA, instead of a
run: command resolved from the checked-out workspace. Per issue #6961's
acceptance criteria, authentication must execute only from an immutable
trusted action revision, never from the tested checkout. Update the
workflow-boundary contract and its test to assert the pinned uses/with
shape in place of the former run/env shape.

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
@cjagwani cjagwani added v0.0.86 and removed v0.0.85 labels Jul 17, 2026
@apurvvkumaria apurvvkumaria self-assigned this Jul 17, 2026
Co-authored-by: Tinson Lai <tinsonl@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@apurvvkumaria apurvvkumaria changed the title refactor(e2e): route Docker Hub auth through a trusted setup script fix(e2e): run Docker Hub auth from an immutable pinned action Jul 17, 2026
Co-authored-by: Tinson Lai <tinsonl@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>

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

Actionable comments posted: 2

🤖 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 `@ci/source-shape-test-budget.json`:
- Around line 135-136: Update the test title for the immutable reviewed revision
check in test/e2e/support/dockerhub-auth-workflow-boundary.test.ts to end with
the exact suffix “(`#6961`)”, then mirror that complete renamed title in the
corresponding allowlist entry in ci/source-shape-test-budget.json.

In `@test/e2e/support/dockerhub-auth-workflow-boundary.test.ts`:
- Around line 122-124: Update the describe title for the shared Docker Hub
authentication workflow boundary suite to append the required local issue
suffix, leaving the child test title unchanged.
🪄 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: Enterprise

Run ID: 2c56c2a5-d99b-46aa-b27e-e0ec8e63a859

📥 Commits

Reviewing files that changed from the base of the PR and between 7691eb4 and 01e4cf0.

📒 Files selected for processing (3)
  • ci/source-shape-test-budget.json
  • test/e2e/support/dockerhub-auth-workflow-boundary.test.ts
  • tools/e2e/workflow-boundary.mts

Comment thread ci/source-shape-test-budget.json Outdated
Comment thread test/e2e/support/dockerhub-auth-workflow-boundary.test.ts Outdated
Co-authored-by: Tinson Lai <tinsonl@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@apurvvkumaria

Copy link
Copy Markdown
Collaborator

Protected E2E status for exact head da7ad130c029af75fb68b4bb2607414b899625b7: the single authorized dispatch ran at https://github.com/NVIDIA/NemoClaw/actions/runs/29580914707. Credential sanitization, cloud onboard, and OpenClaw security posture passed. The Hermes security-posture lane ended with the GitHub annotation The hosted runner lost communication with the server; no test-failure log or Hermes artifact was produced. I did not retry, consistent with the once-per-revision/no-retry policy. This leaves the revision infrastructure-blocked rather than identifying a PR code regression.

@jyaunches jyaunches added v0.0.88 and removed v0.0.86 labels Jul 17, 2026
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>

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

Actionable comments posted: 2

🤖 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/scripts/host-dependency-setup.sh:
- Around line 12-24: Update the HOST_DEPENDENCY_PACKAGES validation before
iterating in the setup script to reject whitespace-only input, reject any
embedded newline or other non-space-separated format, and require at least one
parsed package token. Preserve the existing allowlist validation for each
accepted token.

In `@tools/e2e/workflow-boundary.mts`:
- Around line 697-723: Update validateHostDependencyActionStep to reject any
defined step.continue-on-error value, requiring it to remain unset for
privileged host setup. Add a mutation test that sets continue-on-error: true and
verifies validation fails, matching the existing Docker authentication contract.
🪄 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: Enterprise

Run ID: 1964fe21-9bcc-48bf-a711-6b3ccb0b5642

📥 Commits

Reviewing files that changed from the base of the PR and between 01e4cf0 and f94c78f.

📒 Files selected for processing (7)
  • .github/actions/host-dependency-setup/action.yaml
  • .github/scripts/host-dependency-setup.sh
  • .github/workflows/e2e.yaml
  • ci/source-shape-test-budget.json
  • test/e2e/support/dockerhub-auth-workflow-boundary.test.ts
  • test/e2e/support/e2e-host-dependency-workflow-boundary.test.ts
  • tools/e2e/workflow-boundary.mts
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/e2e/support/dockerhub-auth-workflow-boundary.test.ts

Comment thread .github/scripts/host-dependency-setup.sh
Comment thread tools/e2e/workflow-boundary.mts

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Requesting changes on refreshed head 7050aff88. The immutable action pins, checkout-sha credential guard, private Docker config, exact package mapping, and fail-closed scripts review cleanly, but the new privileged host-dependency helper has no direct behavioral regression test. The current E2E-support coverage validates YAML/provenance mutations only; it never executes .github/scripts/host-dependency-setup.sh. Please add a fake-sudo harness that proves invalid/newline/non-allowlisted packages make zero apt calls, two failed updates then success install exactly expect iptables, and three failed updates exit nonzero without installing. This is required evidence for the new privileged retry/allowlist boundary.

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Deferred at exact head a032ad9. The requested privileged-helper fake-sudo, retry/exhaustion, invalid-input, and positional-argument coverage is implemented; security review and every selected E2E lane passed with no skips. Approval remains blocked because the deterministic maintainer checker fails closed when the retry-marked failed coordination check and its validated successful replacement share the exact-diff external ID.

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved. Security review: PASS. Docker authentication and host setup execute from immutable pinned actions, and the trust predicates prevent untrusted revisions from receiving secrets or sudo execution. Workflow-boundary and fake-sudo coverage pass; the authorized credential-bearing E2E run remains a merge gate.

@cv
cv merged commit c28b04e into main Jul 18, 2026
52 checks passed
@cv
cv deleted the refactor/e2e-docker-auth-setup-helper branch July 18, 2026 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor PR restructures code without intended behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consolidate repeated live E2E invocation and Docker-auth setup into pinned helper actions

6 participants