Skip to content

Conversation

@isasmendiagus
Copy link
Contributor

No description provided.

…n for BOM rules

Add path matching helpers that support three levels:
- Purl-only (no path): applies globally
- File-level (exact path): applies to specific file
- Folder-level (trailing '/'): applies to all files under directory

Add priority-based rule resolution: path+purl (4) > purl-only (2) > path-only (1),
with longer paths winning on equal priority.

Update JSON schema to allow path-only remove entries (anyOf purl/path)
and add folder path examples to include/remove/replace sections.

Add per-batch SBOM context resolution (get_sbom_for_batch) for scoping
include/exclude purls to requests containing matching files.
Replace first-match-wins logic with find_best_match() for both
remove and replace post-processing. This enables folder-level
matching (trailing '/') and ensures the most specific rule wins
when multiple BOM entries match the same result.

Path-only remove entries (no purl) are now supported.
When BOM include/exclude entries have path fields, resolve SBOM context
per-batch instead of setting it globally. Each API request now receives
only the purls relevant to the files in that batch.

- scanossapi: add per-request sbom override parameter to scan()
- threadedscanning: pass SBOM alongside WFP through the queue
- scanner: track file paths per batch, compute filtered SBOM at flush
  points, extract paths from WFP for pre-generated fingerprint files

Purl-only entries (no path) are always included in every request.
When no path-scoped entries exist, the global SBOM behavior is unchanged.
Cover path matching helpers, priority resolution, post-processor
folder matching, per-batch SBOM context filtering, and WFP path
extraction. 45 new test cases.
Introduce a proper class hierarchy for BOM rules mirroring the Java
implementation: BomEntry base dataclass with ReplaceRule subclass that
adds replace_with and license fields. All get_bom_* methods now convert
raw dicts to typed dataclass instances via from_dict() factory methods.
@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

SCANOSS SCAN Completed 🚀

  • Detected components: 2
  • Undeclared components: 0
  • Declared components: 2
  • Detected files: 104
  • Detected files undeclared: 0
  • Detected files declared: 104
  • Licenses detected: 1
  • Licenses detected with copyleft: 0
  • Policies: ✅ 1 pass (1 total)

View more details on SCANOSS Action Summary

@github-actions
Copy link

SCANOSS SCAN Completed 🚀

  • Detected components: 2
  • Undeclared components: 0
  • Declared components: 2
  • Detected files: 104
  • Detected files undeclared: 0
  • Detected files declared: 104
  • Licenses detected: 1
  • Licenses detected with copyleft: 0
  • Policies: ✅ 1 pass (1 total)

View more details on SCANOSS Action Summary

@github-actions
Copy link

SCANOSS SCAN Completed 🚀

  • Detected components: 2
  • Undeclared components: 0
  • Declared components: 2
  • Detected files: 104
  • Detected files undeclared: 0
  • Detected files declared: 104
  • Licenses detected: 1
  • Licenses detected with copyleft: 0
  • Policies: ✅ 1 pass (1 total)

View more details on SCANOSS Action Summary

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.

2 participants