Skip to content

fix: use archive checksums for Bazel registry packages - #17

Merged
masc2023 merged 1 commit into
eclipse-score:mainfrom
nicu1989:nicu1989_sbom_checksum_fix
Oct 16, 2026
Merged

masc2023 merged 1 commit into
eclipse-score:mainfrom
nicu1989:nicu1989_sbom_checksum_fix

Conversation

@nicu1989

Copy link
Copy Markdown
Member

The generator used source.json file hashes as package checksums. These hashes identify registry metadata rather than the downloaded archives.

Download source.json, verify it against MODULE.bazel.lock and read the archive checksum from its integrity field. Include the archive URL in the SPDX package entry.

Support cached metadata for offline builds and reject invalid metadata. Update the checksum documentation and add regression tests using real Boost metadata.

Closes: #16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Explicitly supplied incomplete or malformed caches currently succeed while silently omitting checksums.

1 open finding
What changed in this PR

Corrects Bazel registry package checksums by verifying source.json and extracting archive metadata.

Changes:

  • Adds verified registry metadata collection and offline caching.
  • Emits archive checksums and URLs in SBOM outputs.
  • Adds regression tests, smoke coverage, and documentation.
File Description
README.md Documents registry checksum handling and caching.
defs.bzl Exposes registry cache options.
internal/​rules.bzl Generates or consumes registry metadata caches.
internal/​generator/​registry_metadata.py Validates metadata and extracts archive details.
internal/​generator/​sbom_generator.py Integrates verified archive metadata.
internal/​generator/​BUILD Adds the metadata library dependency.
scripts/​generate_registry_metadata_cache.py Downloads and verifies registry metadata.
scripts/​BUILD.bazel Defines cache generator targets.
tests/​test_registry_checksums.py Adds checksum and cache regression tests.
tests/​test_sbom_generator.py Updates lockfile checksum expectations.
tests/​fixtures/​boost.config-1.83.0.bcr.4-source.json Provides real Boost metadata.
tests/​BUILD Registers the new tests.
examples/​dummy_project/​registry_smoke_test.py Verifies live registry metadata output.
examples/​dummy_project/​BUILD.bazel Adds the registry smoke test target.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/generator/sbom_generator.py
@nicu1989
nicu1989 force-pushed the nicu1989_sbom_checksum_fix branch from 8d53174 to f8e4671 Compare October 14, 2026 11:25
@nicu1989
nicu1989 requested a balanced review from Copilot October 14, 2026 11:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Conflicting source types across lockfiles can incorrectly inherit an archive checksum from only one registry.

1 open finding
1 resolved since last review

🧠 Review effort: Balanced

Comment thread internal/generator/sbom_generator.py Outdated
@nicu1989
nicu1989 force-pushed the nicu1989_sbom_checksum_fix branch from f8e4671 to be6fdf1 Compare October 14, 2026 15:08
@nicu1989
nicu1989 requested a balanced review from Copilot October 14, 2026 15:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Registry URLs can be omitted or associated with the wrong package version.

2 open findings
1 resolved since last review

🧠 Review effort: Balanced

Comment thread internal/generator/sbom_generator.py
Comment thread internal/generator/registry_metadata.py Outdated
@nicu1989
nicu1989 force-pushed the nicu1989_sbom_checksum_fix branch from be6fdf1 to 134407c Compare October 14, 2026 15:19
@nicu1989
nicu1989 requested a balanced review from Copilot October 14, 2026 15:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation addresses the checksum provenance issue with validation, offline support, documentation, and comprehensive regression coverage.

0 open findings

2 resolved since last review

🧠 Review effort: Balanced

The generator used `source.json` file hashes as package checksums.
These hashes identify registry metadata rather than the downloaded
archives.

Download `source.json`, verify it against `MODULE.bazel.lock` and read
the archive checksum from its integrity field. Include the archive
URL in the SPDX package entry.

Support cached metadata for offline builds and reject invalid
metadata. Update the checksum documentation and add regression
tests using real Boost metadata.

Signed-off-by: Nicolae Dicu <nicolae.dicu.ext@qorix.ai>
@nicu1989
nicu1989 force-pushed the nicu1989_sbom_checksum_fix branch from 134407c to 3d96ae1 Compare October 15, 2026 08:02

@dcalavrezo-qorix dcalavrezo-qorix left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@masc2023
masc2023 merged commit 55efcaa into eclipse-score:main Oct 16, 2026
7 checks passed
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.

Fix incorrect package checksums for Bazel registry dependencies

4 participants