Skip to content

Use shared integrity module - #35

Merged
andrew merged 4 commits into
mainfrom
integrity-migration
Aug 16, 2026
Merged

Use shared integrity module#35
andrew merged 4 commits into
mainfrom
integrity-migration

Conversation

@andrew

@andrew andrew commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Use github.com/git-pkgs/integrity for SRI parsing and preserve every supported digest when reading and writing CycloneDX lockfiles. The old pin/integrity package is removed.

Closes #34

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.

Pull request overview

This pull request migrates CycloneDX lockfile SRI handling to the shared github.com/git-pkgs/integrity module, enabling round-tripping of multiple supported SRI digests while keeping pin/integrity as deprecated compatibility wrappers.

Changes:

  • Switch CycloneDX lockfile read/write to use github.com/git-pkgs/integrity, preserving multiple SRI digests for both file and package hashes.
  • Add CycloneDX tests covering multi-hash round-trip, malformed supported hashes rejection, and ignoring unsupported hashes.
  • Replace pin/integrity implementation with thin deprecated wrappers and remove associated fuzz/bench tests; add the new shared module dependency.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Makefile Removes fuzz targets for the legacy integrity package (tests were removed).
lock/cyclonedx.go Uses shared integrity parsing/formatting and supports encoding/decoding multiple hashes.
lock/cyclonedx_test.go Adds coverage for multi-hash round-trips and hash validation behavior.
integrity/sri.go Converts legacy SRI helpers into deprecated wrappers over the shared module.
integrity/sri_test.go Adds a test ensuring legacy ParseSRI returns the first digest from multi-hash input.
integrity/fuzz_test.go Removes fuzz tests for legacy integrity implementation.
integrity/bench_test.go Removes benchmarks for legacy integrity implementation.
go.mod Adds dependency on github.com/git-pkgs/integrity v0.1.0.
go.sum Adds checksums for github.com/git-pkgs/integrity v0.1.0.

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

Comment thread integrity/sri.go Outdated
@andrew
andrew marked this pull request as ready for review August 15, 2026 21:45
@andrew
andrew merged commit 596f182 into main Aug 16, 2026
5 checks passed
@andrew
andrew deleted the integrity-migration branch August 16, 2026 21:11
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.

Extract integrity helpers into a shared module

2 participants