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

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


The following commit(s) were added to refs/heads/master by this push:
     new 843d89c0ae ci: narrow K8s test triggers (#7340)
843d89c0ae is described below

commit 843d89c0ae71f39c04a2e30ee1388a7358c8d10d
Author: aias00 <[email protected]>
AuthorDate: Mon Sep 28 05:15:44 2026 -0700

    ci: narrow K8s test triggers (#7340)
---
 .github/scripts/resolve-test-case-matrix-test.sh | 77 ++++++++++++++++++++++++
 .github/scripts/resolve-test-case-matrix.sh      | 19 +++++-
 .github/workflows/ci.yml                         |  2 +
 3 files changed, 96 insertions(+), 2 deletions(-)

diff --git a/.github/scripts/resolve-test-case-matrix-test.sh 
b/.github/scripts/resolve-test-case-matrix-test.sh
new file mode 100644
index 0000000000..d29de388d5
--- /dev/null
+++ b/.github/scripts/resolve-test-case-matrix-test.sh
@@ -0,0 +1,77 @@
+#!/usr/bin/env bash
+#
+# 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.
+
+set -euo pipefail
+
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+readonly SCRIPT_DIR
+readonly RESOLVER="${SCRIPT_DIR}/resolve-test-case-matrix.sh"
+
+assert_k8s_output() {
+  local mode="$1"
+  local changed_file="$2"
+  local output_name="$3"
+  local expected="$4"
+  local output_file
+  local actual
+
+  output_file="$(mktemp)"
+  CI_CASE_MODE="${mode}" \
+    CHANGED_FILES_JSON="$(jq -cn --arg file "${changed_file}" '[ $file ]')" \
+    GITHUB_OUTPUT="${output_file}" \
+    bash "${RESOLVER}" >/dev/null
+
+  actual="$(awk -F= -v name="${output_name}" '$1 == name { print $2 }' 
"${output_file}")"
+  rm -f "${output_file}"
+
+  if [[ "${actual}" != "${expected}" ]]; then
+    echo "Expected ${output_name}=${expected} for ${changed_file}, got 
${actual}" >&2
+    return 1
+  fi
+}
+
+assert_k8s_output "k8s-ingress" \
+  "shenyu-client/shenyu-client-mcp/shenyu-client-mcp-common/pom.xml" \
+  "run_k8s_ingress" "false"
+assert_k8s_output "k8s-ingress" \
+  "shenyu-plugin/shenyu-plugin-ai/shenyu-plugin-ai-common/pom.xml" \
+  "run_k8s_ingress" "false"
+assert_k8s_output "k8s-ingress" \
+  "shenyu-integrated-test/shenyu-integrated-test-k8s-ingress-grpc/pom.xml" \
+  "run_k8s_ingress" "true"
+assert_k8s_output "k8s-ingress" \
+  
"shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-grpc/pom.xml"
 \
+  "run_k8s_ingress" "true"
+assert_k8s_output "k8s-ingress" "shenyu-common/pom.xml" "run_k8s_ingress" 
"true"
+assert_k8s_output "k8s-ingress" "pom.xml" "run_k8s_ingress" "true"
+
+assert_k8s_output "k8s-examples-http" \
+  "shenyu-client/shenyu-client-mcp/shenyu-client-mcp-common/pom.xml" \
+  "run_k8s_examples" "false"
+assert_k8s_output "k8s-examples-http" \
+  "shenyu-examples/shenyu-examples-grpc/pom.xml" \
+  "run_k8s_examples" "false"
+assert_k8s_output "k8s-examples-http" \
+  "shenyu-examples/shenyu-examples-http/pom.xml" \
+  "run_k8s_examples" "true"
+assert_k8s_output "k8s-examples-http" \
+  "shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-divide/pom.xml" \
+  "run_k8s_examples" "true"
+assert_k8s_output "k8s-examples-http" "shenyu-bootstrap/pom.xml" 
"run_k8s_examples" "true"
+assert_k8s_output "k8s-examples-http" "pom.xml" "run_k8s_examples" "true"
+
+echo "resolve-test-case-matrix k8s tests passed"
diff --git a/.github/scripts/resolve-test-case-matrix.sh 
b/.github/scripts/resolve-test-case-matrix.sh
index df83108102..843e56927b 100644
--- a/.github/scripts/resolve-test-case-matrix.sh
+++ b/.github/scripts/resolve-test-case-matrix.sh
@@ -93,7 +93,16 @@ resolve_k8s_change() {
 
   if [[ "${mode}" == "k8s-ingress" ]]; then
     case "${file}" in
-      
shenyu-integrated-test-k8s-ingress*/*|shenyu-*/*|pom.xml|*/pom.xml|shenyu-examples/*)
+      pom.xml|mvnw|mvnw.cmd|.mvn/*|\
+      shenyu-integrated-test/shenyu-integrated-test-k8s-ingress-*/*|\
+      shenyu-kubernetes-controller/*|\
+      shenyu-common/*|shenyu-web/*|shenyu-bootstrap/*|shenyu-admin/*|\
+      shenyu-admin-listener/*|shenyu-sync-data-center/*|\
+      
shenyu-loadbalancer/*|shenyu-protocol/*|shenyu-register-center/*|shenyu-registry/*|\
+      
shenyu-plugin/pom.xml|shenyu-plugin/shenyu-plugin-api/*|shenyu-plugin/shenyu-plugin-base/*|\
+      shenyu-spring-boot-starter/pom.xml|\
+      
*apache-dubbo*|*shenyu-plugin-dubbo*|*grpc*|*websocket*|*divide*|*springmvc*|\
+      shenyu-examples/shenyu-examples-http*/*)
         run_k8s_ingress=true
         ;;
     esac
@@ -102,7 +111,13 @@ resolve_k8s_change() {
 
   if [[ "${mode}" == "k8s-examples-http" ]]; then
     case "${file}" in
-      shenyu-examples/*|shenyu-*/*|pom.xml|*/pom.xml)
+      pom.xml|mvnw|mvnw.cmd|.mvn/*|\
+      shenyu-examples/shenyu-examples-http*/*|\
+      shenyu-common/*|shenyu-web/*|shenyu-bootstrap/*|shenyu-admin/*|\
+      shenyu-admin-listener/*|shenyu-sync-data-center/*|\
+      
shenyu-loadbalancer/*|shenyu-protocol/*|shenyu-register-center/*|shenyu-registry/*|\
+      
shenyu-plugin/pom.xml|shenyu-plugin/shenyu-plugin-api/*|shenyu-plugin/shenyu-plugin-base/*|\
+      shenyu-spring-boot-starter/pom.xml|*divide*|*springmvc*|*http*)
         run_k8s_examples=true
         ;;
     esac
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index fcb1edd5eb..56487dfec3 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -78,6 +78,8 @@ jobs:
       full_build_required: ${{ steps.modules.outputs.full_build_required }}
     steps:
       - uses: actions/checkout@v3
+      - name: Test CI case resolver
+        run: bash .github/scripts/resolve-test-case-matrix-test.sh
       - uses: ./actions/paths-filter
         id: filter
         with:

Reply via email to