Skip to content

refactor(ci): pin E2E Docker Hub auth to trusted setup action - #7082

Closed
Shaurya2k06 wants to merge 7 commits into
NVIDIA:mainfrom
Shaurya2k06:refactor/6961-docker-auth-setup
Closed

refactor(ci): pin E2E Docker Hub auth to trusted setup action#7082
Shaurya2k06 wants to merge 7 commits into
NVIDIA:mainfrom
Shaurya2k06:refactor/6961-docker-auth-setup

Conversation

@Shaurya2k06

@Shaurya2k06 Shaurya2k06 commented Jul 17, 2026

Copy link
Copy Markdown

Summary

Secret-bearing Docker Hub authentication no longer lives as a duplicated inline run: program in E2E workflows. Compatible jobs call a pinned first-party docker-auth-setup action; credential predicates and secret mapping stay in workflow YAML. Live-Vitest consolidation from #6996 is left as-is.

Related Issue

Fixes #6961

Changes

  • Add .github/actions/docker-auth-setup/ (composite action.yaml + setup.sh): job-scoped DOCKER_CONFIG under RUNNER_TEMP, auth-attempt marker, bounded --password-stdin login retries, fail-closed missing-credential path. Current consumers: every image-consuming job in .github/workflows/e2e.yaml and .github/workflows/sandbox-images-and-e2e.yaml. Direct inline YAML is insufficient because the same secret-bearing program was aliased ~70 times and must not execute from the tested checkout. Protected by tools/e2e/docker-auth-setup-workflow-boundary.mts and test/e2e/support/dockerhub-auth-workflow-boundary.test.ts.
  • Replace the &dockerhub-auth inline script with uses: NVIDIA/NemoClaw/.github/actions/docker-auth-setup@66cf71b3af6c32ab972a1ce0e505499da0b495f2 while keeping the YAML alias and per-workflow env predicates (schedule|workflow_dispatch for E2E; push|workflow_dispatch for sandbox images).
  • Flip Docker Hub workflow-boundary validators from “audited inline run” to pinned-action provenance (contentSha256 for action.yaml and setup.sh), preserving auth-before-pull, auth-before-prepare, artifact-before-cleanup, and no-image exemptions.
  • Keep host expect/iptables installs inline (privileged sudo; existing allowlist tests reject uses:).

Intentionally left explicit

Left explicit Why
shared-e2e Vitest Variable --project + credential-free tags; live helper hard-codes e2e-live
gateway-guard-recovery Reordered raw Vitest flags (specialized contract)
mcp-bridge secondary credential-window run Extra -t / --no-file-parallelism shape
Five expect/iptables host installs Privileged setup; boundary tests require inline package allowlists
OpenShell install steps Job-specific env -u scrub sets; out of #6961 Work list
Hermes GPU / rebuild conditional programs Unusual/conditional programs stay explicit per issue
Docker cleanup Already .github/scripts/docker-auth-cleanup.sh; no secrets
Live-Vitest helper Already delivered by #6996; no redundant composite wrapper

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: N/A; new and updated boundary/provenance tests cover the pinned action contract.
  • Tests not applicable — justification: N/A; behavior-changing CI trust-boundary work requires tests.
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification: CI-internal trust-boundary refactor; no user-facing product behavior or documented interface changes.
  • 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: Auth executes only from immutable NVIDIA/NemoClaw/.github/actions/docker-auth-setup@66cf71b3af6c32ab972a1ce0e505499da0b495f2, never from the tested checkout. Provenance binds action.yaml + setup.sh digests; YAML retains credential predicates; cleanup remains the always-run final step.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: N/A; no waived CI check at PR open.

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 test/e2e/support/dockerhub-auth-workflow-boundary.test.ts test/e2e/support/hermes-secret-boundary-workflow.test.ts test/e2e/support/sandbox-images-workflow-boundary.test.ts test/e2e/support/prepare-e2e-workflow-boundary.test.ts → 26 passed; related Docker Hub / sandbox-images / prepare-e2e boundary coverage also green.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result: N/A; change is CI workflow/action trust-boundary only. Targeted e2e-support boundary tests exercise the contract; full npm test / npm run check not required for this scope.
  • 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) — justification: N/A; no docs changes.
  • Doc pages follow the style guide (doc changes only) — justification: N/A; no docs changes.
  • New doc pages include SPDX header and frontmatter (new pages only) — justification: N/A; no new doc pages.

Signed-off-by: shaurya2k06 shaurya2k06@gmail.com

