Skip to content
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

model: Move ScanResultContainer to FileBasedStorage #5935

Merged
merged 3 commits into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 0 additions & 40 deletions model/src/main/kotlin/ScanResultContainer.kt

This file was deleted.

132 changes: 0 additions & 132 deletions model/src/test/kotlin/ScanResultContainerTest.kt

This file was deleted.

16 changes: 15 additions & 1 deletion scanner/src/main/kotlin/storages/FileBasedStorage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import org.apache.logging.log4j.kotlin.Logging

import org.ossreviewtoolkit.model.Identifier
import org.ossreviewtoolkit.model.ScanResult
import org.ossreviewtoolkit.model.ScanResultContainer
import org.ossreviewtoolkit.model.yamlMapper
import org.ossreviewtoolkit.scanner.ScanResultsStorage
import org.ossreviewtoolkit.scanner.ScanStorageException
Expand Down Expand Up @@ -109,3 +108,18 @@ class FileBasedStorage(

private fun storagePath(id: Identifier) = "${id.toPath()}/$SCAN_RESULTS_FILE_NAME"
}

/**
* A container for [ScanResult]s for the package identified by [id].
*/
private data class ScanResultContainer(
/**
* The [Identifier] of the package these [results] belong to.
*/
val id: Identifier,

/**
* The list of [ScanResult]s from potentially multiple scanners and / or with different package provenance.
*/
val results: List<ScanResult>
)