diff --git a/analyzer/src/funTest/assets/projects/external/git-repo-expected-output.yml b/analyzer/src/funTest/assets/projects/external/git-repo-expected-output.yml index c33dc85e17373..f3242e8610788 100644 --- a/analyzer/src/funTest/assets/projects/external/git-repo-expected-output.yml +++ b/analyzer/src/funTest/assets/projects/external/git-repo-expected-output.yml @@ -1673,7 +1673,7 @@ analyzer: url: "https://git-wip-us.apache.org/repos/asf/jena.git" revision: "jena-3.9.0-rc1" path: "" - is_meta_data_only: true + is_metadata_only: true curations: [] - metadata: id: "Maven:org.apache.jena:jena-arq:3.9.0" @@ -2402,7 +2402,7 @@ analyzer: url: "https://git-wip-us.apache.org/repos/asf/thrift.git" revision: "" path: "" - is_meta_data_only: true + is_metadata_only: true curations: [] - metadata: id: "Maven:org.apache.xmlbeans:xmlbeans:2.6.0" diff --git a/analyzer/src/funTest/assets/projects/synthetic/gradle-all-dependencies-expected-result-with-curations.yml b/analyzer/src/funTest/assets/projects/synthetic/gradle-all-dependencies-expected-result-with-curations.yml index 6eb1d0b6c6d40..7dfb9ce48d268 100644 --- a/analyzer/src/funTest/assets/projects/synthetic/gradle-all-dependencies-expected-result-with-curations.yml +++ b/analyzer/src/funTest/assets/projects/synthetic/gradle-all-dependencies-expected-result-with-curations.yml @@ -458,7 +458,7 @@ analyzer: url: "https://gitbox.apache.org/repos/asf/struts.git" revision: "STRUTS_2_5_14_1" path: "" - is_meta_data_only: true + is_metadata_only: true curations: [] - metadata: id: "Maven:org.hamcrest:hamcrest-core:1.3" diff --git a/analyzer/src/funTest/assets/projects/synthetic/gradle-all-dependencies-expected-result.yml b/analyzer/src/funTest/assets/projects/synthetic/gradle-all-dependencies-expected-result.yml index 9a0aae2e1f395..e927dda66fa5a 100644 --- a/analyzer/src/funTest/assets/projects/synthetic/gradle-all-dependencies-expected-result.yml +++ b/analyzer/src/funTest/assets/projects/synthetic/gradle-all-dependencies-expected-result.yml @@ -458,7 +458,7 @@ analyzer: url: "https://gitbox.apache.org/repos/asf/struts.git" revision: "STRUTS_2_5_14_1" path: "" - is_meta_data_only: true + is_metadata_only: true curations: [] - metadata: id: "Maven:org.hamcrest:hamcrest-core:1.3" diff --git a/analyzer/src/funTest/assets/projects/synthetic/gradle-expected-output-app.yml b/analyzer/src/funTest/assets/projects/synthetic/gradle-expected-output-app.yml index abe8da408ba10..95fd199031c2e 100644 --- a/analyzer/src/funTest/assets/projects/synthetic/gradle-expected-output-app.yml +++ b/analyzer/src/funTest/assets/projects/synthetic/gradle-expected-output-app.yml @@ -214,4 +214,4 @@ packages: url: "https://gitbox.apache.org/repos/asf/struts.git" revision: "STRUTS_2_5_14_1" path: "" - is_meta_data_only: true + is_metadata_only: true diff --git a/analyzer/src/funTest/assets/projects/synthetic/gradle-expected-output-lib.yml b/analyzer/src/funTest/assets/projects/synthetic/gradle-expected-output-lib.yml index 2ec09b348eb16..94196435a6a4e 100644 --- a/analyzer/src/funTest/assets/projects/synthetic/gradle-expected-output-lib.yml +++ b/analyzer/src/funTest/assets/projects/synthetic/gradle-expected-output-lib.yml @@ -242,7 +242,7 @@ packages: url: "https://gitbox.apache.org/repos/asf/struts.git" revision: "STRUTS_2_5_14_1" path: "" - is_meta_data_only: true + is_metadata_only: true - id: "Maven:org.hamcrest:hamcrest-core:1.3" purl: "pkg:maven/org.hamcrest/hamcrest-core@1.3" authors: diff --git a/analyzer/src/funTest/assets/projects/synthetic/gradle-library-expected-output-app.yml b/analyzer/src/funTest/assets/projects/synthetic/gradle-library-expected-output-app.yml index aad0b73f24126..1596257b4d6c6 100644 --- a/analyzer/src/funTest/assets/projects/synthetic/gradle-library-expected-output-app.yml +++ b/analyzer/src/funTest/assets/projects/synthetic/gradle-library-expected-output-app.yml @@ -212,4 +212,4 @@ packages: url: "https://gitbox.apache.org/repos/asf/struts.git" revision: "STRUTS_2_5_14_1" path: "" - is_meta_data_only: true + is_metadata_only: true diff --git a/analyzer/src/funTest/assets/projects/synthetic/gradle-library-expected-output-lib.yml b/analyzer/src/funTest/assets/projects/synthetic/gradle-library-expected-output-lib.yml index 7ce0317556186..fa1c374a46e70 100644 --- a/analyzer/src/funTest/assets/projects/synthetic/gradle-library-expected-output-lib.yml +++ b/analyzer/src/funTest/assets/projects/synthetic/gradle-library-expected-output-lib.yml @@ -242,7 +242,7 @@ packages: url: "https://gitbox.apache.org/repos/asf/struts.git" revision: "STRUTS_2_5_14_1" path: "" - is_meta_data_only: true + is_metadata_only: true - id: "Maven:org.hamcrest:hamcrest-core:1.3" purl: "pkg:maven/org.hamcrest/hamcrest-core@1.3" authors: diff --git a/analyzer/src/funTest/assets/projects/synthetic/maven-expected-output-app.yml b/analyzer/src/funTest/assets/projects/synthetic/maven-expected-output-app.yml index a637ffa1e7cc6..71cbf4013b93b 100644 --- a/analyzer/src/funTest/assets/projects/synthetic/maven-expected-output-app.yml +++ b/analyzer/src/funTest/assets/projects/synthetic/maven-expected-output-app.yml @@ -69,7 +69,7 @@ packages: url: "https://gitbox.apache.org/repos/asf/beam.git" revision: "v2.3.0-RC3" path: "" - is_meta_data_only: true + is_metadata_only: true - id: "Maven:org.apache.commons:commons-lang3:3.5" purl: "pkg:maven/org.apache.commons/commons-lang3@3.5" authors: diff --git a/analyzer/src/funTest/assets/projects/synthetic/maven-expected-output-lib.yml b/analyzer/src/funTest/assets/projects/synthetic/maven-expected-output-lib.yml index 1707ebf21ae54..614446dde912f 100644 --- a/analyzer/src/funTest/assets/projects/synthetic/maven-expected-output-lib.yml +++ b/analyzer/src/funTest/assets/projects/synthetic/maven-expected-output-lib.yml @@ -102,7 +102,7 @@ packages: url: "https://gitbox.apache.org/repos/asf/beam.git" revision: "v2.3.0-RC3" path: "" - is_meta_data_only: true + is_metadata_only: true - id: "Maven:org.apache.commons:commons-lang3:3.5" purl: "pkg:maven/org.apache.commons/commons-lang3@3.5" authors: diff --git a/analyzer/src/funTest/assets/projects/synthetic/pub-expected-output-with-flutter-android-and-cocoapods.yml b/analyzer/src/funTest/assets/projects/synthetic/pub-expected-output-with-flutter-android-and-cocoapods.yml index d7f590d0500aa..4829979b18b00 100644 --- a/analyzer/src/funTest/assets/projects/synthetic/pub-expected-output-with-flutter-android-and-cocoapods.yml +++ b/analyzer/src/funTest/assets/projects/synthetic/pub-expected-output-with-flutter-android-and-cocoapods.yml @@ -2039,7 +2039,7 @@ packages: url: "https://github.com/Kotlin/kotlinx.coroutines.git" revision: "" path: "" - is_meta_data_only: true + is_metadata_only: true curations: [] - metadata: id: "Maven:org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.2" diff --git a/analyzer/src/main/kotlin/managers/Pip.kt b/analyzer/src/main/kotlin/managers/Pip.kt index 21a95487f2c13..a6bf219ac7ba4 100644 --- a/analyzer/src/main/kotlin/managers/Pip.kt +++ b/analyzer/src/main/kotlin/managers/Pip.kt @@ -384,7 +384,7 @@ class Pip( }.getOrThrow() // Get the locally available metadata for all installed packages as a fallback. - val installedPackages = getInstalledPackagesWithLocalMetaData(virtualEnvDir, workingDir).associateBy { it.id } + val installedPackages = getInstalledPackagesWithLocalMetadata(virtualEnvDir, workingDir).associateBy { it.id } val fullDependencyTree = jsonMapper.readTree(jsonFile) jsonFile.parentFile.safeDeleteRecursively(force = true) @@ -649,7 +649,7 @@ class Pip( }.getOrDefault(Package.EMPTY.copy(id = id)) } - private fun getInstalledPackagesWithLocalMetaData(virtualEnvDir: File, workingDir: File): List { + private fun getInstalledPackagesWithLocalMetadata(virtualEnvDir: File, workingDir: File): List { val allPackages = listAllInstalledPackages(virtualEnvDir, workingDir) // Invoking 'pip show' once for each package separately is too slow, thus obtain the output for all packages diff --git a/analyzer/src/main/kotlin/managers/utils/MavenSupport.kt b/analyzer/src/main/kotlin/managers/utils/MavenSupport.kt index 732301f59bf90..fdb09afe39f03 100644 --- a/analyzer/src/main/kotlin/managers/utils/MavenSupport.kt +++ b/analyzer/src/main/kotlin/managers/utils/MavenSupport.kt @@ -709,7 +709,7 @@ class MavenSupport(private val workspaceReader: WorkspaceReader) { PackageManager.processProjectVcs(it, vcsFromPackage, *vcsFallbackUrls) } ?: PackageManager.processPackageVcs(vcsFromPackage, *vcsFallbackUrls) - val isSpringMetaDataProject = with(mavenProject) { + val isSpringMetadataProject = with(mavenProject) { listOf("boot", "cloud").any { groupId == "org.springframework.$it" && ( artifactId.startsWith("spring-$it-starter") || @@ -734,7 +734,7 @@ class MavenSupport(private val workspaceReader: WorkspaceReader) { sourceArtifact = sourceRemoteArtifact, vcs = vcsFromPackage, vcsProcessed = vcsProcessed, - isMetaDataOnly = mavenProject.packaging == "pom" || isSpringMetaDataProject, + isMetadataOnly = mavenProject.packaging == "pom" || isSpringMetadataProject, isModified = isBinaryArtifactModified || isSourceArtifactModified ) } diff --git a/analyzer/src/main/kotlin/managers/utils/NuGetAllPackageData.kt b/analyzer/src/main/kotlin/managers/utils/NuGetAllPackageData.kt index 5af250588a74b..c4a4fb2f65390 100644 --- a/analyzer/src/main/kotlin/managers/utils/NuGetAllPackageData.kt +++ b/analyzer/src/main/kotlin/managers/utils/NuGetAllPackageData.kt @@ -85,11 +85,11 @@ internal class NuGetAllPackageData( // See https://docs.microsoft.com/en-us/nuget/reference/nuspec. data class PackageSpec( - val metadata: MetaData + val metadata: Metadata ) @JsonIgnoreProperties(ignoreUnknown = true) - data class MetaData( + data class Metadata( // See https://docs.microsoft.com/en-us/nuget/reference/nuspec#required-metadata-elements val id: String, val version: String, diff --git a/downloader/src/main/kotlin/Downloader.kt b/downloader/src/main/kotlin/Downloader.kt index 838b33d820e1c..974416882b4d7 100644 --- a/downloader/src/main/kotlin/Downloader.kt +++ b/downloader/src/main/kotlin/Downloader.kt @@ -69,7 +69,7 @@ class Downloader(private val config: DownloaderConfiguration) { fun download(pkg: Package, outputDirectory: File): Provenance { verifyOutputDirectory(outputDirectory) - if (pkg.isMetaDataOnly) return UnknownProvenance + if (pkg.isMetadataOnly) return UnknownProvenance val exception = DownloadException("Download failed for '${pkg.id.toCoordinates()}'.") diff --git a/evaluator/src/main/kotlin/PackageRule.kt b/evaluator/src/main/kotlin/PackageRule.kt index d49dfd11c33e2..296fae001712a 100644 --- a/evaluator/src/main/kotlin/PackageRule.kt +++ b/evaluator/src/main/kotlin/PackageRule.kt @@ -129,11 +129,11 @@ open class PackageRule( /** * A [RuleMatcher] that checks whether the [package][pkg] is metadata only. */ - fun isMetaDataOnly() = + fun isMetadataOnly() = object : RuleMatcher { - override val description = "isMetaDataOnly()" + override val description = "isMetadataOnly()" - override fun matches() = pkg.metadata.isMetaDataOnly + override fun matches() = pkg.metadata.isMetadataOnly } /** diff --git a/evaluator/src/test/kotlin/PackageRuleTest.kt b/evaluator/src/test/kotlin/PackageRuleTest.kt index 53f45b96aaeaa..a94bc960bd7c7 100644 --- a/evaluator/src/test/kotlin/PackageRuleTest.kt +++ b/evaluator/src/test/kotlin/PackageRuleTest.kt @@ -130,17 +130,17 @@ class PackageRuleTest : WordSpec() { } } - "isMetaDataOnly()" should { + "isMetadataOnly()" should { "return true for a package that has only metadata" { - val rule = createPackageRule(packageMetaDataOnly) - val matcher = rule.isMetaDataOnly() + val rule = createPackageRule(packageMetadataOnly) + val matcher = rule.isMetadataOnly() matcher.matches() shouldBe true } "return false for a package that has not only metadata" { val rule = createPackageRule(packageWithoutLicense) - val matcher = rule.isMetaDataOnly() + val matcher = rule.isMetadataOnly() matcher.matches() shouldBe false } diff --git a/evaluator/src/test/kotlin/TestData.kt b/evaluator/src/test/kotlin/TestData.kt index 3935db302b536..7b563953f51f0 100644 --- a/evaluator/src/test/kotlin/TestData.kt +++ b/evaluator/src/test/kotlin/TestData.kt @@ -116,9 +116,9 @@ val packageWithVulnerabilities = Package.EMPTY.copy( id = Identifier("Maven:org.ossreviewtoolkit:package-with-vulnerabilities:1.0") ) -val packageMetaDataOnly = Package.EMPTY.copy( +val packageMetadataOnly = Package.EMPTY.copy( id = Identifier("Maven:org.ossreviewtoolkit:package-metadata-only:1.0"), - isMetaDataOnly = true + isMetadataOnly = true ) val packageDependency = Package.EMPTY.copy( @@ -135,7 +135,7 @@ val allPackages = listOf( packageWithOnlyConcludedLicense, packageWithOnlyDeclaredLicense, packageWithConcludedAndDeclaredLicense, - packageMetaDataOnly, + packageMetadataOnly, packageDependency ) @@ -165,7 +165,7 @@ val scopeIncluded = Scope( packageWithConcludedAndDeclaredLicense.toReference(), packageRefDynamicallyLinked, packageRefStaticallyLinked, - packageMetaDataOnly.toReference() + packageMetadataOnly.toReference() ) ) diff --git a/model/src/main/kotlin/Package.kt b/model/src/main/kotlin/Package.kt index e3d38fa20c820..040dd79528643 100644 --- a/model/src/main/kotlin/Package.kt +++ b/model/src/main/kotlin/Package.kt @@ -19,6 +19,7 @@ package org.ossreviewtoolkit.model +import com.fasterxml.jackson.annotation.JsonAlias import com.fasterxml.jackson.annotation.JsonInclude import java.util.SortedSet @@ -119,8 +120,9 @@ data class Package( * Indicates whether the package is just metadata, like e.g. Maven BOM artifacts which only define constraints * for dependency versions. */ + @JsonAlias("is_meta_data_only") @JsonInclude(JsonInclude.Include.NON_DEFAULT) - val isMetaDataOnly: Boolean = false, + val isMetadataOnly: Boolean = false, /** * Indicates whether the source code of the package has been modified compared to the original source code, @@ -172,7 +174,7 @@ data class Package( binaryArtifact = binaryArtifact.takeIf { it != other.binaryArtifact }, sourceArtifact = sourceArtifact.takeIf { it != other.sourceArtifact }, vcs = vcsProcessed.takeIf { it != other.vcsProcessed }?.toCuration(), - isMetaDataOnly = isMetaDataOnly.takeIf { it != other.isMetaDataOnly }, + isMetadataOnly = isMetadataOnly.takeIf { it != other.isMetadataOnly }, isModified = isModified.takeIf { it != other.isModified } ) } diff --git a/model/src/main/kotlin/PackageCurationData.kt b/model/src/main/kotlin/PackageCurationData.kt index d499930c77635..50257587a1d0c 100644 --- a/model/src/main/kotlin/PackageCurationData.kt +++ b/model/src/main/kotlin/PackageCurationData.kt @@ -19,6 +19,7 @@ package org.ossreviewtoolkit.model +import com.fasterxml.jackson.annotation.JsonAlias import com.fasterxml.jackson.annotation.JsonInclude import java.util.SortedSet @@ -89,7 +90,8 @@ data class PackageCurationData( /** * Whether the package is metadata only. */ - val isMetaDataOnly: Boolean? = null, + @JsonAlias("is_meta_data_only") + val isMetadataOnly: Boolean? = null, /** * Whether the package is modified compared to the original source @@ -140,7 +142,7 @@ data class PackageCurationData( sourceArtifact = sourceArtifact ?: original.sourceArtifact, vcs = original.vcs, vcsProcessed = vcsProcessed, - isMetaDataOnly = isMetaDataOnly ?: original.isMetaDataOnly, + isMetadataOnly = isMetadataOnly ?: original.isMetadataOnly, isModified = isModified ?: original.isModified ) @@ -176,7 +178,7 @@ data class PackageCurationData( binaryArtifact = binaryArtifact ?: other.binaryArtifact, sourceArtifact = sourceArtifact ?: other.sourceArtifact, vcs = vcs?.merge(other.vcs ?: vcs) ?: other.vcs, - isMetaDataOnly = isMetaDataOnly ?: other.isMetaDataOnly, + isMetadataOnly = isMetadataOnly ?: other.isMetadataOnly, isModified = isModified ?: other.isModified, declaredLicenseMapping = declaredLicenseMapping.zip(other.declaredLicenseMapping) { value, otherValue -> (value ?: otherValue)!! diff --git a/model/src/test/kotlin/PackageCurationDataTest.kt b/model/src/test/kotlin/PackageCurationDataTest.kt index a5963bf241fd0..2c03f254aa3fa 100644 --- a/model/src/test/kotlin/PackageCurationDataTest.kt +++ b/model/src/test/kotlin/PackageCurationDataTest.kt @@ -47,7 +47,7 @@ class PackageCurationDataTest : WordSpec({ revision = "original", path = "original" ), - isMetaDataOnly = true, + isMetadataOnly = true, isModified = true, declaredLicenseMapping = mapOf("original" to "original".toSpdx()) ) @@ -74,7 +74,7 @@ class PackageCurationDataTest : WordSpec({ revision = "other", path = "other" ), - isMetaDataOnly = false, + isMetadataOnly = false, isModified = false, declaredLicenseMapping = mapOf("other" to "other".toSpdx()) ) @@ -91,7 +91,7 @@ class PackageCurationDataTest : WordSpec({ concludedLicense = null, binaryArtifact = null, vcs = null, - isMetaDataOnly = null, + isMetadataOnly = null, declaredLicenseMapping = emptyMap() ) @@ -101,7 +101,7 @@ class PackageCurationDataTest : WordSpec({ concludedLicense = other.concludedLicense, binaryArtifact = other.binaryArtifact, vcs = other.vcs, - isMetaDataOnly = other.isMetaDataOnly, + isMetadataOnly = other.isMetadataOnly, declaredLicenseMapping = other.declaredLicenseMapping ) } diff --git a/model/src/test/kotlin/PackageCurationTest.kt b/model/src/test/kotlin/PackageCurationTest.kt index 5ee1ce0ba8933..6229ac7487693 100644 --- a/model/src/test/kotlin/PackageCurationTest.kt +++ b/model/src/test/kotlin/PackageCurationTest.kt @@ -46,7 +46,7 @@ class PackageCurationTest : WordSpec({ binaryArtifact = RemoteArtifact.EMPTY, sourceArtifact = RemoteArtifact.EMPTY, vcs = VcsInfo.EMPTY, - isMetaDataOnly = false, + isMetadataOnly = false, isModified = false ) @@ -74,7 +74,7 @@ class PackageCurationTest : WordSpec({ revision = "revision", path = "path" ), - isMetaDataOnly = true, + isMetadataOnly = true, isModified = true ) ) @@ -96,7 +96,7 @@ class PackageCurationTest : WordSpec({ sourceArtifact shouldBe curation.data.sourceArtifact vcs shouldBe pkg.vcs vcsProcessed.toCuration() shouldBe curation.data.vcs - isMetaDataOnly shouldBe true + isMetadataOnly shouldBe true isModified shouldBe true } @@ -126,7 +126,7 @@ class PackageCurationTest : WordSpec({ revision = "revision", path = "path" ), - isMetaDataOnly = false, + isMetadataOnly = false, isModified = false ) @@ -159,7 +159,7 @@ class PackageCurationTest : WordSpec({ revision = pkg.vcs.revision, path = pkg.vcs.path ) - isMetaDataOnly shouldBe false + isMetadataOnly shouldBe false isModified shouldBe false } @@ -242,7 +242,7 @@ class PackageCurationTest : WordSpec({ } } - "be able to clear isMetaDataOnly" { + "be able to clear isMetadataOnly" { val pkg = Package( id = Identifier( type = "Maven", @@ -257,19 +257,19 @@ class PackageCurationTest : WordSpec({ binaryArtifact = RemoteArtifact.EMPTY, sourceArtifact = RemoteArtifact.EMPTY, vcs = VcsInfo.EMPTY, - isMetaDataOnly = true + isMetadataOnly = true ) val curation = PackageCuration( id = pkg.id, data = PackageCurationData( - isMetaDataOnly = false + isMetadataOnly = false ) ) val curatedPkg = curation.apply(pkg.toCuratedPackage()) - curatedPkg.metadata.isMetaDataOnly shouldBe false + curatedPkg.metadata.isMetadataOnly shouldBe false } "be able to clear isModified" { diff --git a/model/src/test/kotlin/PackageTest.kt b/model/src/test/kotlin/PackageTest.kt index 21ad829adf5c2..06903d01132d4 100644 --- a/model/src/test/kotlin/PackageTest.kt +++ b/model/src/test/kotlin/PackageTest.kt @@ -50,7 +50,7 @@ class PackageTest : StringSpec({ binaryArtifact = RemoteArtifact("url", Hash.create("hash")), sourceArtifact = RemoteArtifact("url", Hash.create("hash")), vcs = VcsInfo(VcsType("type"), "url", "revision"), - isMetaDataOnly = false, + isMetadataOnly = false, isModified = false ) @@ -68,7 +68,7 @@ class PackageTest : StringSpec({ binaryArtifact = RemoteArtifact("other url", Hash.create("other hash")), sourceArtifact = RemoteArtifact("other url", Hash.create("other hash")), vcs = VcsInfo(VcsType("other type"), "other url", "other revision"), - isMetaDataOnly = true, + isMetadataOnly = true, isModified = true ) @@ -80,7 +80,7 @@ class PackageTest : StringSpec({ diff.homepageUrl shouldBe pkg.homepageUrl diff.sourceArtifact shouldBe pkg.sourceArtifact diff.vcs shouldBe pkg.vcsProcessed.toCuration() - diff.isMetaDataOnly shouldBe pkg.isMetaDataOnly + diff.isMetadataOnly shouldBe pkg.isMetadataOnly diff.isModified shouldBe pkg.isModified } @@ -109,6 +109,6 @@ class PackageTest : StringSpec({ diff.homepageUrl should beNull() diff.sourceArtifact should beNull() diff.vcs should beNull() - diff.isMetaDataOnly should beNull() + diff.isMetadataOnly should beNull() } }) diff --git a/reporter-web-app/src/components/AboutModal.js b/reporter-web-app/src/components/AboutModal.js index a6244e5b94057..dae5ebcd4984b 100644 --- a/reporter-web-app/src/components/AboutModal.js +++ b/reporter-web-app/src/components/AboutModal.js @@ -49,10 +49,10 @@ const AboutModal = (props) => { const { repositoryConfiguration } = webAppOrtResult; const { labels, - metaData + metadata } = webAppOrtResult; - const { analyzerStartTime } = metaData; + const { analyzerStartTime } = metadata; const analyzerStartDate = new Date(analyzerStartTime).toLocaleDateString( undefined, { diff --git a/reporter-web-app/src/models/MetaData.js b/reporter-web-app/src/models/Metadata.js similarity index 96% rename from reporter-web-app/src/models/MetaData.js rename to reporter-web-app/src/models/Metadata.js index 52ad90a30e3f6..a4c6321a59fe2 100644 --- a/reporter-web-app/src/models/MetaData.js +++ b/reporter-web-app/src/models/Metadata.js @@ -18,7 +18,7 @@ * License-Filename: LICENSE */ -class MetaData { +class Metadata { #analyzerStartTime; constructor(obj) { @@ -34,4 +34,4 @@ class MetaData { } } -export default MetaData; +export default Metadata; diff --git a/reporter-web-app/src/models/WebAppOrtResult.js b/reporter-web-app/src/models/WebAppOrtResult.js index 8cbb379a92ab1..adafb0ab9ab16 100644 --- a/reporter-web-app/src/models/WebAppOrtResult.js +++ b/reporter-web-app/src/models/WebAppOrtResult.js @@ -18,7 +18,7 @@ * License-Filename: LICENSE */ -import MetaData from './MetaData'; +import Metadata from './Metadata'; import Repository from './Repository'; import Statistics from './Statistics'; import WebAppCopyright from './WebAppCopyright'; @@ -70,7 +70,7 @@ class WebAppOrtResult { #licensesIndexesByNameMap = new Map(); - #metaData = {}; + #metadata = {}; #packages = []; @@ -130,8 +130,8 @@ class WebAppOrtResult { } } - if (obj.meta_data || obj.metaData) { - this.#metaData = new MetaData(obj.meta_data || obj.metaData); + if (obj.meta_data || obj.metaData || obj.metadata) { + this.#metadata = new Metadata(obj.meta_data || obj.metaData || obj.metadata); } if (obj.packages) { @@ -427,8 +427,8 @@ class WebAppOrtResult { return this.#licenses; } - get metaData() { - return this.#metaData; + get metadata() { + return this.#metadata; } get packages() { diff --git a/reporter/src/funTest/assets/evaluated-model-reporter-test-deduplicate-expected-output.yml b/reporter/src/funTest/assets/evaluated-model-reporter-test-deduplicate-expected-output.yml index 9b8c211b096b4..c0d128dabbd39 100644 --- a/reporter/src/funTest/assets/evaluated-model-reporter-test-deduplicate-expected-output.yml +++ b/reporter/src/funTest/assets/evaluated-model-reporter-test-deduplicate-expected-output.yml @@ -964,5 +964,5 @@ labels: process_parameters.PROCESS_PARAM_1: "label process param 1" process_parameters.PROCESS_PARAM_2: "label process param 2" OTHER: "label other" -meta_data: +metadata: analyzer_start_time: "1970-01-01T00:00:00Z" diff --git a/reporter/src/funTest/assets/evaluated-model-reporter-test-expected-output.json b/reporter/src/funTest/assets/evaluated-model-reporter-test-expected-output.json index d33a15da8397f..08711af73c183 100644 --- a/reporter/src/funTest/assets/evaluated-model-reporter-test-expected-output.json +++ b/reporter/src/funTest/assets/evaluated-model-reporter-test-expected-output.json @@ -1062,7 +1062,7 @@ "process_parameters.PROCESS_PARAM_2" : "label process param 2", "OTHER" : "label other" }, - "meta_data" : { + "metadata" : { "analyzer_start_time" : "1970-01-01T00:00:00Z" } } \ No newline at end of file diff --git a/reporter/src/funTest/assets/evaluated-model-reporter-test-expected-output.yml b/reporter/src/funTest/assets/evaluated-model-reporter-test-expected-output.yml index 15ae2d339f840..94835a3a6eb1e 100644 --- a/reporter/src/funTest/assets/evaluated-model-reporter-test-expected-output.yml +++ b/reporter/src/funTest/assets/evaluated-model-reporter-test-expected-output.yml @@ -968,5 +968,5 @@ labels: process_parameters.PROCESS_PARAM_1: "label process param 1" process_parameters.PROCESS_PARAM_2: "label process param 2" OTHER: "label other" -meta_data: +metadata: analyzer_start_time: "1970-01-01T00:00:00Z" diff --git a/reporter/src/main/kotlin/reporters/evaluatedmodel/EvaluatedModel.kt b/reporter/src/main/kotlin/reporters/evaluatedmodel/EvaluatedModel.kt index d344d08cda623..d1de49defb740 100644 --- a/reporter/src/main/kotlin/reporters/evaluatedmodel/EvaluatedModel.kt +++ b/reporter/src/main/kotlin/reporters/evaluatedmodel/EvaluatedModel.kt @@ -119,7 +119,7 @@ data class EvaluatedModel( val labels: Map, - val metaData: MetaData + val metadata: Metadata ) { companion object { private val INT_ID_TYPES = listOf( diff --git a/reporter/src/main/kotlin/reporters/evaluatedmodel/EvaluatedModelMapper.kt b/reporter/src/main/kotlin/reporters/evaluatedmodel/EvaluatedModelMapper.kt index 2d5a182cecd3b..69ccad759a7df 100644 --- a/reporter/src/main/kotlin/reporters/evaluatedmodel/EvaluatedModelMapper.kt +++ b/reporter/src/main/kotlin/reporters/evaluatedmodel/EvaluatedModelMapper.kt @@ -145,7 +145,7 @@ internal class EvaluatedModelMapper(private val input: ReporterInput) { severeRuleViolationThreshold = input.ortConfig.severeRuleViolationThreshold, repositoryConfiguration = yamlMapper.writeValueAsString(input.ortResult.repository.config), labels = input.ortResult.labels, - metaData = MetaDataCalculator().getMetaData(input.ortResult) + metadata = MetadataCalculator().getMetadata(input.ortResult) ) } diff --git a/reporter/src/main/kotlin/reporters/evaluatedmodel/MetaData.kt b/reporter/src/main/kotlin/reporters/evaluatedmodel/Metadata.kt similarity index 97% rename from reporter/src/main/kotlin/reporters/evaluatedmodel/MetaData.kt rename to reporter/src/main/kotlin/reporters/evaluatedmodel/Metadata.kt index 39b9e551a6914..b8eb2be2365d0 100644 --- a/reporter/src/main/kotlin/reporters/evaluatedmodel/MetaData.kt +++ b/reporter/src/main/kotlin/reporters/evaluatedmodel/Metadata.kt @@ -25,7 +25,7 @@ import java.time.Instant /** * Metadata about the ORT run itself. */ -data class MetaData( +data class Metadata( /** * The time the Analyzer started. */ diff --git a/reporter/src/main/kotlin/reporters/evaluatedmodel/MetaDataCalculator.kt b/reporter/src/main/kotlin/reporters/evaluatedmodel/MetadataCalculator.kt similarity index 86% rename from reporter/src/main/kotlin/reporters/evaluatedmodel/MetaDataCalculator.kt rename to reporter/src/main/kotlin/reporters/evaluatedmodel/MetadataCalculator.kt index 9b46467a07c60..f6c958f9b9d56 100644 --- a/reporter/src/main/kotlin/reporters/evaluatedmodel/MetaDataCalculator.kt +++ b/reporter/src/main/kotlin/reporters/evaluatedmodel/MetadataCalculator.kt @@ -25,10 +25,10 @@ import java.time.Instant import org.ossreviewtoolkit.model.OrtResult /** - * This class calculates [MetaData] for a given [OrtResult]. + * This class calculates [Metadata] for a given [OrtResult]. */ -internal class MetaDataCalculator { - fun getMetaData(ortResult: OrtResult) = MetaData( +internal class MetadataCalculator { + fun getMetadata(ortResult: OrtResult) = Metadata( analyzerStartTime = ortResult.analyzer?.startTime ?: Instant.now() ) } diff --git a/scanner/src/main/kotlin/PathScanner.kt b/scanner/src/main/kotlin/PathScanner.kt index 6f6074df5a710..738a8c7ddfec2 100644 --- a/scanner/src/main/kotlin/PathScanner.kt +++ b/scanner/src/main/kotlin/PathScanner.kt @@ -81,7 +81,7 @@ abstract class PathScanner( logger.info { "Searching $scannerName scan results for ${packages.size} package(s)..." } val remainingPackages = packages.filterTo(mutableListOf()) { pkg -> - !pkg.isMetaDataOnly.also { + !pkg.isMetadataOnly.also { if (it) logger.debug { "Skipping '${pkg.id.toCoordinates()}' as it is metadata only." } } } diff --git a/scanner/src/main/kotlin/experimental/ExperimentalScanner.kt b/scanner/src/main/kotlin/experimental/ExperimentalScanner.kt index 5e7ebc1f47a47..7889de6857846 100644 --- a/scanner/src/main/kotlin/experimental/ExperimentalScanner.kt +++ b/scanner/src/main/kotlin/experimental/ExperimentalScanner.kt @@ -98,7 +98,7 @@ class ExperimentalScanner( val packageResults = if (packageScannerWrappers.isNotEmpty()) { val packages = ortResult.getPackages(skipExcluded).map { it.metadata }.filterNotConcluded() - .filterNotMetaDataOnly().toSet() + .filterNotMetadataOnly().toSet() logger.info { "Scanning ${packages.size} package(s) with ${packageScannerWrappers.size} scanner(s)." } @@ -371,8 +371,8 @@ class ExperimentalScanner( keep } - private fun Collection.filterNotMetaDataOnly(): List = - partition { it.isMetaDataOnly }.let { (skip, keep) -> + private fun Collection.filterNotMetadataOnly(): List = + partition { it.isMetadataOnly }.let { (skip, keep) -> if (skip.isNotEmpty()) { logger.debug { "Not scanning the following package(s) which are metadata only: $skip"