Repository navigation
Conversation
andrew
left a comment
There was a problem hiding this comment.
cmd/sbom_root_license.go:110–112 aborts when an existing database lacks manifest_licenses. I reproduced this with a populated schema-15 database: sbom --skip-enrichment on main outputs the MIT license, while this PR exits with loading project licenses: querying indexed project licenses: SQL logic error: no such table: manifest_licenses (1).
Please fall back to tree parsing when the table is absent and add a CLI regression test using the previous schema. The test that deletes rows from the current table does not cover databases created before the table was introduced.
|
Thanks for catching this. |
andrew
left a comment
There was a problem hiding this comment.
The missing-table fallback addresses my earlier review. Verified SBOM output with a schema-15 database, an on-demand-only index, stale manifest license events, and updated license-file text; the schema-15 database retains its schema and has no license table created.
Closes #342
Summary
Connect SBOM generation to the existing
manifest_licensestable, givingGetManifestLicensesAtRefa production consumer.The query now returns the source commit SHA for each license event. No schema migration or dependency update is required.
Scope
This implements the issue's SBOM-consumer option. It does not change on-demand indexing or add project-license entries to the
licensescommand.Regression Coverage
Verification
gofmtgo build ./...go mod tidy -diffgo test ./... -count=1go test -race ./... -count=1go tool golangci-lint run ./...git diff --check