ci(main): install deps before Hermes secret-boundary Vitest (#6143) - #6144
Conversation
The build-hermes-sandbox-image job invoked the Hermes sandbox secret-boundary Vitest test (`npx vitest`) before the 'Set up Node' and 'Install root dependencies' steps. On a clean hosted runner there is no root node_modules, so npx pulled an ad-hoc vitest that could not resolve 'vitest/config' from the repo's vitest.config.ts, failing the job with 'Cannot find module vitest/config'. The ordering regressed in #5756 (commit 8120223) when that lane moved from a shell test to Vitest but the Node setup/install steps stayed below it. Move 'Set up Node' and 'Install root dependencies' up to run right after base-image resolution, so both Hermes Vitest steps use the repository's pinned dependency set. No behavior change to the tests themselves; the smoke test already ran after these steps. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Jason Ma <jama@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ChangesWorkflow Step Reorder
Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in the Show a code coverage summary of the most covered files.
TypeScript / code-coverage/cliThe overall coverage in the Show a code coverage summary of the most covered files.
Updated |
E2E Advisor RecommendationRequired E2E: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
|
E2E Target RecommendationRequired E2E targets: None Full E2E target advisor summaryE2E Target AdvisorBase: Required E2E targets
Optional E2E targets
Relevant changed files
|
PR Review Advisor — No blocking findingsMerge posture: No blocking advisor findings Action checklist
Test follow-ups to resolve or justifyIf these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.
This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision. |
PR Review Advisor (Nemotron Ultra) — No blocking findingsMerge posture: No blocking advisor findings Action checklist
Findings index
Review findings by urgency: 0 required fixes, 0 items to resolve/justify, 1 in-scope improvement
|
) (NVIDIA#6144) ## Summary The `build-hermes-sandbox-image` job in `.github/workflows/sandbox-images-and-e2e.yaml` ran the Hermes sandbox secret-boundary Vitest test (`npx vitest`) **before** the `Set up Node` and `Install root dependencies` steps. On a clean hosted runner there is no root `node_modules`, so `npx` pulled an ad-hoc `vitest` that could not resolve `vitest/config` from the repo's `vitest.config.ts`, failing the job with `Cannot find module 'vitest/config'`. This moves the Node setup + install steps ahead of the first Vitest invocation. ## Related Issue Fixes NVIDIA#6143 ## Changes - Move `Set up Node` and `Install root dependencies` (`npm ci --ignore-scripts`) to run immediately after `Resolve Hermes base image`, before `Build Hermes production image` and both Hermes Vitest steps. - New step order: Checkout → Resolve base image → Set up Node → Install deps → Build/verify Hermes image → secret-boundary Vitest → root-entrypoint smoke Vitest. - Net diff is a pure reorder (9 insertions / 9 deletions); no step content changed. The ordering regressed in NVIDIA#5756 (commit `8120223922bf`). ## 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) ## Quality Gates - [ ] Tests added or updated for changed behavior - [x] Tests not applicable — justification: CI workflow step reorder; correctness is a CI-runner behavior (dependencies present before Vitest), validated by the job's own run plus a host A/B below. No unit-testable surface. - [x] Docs not applicable — justification: internal CI workflow only; no user-facing surface. - [x] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [x] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: touches only CI step ordering in one workflow job; the Hermes secret-boundary and smoke tests, their env, and commands are unchanged — only the position of the standard `setup-node` + `npm ci` steps moved earlier. - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Verification - [x] PR description includes the DCO sign-off declaration and every commit appears as `Verified` in GitHub - [x] Git hooks passed during commit and push - [x] Targeted validation: YAML parses; prek hooks (`check yaml`, whitespace, etc.) pass on the file; step order confirmed. - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed ### Host A/B verification (`local-jama@10.176.198.59`) Reproduced the exact failure and confirmed the fix's premise without running the heavy live Docker test: - **Before `npm install`** (simulating the old ordering — Vitest with no root `node_modules`): `npx vitest list … hermes-sandbox-secret-boundary.test.ts` fails with `Cannot find module 'vitest/config'` — matches the reported CI error. - **After `npm install`** (the new ordering — deps present first): the same `vitest list` resolves `vitest.config.ts` and discovers the test with no ad-hoc `npx` install. (Results pasted in the completion notification.) Definitive check: this PR's own `build-hermes-sandbox-image` job on a fresh runner. --- Signed-off-by: Jason Ma <jama@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated the sandbox image and end-to-end pipeline to prepare dependencies earlier in the run, helping the job execute more smoothly and consistently. * Streamlined setup steps in the workflow by removing duplicate preparation later in the process. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Jason Ma <jama@nvidia.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Summary
The
build-hermes-sandbox-imagejob in.github/workflows/sandbox-images-and-e2e.yamlran the Hermes sandbox secret-boundary Vitest test (npx vitest) before theSet up NodeandInstall root dependenciessteps. On a clean hosted runner there is no rootnode_modules, sonpxpulled an ad-hocvitestthat could not resolvevitest/configfrom the repo'svitest.config.ts, failing the job withCannot find module 'vitest/config'. This moves the Node setup + install steps ahead of the first Vitest invocation.Related Issue
Fixes #6143
Changes
Set up NodeandInstall root dependencies(npm ci --ignore-scripts) to run immediately afterResolve Hermes base image, beforeBuild Hermes production imageand both Hermes Vitest steps.8120223922bf).Type of Change
Quality Gates
setup-node+npm cisteps moved earlier.Verification
Verifiedin GitHubcheck yaml, whitespace, etc.) pass on the file; step order confirmed.Host A/B verification (
local-jama@10.176.198.59)Reproduced the exact failure and confirmed the fix's premise without running the heavy live Docker test:
npm install(simulating the old ordering — Vitest with no rootnode_modules):npx vitest list … hermes-sandbox-secret-boundary.test.tsfails withCannot find module 'vitest/config'— matches the reported CI error.npm install(the new ordering — deps present first): the samevitest listresolvesvitest.config.tsand discovers the test with no ad-hocnpxinstall.(Results pasted in the completion notification.) Definitive check: this PR's own
build-hermes-sandbox-imagejob on a fresh runner.Signed-off-by: Jason Ma jama@nvidia.com
Summary by CodeRabbit