Skip to content

feat!: per-API-group SBOMs with serialNumber tracking#5

Merged
blacksd merged 3 commits intomainfrom
feat/per-group-sbom
Mar 21, 2026
Merged

feat!: per-API-group SBOMs with serialNumber tracking#5
blacksd merged 3 commits intomainfrom
feat/per-group-sbom

Conversation

@blacksd
Copy link
Copy Markdown
Owner

@blacksd blacksd commented Mar 21, 2026

Summary

  • Replace single top-level sbom.cdx.json with per-CRD-API-group SBOMs at schemas/{group}/sbom.cdx.json
  • Add CycloneDX serialNumber (URN UUID v4, stable across regenerations) and version tracking (incremented on each rewrite)
  • Embed source provenance as component Properties with crd-schemas: namespace prefix (type, repo, url, chart)
  • Change detection compares source names+versions against existing SBOM state, not raw bytes (timestamps always differ)
  • Source version bumps with unchanged schemas still produce SBOM version bumps (audit trail)

BREAKING CHANGE: schemas/sbom.cdx.json is removed. Consumers must look for schemas/{group}/sbom.cdx.json instead.

Changed files

File Change
internal/sbom/sbom.go Added State, LoadExisting, HasChanged, newSerialNumber; updated Generate to accept existing state
internal/sbom/sbom_test.go Expanded from 3 to 15 tests covering all new functionality
cmd/crd-schema-extractor/extract.go Per-group SBOM loop replacing single-file generation
.github/workflows/test.yml E2E now verifies per-group SBOMs and serialNumber presence

Test plan

  • All 15 SBOM unit tests pass (go test ./internal/sbom/... -v)
  • Full test suite passes with -race (go test ./... -race)
  • go vet ./... clean
  • E2E workflow validates per-group SBOM files exist with serialNumber (CI)

blacksd and others added 3 commits March 21, 2026 13:37
…ovenance

BREAKING CHANGE: the top-level schemas/sbom.cdx.json is removed. SBOMs are
now generated per CRD API group at schemas/{group}/sbom.cdx.json, co-located
with the extracted schemas for that group.

Each SBOM now includes:
- serialNumber (URN UUID v4) that persists across regenerations
- version field that increments on each rewrite (audit trail)
- component Properties with crd-schemas: namespaced provenance metadata
  (source type, repo, url, chart)

Change detection compares source component names and versions against the
existing SBOM. A source version bump with unchanged schemas still produces
a version bump in the SBOM, creating a traceable record of upstream changes.

A single source producing CRDs for multiple API groups (e.g. crossplane)
results in separate SBOMs in each group directory, each containing the
source as a component.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign the goreleaser checksums.txt with Sigstore cosign in keyless mode,
using GitHub Actions OIDC identity. The .bundle file is uploaded to the
release alongside the existing artifacts.

Verification:
  cosign verify-blob --bundle checksums.txt.bundle \
    --certificate-identity-regexp="github.com/blacksd/crd-schema-extractor" \
    --certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
    checksums.txt

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The autolabeler only runs when release-drafter executes. Without a
pull_request trigger, PR titles are never matched against the labeling
rules, so labels like 'major' from conventional commit '!' syntax
are never applied.

Add pull_request trigger with relevant event types and pull-requests
write permission so the autolabeler can label PRs when they are
opened or updated.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added feature New feature major Breaking change labels Mar 21, 2026
@blacksd blacksd merged commit f7eae9c into main Mar 21, 2026
3 checks passed
@blacksd blacksd deleted the feat/per-group-sbom branch March 21, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature major Breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant