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

Add FOSSA license scanning #1718

Merged
merged 1 commit into from
Feb 10, 2025
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
11 changes: 11 additions & 0 deletions .fossa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 3

targets:
only:
- type: gradle

experimental:
gradle:
configurations-only:
# consumer will only be exposed to these dependencies
- runtimeClasspath
19 changes: 19 additions & 0 deletions .github/workflows/fossa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: FOSSA

on:
push:
branches:
- main

permissions:
contents: read

jobs:
fossa:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- uses: fossas/fossa-action@93a52ecf7c3ac7eb40f5de77fd69b1a19524de94 # v1.5.0
with:
api-key: ${{secrets.FOSSA_API_KEY}}
5 changes: 5 additions & 0 deletions buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ testing {
dependencies {
implementation(project(project.path))

implementation(enforcedPlatform("org.junit:junit-bom:5.11.4"))
implementation(enforcedPlatform("org.testcontainers:testcontainers-bom:1.20.4"))
implementation(enforcedPlatform("com.google.guava:guava-bom:33.4.0-jre"))
implementation(enforcedPlatform("com.linecorp.armeria:armeria-bom:1.31.3"))

compileOnly("com.google.auto.value:auto-value-annotations")
compileOnly("com.google.errorprone:error_prone_annotations")
compileOnly("com.google.code.findbugs:jsr305")
Expand Down
130 changes: 47 additions & 83 deletions dependencyManagement/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,96 +2,60 @@ plugins {
`java-platform`
}

data class DependencySet(val group: String, val version: String, val modules: List<String>)

val dependencyVersions = hashMapOf<String, String>()
rootProject.extra["versions"] = dependencyVersions

val otelInstrumentationVersion = "2.12.0-alpha"

val DEPENDENCY_BOMS = listOf(
"com.fasterxml.jackson:jackson-bom:2.18.2",
"com.google.guava:guava-bom:33.4.0-jre",
"com.linecorp.armeria:armeria-bom:1.31.3",
"org.junit:junit-bom:5.11.4",
"io.grpc:grpc-bom:1.70.0",
"io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:${otelInstrumentationVersion}",
"org.testcontainers:testcontainers-bom:1.20.4"
)

val autoServiceVersion = "1.1.1"
val autoValueVersion = "1.11.0"
val errorProneVersion = "2.36.0"
val prometheusVersion = "0.16.0"
val mockitoVersion = "4.11.0"
val slf4jVersion = "2.0.16"
val semConvVersion = "1.30.0-rc.1"

val CORE_DEPENDENCIES = listOf(
"com.google.auto.service:auto-service:${autoServiceVersion}",
"com.google.auto.service:auto-service-annotations:${autoServiceVersion}",
"com.google.auto.value:auto-value:${autoValueVersion}",
"com.google.auto.value:auto-value-annotations:${autoValueVersion}",
"com.google.errorprone:error_prone_annotations:${errorProneVersion}",
"com.google.errorprone:error_prone_core:${errorProneVersion}",
"io.github.netmikey.logunit:logunit-jul:2.0.0",
"io.opentelemetry.proto:opentelemetry-proto:1.5.0-alpha",
// these two constraints can be removed once the opentelemetry-instrumentation-bom-alpha
// is updated to contain the latest version of opentelemetry-semconv
"io.opentelemetry.semconv:opentelemetry-semconv:${semConvVersion}",
"io.opentelemetry.semconv:opentelemetry-semconv-incubating:${semConvVersion}",
"io.prometheus:simpleclient:${prometheusVersion}",
"io.prometheus:simpleclient_common:${prometheusVersion}",
"io.prometheus:simpleclient_httpserver:${prometheusVersion}",
"org.mockito:mockito-core:${mockitoVersion}",
"org.mockito:mockito-inline:${mockitoVersion}",
"org.mockito:mockito-junit-jupiter:${mockitoVersion}",
"org.slf4j:slf4j-api:${slf4jVersion}",
"org.slf4j:slf4j-simple:${slf4jVersion}",
"org.slf4j:log4j-over-slf4j:${slf4jVersion}",
"org.slf4j:jcl-over-slf4j:${slf4jVersion}",
"org.slf4j:jul-to-slf4j:${slf4jVersion}"
)

val DEPENDENCIES = listOf(
"com.google.code.findbugs:annotations:3.0.1u2",
"com.google.code.findbugs:jsr305:3.0.2",
"com.squareup.okhttp3:okhttp:4.12.0",
"com.uber.nullaway:nullaway:0.12.3",
"org.assertj:assertj-core:3.27.3",
"org.awaitility:awaitility:4.2.2",
"org.bouncycastle:bcpkix-jdk15on:1.70",
"org.junit-pioneer:junit-pioneer:1.9.1",
"org.skyscreamer:jsonassert:1.5.3",
"org.apache.kafka:kafka-clients:3.9.0",
"org.testcontainers:kafka:1.20.4",
"com.lmax:disruptor:3.4.4",
"org.jctools:jctools-core:4.0.5",
"tools.profiler:async-profiler:3.0",
"com.blogspot.mydailyjava:weak-lock-free:0.18",
"org.agrona:agrona:1.22.0"
)
val semconvVersion = "1.30.0-rc.1"

javaPlatform {
allowDependencies()
}

dependencies {
for (bom in DEPENDENCY_BOMS) {
api(enforcedPlatform(bom))
val split = bom.split(':')
dependencyVersions[split[0]] = split[2]
}
// boms that are only used by tests should be added in otel.java-conventions.gradle.kts
// under JvmTestSuite so they don't show up as runtime dependencies in license and vulnerability scans
// (the constraints section below doesn't have this issue, and will only show up
// as runtime dependencies if they are actually used as runtime dependencies)
api(enforcedPlatform("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:${otelInstrumentationVersion}"))
api(enforcedPlatform("com.fasterxml.jackson:jackson-bom:2.18.2"))

constraints {
for (dependency in CORE_DEPENDENCIES) {
api(dependency)
val split = dependency.split(':')
dependencyVersions[split[0]] = split[2]
}
for (dependency in DEPENDENCIES) {
api(dependency)
val split = dependency.split(':')
dependencyVersions[split[0]] = split[2]
}
Comment on lines -86 to -95
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getting rid of this was unrelated, but we don't use the dependencyVersions constants, and inlining the dependencies directly into this section seems so much more straightforward

api("io.opentelemetry.semconv:opentelemetry-semconv:${semconvVersion}")
api("io.opentelemetry.semconv:opentelemetry-semconv-incubating:${semconvVersion}")

api("com.google.auto.service:auto-service:1.1.1")
api("com.google.auto.service:auto-service-annotations:1.1.1")
api("com.google.auto.value:auto-value:1.11.0")
api("com.google.auto.value:auto-value-annotations:1.11.0")
api("com.google.errorprone:error_prone_annotations:2.36.0")
api("com.google.errorprone:error_prone_core:2.36.0")
api("io.github.netmikey.logunit:logunit-jul:2.0.0")
api("io.opentelemetry.proto:opentelemetry-proto:1.5.0-alpha")
api("io.prometheus:simpleclient:0.16.0")
api("io.prometheus:simpleclient_common:0.16.0")
api("io.prometheus:simpleclient_httpserver:0.16.0")
api("org.mockito:mockito-core:4.11.0")
api("org.mockito:mockito-inline:4.11.0")
api("org.mockito:mockito-junit-jupiter:4.11.0")
api("org.slf4j:slf4j-api:2.0.16")
api("org.slf4j:slf4j-simple:2.0.16")
api("org.slf4j:log4j-over-slf4j:2.0.16")
api("org.slf4j:jcl-over-slf4j:2.0.16")
api("org.slf4j:jul-to-slf4j:2.0.16")

api("com.google.code.findbugs:annotations:3.0.1u2")
api("com.google.code.findbugs:jsr305:3.0.2")
api("com.squareup.okhttp3:okhttp:4.12.0")
api("com.uber.nullaway:nullaway:0.12.3")
api("org.assertj:assertj-core:3.27.3")
api("org.awaitility:awaitility:4.2.2")
api("org.bouncycastle:bcpkix-jdk15on:1.70")
api("org.junit-pioneer:junit-pioneer:1.9.1")
api("org.skyscreamer:jsonassert:1.5.3")
api("org.apache.kafka:kafka-clients:3.9.0")
api("org.testcontainers:kafka:1.20.4")
api("com.lmax:disruptor:3.4.4")
api("org.jctools:jctools-core:4.0.5")
api("tools.profiler:async-profiler:3.0")
api("com.blogspot.mydailyjava:weak-lock-free:0.18")
api("org.agrona:agrona:1.22.0")
}
}
2 changes: 1 addition & 1 deletion jmx-metrics/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ val groovyVersion = "3.0.23"
dependencies {
api(platform("org.codehaus.groovy:groovy-bom:$groovyVersion"))

implementation("io.grpc:grpc-netty-shaded")
implementation("io.grpc:grpc-netty-shaded:1.70.0")
implementation("org.codehaus.groovy:groovy-jmx")
implementation("org.codehaus.groovy:groovy")
implementation("io.prometheus:simpleclient")
Expand Down
2 changes: 1 addition & 1 deletion jmx-scraper/test-webapp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ plugins {
description = "JMX metrics scraper - test web application"

dependencies {
providedCompile("jakarta.servlet:jakarta.servlet-api:5.0.0")
compileOnly("jakarta.servlet:jakarta.servlet-api:5.0.0")
}
Loading