This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new 7742f7ff057 [improve][build] Use public Gradle build scans for PRs and
cleanup workflows (#25439)
7742f7ff057 is described below
commit 7742f7ff057e885dd482a3cb9297be4b7f7e657a
Author: Lari Hotari <[email protected]>
AuthorDate: Tue Mar 31 15:01:45 2026 +0300
[improve][build] Use public Gradle build scans for PRs and cleanup
workflows (#25439)
---
.github/actions/setup-gradle/action.yml | 60 +++++++++++++++++++
.github/actions/ssh-access/action.yml | 5 +-
.github/workflows/ci-go-functions.yaml | 3 -
.github/workflows/ci-gradle-cache-update.yaml | 5 +-
.github/workflows/ci-semantic-pull-request.yml | 2 +-
.github/workflows/codeql.yaml | 6 +-
.github/workflows/labeler.yml | 4 ++
.github/workflows/pulsar-ci-flaky.yaml | 13 +----
.github/workflows/pulsar-ci.yaml | 80 ++++++--------------------
pulsar-build/run_unit_group_gradle.sh | 3 -
10 files changed, 94 insertions(+), 87 deletions(-)
diff --git a/.github/actions/setup-gradle/action.yml
b/.github/actions/setup-gradle/action.yml
new file mode 100644
index 00000000000..c7f2518a232
--- /dev/null
+++ b/.github/actions/setup-gradle/action.yml
@@ -0,0 +1,60 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+name: Setup Gradle
+description: Sets up Gradle with Develocity or public build scan publishing by
default
+inputs:
+ develocity-access-key:
+ description: 'Develocity access key for authenticated build scans'
+ required: false
+ default: ''
+ build-scan-publish:
+ description: 'Whether to publish build scans or use Develocity when the
access key is set'
+ required: false
+ default: 'true'
+ cache-read-only:
+ description: 'Whether the Gradle cache is read-only'
+ required: false
+ default: ${{ github.event.repository != null && github.ref_name !=
github.event.repository.default_branch }}
+ add-job-summary:
+ description: 'When to add a job summary'
+ required: false
+ default: 'always'
+runs:
+ using: composite
+ steps:
+ - name: Setup Gradle with Develocity
+ if: ${{ inputs.develocity-access-key != '' && inputs.build-scan-publish
== 'true' }}
+ uses:
gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f
+ with:
+ develocity-injection-enabled: true
+ develocity-url: https://develocity.apache.org
+ develocity-access-key: ${{ inputs.develocity-access-key }}
+ cache-read-only: ${{ inputs.cache-read-only }}
+ add-job-summary: ${{ inputs.add-job-summary }}
+
+ - name: Setup Gradle
+ if: ${{ !(inputs.develocity-access-key != '' &&
inputs.build-scan-publish == 'true') }}
+ uses:
gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f
+ with:
+ build-scan-publish: ${{ inputs.build-scan-publish }}
+ build-scan-terms-of-use-url: 'https://gradle.com/terms-of-service'
+ build-scan-terms-of-use-agree: 'yes'
+ cache-read-only: ${{ inputs.cache-read-only }}
+ add-job-summary: ${{ inputs.add-job-summary }}
\ No newline at end of file
diff --git a/.github/actions/ssh-access/action.yml
b/.github/actions/ssh-access/action.yml
index 2c8f0a01648..89f9b74e604 100644
--- a/.github/actions/ssh-access/action.yml
+++ b/.github/actions/ssh-access/action.yml
@@ -138,7 +138,8 @@ runs:
if command -v upterm &>/dev/null; then
shopt -s nullglob
echo "SSH connection information"
- upterm session current --admin-socket ~/.upterm/*.sock || {
+ export UPTERM_ADMIN_SOCKET=$(find $HOME/.upterm
$XDG_RUNTIME_DIR/upterm /run/user/$(id -u)/upterm -name "*.sock" | head -n 1)
+ upterm session current || {
echo "upterm isn't running. Not waiting any longer."
exit 0
}
@@ -146,7 +147,7 @@ runs:
echo "Waiting $timeout seconds..."
sleep $timeout
echo "Keep waiting as long as there's a connected session"
- while upterm session current --admin-socket
~/.upterm/*.sock|grep Connected &>/dev/null; do
+ while upterm session current|grep Connected &>/dev/null; do
sleep 30
done
echo "No session is connected. Not waiting any longer."
diff --git a/.github/workflows/ci-go-functions.yaml
b/.github/workflows/ci-go-functions.yaml
index 1581e853e24..9e57b4f8b5e 100644
--- a/.github/workflows/ci-go-functions.yaml
+++ b/.github/workflows/ci-go-functions.yaml
@@ -31,9 +31,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
-env:
- MAVEN_OPTS: -Xss1500k -Xmx1024m
-Daether.connector.http.reuseConnections=false
-Daether.connector.requestTimeout=60000 -Dhttp.keepAlive=false
-Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard
-Dmaven.wagon.http.retryHandler.count=3
-Dmaven.wagon.http.retryHandler.requestSentEnabled=true
-Dmaven.wagon.http.serviceUnavailableRetryStrategy.class=standard
-Dmaven.wagon.rto=60000
-
jobs:
preconditions:
name: Preconditions
diff --git a/.github/workflows/ci-gradle-cache-update.yaml
b/.github/workflows/ci-gradle-cache-update.yaml
index 610a3312e66..6f417745d6c 100644
--- a/.github/workflows/ci-gradle-cache-update.yaml
+++ b/.github/workflows/ci-gradle-cache-update.yaml
@@ -65,7 +65,10 @@ jobs:
java-version: 21
- name: Setup Gradle
- uses:
gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f
+ uses: ./.github/actions/setup-gradle
+ with:
+ develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
+ cache-read-only: false
- name: Run Gradle build
run: |
diff --git a/.github/workflows/ci-semantic-pull-request.yml
b/.github/workflows/ci-semantic-pull-request.yml
index 15ac8509024..bd552b41996 100644
--- a/.github/workflows/ci-semantic-pull-request.yml
+++ b/.github/workflows/ci-semantic-pull-request.yml
@@ -34,7 +34,7 @@ jobs:
name: Check pull request title
runs-on: ubuntu-latest
steps:
- - uses: amannn/[email protected]
+ - uses:
amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 #
v6.1.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml
index ccf93219b8f..7f6c5480f2d 100644
--- a/.github/workflows/codeql.yaml
+++ b/.github/workflows/codeql.yaml
@@ -62,10 +62,10 @@ jobs:
uses: actions/checkout@v6
- name: Setup Gradle
- uses:
gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f
+ uses: ./.github/actions/setup-gradle
with:
- develocity-injection-enabled: true
- develocity-url: https://develocity.apache.org
+ develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
+ cache-read-only: true
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml
index 25e6c38f836..6a69a424be1 100644
--- a/.github/workflows/labeler.yml
+++ b/.github/workflows/labeler.yml
@@ -19,6 +19,10 @@ name: "Pull Request Labeler"
on:
- pull_request_target
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
+ cancel-in-progress: true
+
jobs:
triage:
permissions:
diff --git a/.github/workflows/pulsar-ci-flaky.yaml
b/.github/workflows/pulsar-ci-flaky.yaml
index 159f1ddbf6e..041970735a9 100644
--- a/.github/workflows/pulsar-ci-flaky.yaml
+++ b/.github/workflows/pulsar-ci-flaky.yaml
@@ -166,7 +166,6 @@ jobs:
env:
JOB_NAME: Flaky tests suite
COLLECT_COVERAGE: "${{ needs.preconditions.outputs.collect_coverage }}"
- DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
CI_JDK_MAJOR_VERSION: ${{ needs.preconditions.outputs.jdk_major_version
}}
TRACE_TEST_RESOURCE_CLEANUP: ${{ github.event_name ==
'workflow_dispatch' && github.event.inputs.trace_test_resource_cleanup || 'off'
}}
TRACE_TEST_RESOURCE_CLEANUP_DIR: ${{ github.workspace
}}/target/trace-test-resource-cleanup
@@ -203,11 +202,10 @@ jobs:
java-version: ${{ env.CI_JDK_MAJOR_VERSION }}
- name: Setup Gradle
- uses:
gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f
+ uses: ./.github/actions/setup-gradle
with:
+ develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
cache-read-only: false
- develocity-injection-enabled: true
- develocity-url: https://develocity.apache.org
- name: Run unit test group BROKER_FLAKY
run: |
@@ -221,13 +219,6 @@ jobs:
if: ${{ always() }}
uses: ./.github/actions/copy-test-reports
- - name: Publish Test Report
- uses: apache/pulsar-test-infra/action-junit-report@master
- if: ${{ always() }}
- with:
- report_paths: 'test-reports/TEST-*.xml'
- annotate_only: 'true'
-
- name: Report detected thread leaks
if: ${{ always() }}
run: |
diff --git a/.github/workflows/pulsar-ci.yaml b/.github/workflows/pulsar-ci.yaml
index f6dceda881e..35d7ab41318 100644
--- a/.github/workflows/pulsar-ci.yaml
+++ b/.github/workflows/pulsar-ci.yaml
@@ -149,7 +149,6 @@ jobs:
name: Build and License check
env:
JOB_NAME: Build and License check
- DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
CI_JDK_MAJOR_VERSION: ${{ needs.preconditions.outputs.jdk_major_version
}}
runs-on: ubuntu-24.04
timeout-minutes: 60
@@ -176,15 +175,12 @@ jobs:
java-version: ${{ env.CI_JDK_MAJOR_VERSION }}
- name: Setup Gradle
- uses:
gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f
+ uses: ./.github/actions/setup-gradle
with:
- develocity-injection-enabled: true
- develocity-url: https://develocity.apache.org
- add-job-summary: always
+ develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
+ cache-read-only: false
- name: Build, check licenses and code style
- # --no-configuration-cache: Shadow plugin's filesMatching { filter { }
} lambdas
- # capture Gradle script references that can't be serialized by the
configuration cache.
run: >-
./gradlew assemble rat spotlessCheck checkstyleMain checkstyleTest
--no-configuration-cache
@@ -232,7 +228,6 @@ jobs:
name: CI - Unit - ${{ matrix.name }}
env:
JOB_NAME: CI - Unit - ${{ matrix.name }}
- DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
CI_JDK_MAJOR_VERSION: ${{ needs.preconditions.outputs.jdk_major_version
}}
TRACE_TEST_RESOURCE_CLEANUP: ${{ github.event_name ==
'workflow_dispatch' && github.event.inputs.trace_test_resource_cleanup || 'off'
}}
TRACE_TEST_RESOURCE_CLEANUP_DIR: ${{ github.workspace
}}/build/trace-test-resource-cleanup
@@ -303,11 +298,9 @@ jobs:
java-version: ${{ matrix.jdk || env.CI_JDK_MAJOR_VERSION }}
- name: Setup Gradle
- uses:
gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f
+ uses: ./.github/actions/setup-gradle
with:
- develocity-injection-enabled: true
- develocity-url: https://develocity.apache.org
- add-job-summary: always
+ develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: Restore build outputs from build job
uses: actions/download-artifact@v8
@@ -334,13 +327,6 @@ jobs:
if: ${{ always() }}
uses: ./.github/actions/copy-test-reports
- - name: Publish Test Report
- uses: apache/pulsar-test-infra/action-junit-report@master
- if: ${{ always() }}
- with:
- report_paths: 'test-reports/TEST-*.xml'
- annotate_only: 'true'
-
- name: Report detected thread leaks
if: ${{ always() }}
run: |
@@ -393,7 +379,6 @@ jobs:
needs: ['preconditions', 'build-and-license-check']
if: ${{ needs.preconditions.outputs.docs_only != 'true' }}
env:
- DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
CI_JDK_MAJOR_VERSION: ${{ needs.preconditions.outputs.jdk_major_version
}}
steps:
- name: checkout
@@ -409,11 +394,9 @@ jobs:
java-version: ${{ env.CI_JDK_MAJOR_VERSION }}
- name: Setup Gradle
- uses:
gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f
+ uses: ./.github/actions/setup-gradle
with:
- develocity-injection-enabled: true
- develocity-url: https://develocity.apache.org
- add-job-summary: always
+ develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: Build with Gradle
run: ./gradlew assemble
@@ -425,7 +408,6 @@ jobs:
needs: ['preconditions', 'build-and-license-check']
if: ${{ needs.preconditions.outputs.docs_only != 'true' }}
env:
- DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
CI_JDK_MAJOR_VERSION: ${{ needs.preconditions.outputs.jdk_major_version
}}
steps:
- name: checkout
@@ -448,11 +430,9 @@ jobs:
java-version: ${{ env.CI_JDK_MAJOR_VERSION }}
- name: Setup Gradle
- uses:
gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f
+ uses: ./.github/actions/setup-gradle
with:
- develocity-injection-enabled: true
- develocity-url: https://develocity.apache.org
- add-job-summary: always
+ develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: Restore build outputs from build job
uses: actions/download-artifact@v8
@@ -493,7 +473,6 @@ jobs:
env:
JOB_NAME: CI - Integration - ${{ matrix.name }}
PULSAR_TEST_IMAGE_NAME: apachepulsar/java-test-image:latest
- DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
CI_JDK_MAJOR_VERSION: ${{ needs.preconditions.outputs.jdk_major_version
}}
strategy:
fail-fast: false
@@ -562,11 +541,9 @@ jobs:
java-version: ${{ env.CI_JDK_MAJOR_VERSION }}
- name: Setup Gradle
- uses:
gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f
+ uses: ./.github/actions/setup-gradle
with:
- develocity-injection-enabled: true
- develocity-url: https://develocity.apache.org
- add-job-summary: always
+ develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: Restore build outputs from build job
uses: actions/download-artifact@v8
@@ -609,13 +586,6 @@ jobs:
if: ${{ always() }}
uses: ./.github/actions/copy-test-reports
- - name: Publish Test Report
- uses: apache/pulsar-test-infra/action-junit-report@master
- if: ${{ always() }}
- with:
- report_paths: 'test-reports/TEST-*.xml'
- annotate_only: 'true'
-
- name: Upload test reports
uses: actions/upload-artifact@v7
if: ${{ !success() }}
@@ -661,7 +631,6 @@ jobs:
needs: ['preconditions', 'build-and-license-check']
if: ${{ needs.preconditions.outputs.docs_only != 'true' }}
env:
- DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
CI_JDK_MAJOR_VERSION: ${{ needs.preconditions.outputs.jdk_major_version
}}
steps:
- name: checkout
@@ -684,11 +653,9 @@ jobs:
java-version: ${{ env.CI_JDK_MAJOR_VERSION }}
- name: Setup Gradle
- uses:
gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f
+ uses: ./.github/actions/setup-gradle
with:
- develocity-injection-enabled: true
- develocity-url: https://develocity.apache.org
- add-job-summary: always
+ develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: Restore build outputs from build job
uses: actions/download-artifact@v8
@@ -754,7 +721,6 @@ jobs:
env:
JOB_NAME: CI - System - ${{ matrix.name }}
PULSAR_TEST_IMAGE_NAME: apachepulsar/pulsar-test-latest-version:latest
- DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
CI_JDK_MAJOR_VERSION: ${{ needs.preconditions.outputs.jdk_major_version
}}
strategy:
fail-fast: false
@@ -802,11 +768,9 @@ jobs:
java-version: ${{ env.CI_JDK_MAJOR_VERSION }}
- name: Setup Gradle
- uses:
gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f
+ uses: ./.github/actions/setup-gradle
with:
- develocity-injection-enabled: true
- develocity-url: https://develocity.apache.org
- add-job-summary: always
+ develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: Restore build outputs from build job
uses: actions/download-artifact@v8
@@ -837,13 +801,6 @@ jobs:
if: ${{ always() }}
uses: ./.github/actions/copy-test-reports
- - name: Publish Test Report
- uses: apache/pulsar-test-infra/action-junit-report@master
- if: ${{ always() }}
- with:
- report_paths: 'test-reports/TEST-*.xml'
- annotate_only: 'true'
-
- name: Upload test reports
uses: actions/upload-artifact@v7
if: ${{ !success() }}
@@ -893,7 +850,6 @@ jobs:
contents: read
security-events: write
env:
- DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
CI_JDK_MAJOR_VERSION: ${{ needs.preconditions.outputs.jdk_major_version
}}
CODEQL_LANGUAGE: java-kotlin
steps:
@@ -918,11 +874,9 @@ jobs:
java-version: ${{ env.CI_JDK_MAJOR_VERSION }}
- name: Setup Gradle
- uses:
gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f
+ uses: ./.github/actions/setup-gradle
with:
- develocity-injection-enabled: true
- develocity-url: https://develocity.apache.org
- add-job-summary: always
+ develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
diff --git a/pulsar-build/run_unit_group_gradle.sh
b/pulsar-build/run_unit_group_gradle.sh
index 72d0ff4e14c..58bc30eaeb2 100755
--- a/pulsar-build/run_unit_group_gradle.sh
+++ b/pulsar-build/run_unit_group_gradle.sh
@@ -45,9 +45,6 @@ function gradle_test() {
continue_args="--continue"
fi
echo "::group::Run tests for " "$@"
- # --no-configuration-cache: required because the Shadow plugin's
filesMatching { filter { } }
- # lambdas in shaded JAR builds capture Gradle script references that can't
be serialized.
- # This is a known Shadow plugin limitation tracked upstream.
./gradlew --no-configuration-cache $continue_args "$@" $failfast_args
"${COMMANDLINE_ARGS[@]}"
echo "::endgroup::"
set +x