You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scanner: Merge duplicate scan results that share a provenance
When the SpdxDocumentFile package manager is used, the *project* and all
contained *packages* often resolve to the **same VCS provenance** (e.g. the
root of the Git repository).
Before this change ORT stored two separate `ScanResult`s for such a
provenance – one keyed to the project, one keyed to the package.
That caused two follow-on problems:
* Both results appeared in the `OrtResult`, so evaluators saw **duplicate
findings** for the *same* source tree.
* Because projects and packages are handled by different rules the package
result was additionally **padded with a `SpdxConstants.NONE` finding**
whenever `includeFilesWithoutFindings` was enabled.
The evaluator therefore compared *real* license findings from the project
result with `NONE` from the package result and failed with a violation.
This patch
* groups scan results by the pair `(provenance, scanner)` and folds them
into a single `ScanResult`,
* unions the inner finding sets to avoid duplicates, and
* performs the "pad with NONE" step only **after** deduplication, so every
path is represented exactly once.
As a consequence the evaluator now receives one consistent set of license
findings per provenance / scanner, eliminating the false mismatch.
Signed-off-by: Jonatan Männchen <jonatan@maennchen.ch>
0 commit comments