Summary by CodeRabbit

  • New Features
    • Added a composite Docker Hub authentication setup action for workflow jobs, supporting optional anonymous pulls and credential-based login.
  • Bug Fixes
    • Standardized Docker auth behavior with an isolated Docker config and fail-closed handling when trusted credentials are required but missing.
  • Tests
    • Tightened workflow boundary checks to require the pinned, reviewed action (no inline auth scripts) and expanded watch-trigger, risk-plan, and PR-risk coverage for the new action.

Extract the shared Docker Hub login/isolation/retry program into a
first-party composite action so secret-bearing authentication executes
from an immutable revision rather than duplicated workflow YAML.

Refs NVIDIA#6961

Signed-off-by: shaurya2k06 <shaurya2k06@gmail.com>
Replace the duplicated inline Docker Hub login program in e2e.yaml and
sandbox-images-and-e2e.yaml with the immutable docker-auth-setup action.
Credential predicates stay in workflow YAML; boundary validators now
assert the pinned action provenance instead of an inline run script.

Refs NVIDIA#6961

Signed-off-by: shaurya2k06 <shaurya2k06@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@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: bd31c000-7227-456f-8d94-9813922d4404

📥 Commits

Reviewing files that changed from the base of the PR and between cbc6105 and 434d891.

📒 Files selected for processing (2)
  • .github/workflows/e2e.yaml
  • tools/e2e/workflow-boundary.mts
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/e2e.yaml
  • tools/e2e/workflow-boundary.mts

📝 Walkthrough

Walkthrough

This change extracts Docker Hub authentication into a pinned composite action, updates E2E workflows to use it, adds provenance and workflow-boundary validation, and expands tests and risk mappings for the new action files.

Changes

Docker authentication helper

