Skip to content

Add support for PackageGuard and use it in the pipeline - #659

Merged
dennisdoomen merged 1 commit into
developfrom
claude/packageguard-generated-support-e39906
Sep 19, 2026
Merged

dennisdoomen merged 1 commit into
developfrom
claude/packageguard-generated-support-e39906

Conversation

@dennisdoomen

@dennisdoomen dennisdoomen commented Aug 25, 2026 •

Copy link
Copy Markdown
Collaborator

Adds a Fallout CLI tool wrapper for PackageGuard's analyze command, based on AnalyzeCommandSettings.cs, and wires it into the build pipeline as a compliance gate plus SBOM/risk-reporting.

Tool wrapper

  • src/Fallout.Common/Tools/PackageGuard/PackageGuard.json — spec covering all 18 analyze settings, plus NpmPackageManager and SbomFormat enumerations for the properties restricted to a fixed set of values.
  • PackageGuard.Generated.cs — regenerated via ./build.ps1 GenerateTools.
  • Added a row to the supported-tools table in docs/website/03-common/08-cli-tools.md.
  • Added TestPackageGuard to tests/Fallout.Common.Specs/SettingsSpecs.cs.

Build pipeline

  • New PackageGuard target (build/Build.PackageGuard.cs) runs the policy-violation check on every PR (added to build.yml's required gate, alongside VerifyGeneratedTools/Test/Pack) — a license/package-policy violation now blocks the PR gate like any other check.
  • The SBOM (CycloneDX) and HTML + SARIF risk report are only generated on main, develop, release/*, or support/* — via GitRepository.IsOn*Branch() (including a new IsOnSupportBranch() extension), or, for the tag-triggered release workflow where HEAD is detached, because that workflow's own validate-ref job already proved the tag is reachable from a production branch.
  • New security-scan workflow (generated from a third [GitHubActions] attribute) runs on every push to those branches and uploads the SARIF report to GitHub code scanning via github/codeql-action/upload-sarif.
  • publish-packages-release.yml now runs PackageGuard alongside Test+Pack and attaches both the SBOM and the HTML risk report to the GitHub Release as assets.
  • Added .packageguard/config.json — an allowlist covering the permissive license family this repo's actual dependencies use (MIT, Apache-2.0, BSD-2/3-Clause, ISC, 0BSD, MS-PL), plus an explicit package-name allowance for FluentAssertions (its pinned 8.10.0 reports no SPDX license expression at all — a licenseFile plus a note that commercial use requires a paid Xceed license — so no license-based match would cover it; mirrors the same allowance PackageGuard's own repo uses on itself). Without a config file, PackageGuard's NuGet analysis throws on every run instead of defaulting permissive, which would have broken every PR the moment this became a required check.

Purely additive — no breaking changes.

🤖 Generated with Claude Code

@dennisdoomen dennisdoomen added enhancement New feature or request target/vCurrent Targets the current version labels Aug 25, 2026
@dennisdoomen
dennisdoomen force-pushed the claude/packageguard-generated-support-e39906 branch from d0c4f43 to f3da768 Compare August 25, 2026 19:16
@dennisdoomen

Copy link
Copy Markdown
Collaborator Author

@ChrisonSimtian what do you think about this PR?

@ChrisonSimtian

Copy link
Copy Markdown
Collaborator

@ChrisonSimtian what do you think about this PR?

I love the idea of having this baked in, it adds real value to the CI

@dennisdoomen
dennisdoomen force-pushed the claude/packageguard-generated-support-e39906 branch 2 times, most recently from e5d1a2a to 331023a Compare August 28, 2026 07:09
dennisdoomen added a commit that referenced this pull request Aug 28, 2026
Its NuGet metadata carries no license expression or URL, same gap as
FluentAssertions above it — PackageGuard can't auto-detect either
despite both being MIT. See #659.
@dennisdoomen
dennisdoomen force-pushed the claude/packageguard-generated-support-e39906 branch from c926a33 to 2d4db33 Compare August 28, 2026 09:04
@dennisdoomen
dennisdoomen marked this pull request as ready for review August 28, 2026 09:12
@dennisdoomen
dennisdoomen requested a review from a team as a code owner August 28, 2026 09:12
Comment thread .packageguard/config.json
Comment thread src/Fallout.Build/VCS/GitRepositoryExtensions.cs
@dennisdoomen
dennisdoomen force-pushed the claude/packageguard-generated-support-e39906 branch from 2d4db33 to 1e47fed Compare September 19, 2026 06:30
Adds a Fallout CLI tool wrapper for PackageGuard's analyze command
and wires it into the build pipeline as a compliance gate plus
SBOM/risk-reporting:

- New PackageGuard target (build/Build.PackageGuard.cs) runs the
  policy-violation check on every PR; the SBOM (CycloneDX) and
  HTML+SARIF risk report are only generated on main/develop/release/
  support branches, uploaded to GitHub code scanning via a new
  security-scan workflow, and attached to GitHub Releases.
- .packageguard/config.json allow-lists this repo's permissive
  license family, plus FluentAssertions and NetArchTest.Rules, which
  are MIT-licensed but publish no license expression or URL for
  PackageGuard to auto-detect.
- Pins PackageGuard at 2.7.1 and passes the risk-report path via the
  CLI's --report-risk path argument (added in 2.5.0) rather than the
  undocumented env var override that 2.4.0 required.
- Points the CLI tools doc at PackageGuard's new packageguard.org
  site instead of its GitHub repo.

Also serialises ConsoleUtilitySpecs with the process-global-state
collection: it races with PromptConfirmationGlyphSpecs over the
shared static ConsoleUtility wrapper, which xUnit's parallel
collection runs intermittently surfaced as a FakeConsole.LastLine
failure in CI.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@dennisdoomen
dennisdoomen force-pushed the claude/packageguard-generated-support-e39906 branch from 485ea32 to 9bdfa51 Compare September 19, 2026 07:48
@dennisdoomen
dennisdoomen enabled auto-merge (rebase) September 19, 2026 07:49
@dennisdoomen
dennisdoomen merged commit 7090476 into develop Sep 19, 2026
6 checks passed
@dennisdoomen
dennisdoomen deleted the claude/packageguard-generated-support-e39906 branch September 19, 2026 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request target/vCurrent Targets the current version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants