This is an automated email from the ASF dual-hosted git repository. lhotari pushed a commit to branch experiment-ge.apache.org in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit 6297de5ad98d237f94a84a7ec6a95f2a586a09fd Author: Lari Hotari <[email protected]> AuthorDate: Wed Jan 4 20:08:41 2023 +0200 [feat][ci] Add integration to ge.apache.org Gradle Enterprise server --- .github/actions/gradle-enterprise/action.yml | 36 ++++++++++++++ .github/workflows/ci-maven-cache-update.yaml | 7 +++ .github/workflows/ci-owasp-dependency-check.yaml | 9 +++- .github/workflows/pulsar-ci-flaky.yaml | 7 +++ .github/workflows/pulsar-ci.yaml | 62 ++++++++++++++++++++++++ .gitignore | 6 +++ .mvn/ge-extensions.xml | 34 +++++++++++++ .mvn/gradle-enterprise-custom-user-data.groovy | 44 +++++++++++++++++ .mvn/gradle-enterprise.xml | 47 ++++++++++++++++++ 9 files changed, 251 insertions(+), 1 deletion(-) diff --git a/.github/actions/gradle-enterprise/action.yml b/.github/actions/gradle-enterprise/action.yml new file mode 100644 index 00000000000..935e76d3cd6 --- /dev/null +++ b/.github/actions/gradle-enterprise/action.yml @@ -0,0 +1,36 @@ +# +# 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: Configure Gradle Enterprise integration +description: Configure Gradle Enterprise when secret GE_ACCESS_TOKEN is available +inputs: + token: + description: 'The token for accessing Gradle Enterprise' + required: true +runs: + using: composite + steps: + - run: | + if [[ -n "${{ inputs.token }}" ]]; then + echo "::group::Configuring Gradle Enterprise for build" + cp .mvn/ge-extensions.xml .mvn/extensions.xml + echo "GRADLE_ENTERPRISE_ACCESS_KEY=${{ inputs.token }}" >> $GITHUB_ENV + echo "::endgroup::" + fi + shell: bash \ No newline at end of file diff --git a/.github/workflows/ci-maven-cache-update.yaml b/.github/workflows/ci-maven-cache-update.yaml index daba3dcc032..831a2866bea 100644 --- a/.github/workflows/ci-maven-cache-update.yaml +++ b/.github/workflows/ci-maven-cache-update.yaml @@ -47,6 +47,8 @@ env: jobs: update-maven-dependencies-cache: name: Update Maven dependency cache for ${{ matrix.name }} + env: + JOB_NAME: Update Maven dependency cache for ${{ matrix.name }} runs-on: ${{ matrix.runs-on }} timeout-minutes: 45 @@ -75,6 +77,11 @@ jobs: - name: Tune Runner VM uses: ./.github/actions/tune-runner-vm + - name: Configure Gradle Enterprise + uses: ./.github/actions/gradle-enterprise + with: + token: ${{ secrets.GE_ACCESS_TOKEN }} + - name: Detect changed files if: ${{ github.event_name != 'schedule' }} id: changes diff --git a/.github/workflows/ci-owasp-dependency-check.yaml b/.github/workflows/ci-owasp-dependency-check.yaml index 38bd7f9eec4..9ee9c8c46b3 100644 --- a/.github/workflows/ci-owasp-dependency-check.yaml +++ b/.github/workflows/ci-owasp-dependency-check.yaml @@ -28,7 +28,9 @@ env: jobs: run-owasp-dependency-check: if: ${{ github.repository == 'apache/pulsar' }} - name: Run OWASP Dependency Check + name: Run OWASP Dependency Check for ${{ matrix.name }} + env: + JOB_NAME: Run OWASP Dependency Check for ${{ matrix.name }} runs-on: ubuntu-20.04 timeout-minutes: 45 strategy: @@ -55,6 +57,11 @@ jobs: - name: Tune Runner VM uses: ./.github/actions/tune-runner-vm + - name: Configure Gradle Enterprise + uses: ./.github/actions/gradle-enterprise + with: + token: ${{ secrets.GE_ACCESS_TOKEN }} + - name: Cache local Maven repository uses: actions/cache@v3 with: diff --git a/.github/workflows/pulsar-ci-flaky.yaml b/.github/workflows/pulsar-ci-flaky.yaml index 9c52cfe77d6..5f7a278b2eb 100644 --- a/.github/workflows/pulsar-ci-flaky.yaml +++ b/.github/workflows/pulsar-ci-flaky.yaml @@ -69,6 +69,8 @@ jobs: build-and-test: needs: preconditions name: Flaky tests suite + env: + JOB_NAME: Flaky tests suite runs-on: ubuntu-20.04 timeout-minutes: 100 if: ${{ needs.preconditions.outputs.docs_only != 'true' }} @@ -79,6 +81,11 @@ jobs: - name: Tune Runner VM uses: ./.github/actions/tune-runner-vm + - name: Configure Gradle Enterprise + uses: ./.github/actions/gradle-enterprise + with: + token: ${{ secrets.GE_ACCESS_TOKEN }} + - name: Setup ssh access to build runner VM # ssh access is enabled for builds in own forks if: ${{ github.repository != 'apache/pulsar' && github.event_name == 'pull_request' }} diff --git a/.github/workflows/pulsar-ci.yaml b/.github/workflows/pulsar-ci.yaml index 3741d3c8424..fcc5b4ade30 100644 --- a/.github/workflows/pulsar-ci.yaml +++ b/.github/workflows/pulsar-ci.yaml @@ -75,6 +75,8 @@ jobs: build-and-license-check: needs: preconditions name: Build and License check + env: + JOB_NAME: Build and License check runs-on: ubuntu-20.04 timeout-minutes: 60 if: ${{ needs.preconditions.outputs.docs_only != 'true' }} @@ -85,6 +87,11 @@ jobs: - name: Tune Runner VM uses: ./.github/actions/tune-runner-vm + - name: Configure Gradle Enterprise + uses: ./.github/actions/gradle-enterprise + with: + token: ${{ secrets.GE_ACCESS_TOKEN }} + - name: Setup ssh access to build runner VM # ssh access is enabled for builds in own forks if: ${{ github.repository != 'apache/pulsar' && github.event_name == 'pull_request' }} @@ -145,6 +152,8 @@ jobs: unit-tests: name: CI - Unit - ${{ matrix.name }} + env: + JOB_NAME: CI - Unit - ${{ matrix.name }} runs-on: ubuntu-20.04 timeout-minutes: ${{ matrix.timeout || 60 }} needs: ['preconditions', 'build-and-license-check'] @@ -180,6 +189,11 @@ jobs: - name: Tune Runner VM uses: ./.github/actions/tune-runner-vm + - name: Configure Gradle Enterprise + uses: ./.github/actions/gradle-enterprise + with: + token: ${{ secrets.GE_ACCESS_TOKEN }} + - name: Setup ssh access to build runner VM # ssh access is enabled for builds in own forks if: ${{ github.repository != 'apache/pulsar' && github.event_name == 'pull_request' }} @@ -281,6 +295,11 @@ jobs: - name: Tune Runner VM uses: ./.github/actions/tune-runner-vm + - name: Configure Gradle Enterprise + uses: ./.github/actions/gradle-enterprise + with: + token: ${{ secrets.GE_ACCESS_TOKEN }} + - name: Setup ssh access to build runner VM # ssh access is enabled for builds in own forks if: ${{ github.repository != 'apache/pulsar' && github.event_name == 'pull_request' }} @@ -338,6 +357,7 @@ jobs: needs: ['preconditions', 'pulsar-java-test-image'] if: ${{ needs.preconditions.outputs.docs_only != 'true' }} env: + JOB_NAME: CI - Integration - ${{ matrix.name }} PULSAR_TEST_IMAGE_NAME: apachepulsar/java-test-image:latest strategy: fail-fast: false @@ -379,6 +399,11 @@ jobs: - name: Tune Runner VM uses: ./.github/actions/tune-runner-vm + - name: Configure Gradle Enterprise + uses: ./.github/actions/gradle-enterprise + with: + token: ${{ secrets.GE_ACCESS_TOKEN }} + - name: Setup ssh access to build runner VM # ssh access is enabled for builds in own forks if: ${{ github.repository != 'apache/pulsar' && github.event_name == 'pull_request' }} @@ -486,6 +511,11 @@ jobs: - name: Tune Runner VM uses: ./.github/actions/tune-runner-vm + - name: Configure Gradle Enterprise + uses: ./.github/actions/gradle-enterprise + with: + token: ${{ secrets.GE_ACCESS_TOKEN }} + - name: Install gh-actions-artifact-client.js uses: apache/pulsar-test-infra/gh-actions-artifact-client/dist@master @@ -508,6 +538,11 @@ jobs: - name: Tune Runner VM uses: ./.github/actions/tune-runner-vm + - name: Configure Gradle Enterprise + uses: ./.github/actions/gradle-enterprise + with: + token: ${{ secrets.GE_ACCESS_TOKEN }} + - name: Setup ssh access to build runner VM # ssh access is enabled for builds in own forks if: ${{ github.repository != 'apache/pulsar' && github.event_name == 'pull_request' }} @@ -598,6 +633,7 @@ jobs: needs: ['preconditions', 'pulsar-test-latest-version-image'] if: ${{ needs.preconditions.outputs.docs_only != 'true' }} env: + JOB_NAME: CI - System - ${{ matrix.name }} PULSAR_TEST_IMAGE_NAME: apachepulsar/pulsar-test-latest-version:latest strategy: fail-fast: false @@ -634,6 +670,11 @@ jobs: - name: Tune Runner VM uses: ./.github/actions/tune-runner-vm + - name: Configure Gradle Enterprise + uses: ./.github/actions/gradle-enterprise + with: + token: ${{ secrets.GE_ACCESS_TOKEN }} + - name: Setup ssh access to build runner VM # ssh access is enabled for builds in own forks if: ${{ github.repository != 'apache/pulsar' && github.event_name == 'pull_request' }} @@ -726,6 +767,7 @@ jobs: needs: [ 'preconditions', 'pulsar-test-latest-version-image' ] if: ${{ needs.preconditions.outputs.docs_only != 'true' }} env: + JOB_NAME: CI Flaky - System - ${{ matrix.name }} PULSAR_TEST_IMAGE_NAME: apachepulsar/pulsar-test-latest-version:latest strategy: fail-fast: false @@ -745,6 +787,11 @@ jobs: - name: Tune Runner VM uses: ./.github/actions/tune-runner-vm + - name: Configure Gradle Enterprise + uses: ./.github/actions/gradle-enterprise + with: + token: ${{ secrets.GE_ACCESS_TOKEN }} + - name: Setup ssh access to build runner VM # ssh access is enabled for builds in own forks if: ${{ github.repository != 'apache/pulsar' && github.event_name == 'pull_request' }} @@ -847,6 +894,11 @@ jobs: - name: Tune Runner VM uses: ./.github/actions/tune-runner-vm + - name: Configure Gradle Enterprise + uses: ./.github/actions/gradle-enterprise + with: + token: ${{ secrets.GE_ACCESS_TOKEN }} + - name: Install gh-actions-artifact-client.js uses: apache/pulsar-test-infra/gh-actions-artifact-client/dist@master @@ -867,6 +919,11 @@ jobs: - name: Tune Runner VM uses: ./.github/actions/tune-runner-vm + - name: Configure Gradle Enterprise + uses: ./.github/actions/gradle-enterprise + with: + token: ${{ secrets.GE_ACCESS_TOKEN }} + - name: Cache Maven dependencies uses: actions/cache@v3 with: @@ -899,6 +956,11 @@ jobs: - name: Tune Runner VM uses: ./.github/actions/tune-runner-vm + - name: Configure Gradle Enterprise + uses: ./.github/actions/gradle-enterprise + with: + token: ${{ secrets.GE_ACCESS_TOKEN }} + - name: Setup ssh access to build runner VM # ssh access is enabled for builds in own forks if: ${{ github.repository != 'apache/pulsar' && github.event_name == 'pull_request' }} diff --git a/.gitignore b/.gitignore index 2759cf054f5..c584baaa0a0 100644 --- a/.gitignore +++ b/.gitignore @@ -92,3 +92,9 @@ examples/flink/src/main/java/org/apache/flink/avro/generated pulsar-flink/src/test/java/org/apache/flink/avro/generated pulsar-client/src/test/java/org/apache/pulsar/client/avro/generated /build/ + +test-reports/ + +# Gradle Enterprise +.mvn/.gradle-enterprise/ +.mvn/extensions.xml diff --git a/.mvn/ge-extensions.xml b/.mvn/ge-extensions.xml new file mode 100644 index 00000000000..5852f0f5bae --- /dev/null +++ b/.mvn/ge-extensions.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + 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. + +--> +<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd"> + <extension> + <groupId>com.gradle</groupId> + <artifactId>gradle-enterprise-maven-extension</artifactId> + <version>1.16.1</version> + </extension> + <extension> + <groupId>com.gradle</groupId> + <artifactId>common-custom-user-data-maven-extension</artifactId> + <version>1.11.1</version> + </extension> +</extensions> diff --git a/.mvn/gradle-enterprise-custom-user-data.groovy b/.mvn/gradle-enterprise-custom-user-data.groovy new file mode 100644 index 00000000000..becb3b0149e --- /dev/null +++ b/.mvn/gradle-enterprise-custom-user-data.groovy @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Add Maven command line arguments +def mavenCommand = '' +if (System.env.MAVEN_CMD_LINE_ARGS) { + mavenCommand = "mvn ${System.env.MAVEN_CMD_LINE_ARGS}".toString() + buildScan.value('Maven command line', mavenCommand) +} +if (System.env.GITHUB_ACTIONS) { + if (session.goals.size() == 1 && session.goals[0] == 'initialize') { + // omit publishing build scan when the only goal is "initialize" + buildScan.publishOnDemand() + } else { + def jobName = System.env.JOB_NAME ?: System.env.GITHUB_JOB + buildScan.value('GitHub Actions Job name', jobName) + buildScan.value('GitHub Actions Event name', System.env.GITHUB_EVENT_NAME) + buildScan.value('GitHub Ref name', System.env.GITHUB_REF_NAME) + buildScan.value('GitHub Actor', System.env.GITHUB_ACTOR) + buildScan.link('GitHub Repository', "https://github.com/" + System.env.GITHUB_REPOSITORY) + buildScan.link('GitHub Commit', "https://github.com/" + System.env.GITHUB_REPOSITORY + "/commits/" + System.env.GITHUB_SHA) + buildScan.buildScanPublished { publishedBuildScan -> + new File(System.env.GITHUB_STEP_SUMMARY).withWriterAppend { out -> + out.println("\n[Gradle build scan for '${mavenCommand}' in ${jobName}](${publishedBuildScan.buildScanUri})\n") + } + } + } +} \ No newline at end of file diff --git a/.mvn/gradle-enterprise.xml b/.mvn/gradle-enterprise.xml new file mode 100644 index 00000000000..3321acacbd1 --- /dev/null +++ b/.mvn/gradle-enterprise.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<!-- + + 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. + +--> +<gradleEnterprise + xmlns="https://www.gradle.com/gradle-enterprise-maven" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="https://www.gradle.com/gradle-enterprise-maven https://www.gradle.com/schema/gradle-enterprise-maven.xsd"> + <server> + <url>https://ge.apache.org</url> + <allowUntrusted>false</allowUntrusted> + </server> + <buildScan> + <captureGoalInputFiles>true</captureGoalInputFiles> + <capture> + <buildLogging>true</buildLogging> + <testLogging>true</testLogging> + </capture> + <backgroundBuildScanUpload>#{isFalse(env['GITHUB_ACTIONS'])}</backgroundBuildScanUpload> + <publish>ALWAYS</publish> + <publishIfAuthenticated>true</publishIfAuthenticated> + <obfuscation> + <ipAddresses>#{{'0.0.0.0'}}</ipAddresses> + </obfuscation> + </buildScan> + <buildCache> + <local> + <enabled>true</enabled> + </local> + </buildCache> +</gradleEnterprise>
