Skip to content

Commit 16258cf

Browse files
committed
Publish build scans to develocity.apache.org for build insights
1 parent d69d7ef commit 16258cf

File tree

8 files changed

+49
-1
lines changed

8 files changed

+49
-1
lines changed

.github/workflows/gradle.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
env:
5757
# publishToMavenLocal causes a GH API requests, use the token for those requests
5858
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
5960
run: |
6061
./gradlew check sourceTarball distTar distZip publishToMavenLocal \
6162
-x :polaris-runtime-service:test \
@@ -94,6 +95,8 @@ jobs:
9495
- name: Prepare Gradle build cache
9596
uses: ./.github/actions/ci-incr-build-cache-prepare
9697
- name: Run Quarkus tests
98+
env:
99+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
97100
run: |
98101
./gradlew \
99102
:polaris-runtime-service:test \
@@ -133,6 +136,8 @@ jobs:
133136
uses: ./.github/actions/ci-incr-build-cache-prepare
134137
- name: Run integration tests
135138
run: ./gradlew intTest --continue
139+
env:
140+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
136141
- name: Save partial Gradle build cache
137142
uses: ./.github/actions/ci-incr-build-cache-save
138143
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
@@ -172,5 +177,8 @@ jobs:
172177
with:
173178
cache-read-only: false
174179
- name: Trigger Gradle home cleanup
180+
env:
181+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
175182
run: ./gradlew --no-daemon :showVersion
183+
176184
# Note: the "Post Gradle invocation" archives the updated build cache.

.github/workflows/helm.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ jobs:
8383
minikube docker-env
8484
8585
- name: Image build
86+
env:
87+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
8688
run: |
8789
eval $(minikube -p minikube docker-env)
8890
./gradlew \

.github/workflows/nightly.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,5 @@ jobs:
6262
# publishToApache causes a GH API requests, use the token for those requests
6363
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6464
ORG_GRADLE_PROJECT_apacheUsername: ${{ secrets.NEXUS_USER }}
65-
ORG_GRADLE_PROJECT_apachePassword: ${{ secrets.NEXUS_PW }}
65+
ORG_GRADLE_PROJECT_apachePassword: ${{ secrets.NEXUS_PW }}
66+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}

.github/workflows/python-client.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ jobs:
6464
make client-unit-test
6565
6666
- name: Image build
67+
env:
68+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
6769
run: |
6870
./gradlew \
6971
:polaris-server:assemble \

.github/workflows/regtest.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ jobs:
5252
run: mkdir -p regtests/output && chmod 777 regtests/output && chmod 777 regtests/t_*/ref/*
5353

5454
- name: Image build
55+
env:
56+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
5557
run: |
5658
./gradlew \
5759
:polaris-server:assemble \

.github/workflows/spark_client_regtests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,12 @@ jobs:
5555
env:
5656
# publishToMavenLocal causes a GH API requests, use the token for those requests
5757
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
5859
run: ./gradlew assemble publishToMavenLocal
5960

6061
- name: Image build
62+
env:
63+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
6164
run: |
6265
./gradlew \
6366
:polaris-server:assemble \

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,19 @@ Default configuration values can be found in `runtime/defaults/src/main/resource
136136
```
137137
- See [README in `site/`](site/README.md) for more information.
138138

139+
#### Publishing Build Scans to develocity.apache.org
140+
141+
All authenticated builds of Apache Polaris will automatically publish build scans to the ASF Develocity instance at
142+
[develocity.apache.org](https://develocity.apache.org/scans?search.rootProjectNames=polaris).
143+
144+
CI builds originating from the `apache/polaris` repository will have access to the Apache organization-level secret
145+
`DEVELOCITY_ACCESS_KEY` and publish build scans using the secret. CI builds originating from pull requests from forks
146+
will not have access to the secret and will silently skip build scan publication.
147+
148+
Apache committers can publish build scans from their local machine by
149+
[provisioning an access key](https://docs.gradle.com/develocity/gradle-plugin/current/#automated_access_key_provisioning)
150+
using ASF LDAP credentials. Builds by anonymous, unauthenticated contributors will silently skip build scan publication.
151+
139152
## License
140153

141154
Apache Polaris is under the Apache License Version 2.0. See the [LICENSE](LICENSE).

settings.gradle.kts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ pluginManagement {
109109
}
110110
}
111111

112+
plugins {
113+
id("com.gradle.develocity") version "4.1.1"
114+
id("com.gradle.common-custom-user-data-gradle-plugin") version "2.3"
115+
}
116+
112117
dependencyResolutionManagement {
113118
repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS
114119
repositories {
@@ -126,3 +131,15 @@ gradle.beforeProject {
126131
version = baseVersion
127132
group = "org.apache.polaris"
128133
}
134+
135+
val isCI = System.getenv("CI") != null
136+
137+
develocity {
138+
server = "https://develocity.apache.org"
139+
projectId = "polaris"
140+
buildScan {
141+
uploadInBackground = !isCI
142+
publishing.onlyIf { it.isAuthenticated }
143+
obfuscation { ipAddresses { addresses -> addresses.map { _ -> "0.0.0.0" } } }
144+
}
145+
}

0 commit comments

Comments
 (0)