Skip to content

fix: handle multiple info-source parents in SBOM graph without panicking#2012

Merged
timbastin merged 3 commits into
mainfrom
fix/sbom-graph-multiple-info-source-parents
May 20, 2026
Merged

fix: handle multiple info-source parents in SBOM graph without panicking#2012
timbastin merged 3 commits into
mainfrom
fix/sbom-graph-multiple-info-source-parents

Conversation

@refoo0
Copy link
Copy Markdown
Member

@refoo0 refoo0 commented May 20, 2026

No description provided.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: rafi <refaei.shikho@hotmail.com>
Copilot AI review requested due to automatic review settings May 20, 2026 13:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates SBOM graph path-finding to tolerate malformed graphs where a single info-source node has multiple parent artifacts, avoiding a hard panic while preserving correct scoped path results.

Changes:

  • Replaced the panic on “info source has multiple parents” with a warning + monitoring alert and updated scoping logic to accept any parent matching the current scope.
  • Added a regression test covering the multi-parent info-source scenario to ensure scoped path results remain correct.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
normalize/sbom_graph.go Avoids panic on multi-parent info sources; logs/alerts and keeps scoped path computation working by checking all parents for the current scope.
normalize/sbom_graph_test.go Adds coverage ensuring scoped path results remain correct when an info source has two parent artifacts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread normalize/sbom_graph.go
Comment thread normalize/sbom_graph.go Outdated
Comment thread normalize/sbom_graph.go Outdated
timbastin and others added 2 commits May 20, 2026 15:20
Signed-off-by: Tim Bastin <38261809+timbastin@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Tim Bastin <38261809+timbastin@users.noreply.github.com>
@timbastin timbastin merged commit 650d238 into main May 20, 2026
9 of 11 checks passed
@timbastin timbastin deleted the fix/sbom-graph-multiple-info-source-parents branch May 20, 2026 13:22
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