Skip to content

Commit 8b02fe4

Browse files
committed
Revert "Update develocity config (open-telemetry#12835)"
This reverts commit 80ccda1.
1 parent 8269e57 commit 8b02fe4

File tree

9 files changed

+185
-15
lines changed

9 files changed

+185
-15
lines changed

.github/repository-settings.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ private admin repo.
1010

1111
- `GPG_PASSWORD` - stored in OpenTelemetry-Java 1Password
1212
- `GPG_PRIVATE_KEY` - stored in OpenTelemetry-Java 1Password
13+
- `GRADLE_ENTERPRISE_ACCESS_KEY` - owned by [@trask](https://github.com/trask)
14+
- Generated at https://ge.opentelemetry.io > My settings > Access keys
15+
- Format of env var is `ge.opentelemetry.io=<access key>`,
16+
see [docs](https://docs.gradle.com/enterprise/gradle-plugin/#via_environment_variable)
1317
- `GRADLE_PUBLISH_KEY`
1418
- `GRADLE_PUBLISH_SECRET`
1519
- `NVD_API_KEY` - stored in OpenTelemetry-Java 1Password

.github/workflows/build-common.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ on:
1616
type: boolean
1717
required: false
1818
secrets:
19+
GRADLE_ENTERPRISE_ACCESS_KEY:
20+
required: false
1921
FLAKY_TEST_REPORTER_ACCESS_KEY:
2022
required: false
2123

@@ -43,6 +45,8 @@ jobs:
4345
cache-read-only: ${{ inputs.cache-read-only }}
4446

4547
- name: Spotless
48+
env:
49+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
4650
run: ./gradlew spotlessCheck ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
4751

4852
license-check:
@@ -65,6 +69,8 @@ jobs:
6569
cache-read-only: ${{ inputs.cache-read-only }}
6670

6771
- name: Generate license report
72+
env:
73+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
6874
# with the build cache enabled occasionally produces outdated results
6975
run: ./gradlew generateLicenseReport --no-build-cache
7076

@@ -192,6 +198,8 @@ jobs:
192198
cache-read-only: ${{ inputs.cache-read-only }}
193199

194200
- name: Build
201+
env:
202+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
195203
run: ./gradlew check javadoc sourcesJar spdxSbom -x spotlessCheck -PskipTests=true ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
196204

197205
- name: Check for jApiCmp diffs
@@ -296,6 +304,8 @@ jobs:
296304
cache-read-only: ${{ inputs.cache-read-only || matrix.test-java-version != 11 || matrix.vm != 'hotspot' }}
297305

298306
- name: List tests
307+
env:
308+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
299309
# "check" is needed to activate all tests for listing purposes
300310
# listTestsInPartition writes test tasks that apply to the given partition to a file named
301311
# "test-tasks.txt" and then disables all tasks (including tests) after it runs
@@ -310,6 +320,8 @@ jobs:
310320
echo "test-tasks=$(cat test-tasks.txt | xargs echo | sed 's/\n/ /g')" >> $GITHUB_ENV
311321
312322
- name: Test
323+
env:
324+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
313325
# spotless is checked separately since it's a common source of failure
314326
run: >
315327
./gradlew
@@ -432,11 +444,15 @@ jobs:
432444
cache-read-only: ${{ inputs.cache-read-only || matrix.smoke-test-suite != 'tomcat' }}
433445

434446
- name: Build
447+
env:
448+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
435449
# running suite "none" compiles everything needed by smoke tests without executing any tests
436450
# --no-daemon is used to free up the memory from the build step before running the test step below
437451
run: ./gradlew :smoke-tests:test -PsmokeTestSuite=none --no-daemon ${{ inputs.no-build-cache && ' --no-build-cache' || '' }}
438452

439453
- name: Test
454+
env:
455+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
440456
run: ./gradlew :smoke-tests:test -PsmokeTestSuite=${{ matrix.smoke-test-suite }} ${{ inputs.no-build-cache && ' --no-build-cache' || '' }}
441457

442458
- name: Build scan

.github/workflows/build-daily-no-build-cache.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ jobs:
1515
with:
1616
no-build-cache: true
1717
secrets:
18+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
1819
FLAKY_TEST_REPORTER_ACCESS_KEY: ${{ secrets.FLAKY_TEST_REPORTER_ACCESS_KEY }}
1920

2021
test-latest-deps:
2122
uses: ./.github/workflows/reusable-test-latest-deps.yml
2223
with:
2324
no-build-cache: true
2425
secrets:
26+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
2527
FLAKY_TEST_REPORTER_ACCESS_KEY: ${{ secrets.FLAKY_TEST_REPORTER_ACCESS_KEY }}
2628

2729
# muzzle is not included here because it doesn't use gradle cache anyway and so is already covered

.github/workflows/build-daily.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ jobs:
1313
common:
1414
uses: ./.github/workflows/build-common.yml
1515
secrets:
16+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
1617
FLAKY_TEST_REPORTER_ACCESS_KEY: ${{ secrets.FLAKY_TEST_REPORTER_ACCESS_KEY }}
1718

1819
test-latest-deps:
1920
uses: ./.github/workflows/reusable-test-latest-deps.yml
2021
secrets:
22+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
2123
FLAKY_TEST_REPORTER_ACCESS_KEY: ${{ secrets.FLAKY_TEST_REPORTER_ACCESS_KEY }}
2224

2325
muzzle:

.github/workflows/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
common:
1515
uses: ./.github/workflows/build-common.yml
1616
secrets:
17+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
1718
FLAKY_TEST_REPORTER_ACCESS_KEY: ${{ secrets.FLAKY_TEST_REPORTER_ACCESS_KEY }}
1819

1920
test-latest-deps:
@@ -23,6 +24,7 @@ jobs:
2324
if: "!startsWith(github.ref_name, 'release/')"
2425
uses: ./.github/workflows/reusable-test-latest-deps.yml
2526
secrets:
27+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
2628
FLAKY_TEST_REPORTER_ACCESS_KEY: ${{ secrets.FLAKY_TEST_REPORTER_ACCESS_KEY }}
2729

2830
muzzle:
@@ -80,6 +82,7 @@ jobs:
8082

8183
- name: Build and publish artifact snapshots
8284
env:
85+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
8386
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
8487
SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
8588
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
@@ -88,6 +91,7 @@ jobs:
8891

8992
- name: Build and publish gradle plugin snapshots
9093
env:
94+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
9195
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
9296
SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
9397
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Reusable - Test latest deps
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
cache-read-only:
7+
type: boolean
8+
required: false
9+
no-build-cache:
10+
type: boolean
11+
required: false
12+
secrets:
13+
GRADLE_ENTERPRISE_ACCESS_KEY:
14+
required: false
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
test-indy:
21+
name: testIndy${{ matrix.test-partition }}
22+
runs-on: ubuntu-latest
23+
strategy:
24+
matrix:
25+
test-partition:
26+
- 0
27+
- 1
28+
- 2
29+
- 3
30+
fail-fast: false
31+
steps:
32+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
33+
34+
- name: Free disk space
35+
run: .github/scripts/gha-free-disk-space.sh
36+
37+
- name: Set up JDK for running Gradle
38+
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
39+
with:
40+
distribution: temurin
41+
java-version-file: .java-version
42+
43+
- name: Increase gradle daemon heap size
44+
run: |
45+
sed -i "s/org.gradle.jvmargs=/org.gradle.jvmargs=-Xmx3g /" gradle.properties
46+
47+
# vaadin 14 tests fail with node 18
48+
- name: Set up Node
49+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
50+
with:
51+
node-version: 16
52+
53+
# vaadin tests use pnpm
54+
- name: Cache pnpm modules
55+
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
56+
with:
57+
path: ~/.pnpm-store
58+
key: ${{ runner.os }}-test-latest-cache-pnpm-modules
59+
60+
- name: Setup Gradle
61+
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
62+
with:
63+
cache-read-only: ${{ inputs.cache-read-only }}
64+
# gradle enterprise is used for the build cache
65+
gradle-home-cache-excludes: caches/build-cache-1
66+
67+
- name: List tests
68+
env:
69+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
70+
run: >
71+
./gradlew
72+
check -x spotlessCheck
73+
listTestsInPartition
74+
-PtestPartition=${{ matrix.test-partition }}
75+
76+
- name: Set test tasks
77+
run: |
78+
echo "test-tasks=$(cat test-tasks.txt | xargs echo | sed 's/\n/ /g')" >> $GITHUB_ENV
79+
80+
- name: Test
81+
env:
82+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
83+
run: >
84+
./gradlew
85+
${{ env.test-tasks }}
86+
-PtestIndy=true
87+
${{ inputs.no-build-cache && ' --no-build-cache' || '' }}
88+
89+
- name: Build scan
90+
if: ${{ !cancelled() && hashFiles('build-scan.txt') != '' }}
91+
run: cat build-scan.txt

.github/workflows/reusable-test-latest-deps.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ on:
1010
type: boolean
1111
required: false
1212
secrets:
13+
GRADLE_ENTERPRISE_ACCESS_KEY:
14+
required: false
1315
FLAKY_TEST_REPORTER_ACCESS_KEY:
1416
required: false
1517

@@ -60,6 +62,8 @@ jobs:
6062
cache-read-only: ${{ inputs.cache-read-only }}
6163

6264
- name: List tests
65+
env:
66+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
6367
run: >
6468
./gradlew
6569
check -x spotlessCheck
@@ -72,6 +76,8 @@ jobs:
7276
echo "test-tasks=$(cat test-tasks.txt | xargs echo | sed 's/\n/ /g')" >> $GITHUB_ENV
7377
7478
- name: Test
79+
env:
80+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
7581
run: >
7682
./gradlew
7783
${{ env.test-tasks }}

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -373,12 +373,11 @@ tasks.withType<Test>().configureEach {
373373
// This value is quite big because with lower values (3 mins) we were experiencing large number of false positives
374374
timeout.set(Duration.ofMinutes(15))
375375

376-
val defaultMaxRetries = if (System.getenv().containsKey("CI")) 5 else 0
377-
val maxTestRetries = gradle.startParameter.projectProperties["maxTestRetries"]?.toInt() ?: defaultMaxRetries
378-
379376
develocity.testRetry {
380377
// You can see tests that were retried by this mechanism in the collected test reports and build scans.
381-
maxRetries.set(maxTestRetries);
378+
if (System.getenv().containsKey("CI") || rootProject.hasProperty("retryTests")) {
379+
maxRetries.set(5)
380+
}
382381
}
383382

384383
reports {

settings.gradle.kts

Lines changed: 57 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ pluginManagement {
1414
}
1515

1616
plugins {
17+
id("com.gradle.develocity") version "4.2"
1718
id("com.gradle.common-custom-user-data-gradle-plugin") version "2.4.0"
1819
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
1920
// this can't live in pluginManagement currently due to
@@ -22,7 +23,6 @@ plugins {
2223
// ./gradlew :smoke-tests:images:servlet:buildLinuxTestImages pushMatrix -PsmokeTestServer=jetty
2324
// ./gradlew :smoke-tests:images:servlet:buildWindowsTestImages pushMatrix -PsmokeTestServer=jetty
2425
id("com.bmuschko.docker-remote-api") version "9.4.0" apply false
25-
id("com.gradle.develocity") version "4.2.2"
2626
}
2727

2828
dependencyResolutionManagement {
@@ -47,21 +47,67 @@ dependencyResolutionManagement {
4747
}
4848
}
4949

50-
develocity {
51-
buildScan {
52-
publishing.onlyIf { System.getenv("CI") != null }
53-
termsOfUseUrl.set("https://gradle.com/help/legal-terms-of-use")
54-
termsOfUseAgree.set("yes")
50+
val gradleEnterpriseServer = "https://ge.opentelemetry.io"
51+
val isCI = System.getenv("CI") != null
52+
val geAccessKey = System.getenv("GRADLE_ENTERPRISE_ACCESS_KEY") ?: ""
5553

56-
if (!gradle.startParameter.taskNames.contains("listTestsInPartition") &&
57-
!gradle.startParameter.taskNames.contains(":test-report:reportFlakyTests")) {
58-
buildScanPublished {
59-
File("build-scan.txt").printWriter().use { writer ->
60-
writer.println(buildScanUri)
54+
// if GE access key is not given and we are in CI, then we publish to scans.gradle.com
55+
val useScansGradleCom = isCI && geAccessKey.isEmpty()
56+
57+
if (useScansGradleCom) {
58+
develocity {
59+
buildScan {
60+
termsOfUseUrl = "https://gradle.com/help/legal-terms-of-use"
61+
termsOfUseAgree = "yes"
62+
uploadInBackground = !isCI
63+
64+
capture {
65+
fileFingerprints = true
66+
}
67+
68+
if (!gradle.startParameter.taskNames.contains("listTestsInPartition") &&
69+
!gradle.startParameter.taskNames.contains(":test-report:reportFlakyTests")) {
70+
buildScanPublished {
71+
File("build-scan.txt").printWriter().use { writer ->
72+
writer.println(buildScanUri)
73+
}
74+
}
75+
}
76+
}
77+
}
78+
} else {
79+
develocity {
80+
server = gradleEnterpriseServer
81+
buildScan {
82+
uploadInBackground = !isCI
83+
publishing.onlyIf { it.isAuthenticated }
84+
85+
capture {
86+
fileFingerprints = true
87+
}
88+
89+
gradle.startParameter.projectProperties["testJavaVersion"]?.let { tag(it) }
90+
gradle.startParameter.projectProperties["testJavaVM"]?.let { tag(it) }
91+
gradle.startParameter.projectProperties["smokeTestSuite"]?.let {
92+
value("Smoke test suite", it)
93+
}
94+
95+
if (!gradle.startParameter.taskNames.contains("listTestsInPartition") &&
96+
!gradle.startParameter.taskNames.contains(":test-report:reportFlakyTests")) {
97+
buildScanPublished {
98+
File("build-scan.txt").printWriter().use { writer ->
99+
writer.println(buildScanUri)
100+
}
61101
}
62102
}
63103
}
64104
}
105+
106+
buildCache {
107+
remote(develocity.buildCache) {
108+
isPush = isCI && geAccessKey.isNotEmpty()
109+
}
110+
}
65111
}
66112

67113
rootProject.name = "opentelemetry-java-instrumentation"

0 commit comments

Comments
 (0)