-
Notifications
You must be signed in to change notification settings - Fork 3.1k
test(images): split base-image platform action contract #8950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
6c31731
test(images): split base-image platform action contract
apurvvkumaria 3c5bee1
refactor(shields): isolate interrupted unlock recovery
apurvvkumaria a2e3c4e
merge: resolve conflicts with main
github-actions[bot] 04c43a6
Merge branch 'main' into codex/fix-main-test-size-gate
apurvvkumaria File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| import fs from "node:fs"; | ||
| import path from "node:path"; | ||
|
|
||
| import { describe, expect, it } from "vitest"; | ||
| import YAML from "yaml"; | ||
|
|
||
| type Step = { | ||
| env?: Record<string, unknown>; | ||
| if?: string; | ||
| name?: string; | ||
| run?: string; | ||
| }; | ||
|
|
||
| const repoRoot = path.resolve(import.meta.dirname, ".."); | ||
|
|
||
| function required<T>(value: T | undefined, message: string): T { | ||
| return ( | ||
| value ?? | ||
| (() => { | ||
| throw new Error(message); | ||
| })() | ||
| ); | ||
| } | ||
|
|
||
| describe("base-image platform action", () => { | ||
| it("executes dos2unix from each Deep Agents Code platform image before manifest publication (#8870)", () => { | ||
| const action = YAML.parse( | ||
| fs.readFileSync( | ||
| path.join(repoRoot, ".github", "actions", "build-base-image-platform", "action.yaml"), | ||
| "utf8", | ||
| ), | ||
| ) as { runs?: { steps?: Step[] } }; | ||
| const steps = action.runs?.steps ?? []; | ||
| const validate = required( | ||
| steps.find((candidate) => candidate.name === "Validate Deep Agents Code dos2unix executable"), | ||
| "base-image platform action is missing the Deep Agents Code dos2unix validation", | ||
| ); | ||
| const buildIndex = steps.findIndex( | ||
| (candidate) => candidate.name === "Build and push platform digest", | ||
| ); | ||
| const validateIndex = steps.indexOf(validate); | ||
| const exportIndex = steps.findIndex((candidate) => candidate.name === "Export platform digest"); | ||
|
|
||
| expect(validate.if).toBe("${{ inputs.agent == 'langchain-deepagents-code' }}"); | ||
| expect(validate.env).toMatchObject({ | ||
| DIGEST: "${{ steps.build.outputs.digest }}", | ||
| IMAGE: "${{ inputs.registry }}/${{ inputs.image }}", | ||
| PLATFORM: "${{ inputs.platform }}", | ||
| }); | ||
| expect(validate.run).toContain('reference="${IMAGE}@${DIGEST}"'); | ||
| expect(validate.run).toContain('docker run --rm --platform "$PLATFORM"'); | ||
| expect(validate.run).toContain("--network none"); | ||
| expect(validate.run).toContain("--cap-drop ALL"); | ||
| expect(validate.run).toContain("--security-opt no-new-privileges"); | ||
| expect(validate.run).toContain("--read-only"); | ||
| expect(validate.run).toContain("--user 999:999"); | ||
| expect(validate.run).toContain("test -x /usr/bin/dos2unix"); | ||
| expect(validate.run).toContain("dos2unix --version"); | ||
| expect(validateIndex).toBeGreaterThan(buildIndex); | ||
| expect(validateIndex).toBeLessThan(exportIndex); | ||
| }); | ||
| }); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: NVIDIA/NemoClaw
Length of output: 7075
🏁 Script executed:
Repository: NVIDIA/NemoClaw
Length of output: 43936
🏁 Script executed:
Repository: NVIDIA/NemoClaw
Length of output: 34646
🏁 Script executed:
Repository: NVIDIA/NemoClaw
Length of output: 16256
🏁 Script executed:
Repository: NVIDIA/NemoClaw
Length of output: 18830
🏁 Script executed:
Repository: NVIDIA/NemoClaw
Length of output: 18591
Add failure-path tests for interrupted Shields down recovery.
src/lib/shields/legacy-hermes-compat.test.tscovers successful recovery, provider-release recovery, policy replay failure, and timer replacement. Add cases for invalid timer authority,unlockAgentConfigUnderMutationLockfailure, andwaitForHermesInferenceRouteConvergencefailure. Assert that recovery does not commitactiveor append audit, preservesshieldsDown, and reports incomplete rollback when lockdown cannot be verified.🤖 Prompt for AI Agents
Sources: Coding guidelines, Path instructions