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 ca2baf2ce70 [chore](ci) Queue TeamCity builds from PR comments through 
FC (#70984)
ca2baf2ce70 is described below

commit ca2baf2ce70e42a39cc88097a24bdf3f4001528c
Author: shuke <[email protected]>
AuthorDate: Wed Nov 25 17:25:25 2026 +0800

    [chore](ci) Queue TeamCity builds from PR comments through FC (#70984)
    
    ### Background
    
    Maintainers use PR comments to run individual TeamCity checks or the
    checks selected by `run buildall`. The GitHub Actions workflow already
    has an OIDC-based queue path that was exercised with pilot commands in
    #70972. Regular commands still authenticate directly to TeamCity.
    
    ### What problem does this PR solve?
    
    Issue Number: None
    Related PR: #70972
    PR Type: Build/CI/Chore
    
    Problem Summary:
    
    Route regular `run` comments through the existing Function Compute (FC)
    queue worker so GitHub-hosted runners can submit builds without a
    TeamCity credential or a connection to the TeamCity server. For example,
    `run p0 2` records an approval for the PR head, base branch, P0 lane and
    count, then sends an OIDC-authenticated request and checks for two build
    IDs. This retires the pilot-only `run debug…` aliases.
    
    ### Details
    
    - **Change map:** The workflow and shell helper account for 162 changed
    lines. They promote FC lane selection and remove the direct TeamCity
    REST client. The remaining 259 changed lines update the tests and remove
    fixtures that simulated that client.
    - **Affected:** The comment workflow for `master`, `branch-4.2` and
    `branch-4.1`. Existing command permissions, changed-file filters,
    sensitive-script checks and master-only Performance selection still
    apply.
    - **Behavior change:** Regular builds now reach TeamCity through FC.
    `skip buildall` continues to write GitHub statuses. The submission job
    reports a failed or incomplete queue receipt.
    - **Developer and release impact:** Maintainers keep the existing
    command syntax. Operators must keep the FC worker's TeamCity credential
    valid for queues to accept new builds.
    - **CI permissions and secrets:** The selection job uses the built-in
    GitHub token for PR metadata, comments and commit statuses. Only the
    submission job can request an OIDC token for the FC audience.
    `TEAMCITY_FC_TRIGGER_URL` is a repository variable. The workflow no
    longer reads `TEAMCITY_CURRENT_TOKEN`.
    - **License and third-party:** None.
    - **Rollback:** Revert this change and verify the previous direct
    endpoint, credential and network path before resuming direct
    submissions.
    
    ### Testing
    
    - Ran all 20 shell/workflow tests locally. They cover command and branch
    authorization, lane selection, skip statuses, PR snapshot checks, and
    failed or partial FC receipts. Two cutover tests also failed as expected
    against the previous workflow.
    - Parsed the workflow YAML and checked all 18 embedded shell steps and
    the helper with Bash.
    - Before this change, the same FC transport returned TeamCity build IDs
    for P0 and Compile on #70977. The P0 build then failed while fetching
    its compile package. These runs verify submission only. [P0
    run](https://github.com/apache/doris/actions/runs/45535741913) ·
    [Compile run](https://github.com/apache/doris/actions/runs/45536084446)
    
    ### Release note
    
    None.
    
    ### Check List (For Author)
    
    - Behavior changed: Yes (see Details)
    - Does this need documentation: No
    - Pre-submission status: Partially verified: regular commands use the
    default branch workflow and can be exercised end to end after merge.
    Eight lanes have local coverage only.
    
    ### AI Disclosure
    
    - Tool: OpenAI Codex
    - Generated: Workflow, shell helper, tests and PR description.
    - Human review: Pending.
---
 .github/workflows/comment-to-trigger-teamcity.yml  |  70 ++----
 regression-test/pipeline/common/teamcity-utils.sh  |  92 +-------
 .../pipeline/common/tests/test_teamcity_utils.py   | 259 +++++----------------
 3 files changed, 88 insertions(+), 333 deletions(-)

diff --git a/.github/workflows/comment-to-trigger-teamcity.yml 
b/.github/workflows/comment-to-trigger-teamcity.yml
index 592ab98c1bf..18786fd401f 100644
--- a/.github/workflows/comment-to-trigger-teamcity.yml
+++ b/.github/workflows/comment-to-trigger-teamcity.yml
@@ -36,8 +36,6 @@ jobs:
         github.event.issue.pull_request &&
         !startsWith(github.event.comment.body, '/review') &&
         (
-          (github.event.comment.user.id == 37901441 && github.event.sender.id 
== 37901441 &&
-           github.event.comment.user.login == 'shuke987' && 
contains(github.event.comment.body, 'run debug')) ||
           contains(github.event.comment.body, 'run buildall') ||
           contains(github.event.comment.body, 'run compile') ||
           contains(github.event.comment.body, 'run beut') ||
@@ -62,11 +60,7 @@ jobs:
     runs-on: ubuntu-latest
     env:
       COMMENT_BODY: ${{ github.event.comment.body }}
-      COMMENT_LOGIN: ${{ github.event.comment.user.login }}
-      COMMENT_SENDER_ID: ${{ github.event.sender.id }}
       COMMENT_USER_ID: ${{ github.event.comment.user.id }}
-      TEAMCITY_CURRENT_URL: ${{ vars.TEAMCITY_CURRENT_URL }}
-      TEAMCITY_CURRENT_TOKEN: ${{ !contains(github.event.comment.body, 
'debug') && secrets.TEAMCITY_CURRENT_TOKEN || '' }}
       GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 
     steps:
@@ -79,22 +73,6 @@ jobs:
           "https://api.github.com/repos/${{ github.repository 
}}/pulls/${PULL_REQUEST_NUM}")
         COMMIT_ID_FROM_TRIGGER=$(jq -er '.head.sha' <<< "$pr_json")
         TARGET_BRANCH=$(jq -er '.base.ref' <<< "$pr_json")
-        # Debug commands exercise the FC transport with the same production 
lane rules.
-        if [[ "$COMMENT_BODY" == 'run debug'* ]]; then
-          [[ "$COMMENT_LOGIN" == shuke987 && "$COMMENT_USER_ID" == 37901441 && 
"$COMMENT_SENDER_ID" == 37901441 ]] || exit 1
-          debug_command='^run 
debug(all|compile|p0|feut|beut|cloudut|external|cloud_p0|vault_p0|nonconcurrent|performance)(
 ([1-9][0-9]*))?$'
-          [[ "$COMMENT_BODY" =~ $debug_command ]] || { echo 'Unsupported FC 
debug command'; exit 1; }
-          lane=${BASH_REMATCH[1]}
-          repeat=${BASH_REMATCH[3]:-1}
-          [[ "$repeat" =~ ^([1-9]|1[0-9]|20)$ ]] || { echo 'Repeat must be 
between 1 and 20'; exit 1; }
-          [[ "$lane" != all ]] || lane=buildall
-          COMMENT_BODY="run $lane $repeat"
-          echo "fc=true" >> "$GITHUB_OUTPUT"
-          base_sha=$(jq -er '.base.sha' <<< "$pr_json")
-          file_count=$(jq -er '.changed_files' <<< "$pr_json")
-          echo "base_sha=$base_sha" >> "$GITHUB_OUTPUT"
-          echo "file_count=$file_count" >> "$GITHUB_OUTPUT"
-        fi
         if [[ "${COMMENT_BODY}" == *'run buildall'* ||
             "${COMMENT_BODY}" == *'run compile'* ||
             "${COMMENT_BODY}" == *'run beut'* ||
@@ -164,6 +142,11 @@ jobs:
         if [[ "${COMMENT_BODY}" =~ $reg ]]; then
           COMMENT_TRIGGER_TYPE=${BASH_REMATCH[1]}
           COMMENT_REPEAT_TIMES=${BASH_REMATCH[3]:-1}
+          [[ "$COMMENT_REPEAT_TIMES" =~ ^([1-9]|1[0-9]|20)$ ]] || { echo 
'Repeat must be between 1 and 20'; exit 1; }
+          base_sha=$(jq -er '.base.sha' <<< "$pr_json")
+          file_count=$(jq -er '.changed_files' <<< "$pr_json")
+          echo "base_sha=$base_sha" >> "$GITHUB_OUTPUT"
+          echo "file_count=$file_count" >> "$GITHUB_OUTPUT"
         elif [[ "${COMMENT_BODY}" != 'skip buildall' ]]; then
           echo 'Unsupported command; use run <TeamCity check suffix> [count] 
or run buildall'; exit 1
         fi
@@ -277,7 +260,7 @@ jobs:
         fi
 
     - name: Prepare FC lane selection
-      if: steps.parse.outputs.fc == 'true'
+      if: steps.parse.outputs.comment_trigger == 'true'
       env:
         PR: ${{ steps.parse.outputs.PULL_REQUEST_NUM }}
         HEAD_SHA: ${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}
@@ -286,10 +269,11 @@ jobs:
       run: |
         # The file filters and the approval record must describe the same PR 
revision.
         [[ "$FILE_COUNT" =~ ^[0-9]+$ && $(wc -l < all_files) -eq "$FILE_COUNT" 
]]
-        curl --fail --silent --show-error -H "Authorization: Bearer 
$GITHUB_TOKEN" \
-          "https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls/$PR"; |
-          jq -e --arg head "$HEAD_SHA" --arg base "$BASE_SHA" --arg branch 
"$TARGET_BRANCH" \
-            '.state == "open" and .head.sha == $head and .base.sha == $base 
and .base.ref == $branch' >/dev/null
+        pr_json=$(curl --fail --silent --show-error -H "Authorization: Bearer 
$GITHUB_TOKEN" \
+          "https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls/$PR";)
+        jq -se --arg head "$HEAD_SHA" --arg base "$BASE_SHA" --arg branch 
"$TARGET_BRANCH" \
+          'length == 1 and (.[0] | .state == "open" and .head.sha == $head and 
.base.sha == $base and .base.ref == $branch)' \
+          <<< "$pr_json" >/dev/null
         : > "$RUNNER_TEMP/teamcity-fc-lanes"
         echo "TEAMCITY_FC_PLAN=$RUNNER_TEMP/teamcity-fc-lanes" >> "$GITHUB_ENV"
 
@@ -303,8 +287,7 @@ jobs:
           "${{ steps.parse.outputs.PULL_REQUEST_NUM }}" \
           "${{ steps.parse.outputs.TARGET_BRANCH }}" \
           "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" \
-          "feut" \
-          "${{ steps.parse.outputs.COMMENT_REPEAT_TIMES }}"
+          "feut"
 
 
     - name: "Trigger beut"
@@ -317,8 +300,7 @@ jobs:
           "${{ steps.parse.outputs.PULL_REQUEST_NUM }}" \
           "${{ steps.parse.outputs.TARGET_BRANCH }}" \
           "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" \
-          "beut" \
-          "${{ steps.parse.outputs.COMMENT_REPEAT_TIMES }}"
+          "beut"
 
     - name: "Trigger cloudut"
       if: ${{ fromJSON(steps.parse.outputs.comment_trigger) && 
contains(fromJSON('["cloudut", "buildall"]'), 
steps.parse.outputs.COMMENT_TRIGGER_TYPE) }}
@@ -330,8 +312,7 @@ jobs:
           "${{ steps.parse.outputs.PULL_REQUEST_NUM }}" \
           "${{ steps.parse.outputs.TARGET_BRANCH }}" \
           "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" \
-          "cloudut" \
-          "${{ steps.parse.outputs.COMMENT_REPEAT_TIMES }}"
+          "cloudut"
 
     - name: "Trigger compile"
       if: ${{ fromJSON(steps.parse.outputs.comment_trigger) && 
contains(fromJSON('["compile", "buildall"]'), 
steps.parse.outputs.COMMENT_TRIGGER_TYPE) }}
@@ -348,8 +329,7 @@ jobs:
           "${{ steps.parse.outputs.PULL_REQUEST_NUM }}" \
           "${{ steps.parse.outputs.TARGET_BRANCH }}" \
           "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" \
-          "compile" \
-          "${{ steps.parse.outputs.COMMENT_REPEAT_TIMES }}"
+          "compile"
 
     - name: "Trigger p0"
       if: ${{ fromJSON(steps.parse.outputs.comment_trigger) && 
steps.parse.outputs.COMMENT_TRIGGER_TYPE == 'p0' }}
@@ -361,8 +341,7 @@ jobs:
           "${{ steps.parse.outputs.PULL_REQUEST_NUM }}" \
           "${{ steps.parse.outputs.TARGET_BRANCH }}" \
           "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" \
-          "p0" \
-          "${{ steps.parse.outputs.COMMENT_REPEAT_TIMES }}"
+          "p0"
 
     - name: "Trigger external"
       if: ${{ fromJSON(steps.parse.outputs.comment_trigger) && 
steps.parse.outputs.COMMENT_TRIGGER_TYPE == 'external' }}
@@ -374,8 +353,7 @@ jobs:
           "${{ steps.parse.outputs.PULL_REQUEST_NUM }}" \
           "${{ steps.parse.outputs.TARGET_BRANCH }}" \
           "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" \
-          "external" \
-          "${{ steps.parse.outputs.COMMENT_REPEAT_TIMES }}"
+          "external"
 
     - name: "Trigger cloud_p0"
       if: ${{ fromJSON(steps.parse.outputs.comment_trigger) && 
steps.parse.outputs.COMMENT_TRIGGER_TYPE == 'cloud_p0' }}
@@ -387,8 +365,7 @@ jobs:
           "${{ steps.parse.outputs.PULL_REQUEST_NUM }}" \
           "${{ steps.parse.outputs.TARGET_BRANCH }}" \
           "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" \
-          "cloud_p0" \
-          "${{ steps.parse.outputs.COMMENT_REPEAT_TIMES }}"
+          "cloud_p0"
 
 
     - name: "Trigger vault_p0"
@@ -401,8 +378,7 @@ jobs:
           "${{ steps.parse.outputs.PULL_REQUEST_NUM }}" \
           "${{ steps.parse.outputs.TARGET_BRANCH }}" \
           "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" \
-          "vault_p0" \
-          "${{ steps.parse.outputs.COMMENT_REPEAT_TIMES }}"
+          "vault_p0"
 
     - name: "Trigger nonconcurrent"
       if: ${{ fromJSON(steps.parse.outputs.comment_trigger) && 
steps.parse.outputs.COMMENT_TRIGGER_TYPE == 'nonconcurrent' }}
@@ -414,8 +390,7 @@ jobs:
           "${{ steps.parse.outputs.PULL_REQUEST_NUM }}" \
           "${{ steps.parse.outputs.TARGET_BRANCH }}" \
           "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" \
-          "nonconcurrent" \
-          "${{ steps.parse.outputs.COMMENT_REPEAT_TIMES }}"
+          "nonconcurrent"
   
     - name: "Trigger performance"
       if: ${{ fromJSON(steps.parse.outputs.comment_trigger) && 
contains(fromJSON('["performance", "buildall"]'), 
steps.parse.outputs.COMMENT_TRIGGER_TYPE) && steps.parse.outputs.TARGET_BRANCH 
== 'master' }}
@@ -427,12 +402,11 @@ jobs:
           "${{ steps.parse.outputs.PULL_REQUEST_NUM }}" \
           "${{ steps.parse.outputs.TARGET_BRANCH }}" \
           "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" \
-          "performance" \
-          "${{ steps.parse.outputs.COMMENT_REPEAT_TIMES }}"
+          "performance"
 
     - name: Collect selected FC lanes
       id: fc_lanes
-      if: steps.parse.outputs.fc == 'true'
+      if: steps.parse.outputs.comment_trigger == 'true'
       run: |
         lanes=$(jq -Rsc 'split("\n") | map(select(length > 0))' 
"$TEAMCITY_FC_PLAN")
         echo "lanes=$lanes" >> "$GITHUB_OUTPUT"
diff --git a/regression-test/pipeline/common/teamcity-utils.sh 
b/regression-test/pipeline/common/teamcity-utils.sh
index 444e6d37e5f..519b054b994 100644
--- a/regression-test/pipeline/common/teamcity-utils.sh
+++ b/regression-test/pipeline/common/teamcity-utils.sh
@@ -23,32 +23,9 @@ declare -A targetBranch_to_pipelines=(
     [branch-4.2]='compile feut beut cloudut p0 cloud_p0 vault_p0 external 
nonconcurrent'
     [branch-4.1]='compile feut beut cloudut p0 cloud_p0 vault_p0 external 
nonconcurrent'
 )
-declare -A comment_to_pipeline=(
-    [compile]=Doris_Compile [feut]=Doris_FEUT [beut]=Doris_BEUT
-    [cloudut]=Doris_CloudUT [p0]=Doris_P0 [cloud_p0]=Doris_CloudP0
-    [vault_p0]=Doris_VaultP0 [external]=Doris_External
-    [nonconcurrent]=Doris_NonConcurrent [performance]=Doris_Performance
-)
 declare -A conment_to_context
-for lane in "${!comment_to_pipeline[@]}"; do 
conment_to_context[$lane]="TeamCity/$lane"; done
+for lane in ${targetBranch_to_pipelines[master]}; do 
conment_to_context[$lane]="TeamCity/$lane"; done
 unset lane
-TEAMCITY_URL=${TEAMCITY_CURRENT_URL:-}
-
-# Never trace authenticated requests or follow redirects carrying credentials.
-teamcity_request() {
-    set +x
-    [[ ${TEAMCITY_URL:-} =~ ^https://[A-Za-z0-9.-]+(:[0-9]+)?$ && -n 
${TEAMCITY_CURRENT_TOKEN:-} ]] || {
-        echo 'TeamCity HTTPS URL/token is not configured' >&2; return 1;
-    }
-    curl --header "Authorization: Bearer ${TEAMCITY_CURRENT_TOKEN}" "$@"
-}
-
-teamcity_rest() {
-    local path=$1; shift
-    teamcity_request --globoff --fail --silent --show-error --max-time 45 
--max-filesize 8388608 \
-        -H 'Accept: application/json' -H 'Content-Type: application/json' \
-        "${TEAMCITY_URL}/app/rest/${path}" "$@"
-}
 
 teamcity_current_pr() {
     set +x
@@ -59,49 +36,6 @@ teamcity_current_pr() {
             '.state=="open" and .head.sha==$head and .base.ref==$branch' 
>/dev/null
 }
 
-teamcity_current_root() {
-    teamcity_rest "buildTypes/id:$1/vcs-root-entries" |
-        jq -e '."vcs-root-entry" | length==1 and 
.[0]."vcs-root".id=="DorisMigrationValidation_ApacheDoris"' >/dev/null || {
-            echo "$1 is not configured for general PR builds; no build 
submitted" >&2; return 1;
-        }
-}
-
-teamcity_current_enqueue() {
-    local type=$1 params=$2 count=$3 ordinal id instance payload actual
-    teamcity_current_root "$type" || return 1
-    instance=$(teamcity_rest 
"vcs-root-instances?locator=buildType:(id:${type})&fields=vcs-root-instance(id,vcs-root-id)"
 |
-        jq -er '[."vcs-root-instance"[] | 
select(."vcs-root-id"=="DorisMigrationValidation_ApacheDoris")] | 
select(length==1) | .[0].id') || return 1
-    for ((ordinal=1; ordinal<=count; ordinal++)); do
-        teamcity_current_pr || { echo 'PR revision or target changed; no new 
build submitted' >&2; return 1; }
-        payload=$(jq -cn --arg type "$type" --arg pr "$PULL_REQUEST_NUM" --arg 
head "$COMMIT_ID_FROM_TRIGGER" --arg instance "$instance" --argjson params 
"$params" '
-            
{buildType:{id:$type},branchName:("pull/"+$pr),revisions:{failOnMissingRevisions:true,revision:[{version:$head,vcsBranchName:("refs/pull/"+$pr+"/head"),"vcs-root-instance":{id:$instance}}]},
-             
properties:{property:($params|to_entries|map({name:.key,value:.value}))},
-             
triggeringOptions:{queueAtTop:false,rebuildAllDependencies:false}}') || return 1
-        # Queue replacement and duplicate handling belong to TeamCity.
-        id=$(teamcity_rest buildQueue -X POST --data-binary "$payload" | jq 
-er .id) || return 1
-        actual=$(teamcity_rest "builds/id:${id}?fields=${TC_FIELDS}") || 
return 1
-        jq -e --arg head "$COMMIT_ID_FROM_TRIGGER" --argjson params "$params" '
-            ((.properties.property // []) | map({key:.name,value:.value}) | 
from_entries) as $p |
-            [.revisions.revision[].version]==[$head] and 
all($params|to_entries[]; $p[.key]==.value)' <<< "$actual" >/dev/null || return 
1
-        echo "INFO: ${type} build ${id}: 
${TEAMCITY_URL}/buildConfiguration/${type}/${id}" >&2
-        printf '%s\n' "$id"
-    done
-}
-
-teamcity_current_trigger() (
-    set -euo pipefail
-    set +x
-    local lane=$1 count=${2:-1} params
-    [[ $PULL_REQUEST_NUM =~ ^[1-9][0-9]*$ && $COMMIT_ID_FROM_TRIGGER =~ 
^[0-9a-f]{40}$ && $count =~ ^[1-9][0-9]*$ && $count -le 20 ]]
-    [[ " ${targetBranch_to_pipelines[$PULL_REQUEST_TARGET_BRANCH]:-} " == *" 
$lane "* ]] || {
-        echo "No pipeline for $lane on $PULL_REQUEST_TARGET_BRANCH" >&2; exit 
1;
-    }
-    # Artifact lookup belongs to the pipeline; only submit the requested lane 
here.
-    local 
TC_FIELDS='id,revisions(revision(version)),properties(property(name,value))'
-    params=$(jq -cn --arg pr "$PULL_REQUEST_NUM" --arg branch 
"$PULL_REQUEST_TARGET_BRANCH" --arg head "$COMMIT_ID_FROM_TRIGGER" 
'{"env.PR_NUMBER":$pr,"env.CI_BRANCH":$branch,"env.CI_REQUESTED_PR_HEAD":$head}')
-    teamcity_current_enqueue "${comment_to_pipeline[$lane]}" "$params" "$count"
-)
-
 # Run only in the OIDC-enabled job after GitHub records the lane approvals.
 teamcity_fc_submit() (
     set -euo pipefail
@@ -168,21 +102,6 @@ skip_build() {
 }
 # skip_build "$1" "$2"
 
-trigger_build() {
-    # 新触发一个build
-    local PULL_REQUEST_NUM="${PULL_REQUEST_NUM:-$1}"
-    local COMMIT_ID_FROM_TRIGGER="${COMMIT_ID_FROM_TRIGGER:-$2}"
-    local COMMENT_TRIGGER_TYPE="${COMMENT_TRIGGER_TYPE:-$3}"
-    local COMMENT_REPEAT_TIMES="${COMMENT_REPEAT_TIMES:-$4}"
-    local 
PULL_REQUEST_TARGET_BRANCH="${PULL_REQUEST_TARGET_BRANCH:-${TARGET_BRANCH:-}}"
-    if [[ -z "${PULL_REQUEST_NUM}" || -z "${COMMIT_ID_FROM_TRIGGER}" || -z 
"${COMMENT_TRIGGER_TYPE}" ]]; then
-        echo "Usage: add_build PULL_REQUEST_NUM COMMIT_ID_FROM_TRIGGER 
COMMENT_TRIGGER_TYPE [COMMENT_REPEAT_TIMES]"
-        return 1
-    fi
-    teamcity_current_trigger "$COMMENT_TRIGGER_TYPE" 
"${COMMENT_REPEAT_TIMES:-1}"
-}
-# trigger_build "$1" "$2" "$3" "$4"
-
 # A skipped Compile also resolves the checks that its fanout would publish.
 teamcity_skip_unaffected() {
     teamcity_current_pr || { echo 'PR revision or target changed; no skip 
status written' >&2; return 1; }
@@ -203,11 +122,10 @@ trigger_or_skip_build() {
     local PULL_REQUEST_TARGET_BRANCH="${PULL_REQUEST_TARGET_BRANCH:-$3}"
     local COMMIT_ID_FROM_TRIGGER="${COMMIT_ID_FROM_TRIGGER:-$4}"
     local COMMENT_TRIGGER_TYPE="${COMMENT_TRIGGER_TYPE:-$5}"
-    local COMMENT_REPEAT_TIMES="${COMMENT_REPEAT_TIMES:-$6}"
     if [[ -z "${PULL_REQUEST_NUM}" ||
         -z "${COMMIT_ID_FROM_TRIGGER}" ||
         -z "${COMMENT_TRIGGER_TYPE}" ]]; then
-        echo "Usage: add_build FILE_CHANGED PULL_REQUEST_NUM 
COMMIT_ID_FROM_TRIGGER COMMENT_TRIGGER_TYPE [COMMENT_REPEAT_TIMES]"
+        echo "Usage: trigger_or_skip_build FILE_CHANGED PR TARGET_BRANCH 
COMMIT LANE"
         return 1
     fi
 
@@ -216,11 +134,7 @@ trigger_or_skip_build() {
     }
     case "$FILE_CHANGED" in
         true)
-            if [[ -n ${TEAMCITY_FC_PLAN:-} ]]; then
-                printf '%s\n' "$COMMENT_TRIGGER_TYPE" >> "$TEAMCITY_FC_PLAN"
-            else
-                trigger_build "$PULL_REQUEST_NUM" "$COMMIT_ID_FROM_TRIGGER" 
"$COMMENT_TRIGGER_TYPE" "${COMMENT_REPEAT_TIMES:-1}"
-            fi
+            printf '%s\n' "$COMMENT_TRIGGER_TYPE" >> 
"${TEAMCITY_FC_PLAN:?Missing FC lane plan}"
             ;;
         false) teamcity_skip_unaffected ;;
         *) echo "Invalid FILE_CHANGED: $FILE_CHANGED" >&2; return 1 ;;
diff --git a/regression-test/pipeline/common/tests/test_teamcity_utils.py 
b/regression-test/pipeline/common/tests/test_teamcity_utils.py
index 9218eef213d..43f51ff4105 100644
--- a/regression-test/pipeline/common/tests/test_teamcity_utils.py
+++ b/regression-test/pipeline/common/tests/test_teamcity_utils.py
@@ -28,38 +28,6 @@ import unittest
 
 HELPER = Path(__file__).parents[1] / 'teamcity-utils.sh'
 HEAD = 'a' * 40
-MOCK = r'''
-import json, os, re, sys
-from pathlib import Path
-root=Path(os.environ['FIXTURE_ROOT']); path=root/'state.json'; 
state=json.loads(path.read_text())
-args=sys.argv[1:]; url=next(x for x in args if 
x.startswith('https://ci.example/app/rest/'))
-route=url.split('/app/rest/',1)[1]; method=args[args.index('-X')+1] if '-X' in 
args else 'GET'
-rows=state.get('builds',[])
-def emit(value): print(json.dumps(value))
-if method=='POST':
- assert route=='buildQueue'
- body=json.loads(args[args.index('--data-binary')+1]); 
state.setdefault('posts',[]).append(body)
- bid=100+len(state['posts']); 
body.update(id=bid,number=str(bid),buildTypeId=body['buildType']['id'],state='queued',status='UNKNOWN')
- 
body['revisions']['revision']=[{'version':body['revisions']['revision'][0]['version']}]
- state.setdefault('builds',[]).append(body); path.write_text(json.dumps(state))
- if state.get('lose_response'):
-  state['lose_response']=False; path.write_text(json.dumps(state));sys.exit(1)
- emit({'id':bid});sys.exit()
-if 'vcs-root-entries' in route:
- 
emit({'vcs-root-entry':[{'vcs-root':{'id':state.get('root','DorisMigrationValidation_ApacheDoris')}}]})
-elif route.startswith('vcs-root-instances'):
- 
emit({'vcs-root-instance':[{'id':3,'vcs-root-id':'DorisMigrationValidation_ApacheDoris'}]})
-elif route.startswith('builds/id:'):
- bid=int(route.split(':')[1].split('?')[0]);emit(next(b for b in rows if 
b['id']==bid))
-else: raise AssertionError(route)
-'''
-
-
-def build(bid=1, lane='Doris_CloudUT', state='running', head=HEAD, 
params=None):
-    return {'id': bid, 'number': str(bid), 'buildTypeId': lane, 'state': state,
-            'status': 'SUCCESS', 'branchName': 'pull/123',
-            'revisions': {'revision': [{'version': head}]},
-            'properties': {'property': [{'name': k, 'value': v} for k, v in 
(params or {}).items()]}}
 
 
 class TeamCityUtilsTests(unittest.TestCase):
@@ -67,7 +35,6 @@ class TeamCityUtilsTests(unittest.TestCase):
         self.temp = tempfile.TemporaryDirectory()
         self.addCleanup(self.temp.cleanup)
         self.root = Path(self.temp.name)
-        (self.root / 'mock.py').write_text(MOCK)
         (self.root / 'status_mock.py').write_text('''import json, os, sys
 from pathlib import Path
 p=Path(os.environ['FIXTURE_ROOT'])/'statuses.json'
@@ -76,24 +43,14 @@ assert '-d' in sys.argv and '-X' in sys.argv
 if os.environ.get('STATUS_FAIL')=='true': sys.exit(22)
 
rows.append(json.loads(sys.argv[sys.argv.index('-d')+1]));p.write_text(json.dumps(rows))
 ''')
-        self.save({})
-        (self.root / 'event.json').write_text(json.dumps({'comment': {
-            'id': 45, 'body': 'run cloudut', 'updated_at': 
'2026-11-11T00:00:00Z'}}))
-        self.env = {**os.environ, 'TARGET_BRANCH': 'master', 
'TEAMCITY_CURRENT_URL': 'https://ci.example',
-                    'TEAMCITY_CURRENT_TOKEN': 'test-current-token', 
'GITHUB_TOKEN': 'test-github-token', 'FIXTURE_ROOT': str(self.root),
-                    'GITHUB_EVENT_PATH': str(self.root / 'event.json')}
-
-    def save(self, value):
-        (self.root / 'state.json').write_text(json.dumps(value))
-
-    def state(self):
-        return json.loads((self.root / 'state.json').read_text())
+        self.plan = self.root / 'fc-lanes'
+        self.env = {**os.environ, 'TARGET_BRANCH': 'master', 'GITHUB_TOKEN': 
'test-github-token',
+                    'FIXTURE_ROOT': str(self.root), 'TEAMCITY_FC_PLAN': 
str(self.plan)}
 
     def run_shell(self, command, mock=True, check=True, env=None):
         prefix = 'source "$1"\n'
         if mock:
-            prefix += '''teamcity_request(){ python3 "$FIXTURE_ROOT/mock.py" 
"$@"; }
-teamcity_current_pr(){ [[ ${PR_FRESH:-true} == true ]]; }
+            prefix += '''teamcity_current_pr(){ [[ ${PR_FRESH:-true} == true 
]]; }
 curl(){ python3 "$FIXTURE_ROOT/status_mock.py" "$@"; }
 '''
         result = subprocess.run(['bash', '-c', prefix + command, 'test', 
str(HELPER)],
@@ -102,59 +59,47 @@ curl(){ python3 "$FIXTURE_ROOT/status_mock.py" "$@"; }
             self.assertEqual(result.returncode, 0, result.stdout + 
result.stderr)
         return result
 
-    def trigger(self, lane='cloudut', count=1, **kwargs):
-        return self.run_shell('trigger_or_skip_build true 123 master ' + HEAD 
+ ' ' + lane + ' ' + str(count), **kwargs)
-
     def skipped_contexts(self):
         p = self.root / 'statuses.json'
         return [row['context'] for row in json.loads(p.read_text())] if 
p.exists() else []
 
     def test_unrelated_files_skip_without_submitting(self):
-        self.run_shell('trigger_or_skip_build false 123 master ' + HEAD + ' 
feut 1')
-        self.assertEqual(self.skipped_contexts(), ['TeamCity/feut'])
-        self.assertFalse(self.state().get('posts'))
-
-    def run_with_pr(self, pr, changed):
-        prefix = '''teamcity_request(){ python3 "$FIXTURE_ROOT/mock.py" "$@"; }
-curl(){
-    if [[ "$*" == *'/pulls/123'* ]]; then
-        printf '%s\\n' "$MOCK_PR";
-    else
-        python3 "$FIXTURE_ROOT/status_mock.py" "$@";
-    fi
-}
-'''
-        return self.run_shell(prefix + 'trigger_or_skip_build ' + changed + ' 
123 master ' + HEAD + ' feut 1',
-                              mock=False, check=False, env={'MOCK_PR': 
json.dumps(pr)})
-
-    def test_draft_pr_can_trigger_and_skip(self):
-        pr = {'state': 'open', 'draft': True, 'head': {'sha': HEAD}, 'base': 
{'ref': 'master'}}
-        result = self.run_with_pr(pr, 'true')
-        self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
-        self.assertEqual(len(self.state()['posts']), 1)
-        result = self.run_with_pr(pr, 'false')
-        self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
+        self.run_shell('trigger_or_skip_build false 123 master ' + HEAD + ' 
feut')
         self.assertEqual(self.skipped_contexts(), ['TeamCity/feut'])
+        self.assertFalse(self.plan.exists())
 
-    def test_closed_or_changed_draft_pr_cannot_trigger_or_skip(self):
-        for change in [{'state': 'closed'}, {'head': {'sha': 'b' * 40}}, 
{'base': {'ref': 'branch-4.2'}}]:
-            for changed in ['true', 'false']:
-                with self.subTest(change=change, changed=changed):
-                    pr = {'state': 'open', 'draft': True, 'head': {'sha': 
HEAD}, 'base': {'ref': 'master'}, **change}
-                    result = self.run_with_pr(pr, changed)
-                    self.assertNotEqual(result.returncode, 0)
-                    self.assertFalse(self.state().get('posts'))
-                    self.assertFalse(self.skipped_contexts())
+    def 
test_lane_approval_requires_an_open_pr_and_matching_file_snapshot(self):
+        workflow = (HELPER.parents[3] / 
'.github/workflows/comment-to-trigger-teamcity.yml').read_text()
+        step = workflow.split('    - name: Prepare FC lane selection\n', 
1)[1].split('    - name:', 1)[0]
+        script = textwrap.dedent(step.split('      run: |\n', 1)[1])
+        (self.root / 'all_files').write_text('be/src/example.cpp\n')
+        base_sha = 'c' * 40
+        pr = {'state': 'open', 'draft': True, 'head': {'sha': HEAD}, 'base': 
{'ref': 'master', 'sha': base_sha}}
+        for update, count, success in [({}, 1, True), ({'state': 'closed'}, 1, 
False),
+                                       ({'head': {'sha': 'b' * 40}}, 1, False),
+                                       ({'base': {'ref': 'branch-4.2', 'sha': 
base_sha}}, 1, False),
+                                       ({'base': {'ref': 'master', 'sha': 'd' 
* 40}}, 1, False),
+                                       ({}, 2, False), (None, 1, False)]:
+            with self.subTest(update=update, count=count):
+                plan = self.root / 'teamcity-fc-lanes'
+                plan.unlink(missing_ok=True)
+                env = {**self.env, 'PR': '123', 'HEAD_SHA': HEAD, 'BASE_SHA': 
base_sha, 'TARGET_BRANCH': 'master',
+                       'FILE_COUNT': str(count), 'MOCK_PR': json.dumps({**pr, 
**update}) if update is not None else '',
+                       'GITHUB_ENV': str(self.root / 'env'), 'RUNNER_TEMP': 
str(self.root)}
+                result = subprocess.run(['bash', '-eo', 'pipefail', '-c', 
'curl(){ echo "$MOCK_PR"; }\n' + script],
+                                        cwd=self.root, env=env, text=True, 
capture_output=True)
+                self.assertEqual(result.returncode == 0, success, 
result.stdout + result.stderr)
+                self.assertEqual(plan.exists(), success)
 
     def test_compile_skip_covers_downstream_checks(self):
-        self.run_shell('trigger_or_skip_build false 123 master ' + HEAD + ' 
compile 1')
+        self.run_shell('trigger_or_skip_build false 123 master ' + HEAD + ' 
compile')
         self.assertEqual(self.skipped_contexts(), ['TeamCity/compile', 
'TeamCity/p0', 'TeamCity/cloud_p0',
                                                   'TeamCity/vault_p0', 
'TeamCity/external', 'TeamCity/nonconcurrent'])
-        self.assertFalse(self.state().get('posts'))
+        self.assertFalse(self.plan.exists())
 
     def test_failed_skip_and_stale_head_do_not_succeed(self):
         for env in [{'STATUS_FAIL': 'true'}, {'PR_FRESH': 'false'}]:
-            result = self.run_shell('trigger_or_skip_build false 123 master ' 
+ HEAD + ' feut 1', check=False, env=env)
+            result = self.run_shell('trigger_or_skip_build false 123 master ' 
+ HEAD + ' feut', check=False, env=env)
             self.assertNotEqual(result.returncode, 0)
             self.assertFalse(self.skipped_contexts())
 
@@ -219,7 +164,7 @@ curl(){
     def test_keywords_match_required_checks(self):
         repo = HELPER.parents[3]
         required = set(re.findall(r'- (TeamCity/\S+)', (repo / 
'.asf.yaml').read_text()))
-        result = self.run_shell('for lane in "${!comment_to_pipeline[@]}"; do 
echo "$lane ${conment_to_context[$lane]}"; done')
+        result = self.run_shell('for lane in "${!conment_to_context[@]}"; do 
echo "$lane ${conment_to_context[$lane]}"; done')
         mappings = dict(line.split() for line in result.stdout.splitlines())
         self.assertEqual(set(mappings.values()), required | 
{'TeamCity/external', 'TeamCity/performance'})
         self.assertTrue(all(context == 'TeamCity/' + lane for lane, context in 
mappings.items()))
@@ -227,8 +172,7 @@ curl(){
         commands = re.search(r'reg="\^run \(([^)]+)\)', 
workflow).group(1).split('|')
         self.assertEqual(set(commands), set(mappings) | {'buildall'})
 
-    def parse_comment(self, command, branch='master', permission='write', 
check=True, user_id='27881198',
-                      login='tester', sender_id=None):
+    def parse_comment(self, command, branch='master', permission='write', 
check=True, user_id='27881198'):
         workflow = (HELPER.parents[3] / 
'.github/workflows/comment-to-trigger-teamcity.yml').read_text()
         block = workflow.split('    - name: "Parse PR comment"\n', 
1)[1].split('    - name:', 1)[0]
         script = textwrap.dedent(block.split('      run: |\n', 1)[1])
@@ -238,7 +182,6 @@ curl(){
         prefix = 'curl(){ printf "%s\\n" "$MOCK_GITHUB_RESPONSE"; };\n'
         result = subprocess.run(['bash', '-eo', 'pipefail', '-c', prefix + 
script], text=True, capture_output=True,
                                 env={**self.env, 'COMMENT_BODY': command, 
'COMMENT_USER_ID': user_id,
-                                     'COMMENT_LOGIN': login, 
'COMMENT_SENDER_ID': sender_id or user_id,
                                      'GITHUB_TOKEN': 'test-github-token', 
'GITHUB_OUTPUT': str(output),
                                      'GITHUB_ENV': str(self.root / 
'workflow-env'),
                                      'MOCK_GITHUB_RESPONSE': 
json.dumps({'head': {'sha': HEAD}, 'base': {'ref': branch, 'sha': 'c' * 40}, 
'changed_files': 1, 'permission': permission})})
@@ -252,38 +195,35 @@ curl(){
             result, output = self.parse_comment('run ' + lane + ' 2')
             self.assertIn('COMMENT_TRIGGER_TYPE=' + lane + '\n', output)
             self.assertIn('COMMENT_REPEAT_TIMES=2\n', output)
-        for command in ['run feut-extra', 'please run feut', 'run 
nonConcurrent', 'run p1', 'run cloud_p1', 'run check_coverage']:
+            self.assertIn('base_sha=' + 'c' * 40 + '\n', output)
+            self.assertIn('file_count=1\n', output)
+        for command in ['run feut-extra', 'please run feut', 'run 
nonConcurrent', 'run p1', 'run cloud_p1', 'run check_coverage',
+                        'run debugcompile', 'run debugall', 'run p0 21', 'run 
p0 0']:
             result, output = self.parse_comment(command, check=False)
             self.assertNotIn('COMMENT_TRIGGER_TYPE=', output)
 
-    def test_debug_commands_require_the_pilot_author_and_editor(self):
-        pilot = {'login': 'shuke987', 'user_id': '37901441'}
-        for lane in ['compile', 'feut', 'beut', 'cloudut', 'p0', 'cloud_p0', 
'vault_p0',
-                     'external', 'nonconcurrent', 'performance', 'all']:
-            _, output = self.parse_comment('run debug' + lane + ' 2', **pilot)
-            self.assertIn('fc=true', output)
-            self.assertIn('COMMENT_TRIGGER_TYPE=' + ('buildall' if lane == 
'all' else lane) + '\n', output)
-            self.assertIn('COMMENT_REPEAT_TIMES=2', output)
-        for kwargs in [{'login': 'other'}, {'user_id': '123'}, {'sender_id': 
'123'}]:
-            result, output = self.parse_comment('run debugall', **{**pilot, 
**kwargs}, check=False)
-            self.assertNotEqual(result.returncode, 0)
-            self.assertNotIn('fc=true', output)
-        for cmd in ['run debugcompile 21', 'run debugall extra', 'run 
debugunknown']:
-            result, _ = self.parse_comment(cmd, **pilot, check=False)
-            self.assertNotEqual(result.returncode, 0)
-        _, output = self.parse_comment('run compile', **pilot)
-        self.assertNotIn('fc=true', output)
-
-    def test_debug_selection_never_enqueues_directly(self):
-        plan = self.root / 'fc-lanes'
+    def test_workflow_plans_lanes_and_scopes_oidc_to_submission(self):
+        workflow = (HELPER.parents[3] / 
'.github/workflows/comment-to-trigger-teamcity.yml').read_text()
+        for title in ['Prepare FC lane selection', 'Collect selected FC 
lanes']:
+            step = workflow.split('    - name: ' + title + '\n', 1)[1].split(' 
     run: |', 1)[0]
+            self.assertIn("if: steps.parse.outputs.comment_trigger == 'true'", 
step)
+        gate, submit = workflow.split('  submit-fc:\n')
+        self.assertNotIn('TEAMCITY_CURRENT_TOKEN', workflow)
+        self.assertNotIn('id-token: write', gate)
+        self.assertIn('id-token: write', submit)
+        self.assertIn('needs: [check-comment-if-need-to-trigger-teamcity, 
approve-fc]', submit)
         for lane in ['compile', 'p0', 'feut']:
-            self.trigger(lane, env={'TEAMCITY_FC_PLAN': str(plan)})
-        self.run_shell('trigger_or_skip_build false 123 master ' + HEAD + ' 
cloudut 1',
-                       env={'TEAMCITY_FC_PLAN': str(plan)})
-        self.assertEqual(plan.read_text().splitlines(), ['compile', 'p0', 
'feut'])
-        self.assertFalse(self.state().get('posts'))
+            self.run_shell('trigger_or_skip_build true 123 master ' + HEAD + ' 
' + lane)
+        self.run_shell('trigger_or_skip_build false 123 master ' + HEAD + ' 
cloudut')
+        self.assertEqual(self.plan.read_text().splitlines(), ['compile', 'p0', 
'feut'])
         self.assertEqual(self.skipped_contexts(), ['TeamCity/cloudut'])
 
+    def test_missing_plan_stops_submission(self):
+        result = self.run_shell('trigger_or_skip_build true 123 master ' + 
HEAD + ' p0',
+                                env={'TEAMCITY_FC_PLAN': ''}, check=False)
+        self.assertNotEqual(result.returncode, 0)
+        self.assertIn('Missing FC lane plan', result.stderr)
+
     def test_fc_submission_validates_receipts_and_never_reposts(self):
         mock = '''curl(){
     local header
@@ -340,7 +280,7 @@ curl(){
             expected = {'TeamCity/' + lane for lane in ['compile', 'feut', 
'beut', 'cloudut', 'p0', 'cloud_p0', 'vault_p0', 'external', 'nonconcurrent']}
             if branch == 'master': expected.add('TeamCity/performance')
             self.assertEqual(set(self.skipped_contexts()), expected)
-            self.assertFalse(self.state().get('posts'))
+            self.assertFalse(self.plan.exists())
 
     def test_workflow_branch_and_permission_checks(self):
         for branch in ['branch-4.2', 'branch-4.1']:
@@ -352,50 +292,22 @@ curl(){
             result, _ = self.parse_comment('run feut', branch=branch, 
permission=permission, check=False)
             self.assertNotEqual(result.returncode, 0)
 
-    def test_credentials_are_not_traced(self):
-        result = self.run_shell('''curl(){ printf '%s\\n' "$@" > 
"$FIXTURE_ROOT/curl-args"; }
-set -x
-teamcity_request --fail https://ci.example
-''', mock=False)
-        self.assertNotIn('test-current-token', result.stdout + result.stderr)
-        args = (self.root / 'curl-args').read_text()
-        self.assertIn('Authorization: Bearer test-current-token', args)
-        self.assertNotIn('--user', args)
-
     def test_retired_branch_has_no_submission(self):
-        result = self.run_shell('trigger_or_skip_build true 123 branch-4.0 ' + 
HEAD + ' feut 1', check=False)
+        result = self.run_shell('trigger_or_skip_build true 123 branch-4.0 ' + 
HEAD + ' feut', check=False)
         self.assertNotEqual(result.returncode, 0)
-        self.assertFalse(self.state().get('posts'))
+        self.assertFalse(self.plan.exists())
 
     def test_release_branches_reject_performance(self):
         for branch in ['branch-4.2', 'branch-4.1']:
-            result = self.run_shell('trigger_or_skip_build true 123 ' + branch 
+ ' ' + HEAD + ' performance 1', check=False)
+            result = self.run_shell('trigger_or_skip_build true 123 ' + branch 
+ ' ' + HEAD + ' performance', check=False)
             self.assertNotEqual(result.returncode, 0)
-            self.assertFalse(self.state().get('posts'))
+            self.assertFalse(self.plan.exists())
 
     def test_status_token_is_not_traced(self):
         result = self.run_shell('curl(){ return 0; }; set -x; skip_build 
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" feut',
                                 mock=False, env={'GITHUB_TOKEN': 
'test-github-token'})
         self.assertNotIn('test-github-token', result.stdout + result.stderr)
 
-    def test_missing_private_token_has_no_public_fallback(self):
-        result = self.run_shell('curl(){ exit 99; }; teamcity_request 
https://ci.example', mock=False,
-                                check=False, env={'TEAMCITY_CURRENT_TOKEN': 
''})
-        self.assertEqual(result.returncode, 1)
-
-    def test_regressions_submit_directly_with_only_pr_parameters(self):
-        for lane, pipeline in [('p0', 'Doris_P0'), ('cloud_p0', 
'Doris_CloudP0'),
-                               ('vault_p0', 'Doris_VaultP0'), ('external', 
'Doris_External'),
-                               ('nonconcurrent', 'Doris_NonConcurrent')]:
-            self.save({})
-            self.trigger(lane)
-            body = self.state()['posts'][0]
-            self.assertEqual(body['buildType']['id'], pipeline)
-            self.assertEqual({p['name']: p['value'] for p in 
body['properties']['property']},
-                             {'env.PR_NUMBER': '123', 'env.CI_BRANCH': 
'master', 'env.CI_REQUESTED_PR_HEAD': HEAD})
-            self.assertNotIn('custom-artifact-dependencies', body)
-            self.assertEqual(len(self.state()['posts']), 1)
-
     def test_workflow_dispatch_matrix(self):
         workflow = (HELPER.parents[3] / 
'.github/workflows/comment-to-trigger-teamcity.yml').read_text()
         conditions = dict(re.findall(r'    - name: "Trigger ([a-z_]+)"\n      
if: \$\{\{ (.*?) \}\}', workflow))
@@ -413,54 +325,9 @@ teamcity_request --fail https://ci.example
                 if branch != 'master': expected.discard('performance')
                 self.assertEqual(selected, expected, (branch, command))
 
-    def test_exact_revision_submission(self):
-        self.trigger()
-        body = self.state()['posts'][0]
-        self.assertEqual(body['buildType']['id'], 'Doris_CloudUT')
-        self.assertEqual(body['branchName'], 'pull/123')
-        self.assertEqual(body['properties']['property'][0]['name'], 
'env.PR_NUMBER')
-
-    def test_active_build_does_not_prevent_submission(self):
-        self.save({'builds': [build()]})
-        self.trigger()
-        self.assertEqual(len(self.state()['posts']), 1)
-        self.assertEqual(self.state()['builds'][0]['state'], 'running')
-
-    def test_other_revision_is_preserved_and_not_reused(self):
-        self.save({'builds': [build(head='f' * 40)]})
-        self.trigger()
-        self.assertEqual(len(self.state()['posts']), 1)
-        self.assertEqual(self.state()['builds'][0]['state'], 'running')
-
-    def test_each_request_is_submitted_to_teamcity(self):
-        self.trigger(count=2)
-        self.trigger(count=2)
-        self.assertEqual(len(self.state()['posts']), 4)
-        for body in self.state()['posts']:
-            self.assertNotIn('env.CI_COMMENT_REQUEST_KEY', {p['name'] for p in 
body['properties']['property']})
-
-    def test_uncertain_post_does_not_automatically_retry(self):
-        self.save({'lose_response': True})
-        self.assertNotEqual(self.trigger(check=False).returncode, 0)
-        self.assertEqual(len(self.state()['posts']), 1)
-
-    def test_changed_pr_does_not_submit(self):
-        self.assertNotEqual(self.trigger(check=False, env={'PR_FRESH': 
'false'}).returncode, 0)
-        self.assertFalse(self.state().get('posts'))
-
-    def test_temporary_configuration_rejected(self):
-        self.save({'root': 'Doris_Performance_Schema70411_Debug'})
-        self.assertNotEqual(self.trigger('performance', 
check=False).returncode, 0)
-        self.assertFalse(self.state().get('posts'))
-
-    def test_invalid_count_rejected(self):
-        for count in [0, 21, 'abc']:
-            self.assertNotEqual(self.trigger(count=count, 
check=False).returncode, 0)
-        self.assertFalse(self.state().get('posts'))
-
     def test_removed_lane_has_no_legacy_fallback(self):
-        self.assertNotEqual(self.trigger('p1', check=False).returncode, 0)
-        self.assertFalse(self.state().get('posts'))
+        self.assertNotEqual(self.run_shell('trigger_or_skip_build true 123 
master ' + HEAD + ' p1', check=False).returncode, 0)
+        self.assertFalse(self.plan.exists())
 
 
 if __name__ == '__main__':


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

Reply via email to