This is an automated email from the ASF dual-hosted git repository.

hello-stephen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new f5a343c4efe [chore](ci) Run selected Linux thirdparty PR builds on 
TeamCity (#71436)
f5a343c4efe is described below

commit f5a343c4efeb42cde612393fbb504a3d4da34d75
Author: shuke <[email protected]>
AuthorDate: Fri Dec 4 21:29:18 2026 +0800

    [chore](ci) Run selected Linux thirdparty PR builds on TeamCity (#71436)
    
    ### Background
    
    The Linux thirdparty check builds the native libraries used by Doris.
    GitHub Actions currently selects PRs by changed paths and keeps a hosted
    runner until compilation and the two post-build tests finish.
    
    ### What problem does this PR solve?
    
    Issue Number: None
    Related PR: None
    PR Type: Build/CI/Chore
    
    Problem Summary:
    
    The Linux check occupies a GitHub runner throughout a multi-hour build.
    This change keeps the existing path decision in GitHub Actions, submits
    the selected PR merge revision to TeamCity, and releases the runner once
    it has a build receipt. TeamCity publishes the result under the existing
    required check name.
    
    ### Details
    
    - **Change map:** Four workflow files account for all 350 added and
    removed lines. The original workflow gives up the Linux job, the
    reusable workflow contains the original path detector, and two small
    workflows select and submit the Linux build.
    - **Affected:** Linux x86_64 thirdparty PR builds. The selector runs
    independently of UI, CDC, and script tests so those jobs cannot delay
    submission. Both component workflows use the same path-filter
    implementation.
    - **Behavior change:** TeamCity posts the final check to the PR head.
    The Linux check is skipped when the path filter excludes the PR.
    - **Developer and release impact:** Contributors can open the build link
    in the Actions summary immediately after submission. Release artifacts
    are unaffected.
    - **License and third-party:** None.
    - **Rollback:** Revert the workflow change to restore Linux compilation
    on GitHub-hosted runners.
    - **CI permissions and secrets:** Only the default-branch relay can
    request an OIDC token. It reads the source run's job metadata, uses the
    existing TeamCity FC URL and shared /trigger endpoint, and runs no PR
    code. Fork contributors need no credentials.
    
    ### Testing
    
    - Ran `actionlint` on all four workflow files. Compared the shared path
    detector, UI, CDC, script-test and macOS job definitions with the
    original workflow.
    - Ran 69 dispatch-service unit tests. Verified that both packaged
    handlers route all 11 pipelines through /trigger and reject
    cross-workflow credentials using signed test tokens. Tested the Actions
    relay with successful, superseded and invalid queue receipts. A TeamCity
    build previously compiled the merge revision of #70808 successfully. The
    first end-to-end check, including status publication, requires the new
    relay to be available on the default branch.
    
    ### Release note
    
    None
    
    ### Check List (For Author)
    
    - Behavior changed: Yes (see Details)
    - Does this need documentation: No
    - Pre-submission status: Partially verified: the first live PR dispatch
    and its final status remain to be verified.
    
    ### AI Disclosure
    
    - Tool: OpenAI Codex (GPT-6).
    - Generated: Workflow changes, dispatch-service tests, and this
    description.
    - Human review: Pending.
---
 .github/workflows/build-thirdparty.yml            | 162 +---------------------
 .github/workflows/component-build-paths.yml       |  78 +++++++++++
 .github/workflows/request-thirdparty-teamcity.yml |  43 ++++++
 .github/workflows/submit-thirdparty-teamcity.yml  |  67 +++++++++
 4 files changed, 189 insertions(+), 161 deletions(-)

diff --git a/.github/workflows/build-thirdparty.yml 
b/.github/workflows/build-thirdparty.yml
index 468a886d990..98f39229295 100644
--- a/.github/workflows/build-thirdparty.yml
+++ b/.github/workflows/build-thirdparty.yml
@@ -27,48 +27,10 @@ concurrency:
 
 jobs:
   changes:
-    name: Detect component build paths
-    runs-on: ubuntu-24.04
     if: github.event_name == 'pull_request'
+    uses: ./.github/workflows/component-build-paths.yml
     permissions:
       contents: read
-    # If the comparison is unavailable, run every build whose result is 
unknown.
-    outputs:
-      ui_changes: ${{ steps.filter.outputs.ui_changes != 'false' }}
-      cdc_client_changes: ${{ steps.filter.outputs.cdc_client_changes != 
'false' }}
-      thirdparty_changes: ${{ steps.filter.outputs.thirdparty_changes != 
'false' }}
-      focused_test_changes: ${{ steps.filter.outputs.focused_test_changes != 
'false' }}
-    steps:
-      - name: Detect changed paths
-        id: filter
-        continue-on-error: true
-        env:
-          GH_TOKEN: ${{ github.token }}
-          BASE_SHA: ${{ github.event.pull_request.base.sha }}
-          HEAD_SHA: ${{ github.event.pull_request.head.sha }}
-        run: |
-          # Compare the PR snapshot even if a newer commit arrives while this 
run is queued.
-          merge_base=$(gh api 
"repos/$GITHUB_REPOSITORY/compare/$BASE_SHA...$HEAD_SHA?per_page=1" --jq 
'.merge_base_commit.sha')
-          git init --bare --quiet
-          git remote add origin "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git"
-          gh auth setup-git
-          git fetch --quiet --no-tags --depth=1 --filter=blob:none origin 
"$merge_base" "$HEAD_SHA"
-
-          changed() {
-            local output=$1
-            shift
-            git diff --no-renames --name-only "$merge_base" "$HEAD_SHA" -- 
"$@" > "$RUNNER_TEMP/changed-paths"
-            if [[ -s "$RUNNER_TEMP/changed-paths" ]]; then
-              echo "$output=true" >> "$GITHUB_OUTPUT"
-            else
-              echo "$output=false" >> "$GITHUB_OUTPUT"
-            fi
-          }
-          changed ui_changes ui/ .github/workflows/build-ui.yml
-          changed cdc_client_changes fs_brokers/cdc_client/
-          changed thirdparty_changes thirdparty/ env.sh
-          changed focused_test_changes 
regression-test/pipeline/external/conf/fe.conf \
-            thirdparty/test/adbc-jni-config-test.sh 
.github/workflows/build-thirdparty.yml
 
   ui:
     needs: changes
@@ -109,128 +71,6 @@ jobs:
         run: |
           thirdparty/test/adbc-jni-config-test.sh
 
-  build_linux:
-    name: Build Third Party Libraries (Linux)
-    needs: changes
-    if: ${{ needs.changes.outputs.thirdparty_changes == 'true' }}
-    runs-on: ubuntu-22.04
-    env:
-      ENABLE_THIRDPARTY_CCACHE: 'ON'
-    steps:
-      - name: Checkout easimon/maximize-build-space
-        run: |
-          git clone -b v7 https://github.com/easimon/maximize-build-space
-
-      #- name: Maximize build space
-      #  uses: ./maximize-build-space
-      #  with:
-      #      root-reserve-mb: 4096
-      #      temp-reserve-mb: 4096
-      #      swap-size-mb: 8192
-      #      remove-dotnet: 'true'
-      #      remove-android: 'true'
-      #      remove-haskell: 'true'
-      #      remove-codeql: 'true'
-      #      remove-docker-images: 'true'
-
-      - name: Checkout ${{ github.ref }}
-        uses: actions/checkout@v4
-
-      # ccache-action is vendored as a submodule and the plain checkout above 
does not
-      # fetch it. Initialise only this one; `submodules: recursive` would also 
clone
-      # contrib/clucene, which a third party build does not need.
-      - name: Checkout ccache-action
-        run: git submodule update --init .github/actions/ccache-action
-
-      # This build is cold every time, so changing one package recompiles all 
~80 of
-      # them. build-thirdparty.sh routes the cmake-based packages through 
ccache when
-      # ENABLE_THIRDPARTY_CCACHE is on. Note that a cache saved by a pull 
request run
-      # is only visible to that same pull request, so this pays off across 
pushes to
-      # one branch; sharing it across pull requests needs a run on master.
-      - name: Ccache ${{ github.ref }}
-        uses: ./.github/actions/ccache-action
-        with:
-          key: THIRDPARTY-Linux
-          max-size: "1G"
-          restore-keys: THIRDPARTY-Linux-
-
-      - name: Download
-        run: |
-          cd thirdparty
-          curl -L 
https://github.com/apache/doris-thirdparty/releases/download/automation/doris-thirdparty-source.tgz
 \
-            -o doris-thirdparty-source.tgz
-          tar -zxvf doris-thirdparty-source.tgz
-
-      - name: Prepare
-        run: |
-          export DEFAULT_DIR='/opt/doris'
-          export PATH="${DEFAULT_DIR}/ldb-toolchain/bin:${PATH}"
-
-          packages=(
-            'build-essential'
-            'automake'
-            'autoconf'
-            'libtool-bin'
-            'pkg-config'
-            'cmake=3.22.1-1ubuntu1.22.04.2'
-            'ninja-build'
-            'ccache'
-            'python-is-python3'
-            'bison'
-            'byacc'
-            'flex'
-            'binutils-dev'
-            'libiberty-dev'
-            'curl'
-            'git'
-            'zip'
-            'unzip'
-            'autopoint'
-            'openjdk-8-jdk'
-            'openjdk-8-jdk-headless'
-            'maven'
-          )
-
-          sudo apt update
-          sudo apt-cache policy cmake
-          sudo DEBIAN_FRONTEND=noninteractive apt install --yes 
"${packages[@]}"
-
-          mkdir -p "${DEFAULT_DIR}"
-          wget 
https://github.com/amosbird/ldb_toolchain_gen/releases/download/v0.25/ldb_toolchain_gen.sh
 \
-            -q -O /tmp/ldb_toolchain_gen.sh
-          bash /tmp/ldb_toolchain_gen.sh "${DEFAULT_DIR}/ldb-toolchain"
-
-      - name: Build
-        run: |
-          export DEFAULT_DIR='/opt/doris'
-          export PATH="${DEFAULT_DIR}/ldb-toolchain/bin:${PATH}"
-          export PATH="$(find /usr/lib/jvm/java-8-openjdk* -maxdepth 1 -type d 
-name 'bin'):${PATH}"
-          export JAVA_HOME="$(find /usr/lib/jvm/java-8-openjdk* -maxdepth 0)"
-          export DORIS_TOOLCHAIN=gcc
-          export CMAKE_POLICY_VERSION_MINIMUM=3.10
-          export CUSTOM_CMAKE="/usr/local/bin/cmake"
-
-          #export TMPDIR=/home/runner/work/doris/doris/.tmp
-          #export TMP=$TMPDIR
-          #export TEMP=$TMPDIR
-          #mkdir -p $TMPDIR
-
-          df -h
-          echo $TMPDIR
-          echo $RUNNER_TEMP
-
-          cd thirdparty
-          #./build-thirdparty.sh -j "$(nproc)"
-          ./build-thirdparty.sh -j 2
-
-          # CI has no 64 KiB-page aarch64 host; this drives the libunwind just 
built
-          # through an emulated one, so it also runs on this x86_64 4 KiB 
runner.
-          cd "${GITHUB_WORKSPACE}"
-          thirdparty/test/libunwind-page-size-test.sh
-
-          # Check descriptor ownership when resuming and rotating existing 
logs.
-          thirdparty/test/glog-logfile-resume-test.sh
-
   # Keep both paused macOS checks visible as skipped while the master
   # ruleset still requires their names.
   build_macos:
diff --git a/.github/workflows/component-build-paths.yml 
b/.github/workflows/component-build-paths.yml
new file mode 100644
index 00000000000..a5b71c950cc
--- /dev/null
+++ b/.github/workflows/component-build-paths.yml
@@ -0,0 +1,78 @@
+# 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: Detect component build paths
+
+on:
+  workflow_call:
+    outputs:
+      ui_changes:
+        value: ${{ jobs.changes.outputs.ui_changes }}
+      cdc_client_changes:
+        value: ${{ jobs.changes.outputs.cdc_client_changes }}
+      thirdparty_changes:
+        value: ${{ jobs.changes.outputs.thirdparty_changes }}
+      focused_test_changes:
+        value: ${{ jobs.changes.outputs.focused_test_changes }}
+
+permissions:
+  contents: read
+
+jobs:
+  changes:
+    name: Detect component build paths
+    runs-on: ubuntu-24.04
+    if: github.event_name == 'pull_request'
+    permissions:
+      contents: read
+    # If the comparison is unavailable, run every build whose result is 
unknown.
+    outputs:
+      ui_changes: ${{ steps.filter.outputs.ui_changes != 'false' }}
+      cdc_client_changes: ${{ steps.filter.outputs.cdc_client_changes != 
'false' }}
+      thirdparty_changes: ${{ steps.filter.outputs.thirdparty_changes != 
'false' }}
+      focused_test_changes: ${{ steps.filter.outputs.focused_test_changes != 
'false' }}
+    steps:
+      - name: Detect changed paths
+        id: filter
+        continue-on-error: true
+        env:
+          GH_TOKEN: ${{ github.token }}
+          BASE_SHA: ${{ github.event.pull_request.base.sha }}
+          HEAD_SHA: ${{ github.event.pull_request.head.sha }}
+        run: |
+          # Compare the PR snapshot even if a newer commit arrives while this 
run is queued.
+          merge_base=$(gh api 
"repos/$GITHUB_REPOSITORY/compare/$BASE_SHA...$HEAD_SHA?per_page=1" --jq 
'.merge_base_commit.sha')
+          git init --bare --quiet
+          git remote add origin "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git"
+          gh auth setup-git
+          git fetch --quiet --no-tags --depth=1 --filter=blob:none origin 
"$merge_base" "$HEAD_SHA"
+
+          changed() {
+            local output=$1
+            shift
+            git diff --no-renames --name-only "$merge_base" "$HEAD_SHA" -- 
"$@" > "$RUNNER_TEMP/changed-paths"
+            if [[ -s "$RUNNER_TEMP/changed-paths" ]]; then
+              echo "$output=true" >> "$GITHUB_OUTPUT"
+            else
+              echo "$output=false" >> "$GITHUB_OUTPUT"
+            fi
+          }
+          changed ui_changes ui/ .github/workflows/build-ui.yml
+          changed cdc_client_changes fs_brokers/cdc_client/
+          changed thirdparty_changes thirdparty/ env.sh
+          changed focused_test_changes 
regression-test/pipeline/external/conf/fe.conf \
+            thirdparty/test/adbc-jni-config-test.sh 
.github/workflows/build-thirdparty.yml
diff --git a/.github/workflows/request-thirdparty-teamcity.yml 
b/.github/workflows/request-thirdparty-teamcity.yml
new file mode 100644
index 00000000000..d42bf0113fd
--- /dev/null
+++ b/.github/workflows/request-thirdparty-teamcity.yml
@@ -0,0 +1,43 @@
+# 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: Select Linux thirdparty for TeamCity
+
+on: pull_request
+
+concurrency:
+  group: ${{ github.ref }} (Select Linux thirdparty for TeamCity)
+  cancel-in-progress: true
+
+permissions: {}
+
+jobs:
+  changes:
+    uses: ./.github/workflows/component-build-paths.yml
+    permissions:
+      contents: read
+
+  build_linux:
+    needs: changes
+    # When selected, only TeamCity publishes the required check. When skipped,
+    # keep the existing check name so unaffected PRs can merge.
+    name: ${{ needs.changes.outputs.thirdparty_changes == 'false' && 'Build 
Third Party Libraries (Linux)' || format('Request thirdparty on TeamCity / {0} 
/ {1}', github.event.pull_request.number, github.sha) }}
+    if: needs.changes.outputs.thirdparty_changes == 'true'
+    runs-on: ubuntu-slim
+    permissions: {}
+    steps:
+      - run: echo 'Selected the Linux thirdparty build for TeamCity.'
diff --git a/.github/workflows/submit-thirdparty-teamcity.yml 
b/.github/workflows/submit-thirdparty-teamcity.yml
new file mode 100644
index 00000000000..54a317c2908
--- /dev/null
+++ b/.github/workflows/submit-thirdparty-teamcity.yml
@@ -0,0 +1,67 @@
+# 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: Submit Linux thirdparty to TeamCity
+
+on:
+  workflow_run:
+    workflows: ["Select Linux thirdparty for TeamCity"]
+    types: [completed]
+
+permissions: {}
+
+jobs:
+  submit:
+    if: >-
+      github.repository == 'apache/doris' &&
+      github.event.workflow_run.event == 'pull_request' &&
+      github.event.workflow_run.path == 
'.github/workflows/request-thirdparty-teamcity.yml' &&
+      github.event.workflow_run.conclusion != 'cancelled'
+    runs-on: ubuntu-slim
+    permissions:
+      actions: read
+      id-token: write
+    steps:
+      # Fork PRs do not need an OIDC token. This default-branch job reads
+      # GitHub job metadata and never checks out or executes PR contents.
+      - name: Submit the selected merge revision
+        shell: bash
+        env:
+          GH_TOKEN: ${{ github.token }}
+          TEAMCITY_FC_TRIGGER_URL: ${{ vars.TEAMCITY_FC_TRIGGER_URL }}
+          SOURCE_RUN: ${{ github.event.workflow_run.id }}
+          SOURCE_ATTEMPT: ${{ github.event.workflow_run.run_attempt }}
+        run: |
+          set -euo pipefail
+          jobs=$(gh api --paginate --slurp 
"repos/$GITHUB_REPOSITORY/actions/runs/$SOURCE_RUN/attempts/$SOURCE_ATTEMPT/jobs?per_page=100")
+          if ! jq -e 'any(.[].jobs[]; .conclusion == "success" and (.name | 
startswith("Request thirdparty on TeamCity / ")))' <<< "$jobs" >/dev/null; then
+            exit 0
+          fi
+          
expected_endpoint='https://doris-c-trigger-mtjzjrppvu.cn-hongkong.fcapp.run/trigger'
+          if [[ "$TEAMCITY_FC_TRIGGER_URL" != "$expected_endpoint" ]]; then
+            echo "Unexpected TEAMCITY_FC_TRIGGER_URL" >&2
+            exit 1
+          fi
+          token=$(curl -fsS -H "Authorization: Bearer 
$ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
+            
"${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=urn%3Aapache%3Adoris%3Aci%3Ateamcity-trigger"
 | jq -er '.value')
+          echo "::add-mask::$token"
+          payload=$(jq -cn --argjson run "$SOURCE_RUN" --argjson attempt 
"$SOURCE_ATTEMPT" '{pipeline: "thirdparty", run: $run, attempt: $attempt}')
+          receipt=$(curl --fail-with-body --silent --show-error --max-time 45 
--retry 2 --retry-all-errors \
+            -H "Authorization: Bearer $token" -H 'Content-Type: 
application/json' --data "$payload" \
+            "$TEAMCITY_FC_TRIGGER_URL")
+          jq -er 'if .status == "superseded" then "Superseded PR snapshot"
+                  else (.build_ids | select(type == "array" and length == 1) | 
.[0] | select(type == "number" and . > 0 and floor == .) | "TeamCity build: 
https://tc.doris-ci.com/build/\(.)") end' <<< "$receipt" >> 
"$GITHUB_STEP_SUMMARY"


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to