Repository navigation
fix(deps): bound YAML merge work with js-yaml 4.3.2 #11267
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,45 @@ | ||
| // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| import { describe, expect, it } from "vitest"; | ||
| import { parseManifestRecord } from "./manifest-readers"; | ||
|
|
||
| describe("agent manifest YAML merges", () => { | ||
| it("preserves defaults and lets explicit values override merged values", () => { | ||
| expect( | ||
| parseManifestRecord( | ||
| "defaults: &defaults {enabled: true, name: default}\nagent: {<<: *defaults, name: custom}\n", | ||
| "merge.yaml", | ||
| ), | ||
| ).toEqual({ | ||
| defaults: { enabled: true, name: "default" }, | ||
| agent: { enabled: true, name: "custom" }, | ||
| }); | ||
| }); | ||
|
|
||
| it("accepts a merge sequence with 100 empty sources", () => { | ||
| const sources = Array<string>(100).fill("*empty").join(", "); | ||
| expect( | ||
| parseManifestRecord(`empty: &empty {}\nagent: {<<: [${sources}]}\n`, "merge.yaml"), | ||
| ).toEqual({ empty: {}, agent: {} }); | ||
| }); | ||
|
|
||
| it("rejects a merge sequence with more than 100 sources (#11252)", () => { | ||
| const sources = Array<string>(101).fill("*empty").join(", "); | ||
| expect(() => | ||
| parseManifestRecord(`empty: &empty {}\nagent: {<<: [${sources}]}\n`, "merge.yaml"), | ||
| ).toThrow(/abnormal merge sequence size/); | ||
| }); | ||
|
|
||
| it("rejects repeated empty merge sources that exceed the document work limit (#11252)", () => { | ||
| const sources = Array<string>(100).fill("*empty").join(", "); | ||
| // Each sequence stays within its limit; 1,001 sequences exceed the 100,000-work document limit. | ||
| const mappings = Array.from( | ||
| { length: 1001 }, | ||
| (_, index) => `agent${index}: {<<: [${sources}]}`, | ||
| ); | ||
| expect(() => | ||
| parseManifestRecord(`empty: &empty {}\n${mappings.join("\n")}\n`, "merge.yaml"), | ||
| ).toThrow(/merge keys exceeded maxTotalMergeKeys/); | ||
| }); | ||
| }); | ||
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.
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.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Add an acceptance test at the document work limit.
This test proves rejection at 100,100 merge operations. It does not prove that 100,000 operations remain accepted. An incorrect lower document limit would pass all current tests.
Proposed test
As per path instructions, tests must provide behavioral confidence through the public boundary.
📝 Committable suggestion
🤖 Prompt for AI Agents
Source: Path instructions
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.
The boundary test is implemented locally and passes. Verification found that js-yaml 4.3.2 defaults maxTotalMergeKeys to 10,000, not 100,000 (confirmed in the installed package and upstream release commit 79ca68d90f333fbe6d9e42827527e62636200191). The repair proves acceptance at 10,000 and rejection at 10,100, corrects the original comment, and reduces the rejection fixture. All 47 focused tests pass; the smaller attack fixture remains accepted by 4.3.1 and rejected by 4.3.2. The repair will be published with the completed base refresh after validation.
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.
@rsliter, thank you for the correction. The original comment used the wrong default limit.The revised tests at 10,000 accepted merge keys and 10,100 rejected merge keys provide the required boundary coverage. The reduced rejection fixture is also appropriate. I will keep this thread open until the repair is published and can be verified.
🐇
✏️ Learnings added
You are interacting with an AI system.