Skip to content

feat(release): publish a CycloneDX SBOM per VSIX - #207

Open
clement-tourriere wants to merge 2 commits into
mainfrom
ctourriere/END-1305/publish_sbom
Open

clement-tourriere wants to merge 2 commits into
mainfrom
ctourriere/END-1305/publish_sbom

Conversation

@clement-tourriere

@clement-tourriere clement-tourriere commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Context

clients asked for an SBOM covering the components of the released extension, ggshield included (END-1305, from END-1066).

This PR depends on GitGuardian/ggshield#1577, which adds ggshield-<version>-<target>.cdx.json to ggshield releases. The pinned ggshield 1.56.0 has none. Until ggshield_version points to a release that does, PR and main builds skip the extension SBOM and show a warning. Release builds still fail without it, so the next extension release needs a ggshield release with SBOMs first.

What has been done

  • scripts/generate-sbom.mjs builds a CycloneDX 1.5 SBOM per VSIX target. It contains:
    • the extension, with its target;
    • the npm packages esbuild bundled into dist/extension.js, read from the metafile production builds now write (dist/esbuild-meta.json, excluded from the VSIX). Today there are none: only src/ is bundled;
    • ggshield, with the components of its release SBOM for the matching target nested under it. The generator checks that SBOM's version and target, and fails if it is missing.
  • build.yaml generates gitguardian-<target>.cdx.json and uploads it as an artifact. Its require-sbom input, which release.yaml sets, makes a missing ggshield SBOM fatal; otherwise the generator runs with --allow-missing-ggshield-sbom. release.yaml also attaches the SBOMs to the draft GitHub release and checks there is one per VSIX.
  • Unit tests in scripts/generate-sbom.test.mjs, run by npm run test:scripts in the lint job.
  • SECURITY.md documents the SBOMs, and package.json now declares the MIT license, which the SBOM reads.

--ggshield-sbom <file> takes a local ggshield SBOM instead. I used it with SBOMs generated by hand for ggshield 1.56.0, to produce SBOMs of 0.25.0 for the customer.

Validation

  • npm run test:scripts
  • Packaged linux-x64 locally (vsce package --target linux-x64), then ran node scripts/generate-sbom.mjs --target linux-x64 --ggshield-sbom <ggshield 1.56.0 SBOM> -o out.cdx.json. The output passes strict CycloneDX 1.5 validation, and grype sbom:out.cdx.json reports the nested ggshield components. esbuild-meta.json is not in the VSIX.
  • The release workflow can only be fully checked on the next tag.

PR check list

  • As much as possible, the changes include tests
  • If the changes affect the end user (new feature, behavior change, bug fix) then the PR has a changelog entry.

🤖 Generated with Claude Code

@linear

linear Bot commented Oct 21, 2026

Copy link
Copy Markdown

END-1305

@clement-tourriere
clement-tourriere marked this pull request as ready for review October 22, 2026 07:20
@clement-tourriere
clement-tourriere requested a review from a team as a code owner October 22, 2026 07:20
@clement-tourriere clement-tourriere self-assigned this Oct 22, 2026
Customers ask for an SBOM covering what the extension ships, ggshield
included. scripts/generate-sbom.mjs builds one per target from:
- the npm packages esbuild bundled into dist/extension.js, read from
  the metafile production builds now write (none today);
- ggshield, with the components of the SBOM its release publishes for
  the matching target nested under it.

The build job generates gitguardian-<target>.cdx.json next to each VSIX
and the release attaches them to the GitHub release. The build fails
if the pinned ggshield release has no SBOM, so ggshield_version must
point to a release that publishes them before this is merged.

Refs: END-1305
The pinned ggshield 1.56.0 publishes no SBOM, so every PR build failed.
PR and main builds now skip the extension SBOM with a warning when the
ggshield release has none; release builds still fail without it, before
anything is published.

Refs: END-1305
@clement-tourriere
clement-tourriere force-pushed the ctourriere/END-1305/publish_sbom branch from 84ec847 to 7019ebf Compare October 22, 2026 12:57

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant