From 2bf015e1019a62bfb5b813c371950b7af0e37401 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Fri, 24 Oct 2025 11:06:43 -0700 Subject: [PATCH 1/2] Enable Develocity build scans --- .github/workflows/build.yml | 1 + .github/workflows/codeql.yml | 2 ++ settings.gradle.kts | 39 ++++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2f18ba6..85c0f15 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,3 +33,4 @@ jobs: SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }} GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} + DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 3a5c703..550affe 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -57,6 +57,8 @@ jobs: # --no-daemon is required for codeql to observe the compilation # (see https://docs.github.com/en/code-security/codeql-cli/getting-started-with-the-codeql-cli/preparing-your-code-for-codeql-analysis#specifying-build-commands) run: ./gradlew assemble --no-build-cache --no-daemon + env: + DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} - name: Perform CodeQL analysis uses: github/codeql-action/analyze@16140ae1a102900babc80a33c44059580f687047 # v4.30.9 diff --git a/settings.gradle.kts b/settings.gradle.kts index 58d0f1d..60aee87 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -4,11 +4,50 @@ pluginManagement { id("de.undercouch.download") version "5.6.0" id("io.github.gradle-nexus.publish-plugin") version "2.0.0" id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" + id("com.gradle.develocity") version "3.19.2" } } plugins { id("org.gradle.toolchains.foojay-resolver-convention") + id("com.gradle.develocity") +} + +val develocityServer = "https://develocity.opentelemetry.io" +val isCI = System.getenv("CI") != null +val develocityAccessKey = System.getenv("DEVELOCITY_ACCESS_KEY") ?: "" + +// if develocity access key is not given and we are in CI, then we publish to scans.gradle.com +val useScansGradleCom = isCI && develocityAccessKey.isEmpty() + +develocity { + if (useScansGradleCom) { + buildScan { + termsOfUseUrl = "https://gradle.com/help/legal-terms-of-use" + termsOfUseAgree = "yes" + } + } else { + server = develocityServer + buildScan { + publishing.onlyIf { it.isAuthenticated } + } + } + + buildScan { + uploadInBackground = !isCI + + capture { + fileFingerprints = true + } + } +} + +if (!useScansGradleCom) { + buildCache { + remote(develocity.buildCache) { + isPush = isCI && develocityAccessKey.isNotEmpty() + } + } } rootProject.name = "opentelemetry-proto" From 487c3d02ba2d2c6d252d4f9d4b2df95a87a151df Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Sun, 26 Oct 2025 12:32:20 -0700 Subject: [PATCH 2/2] spotless --- settings.gradle.kts | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index 60aee87..ecc398f 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -21,33 +21,33 @@ val develocityAccessKey = System.getenv("DEVELOCITY_ACCESS_KEY") ?: "" val useScansGradleCom = isCI && develocityAccessKey.isEmpty() develocity { - if (useScansGradleCom) { - buildScan { - termsOfUseUrl = "https://gradle.com/help/legal-terms-of-use" - termsOfUseAgree = "yes" - } - } else { - server = develocityServer - buildScan { - publishing.onlyIf { it.isAuthenticated } - } + if (useScansGradleCom) { + buildScan { + termsOfUseUrl = "https://gradle.com/help/legal-terms-of-use" + termsOfUseAgree = "yes" } - + } else { + server = develocityServer buildScan { - uploadInBackground = !isCI + publishing.onlyIf { it.isAuthenticated } + } + } - capture { - fileFingerprints = true - } + buildScan { + uploadInBackground = !isCI + + capture { + fileFingerprints = true } + } } if (!useScansGradleCom) { - buildCache { - remote(develocity.buildCache) { - isPush = isCI && develocityAccessKey.isNotEmpty() - } + buildCache { + remote(develocity.buildCache) { + isPush = isCI && develocityAccessKey.isNotEmpty() } + } } rootProject.name = "opentelemetry-proto"