Layer / File(s) Summary
Helper action and authentication runtime
.github/actions/docker-auth-setup/*
Defines a composite action that runs an isolated Docker configuration setup script with optional credentialed login and retries.
Workflow adoption and canonical auth shape
.github/workflows/e2e.yaml, .github/workflows/sandbox-images-and-e2e.yaml, tools/e2e/*workflow-boundary.mts
Replaces inline authentication with the pinned action and requires canonical steps exposing only name, uses, and env.
Action provenance and script validation
tools/e2e/docker-auth-setup-workflow-boundary.mts
Validates pinned hashes, action metadata, script ordering and contents, isolated configuration persistence, password-stdin usage, and fail-closed behavior.
Boundary tests and change-impact wiring
test/e2e/support/*, test/helpers/vitest-watch-triggers.ts, test/vitest-watch-triggers.test.ts, test/pr-risk-plan.test.ts, tools/advisors/*
Updates boundary tests and ensures changes to the action trigger focused validation and relevant risk plans.

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

Sequence Diagram(s)

sequenceDiagram
  participant E2EWorkflow
  participant DockerAuthSetup
  participant DockerHub
  participant BoundaryValidator
  E2EWorkflow->>DockerAuthSetup: invoke pinned action with auth environment
  DockerAuthSetup->>DockerAuthSetup: create and persist isolated DOCKER_CONFIG
  DockerAuthSetup->>DockerHub: attempt docker login using password-stdin
  DockerHub-->>DockerAuthSetup: login result
  DockerAuthSetup-->>E2EWorkflow: continue or fail after retries
  BoundaryValidator->>DockerAuthSetup: verify hashes and script contract
  BoundaryValidator-->>E2EWorkflow: validate canonical action boundary
Loading

Possibly related PRs

Suggested labels: bug-fix

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
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 (4 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: pinning E2E Docker Hub auth to a trusted setup action.
Linked Issues check ✅ Passed The PR adds the pinned Docker-auth helper, updates workflows to use it, and extends boundary tests and validators as required by #6961.
Out of Scope Changes check ✅ Passed All changes are directly related to the Docker-auth refactor, its validation, or trigger/risk coverage updates.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@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: Review the warnings below.
Findings: 0 blockers · 1 warning · 0 suggestions
Status: Canonical ledger: 0 blocker(s), 1 warning(s), 0 suggestion(s).

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 0 blockers · 1 warning · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 1 blocker · 1 warning · 0 suggestions
  • Model comparison: normalized findings differ; normalized E2E selections differ; Nemotron reported 1 more blocker, 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

1 warning · 0 suggestions

Warnings

Warnings do not block.

PRA-1 Warning — Exercise provenance rejection for modified action files

  • Location: test/e2e/support/dockerhub-auth-workflow-boundary.test.ts:241
  • Category: tests
  • Problem: The new provenance test asserts only that the checked-in action and script validate successfully. It never supplies altered action.yaml or setup.sh content, so removing or bypassing either SHA-256 comparison in validateDockerAuthSetupAction would leave the test suite's provenance assertion green.
  • Impact: A future change could silently disable the immutable-content integrity gate while workflow tests continue to verify only the pinned reference, allowing altered checked-in setup code to evade the intended provenance protection.
  • Recommendation: Add fixture-copy cases that alter action.yaml and setup.sh independently, call validateDockerAuthSetupAction(copyActionPath, copySetupPath), and assert the corresponding immutable-content error for each mutation.
  • Verification: Inspect test/e2e/support/dockerhub-auth-workflow-boundary.test.ts:241-245 and confirm it calls validateDockerAuthSetupAction only with default checked-in paths; inspect tools/e2e/docker-auth-setup-workflow-boundary.mts SHA checks to confirm both branches lack negative-path coverage.
  • Test coverage: A Vitest fixture test that copies both action files to temporary paths, modifies each file separately, invokes validateDockerAuthSetupAction(actionPath, setupPath), and expects the action.yaml or setup.sh immutable-content validation error respectively.
  • Evidence: test/e2e/support/dockerhub-auth-workflow-boundary.test.ts:241-245 calls validateDockerAuthSetupAction() only with default paths and expects an empty error list. tools/e2e/docker-auth-setup-workflow-boundary.mts validates actionYamlSha256 and setupShSha256 independently, but the changed test contains no altered-file invocation.

Workflow run details

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

@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 `@test/e2e/support/dockerhub-auth-workflow-boundary.test.ts`:
- Around line 249-250: Update the test around SETUP_HELPER_PATH to remove
executable-mode and source-text assertions, and verify the action contract
through the fake Docker boundary instead. Assert the observable Docker argv and
stdin passed when setup.sh is invoked, including the expected script content or
invocation behavior, and apply the same change to the assertion at the
referenced later location.
🪄 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: 10186381-9a36-4ea0-9a72-b5976bd1c9f4

📥 Commits

Reviewing files that changed from the base of the PR and between 027632a and d9807de.

📒 Files selected for processing (14)
  • .github/actions/docker-auth-setup/action.yaml
  • .github/actions/docker-auth-setup/setup.sh
  • .github/workflows/e2e.yaml
  • .github/workflows/sandbox-images-and-e2e.yaml
  • test/e2e/support/dockerhub-auth-workflow-boundary.test.ts
  • test/e2e/support/hermes-secret-boundary-workflow.test.ts
  • test/helpers/vitest-watch-triggers.ts
  • test/pr-risk-plan.test.ts
  • test/vitest-watch-triggers.test.ts
  • tools/advisors/e2e-recommendations.mts
  • tools/advisors/risk-plan.mts
  • tools/e2e/docker-auth-setup-workflow-boundary.mts
  • tools/e2e/sandbox-images-workflow-boundary.mts
  • tools/e2e/workflow-boundary.mts

Comment thread test/e2e/support/dockerhub-auth-workflow-boundary.test.ts Outdated
Drop executable-bit and setup.sh source-text checks from the Docker Hub
auth boundary test; the fake Docker invocation already proves
--password-stdin and retry behavior.

Refs NVIDIA#6961

Signed-off-by: shaurya2k06 <shaurya2k06@gmail.com>
@wscurran wscurran added area: ci CI workflows, checks, release automation, or GitHub Actions area: e2e End-to-end tests, nightly failures, or validation infrastructure refactor PR restructures code without intended behavior change labels Jul 17, 2026
@wscurran

Copy link
Copy Markdown
Contributor

✨ Thanks for the refactor. Consolidating the duplicated Docker Hub auth setup into a pinned composite action improves maintainability and security. Ready for maintainer review.


Related open PRs:


Related open issues:

@apurvvkumaria

Copy link
Copy Markdown
Collaborator

Closing as superseded by merged #7079 and #6996, which close #6961 and provide the complete pinned-action/live-test implementation with the current trusted-checkout boundary and coverage. Rebasing this older branch would overlap that work and weaken current-main behavior. Thank you @Shaurya2k06 for developing the trusted-action direction; the remaining non-overlapping workflow adoption ideas can be carried forward as a narrow follow-up with your contribution credited.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci CI workflows, checks, release automation, or GitHub Actions area: e2e End-to-end tests, nightly failures, or validation infrastructure 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

3 participants