Skip to content

Commit 52c18c7

Browse files
authored
Add FOSSA license scanning (#163)
1 parent 70ee253 commit 52c18c7

File tree

5 files changed

+42
-25
lines changed

5 files changed

+42
-25
lines changed

.fossa.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 3
2+
3+
targets:
4+
only:
5+
- type: gradle
6+
7+
experimental:
8+
gradle:
9+
configurations-only:
10+
# consumer will only be exposed to these dependencies
11+
- runtimeClasspath

.github/renovate.json5

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"groupName": "github actions"
1313
},
1414
{
15-
// pin opentelemetry-api dependency to: avoid churn, for conservative api version requirement, and because opentelemetry-api is a compileOnly dependency
15+
// pin opentelemetry-api dependency to: avoid churn, for conservative api version requirement,
16+
// and because opentelemetry-api is a compileOnly dependency
1617
"matchPackageNames": ["io.opentelemetry:opentelemetry-api"],
1718
"matchCurrentVersion": "1.33.0",
1819
"enabled": false

.github/workflows/fossa.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: FOSSA
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
fossa:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
17+
- uses: fossas/fossa-action@93a52ecf7c3ac7eb40f5de77fd69b1a19524de94 # v1.5.0
18+
with:
19+
api-key: ${{secrets.FOSSA_API_KEY}}

buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ testing {
136136
suites.withType(JvmTestSuite::class).configureEach {
137137
dependencies {
138138
implementation(project(project.path))
139+
implementation(enforcedPlatform("org.junit:junit-bom:5.11.4"))
140+
implementation(enforcedPlatform("org.assertj:assertj-bom:3.27.3"))
139141

140142
implementation("org.junit.jupiter:junit-jupiter-api")
141143
implementation("org.junit.jupiter:junit-jupiter-params")

dependencyManagement/build.gradle.kts

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,19 @@ plugins {
22
`java-platform`
33
}
44

5-
data class DependencySet(val group: String, val version: String, val modules: List<String>)
6-
7-
val dependencyVersions = hashMapOf<String, String>()
8-
rootProject.extra["versions"] = dependencyVersions
9-
10-
val DEPENDENCY_BOMS = listOf(
11-
"org.assertj:assertj-bom:3.27.3",
12-
"org.junit:junit-bom:5.11.4",
13-
)
14-
15-
val DEPENDENCIES = listOf(
16-
"io.opentelemetry:opentelemetry-api:1.33.0"
17-
)
18-
195
javaPlatform {
206
allowDependencies()
217
}
228

239
dependencies {
24-
for (bom in DEPENDENCY_BOMS) {
25-
api(enforcedPlatform(bom))
26-
val split = bom.split(':')
27-
dependencyVersions[split[0]] = split[2]
28-
}
10+
// boms that are only used by tests should be added in otel.java-conventions.gradle.kts
11+
// under JvmTestSuite so they don't show up as runtime dependencies in license and vulnerability scans
12+
// (the constraints section below doesn't have this issue, and will only show up
13+
// as runtime dependencies if they are actually used as runtime dependencies)
14+
2915
constraints {
30-
for (dependency in DEPENDENCIES) {
31-
api(dependency)
32-
val split = dependency.split(':')
33-
dependencyVersions[split[0]] = split[2]
34-
}
16+
// pinned to: avoid churn, for conservative api version requirement,
17+
// and because opentelemetry-api is a compileOnly dependency
18+
api("io.opentelemetry:opentelemetry-api:1.33.0")
3519
}
3620
}

0 commit comments

Comments
 (0)