Skip to content

feat(sbom): resolve version unknown#58

Merged
nervgh merged 9 commits intomainfrom
feat/sbom/resolve-version-unknown
Apr 15, 2026
Merged

feat(sbom): resolve version unknown#58
nervgh merged 9 commits intomainfrom
feat/sbom/resolve-version-unknown

Conversation

@reyreavman
Copy link
Copy Markdown
Collaborator

No description provided.

@reyreavman reyreavman force-pushed the feat/sbom/resolve-version-unknown branch 2 times, most recently from ab4ff73 to 7a90b88 Compare March 10, 2026 09:31
Comment thread pkg/sbom/cyclonedxutil/patch.go
Comment thread pkg/build/build_phase.go Outdated
Comment thread pkg/build/sbom_step_test.go
Comment thread pkg/sbom/gomod/resolve_test.go Outdated
Comment thread pkg/sbom/gomod/version.go
@reyreavman reyreavman force-pushed the feat/sbom/resolve-version-unknown branch from aab2894 to ef73b19 Compare March 13, 2026 07:55
@nervgh nervgh self-requested a review March 17, 2026 09:27
Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
- Move _fixtures/sbom-go-replace/state0 → _fixtures/sbom/go_replace
- Add git tag v1.0.0 in test setup for deterministic version
- Assert exact version v1.0.0 instead of just not-UNKNOWN

Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
Local.TagCommit was missing — only Remote had an implementation.
The Base panic stub was being called at runtime when resolving
Go module versions from git tags.

Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
Syft writes "(devel)" (not "UNKNOWN") for local replace modules, and
uses the filesystem path (e.g. "./mylib") as component name instead of
the module name. Fix both:
- Match (devel) in addition to UNKNOWN
- Include local replace paths (New.Path) in match targets
- Handle URL-encoded %28devel%29 in PURL

Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
…2e test

Syft records local replace modules with filesystem path (./mylib)
as component name, not the module name (example.com/mylib).

Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
When Syft records a local replace module with filesystem path as name
(e.g. ./mylib), replace it with the actual module name from go.mod
replace directive (e.g. example.com/mylib) and rebuild PURL accordingly.

Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
…ocessing

Replace gitRepo/commit/imageContext params in ConvergeWithMerge with
[]BOMPatcher — a slice of transform functions. Each patcher is a
closure built by the caller. Adding a new patcher requires only
appending a new function to the slice, no signature changes.

Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
…ent patcher

PatchComponents(bom, match, patch) iterates BOM components and applies
a transformation to each matching one. ResolveUnknownGoVersions is now
built on top of it. New patchers can reuse the same traversal.

Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
@reyreavman reyreavman force-pushed the feat/sbom/resolve-version-unknown branch from 20e3367 to 0744e4c Compare April 14, 2026 23:19
Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
@reyreavman reyreavman force-pushed the feat/sbom/resolve-version-unknown branch from 0744e4c to b892d8c Compare April 14, 2026 23:23
@nervgh nervgh merged commit 5956afc into main Apr 15, 2026
14 of 15 checks passed
@nervgh nervgh deleted the feat/sbom/resolve-version-unknown branch April 15, 2026 08:46
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.

3 participants