You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by he...@apache.org on 2026/05/15 11:56:39 UTC

(doris) 01/01: [fix](pipeline) fix comment-trigger workflow crash when GitHub API rate limit causes missing all_files

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

hello-stephen pushed a commit to branch fix/pipeline-trigger-rate-limit
in repository https://gitbox.apache.org/repos/asf/doris.git

commit e9cff2ea4400bd0bfad08de1adeec7775712d99e
Author: lidongyang <li...@selectdb.com>
AuthorDate: Fri May 15 19:56:07 2026 +0800

    [fix](pipeline) fix comment-trigger workflow crash when GitHub API rate limit causes missing all_files
    
    Two issues fixed:
    1. `_get_pr_changed_files_count` and `_get_pr_changed_files` in github-utils.sh
       made unauthenticated curl requests, hitting GitHub's 60 req/h anonymous rate
       limit on shared Actions runner IPs. Added `${GITHUB_TOKEN:+-H "Authorization:
       Bearer ${GITHUB_TOKEN}"}` so requests use the 5000 req/h authenticated limit
       when GITHUB_TOKEN is available (no-op when unset, preserving local usage).
    
    2. When `_get_pr_changed_files` fails, step 4 falls back to trigger-all but does
       NOT create the `all_files` file. Step 5 then crashes with "No such file or
       directory" on `< all_files`, causing conclusion=failure and skipping all
       TeamCity trigger steps. Added an early-exit guard in step 5 to handle this
       gracefully.
    
    Co-Authored-By: Claude Sonnet 4.6 <no...@anthropic.com>
---
 .github/workflows/comment-to-trigger-teamcity.yml | 6 ++++++
 regression-test/pipeline/common/github-utils.sh   | 5 ++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/comment-to-trigger-teamcity.yml b/.github/workflows/comment-to-trigger-teamcity.yml
index 92336f430f5..5e40d1c0cfc 100644
--- a/.github/workflows/comment-to-trigger-teamcity.yml
+++ b/.github/workflows/comment-to-trigger-teamcity.yml
@@ -230,6 +230,12 @@ jobs:
         # Matches .sh files under regression-test/pipeline/ but excludes files under conf/ subdirectories.
         source regression-test/pipeline/common/github-utils.sh
 
+        if [[ ! -f all_files ]]; then
+          echo "WARNING: all_files not found (GitHub API call likely failed in previous step)."
+          echo "Skipping sensitive check — previous step already defaulted to trigger-all."
+          exit 0
+        fi
+
         changed_sensitive=false
         while IFS= read -r f; do
           if [[ "${f}" == regression-test/pipeline/*.sh ||
diff --git a/regression-test/pipeline/common/github-utils.sh b/regression-test/pipeline/common/github-utils.sh
index ca3977bfc4c..048b282701e 100644
--- a/regression-test/pipeline/common/github-utils.sh
+++ b/regression-test/pipeline/common/github-utils.sh
@@ -131,7 +131,9 @@ _get_pr_changed_files_count() {
     while [[ ${try_times} -gt 0 ]]; do
         set -x
         if ret=$(
-            curl -s -H "Accept: application/vnd.github+json" \
+            curl -s \
+                -H "Accept: application/vnd.github+json" \
+                ${GITHUB_TOKEN:+-H "Authorization: Bearer ${GITHUB_TOKEN}"} \
                 https://api.github.com/repos/"${OWNER}"/"${REPO}"/pulls/"${PULL_NUMBER}" | jq -e '.changed_files'
         ); then
             set +x
@@ -169,6 +171,7 @@ _get_pr_changed_files() {
             set -x
             if curl -s \
                 -H "Accept: application/vnd.github+json" \
+                ${GITHUB_TOKEN:+-H "Authorization: Bearer ${GITHUB_TOKEN}"} \
                 https://api.github.com/repos/"${OWNER}"/"${REPO}"/pulls/"${PULL_NUMBER}"/files?page="${page}"\&per_page="${per_page}" \
                 >>"${file_name}"; then
                 set +x


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org