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

FrankChen021 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new a9d7cf9629b ci: keep the milestone creation message out of the 
milestone number (#20694)
a9d7cf9629b is described below

commit a9d7cf9629b5e29832c0143df568ad42421ed136
Author: Andreas Maechler <[email protected]>
AuthorDate: Sun Oct 25 01:58:18 2026 -0600

    ci: keep the milestone creation message out of the milestone number (#20694)
    
    * ci: keep the milestone creation message out of the milestone number
    
    get_milestone_number returns the number on stdout, but also echoed
    "Creating milestone: ..." there when the milestone did not exist yet.
    The caller then sent both lines as the milestone and GitHub rejected the
    update with HTTP 422, so the first PR merged for a new version got no
    milestone. Print the message to stderr instead.
    
    * ci: fail the milestone step when the milestone number is not resolved
    
    Look up milestones in every state and across pages, so a closed milestone
    is found instead of being created again. If neither the lookup nor the
    create returns a number, for example when two merges race to create the
    same milestone, fail the step instead of sending an empty milestone and
    reporting success.
    
    * ci: stop the milestone step when the milestone lookup fails
    
    The lookup was assigned in its `local` declaration, which hid the exit
    status of `gh api`. A failed lookup then looked like a missing milestone
    and the script tried to create it. Declare the variable separately and
    return early when the lookup fails.
    
    * ci: skip unit tests and CodeQL when only PR automation changes
    
    The labeler, milestone, backport, PR title check and stale workflows and
    their scripts are not used by the build or tests, so a PR that only
    changes them does not need the unit test matrix or CodeQL. A PR that
    also changes anything else still runs both.
    
    * ci: check the milestone create call the same way as the lookup
    
    Return early when the create call fails instead of validating the number
    afterwards, so both gh calls use one guard style.
    
    * ci: also skip unit tests and CodeQL for Dependabot config changes
    
    The build and tests do not read .github/dependabot.yml either.
---
 .github/scripts/auto-add-milestone.sh                | 10 ++++++----
 .github/workflows/codeql.yml                         | 20 ++++++++++++++++++++
 .../workflows/unit-and-integration-tests-unified.yml | 20 ++++++++++++++++++++
 3 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/.github/scripts/auto-add-milestone.sh 
b/.github/scripts/auto-add-milestone.sh
index 7b1dacdc2a9..81d50994286 100755
--- a/.github/scripts/auto-add-milestone.sh
+++ b/.github/scripts/auto-add-milestone.sh
@@ -19,11 +19,12 @@ set -e
 
 get_milestone_number() {
   local milestone_title="$1"
-  local number=$(gh api "repos/$REPOSITORY/milestones" --jq ".[] | 
select(.title==\"$milestone_title\") | .number")
+  local number
+  number=$(gh api "repos/$REPOSITORY/milestones?state=all&per_page=100" 
--paginate --jq ".[] | select(.title==\"$milestone_title\") | .number") || 
return 1
 
   if [ -z "$number" ]; then
-    echo "Creating milestone: $milestone_title"
-    number=$(gh api "repos/$REPOSITORY/milestones" -f title="$milestone_title" 
--jq '.number')
+    echo "Creating milestone: $milestone_title" >&2
+    number=$(gh api "repos/$REPOSITORY/milestones" -f title="$milestone_title" 
--jq '.number') || return 1
   fi
 
   echo "$number"
@@ -34,7 +35,8 @@ create_backport_issue() {
   local pr_title="$2"
   local target_milestone="$3"
 
-  local milestone_number=$(get_milestone_number "$target_milestone")
+  local milestone_number
+  milestone_number=$(get_milestone_number "$target_milestone") || return 1
   local message="Backport #$pr_number to release branch for version 
$target_milestone"
   local note="Add the \`approved\` label to start the automatic backport 
process."
   local body=$(jq -n --arg source_pr "$pr_number" --arg target_version 
"$target_milestone" --arg message "$message" --arg note "$note" '$ARGS.named')
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index e81237da711..7d6c3221c28 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -6,12 +6,32 @@ on:
       - '**/*.md'
       - 'dev/**'
       - 'docs/**'
+      # PR automation that the build and tests do not use
+      - '.github/dependabot.yml'
+      - '.github/labeler.yml'
+      - '.github/scripts/auto-add-milestone.sh'
+      - '.github/scripts/backport-pr.sh'
+      - '.github/workflows/backport.yml'
+      - '.github/workflows/labeler.yml'
+      - '.github/workflows/pr-checks.yml'
+      - '.github/workflows/pr-merged.yml'
+      - '.github/workflows/stale.yml'
     branches: [ 'master', '0.6.x', '0.7.x', '0.7.1.x', '0.7.2.x', '0.8.0', 
'0.8.1', '0.8.2', '0.8.3', '0.9.0', '0.9.1' ]
   pull_request:
     paths-ignore:
       - '**/*.md'
       - 'dev/**'
       - 'docs/**'
+      # PR automation that the build and tests do not use
+      - '.github/dependabot.yml'
+      - '.github/labeler.yml'
+      - '.github/scripts/auto-add-milestone.sh'
+      - '.github/scripts/backport-pr.sh'
+      - '.github/workflows/backport.yml'
+      - '.github/workflows/labeler.yml'
+      - '.github/workflows/pr-checks.yml'
+      - '.github/workflows/pr-merged.yml'
+      - '.github/workflows/stale.yml'
     # The branches below must be a subset of the branches above
     branches: [ 'master' ]
   schedule:
diff --git a/.github/workflows/unit-and-integration-tests-unified.yml 
b/.github/workflows/unit-and-integration-tests-unified.yml
index d7d7e955e49..120e45cde08 100644
--- a/.github/workflows/unit-and-integration-tests-unified.yml
+++ b/.github/workflows/unit-and-integration-tests-unified.yml
@@ -24,6 +24,16 @@ on:
       - 'examples/**/jupyter-notebooks/**'
       - 'web-console/**'
       - 'website/**'
+      # PR automation that the build and tests do not use
+      - '.github/dependabot.yml'
+      - '.github/labeler.yml'
+      - '.github/scripts/auto-add-milestone.sh'
+      - '.github/scripts/backport-pr.sh'
+      - '.github/workflows/backport.yml'
+      - '.github/workflows/labeler.yml'
+      - '.github/workflows/pr-checks.yml'
+      - '.github/workflows/pr-merged.yml'
+      - '.github/workflows/stale.yml'
     branches:
       - master
       - '[0-9]+.[0-9]+.[0-9]+' # release branches
@@ -37,6 +47,16 @@ on:
       - 'examples/**/jupyter-notebooks/**'
       - 'web-console/**'
       - 'website/**'
+      # PR automation that the build and tests do not use
+      - '.github/dependabot.yml'
+      - '.github/labeler.yml'
+      - '.github/scripts/auto-add-milestone.sh'
+      - '.github/scripts/backport-pr.sh'
+      - '.github/workflows/backport.yml'
+      - '.github/workflows/labeler.yml'
+      - '.github/workflows/pr-checks.yml'
+      - '.github/workflows/pr-merged.yml'
+      - '.github/workflows/stale.yml'
     branches:
       - master
       - '[0-9]+.[0-9]+.[0-9]+' # release branches


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

Reply via email to