Skip to content

Commit c70f6c0

Browse files
committed
feat(Provenance): Add a RemoteProvenance sub-interface
In preparation to split the `KnownProvenance` hierarchy further, for now introduce a `RemoteProvenance` that bundles the `RepositoryProvenance` and `ArtifactProvance`. Later an additional `LocalProvance` will be introduced. See [1] for context. [1]: oss-review-toolkit#8803 (comment) Signed-off-by: Jens Keim <[email protected]>
1 parent b85af8b commit c70f6c0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

model/src/main/kotlin/Provenance.kt

+4-2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ data object UnknownProvenance : Provenance {
4343

4444
sealed interface KnownProvenance : Provenance
4545

46+
sealed interface RemoteProvenance : KnownProvenance
47+
4648
/**
4749
* Provenance information for a source artifact.
4850
*/
@@ -51,7 +53,7 @@ data class ArtifactProvenance(
5153
* The source artifact that was downloaded.
5254
*/
5355
val sourceArtifact: RemoteArtifact
54-
) : KnownProvenance {
56+
) : RemoteProvenance {
5557
override fun matches(pkg: Package): Boolean = sourceArtifact == pkg.sourceArtifact
5658
}
5759

@@ -70,7 +72,7 @@ data class RepositoryProvenance(
7072
* like a branch or tag name, but a fixed revision (e.g. the SHA1 of a Git commit).
7173
*/
7274
val resolvedRevision: String
73-
) : KnownProvenance {
75+
) : RemoteProvenance {
7476
init {
7577
require(resolvedRevision.isNotBlank()) { "The resolved revision must not be blank." }
7678
}

0 commit comments

Comments
 (0)