-
Notifications
You must be signed in to change notification settings - Fork 23
feature/folder-level-bom-filtering #180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…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.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
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. Comment |
SCANOSS SCAN Completed 🚀
View more details on SCANOSS Action Summary |
SCANOSS SCAN Completed 🚀
View more details on SCANOSS Action Summary |
SCANOSS SCAN Completed 🚀
View more details on SCANOSS Action Summary |
No description provided.