Repository navigation
sbom: make the CycloneDX serialNumber a valid deterministic urn:uuid - #147
Merged
WintersCoder merged 4 commits intoOct 25, 2026
Merged
WintersCoder merged 4 commits into
WintersCoder merged 4 commits into
Conversation
WintersCoder
previously approved these changes
Oct 25, 2026
Maintainer follow-up on IkarusAILabs#147 (review findings): - ruff: 4 errors would fail CI's `ruff check .` (E501 x3, unused `Path` import). Fixed by moving the UUID into a `serial_number()` helper and rewriting the tests. - Namespace: the serial was uuid5(NAMESPACE_URL, "urn:openpulse:lock:..") - a URN hashed under the URL namespace. It now uses OpenPulse's own namespace, uuid5(NAMESPACE_DNS, "openpulse.ikaruslabs.net"), so OpenPulse serials stay disjoint from other names under the standard namespaces. Still RFC 4122 v5, deterministic per lock. - main() ignored argv[1], so `gen_sbom.py other.lock out.json` silently described requirements.lock; it also built the SBOM twice. It now reads [LOCK [OUT]] and builds once. CI calls it without arguments, so CI behaviour is unchanged. - Tests use fixture locks under tmp_path (no dependency on the real lock or the cwd), check the namespace, and compare main()'s written bytes across runs - the property CI's `cmp` step relies on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WintersCoder
approved these changes
Oct 25, 2026
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #143
Summary
CycloneDX requires
serialNumberto follow an RFC 4122 UUID URN format matching^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$. Previously,scripts/gen_sbom.pyoutputurn:uuid:openpulse-lock-<sha256[:32]>, which caused strict validators to reject the archived SBOM.Changes
scripts/gen_sbom.pyto deriveserialNumberusinguuid.uuid5(uuid.NAMESPACE_URL, f"urn:openpulse:lock:{digest}").tests/test_gen_sbom.pyasserting:serialNumberadheres strictly to RFC 4122 UUID URN regex.cmpbyte check).Verification
pytest tests/test_gen_sbom.py-> 2 passed.