Skip to content

Commit fc04622

Browse files
authored
Fix expired npm audit exception (#279)
1 parent b603373 commit fc04622

4 files changed

Lines changed: 14 additions & 24 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
1515

1616
- **Report sample synchronization is regression-tested** — Added `GoldenReportSampleConsistencyTests` to compare the ordered configured-normalization tables in both checked-in Markdown and HTML samples with the complete `creator-default` profile plus the sample-only overlap-warning value. The testing guide now distinguishes this cross-artifact consistency check from the structural and generation-determinism coverage in `GoldenFileSnapshotTests`. Affected: `FolderDiffIL4DotNet.Tests/Services/GoldenReportSampleConsistencyTests.cs`, `doc/TESTING_GUIDE.md`. Tests: `MarkdownNormalizationTable_MatchesCreatorDefaultProfile`, `HtmlNormalizationTable_MatchesCreatorDefaultProfile`.
1717

18+
#### Fixed
19+
20+
- **Expired npm audit exception no longer blocks CI** — Removed the expired `GHSA-mh99-v99m-4gvg` exception after the locked Jest dependency graph began selecting patched `brace-expansion` releases through the existing overrides. The CI configuration test now requires the npm exception list to remain empty, and the testing guide records that there are no active npm audit exceptions. Affected: `npm-audit-exceptions.json`, `FolderDiffIL4DotNet.Tests/Architecture/CiAutomationConfigurationTests.cs`, `doc/TESTING_GUIDE.md`.
21+
1822
### [2.0.1] - 2026-08-21
1923

2024
#### Changed
@@ -1764,6 +1768,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
17641768

17651769
- **レポートsample同期を回帰テストで保護** — `GoldenReportSampleConsistencyTests`を追加し、commit済みMarkdown/HTML両sampleの設定済み正規化tableを、順序を含む`creator-default` profile全体およびsample固有のoverlap warning用設定値と比較するようにしました。テストガイドでは、この成果物間の整合性検証と、`GoldenFileSnapshotTests`が担う構造/生成決定論の検証との役割を区別しました。対象: `FolderDiffIL4DotNet.Tests/Services/GoldenReportSampleConsistencyTests.cs`, `doc/TESTING_GUIDE.md`。テスト: `MarkdownNormalizationTable_MatchesCreatorDefaultProfile`, `HtmlNormalizationTable_MatchesCreatorDefaultProfile`。
17661770

1771+
#### 修正
1772+
1773+
- **期限切れ npm 監査例外による CI 失敗を解消** — ロック済み Jest 依存グラフが既存の overrides により修正版 `brace-expansion` を選択するようになったため、期限切れの `GHSA-mh99-v99m-4gvg` 例外を削除しました。CI 設定テストでは npm 例外リストが空のままであることを必須とし、テストガイドには現在有効な npm 監査例外がないことを記載しました。対象: `npm-audit-exceptions.json`, `FolderDiffIL4DotNet.Tests/Architecture/CiAutomationConfigurationTests.cs`, `doc/TESTING_GUIDE.md`。
1774+
17671775
### [2.0.1] - 2026-08-21
17681776

17691777
#### 変更

FolderDiffIL4DotNet.Tests/Architecture/CiAutomationConfigurationTests.cs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,8 @@ public void DotNetWorkflow_RunsPinnedJavaScriptTestsAndAuditGate()
263263
var nodeVersion = File.ReadAllText(GetRepositoryFilePath(".node-version")).Trim();
264264
var packageJson = JsonDocument.Parse(File.ReadAllText(GetRepositoryFilePath("package.json"))).RootElement;
265265
var auditGate = File.ReadAllText(GetRepositoryFilePath("scripts", "npm-audit-gate.js"));
266-
var auditException = JsonDocument.Parse(
267-
File.ReadAllText(GetRepositoryFilePath("npm-audit-exceptions.json")))
268-
.RootElement
269-
.GetProperty("exceptions")[0];
266+
using var auditExceptions = JsonDocument.Parse(
267+
File.ReadAllText(GetRepositoryFilePath("npm-audit-exceptions.json")));
270268

271269
Assert.Equal("24.18.0", nodeVersion);
272270
Assert.Contains("javascript-tests:", workflow, StringComparison.Ordinal);
@@ -285,13 +283,7 @@ public void DotNetWorkflow_RunsPinnedJavaScriptTestsAndAuditGate()
285283
packageJson.GetProperty("scripts").GetProperty("audit:high").GetString());
286284
Assert.Contains("runAudit(repositoryRoot, ['--omit=dev'])", auditGate, StringComparison.Ordinal);
287285
Assert.Contains("result.expiredExceptions.length > 0", auditGate, StringComparison.Ordinal);
288-
Assert.Equal("GHSA-mh99-v99m-4gvg", auditException.GetProperty("advisory").GetString());
289-
Assert.Equal(1124334, auditException.GetProperty("source").GetInt32());
290-
Assert.Equal("brace-expansion", auditException.GetProperty("package").GetString());
291-
Assert.Equal("high", auditException.GetProperty("severity").GetString());
292-
Assert.Equal("2026-08-31", auditException.GetProperty("expires").GetString());
293-
Assert.False(string.IsNullOrWhiteSpace(auditException.GetProperty("rationale").GetString()));
294-
Assert.False(string.IsNullOrWhiteSpace(auditException.GetProperty("scope").GetString()));
286+
Assert.Empty(auditExceptions.RootElement.GetProperty("exceptions").EnumerateArray());
295287
}
296288

