-
Notifications
You must be signed in to change notification settings - Fork 3.1k
fix(rebuild): emit actionable diagnostic on all preflight failures (#7794) #7812
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
apurvvkumaria
merged 15 commits into
NVIDIA:main
from
kagura-agent:fix/rebuild-preflight-diagnostic
Aug 5, 2026
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
87a64a1
fix(rebuild): emit 'Aborting rebuild' diagnostic on all preflight fai…
kagura-agent 6de69d1
test: address CodeRabbit review — add issue suffix and sandbox-safety…
kagura-agent 3692bba
Merge branch 'main' into fix/rebuild-preflight-diagnostic
cv 9d211f0
fix(rebuild): stop after onboard lock failure
apurvvkumaria ac32a98
Merge branch 'main' into fix/rebuild-preflight-diagnostic
apurvvkumaria cfa35d4
Merge branch 'main' into fix/rebuild-preflight-diagnostic
apurvvkumaria a15e3c9
fix(rebuild): report gateway schema preflight failures
apurvvkumaria 9186cf9
merge(main): refresh rebuild diagnostic fix
apurvvkumaria 75ecab5
Merge branch 'main' into fix/rebuild-preflight-diagnostic
cv bab583a
test(rebuild): cover pending MCP preflight diagnostic
apurvvkumaria 89b56fc
merge(main): refresh PR #7812
cv d22d441
fix(rebuild): keep lock recovery guidance safe
cv 6b71d26
merge(main): refresh PR #7812
apurvvkumaria 9739944
docs(rebuild): document preflight recovery
apurvvkumaria d3ab503
merge(main): refresh PR #7812
cjagwani 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
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,51 @@ | ||
| // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| import { beforeEach, describe, expect, it, vi } from "vitest"; | ||
|
|
||
| import { printRebuildPreflightFailure } from "./rebuild-preflight-error"; | ||
|
|
||
| describe("printRebuildPreflightFailure (#7794)", () => { | ||
| beforeEach(() => { | ||
| vi.spyOn(console, "error").mockImplementation(() => {}); | ||
| }); | ||
|
|
||
| it("outputs 'Aborting rebuild' and calls bail with the bail message", () => { | ||
| const bail = vi.fn() as unknown as (message: string, code?: number) => never; | ||
|
|
||
| printRebuildPreflightFailure("policy apply failed.", "Check network.", "policy error", bail); | ||
|
|
||
| const output = (console.error as ReturnType<typeof vi.fn>).mock.calls | ||
| .map((c) => c[0]) | ||
| .join("\n"); | ||
| expect(output).toMatch(/Aborting rebuild/i); | ||
| expect(output).toContain("sandbox is untouched, no data was lost."); | ||
| expect(bail).toHaveBeenCalledWith("policy error"); | ||
| }); | ||
|
|
||
| it("includes the summary and detail in output", () => { | ||
| const bail = vi.fn() as unknown as (message: string, code?: number) => never; | ||
|
|
||
| printRebuildPreflightFailure("something broke.", "Try again.", "broke", bail); | ||
|
|
||
| const output = (console.error as ReturnType<typeof vi.fn>).mock.calls | ||
| .map((c) => c[0]) | ||
| .join("\n"); | ||
| expect(output).toContain("something broke."); | ||
| expect(output).toContain("Try again."); | ||
| }); | ||
|
|
||
| it("preserves an explicit bail exit code", () => { | ||
| const bail = vi.fn() as unknown as (message: string, code?: number) => never; | ||
|
|
||
| printRebuildPreflightFailure( | ||
| "policy restore is pending.", | ||
| "Repair the pending transition.", | ||
| "pending policy transition", | ||
| bail, | ||
| 1, | ||
| ); | ||
|
|
||
| expect(bail).toHaveBeenCalledWith("pending policy transition", 1); | ||
| }); | ||
| }); | ||
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
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.
Uh oh!
There was an error while loading. Please reload this page.