297289
/// <summary>

doc/TESTING_GUIDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ npm run test:js
141141
npm run audit:high
142142
```
143143

144-
The audit gate fails on every High/Critical advisory except the exact, time-bounded entries in [`npm-audit-exceptions.json`](../npm-audit-exceptions.json). The current `GHSA-mh99-v99m-4gvg` exception is limited to the development-only Jest dependency chain because the latest Jest 30.4.x graph cannot yet select the patched `brace-expansion` major safely; a separate `--omit=dev` audit enforces that scope, and the exception expires on 2026-08-31. [`scripts/npm-audit-gate.js`](../scripts/npm-audit-gate.js) also fails on an expired exception or if npm audit cannot return a valid report.
144+
The audit gate fails on every High/Critical advisory except exact, time-bounded entries in [`npm-audit-exceptions.json`](../npm-audit-exceptions.json). There are currently no active npm audit exceptions; the locked Jest graph selects patched `brace-expansion` releases through the overrides in `package.json`. A separate `--omit=dev` audit enforces that any future exception remains limited to development dependencies. [`scripts/npm-audit-gate.js`](../scripts/npm-audit-gate.js) also fails on an expired exception or if npm audit cannot return a valid report.
145145

146146
Run the NuGet audit-gate tests and the same full-solution direct/transitive dependency audit used by CI:
147147

@@ -395,7 +395,7 @@ npm run test:js
395395
npm run audit:high
396396
```
397397

398-
監査ゲートは、[`npm-audit-exceptions.json`](../npm-audit-exceptions.json) に完全一致かつ期限付きで記録した項目を除き、High/Critical advisory をすべて失敗させます。現在の `GHSA-mh99-v99m-4gvg` 例外は、最新 Jest 30.4.x の依存グラフが修正版 `brace-expansion` のメジャーバージョンをまだ安全に選択できないため、開発専用 Jest 依存チェーンだけに限定します。この範囲は別の `--omit=dev` 監査で強制し、例外は 2026-08-31 に失効します[`scripts/npm-audit-gate.js`](../scripts/npm-audit-gate.js) は、例外が期限切れの場合や npm audit から有効なレポートを取得できない場合も失敗します。
398+
監査ゲートは、[`npm-audit-exceptions.json`](../npm-audit-exceptions.json) に完全一致かつ期限付きで記録した項目を除き、High/Critical advisory をすべて失敗させます。現在有効な npm 監査例外はなく、ロック済み Jest 依存グラフでは `package.json` の overrides により修正版 `brace-expansion` を選択します。将来追加する例外が開発用依存関係だけに限定されることは、別の `--omit=dev` 監査で強制します[`scripts/npm-audit-gate.js`](../scripts/npm-audit-gate.js) は、例外が期限切れの場合や npm audit から有効なレポートを取得できない場合も失敗します。
399399

400400
NuGet 監査ゲートのテストと、CI と同じソリューション全体の直接・推移的依存関係監査を実行する場合:
401401

npm-audit-exceptions.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
11
{
2-
"exceptions": [
3-
{
4-
"advisory": "GHSA-mh99-v99m-4gvg",
5-
"source": 1124334,
6-
"package": "brace-expansion",
7-
"severity": "high",
8-
"rationale": "The latest Jest 30.4.x dependency graph still requires glob/minimatch releases whose brace-expansion ranges cannot select the patched 5.0.8 major version safely.",
9-
"scope": "Development-only Jest and jsdom test tooling; nildiff runtime and published .NET packages do not consume this dependency.",
10-
"expires": "2026-08-31"
11-
}
12-
]
2+
"exceptions": []
133
}

0 commit comments

Comments
 (0)