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 de4265db93 ci: relax branch freshness and report required checks for 
non-code PRs (#7371)
de4265db93 is described below

commit de4265db93048ece6eeb1477b3bca373c8250673
Author: Liming Deng <[email protected]>
AuthorDate: Wed Sep 30 09:34:18 2026 +0800

    ci: relax branch freshness and report required checks for non-code PRs 
(#7371)
    
    * chore: allow merging PRs without updating to latest master
    
    * ci: report required checks for non-code pull requests
    
    ---------
    
    Co-authored-by: wy471x <[email protected]>
    Co-authored-by: aias00 <[email protected]>
---
 .asf.yaml                                        |  2 +-
 .github/scripts/resolve-ci-modules.sh            |  3 +++
 .github/scripts/resolve-test-case-matrix-test.sh | 33 ++++++++++++++++++++----
 .github/scripts/resolve-test-case-matrix.sh      |  3 +++
 .github/workflows/ci.yml                         | 22 +---------------
 .github/workflows/e2e-k8s.yml                    | 29 +++++----------------
 6 files changed, 43 insertions(+), 49 deletions(-)

diff --git a/.asf.yaml b/.asf.yaml
index e91e3f2ab5..4370f5a67b 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -33,7 +33,7 @@ github:
   protected_branches:
     master:
       required_status_checks:
-        strict: true
+        strict: false
         contexts:
           - check-license-header
           - build
diff --git a/.github/scripts/resolve-ci-modules.sh 
b/.github/scripts/resolve-ci-modules.sh
index 8d9e313385..d96f9a62f1 100644
--- a/.github/scripts/resolve-ci-modules.sh
+++ b/.github/scripts/resolve-ci-modules.sh
@@ -82,6 +82,9 @@ is_ignored_change() {
   local file="$1"
 
   case "${file}" in
+    
*.png|*.jpg|*.jpeg|*.gif|*.svg|*.ico|*.pdf|*.doc|*.docx|DISCLAIMER|*/resources/static/*)
+      return 0
+      ;;
     
.github/*|shenyu-e2e/*|shenyu-integrated-test/*|*.md|*.txt|resources/static/*|.asf.yaml|.gitignore|.licenserc.yaml|LICENSE|NOTICE|*/LICENSE|*/NOTICE)
       return 0
       ;;
diff --git a/.github/scripts/resolve-test-case-matrix-test.sh 
b/.github/scripts/resolve-test-case-matrix-test.sh
index 0376052df6..f9e34726c1 100644
--- a/.github/scripts/resolve-test-case-matrix-test.sh
+++ b/.github/scripts/resolve-test-case-matrix-test.sh
@@ -62,24 +62,29 @@ assert_file_output() {
   assert_output "${mode}" "${changed_files_json}" "${output_name}" 
"${expected}"
 }
 
-assert_ci_ignored() {
-  local changed_file="$1"
+assert_ci_output() {
+  local changed_files_json="$1"
+  local expected="$2"
   local output_file
   local actual
 
   output_file="$(mktemp)"
-  CHANGED_FILES_JSON="$(jq -cn --arg file "${changed_file}" '[ $file ]')" \
+  CHANGED_FILES_JSON="${changed_files_json}" \
     GITHUB_OUTPUT="${output_file}" \
     bash "${SCRIPT_DIR}/resolve-ci-modules.sh" >/dev/null
   actual="$(read_output "${output_file}" "has_code_changes")"
   rm -f "${output_file}"
 
-  if [[ "${actual}" != "false" ]]; then
-    echo "Expected main CI to ignore ${changed_file}, got 
has_code_changes=${actual}" >&2
+  if [[ "${actual}" != "${expected}" ]]; then
+    echo "Expected has_code_changes=${expected} for ${changed_files_json}, got 
${actual}" >&2
     return 1
   fi
 }
 
+assert_ci_ignored() {
+  assert_ci_output "$(jq -cn --arg file "$1" '[ $file ]')" "false"
+}
+
 assert_file_output "k8s-ingress" \
   "shenyu-client/shenyu-client-mcp/shenyu-client-mcp-common/pom.xml" \
   "run_k8s_ingress" "false"
@@ -120,6 +125,24 @@ readonly 
ALL_K8S_INGRESS_MATRIX='{"include":[{"case":"shenyu-integrated-test-k8s
 readonly 
ADMIN_REGISTER_E2E_MATRIX='{"include":[{"script":"e2e-http-sync-compose","case":"shenyu-e2e-case-http","example_projects":":shenyu-examples-http"},{"script":"e2e-springcloud-sync-compose","case":"shenyu-e2e-case-spring-cloud","example_projects":":shenyu-examples-eureka,:shenyu-examples-springcloud"},{"script":"e2e-apache-dubbo-sync-compose","case":"shenyu-e2e-case-apache-dubbo","example_projects":":shenyu-examples-apache-dubbo-service"},{"script":"e2e-grpc-sync-compose","case":"
 [...]
 readonly 
ADMIN_REGISTER_IT_MATRIX='{"include":[{"case":"shenyu-integrated-test-apache-dubbo"},{"case":"shenyu-integrated-test-grpc"},{"case":"shenyu-integrated-test-http"},{"case":"shenyu-integrated-test-https"},{"case":"shenyu-integrated-test-spring-cloud"},{"case":"shenyu-integrated-test-websocket"},{"case":"shenyu-integrated-test-sdk-apache-dubbo"},{"case":"shenyu-integrated-test-sdk-http"}]}'
 
+# Non-code PRs still run required workflows, but must not schedule builds or 
E2E.
+for ignored_file in .asf.yaml README.md DISCLAIMER \
+  shenyu-admin/src/main/resources/static/app.js \
+  shenyu-common/docs/guide.txt; do
+  assert_ci_ignored "${ignored_file}"
+  assert_file_output "e2e" "${ignored_file}" "run_e2e" "false"
+done
+for extension in png jpg jpeg gif svg ico pdf doc docx; do
+  assert_ci_ignored "shenyu-common/docs/example.${extension}"
+  assert_file_output "e2e" "shenyu-common/docs/example.${extension}" "run_e2e" 
"false"
+done
+assert_output "e2e" '[".asf.yaml", "shenyu-common/docs/example.png", 
"pom.xml"]' "run_e2e" "true"
+assert_ci_output '["pom.xml"]' "true"
+assert_ci_output '[".asf.yaml", "shenyu-common/docs/example.png", "pom.xml"]' 
"true"
+assert_ci_output "$(jq -cn --arg file "${ADMIN_SERVICE}" '[ $file ]')" "true"
+assert_ci_output "$(jq -cn --arg file "${ADMIN_SERVICE}" '["README.md", 
$file]')" "true"
+assert_output "e2e" "$(jq -cn --arg file "${ADMIN_SERVICE}" '["README.md", 
$file]')" "run_e2e" "true"
+
 assert_ci_ignored "${E2E_GRPC}"
 assert_file_output "e2e" "${E2E_GRPC}" "e2e_matrix" \
   
'{"include":[{"script":"e2e-grpc-sync-compose","case":"shenyu-e2e-case-grpc","example_projects":":shenyu-examples-grpc"}]}'
diff --git a/.github/scripts/resolve-test-case-matrix.sh 
b/.github/scripts/resolve-test-case-matrix.sh
index b126711119..5a442bf54e 100644
--- a/.github/scripts/resolve-test-case-matrix.sh
+++ b/.github/scripts/resolve-test-case-matrix.sh
@@ -106,6 +106,9 @@ is_ignored_change() {
   local file="$1"
 
   case "${file}" in
+    
*.png|*.jpg|*.jpeg|*.gif|*.svg|*.ico|*.pdf|*.doc|*.docx|DISCLAIMER|*/resources/static/*)
+      return 0
+      ;;
     
.github/*|*.md|*.txt|resources/static/*|.asf.yaml|.gitignore|.licenserc.yaml|LICENSE|NOTICE)
       return 0
       ;;
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index ca6b523323..e969585086 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -16,28 +16,8 @@
 name: ci
 
 on:
+  # Required checks must report a result even for documentation-only PRs.
   pull_request:
-    paths-ignore:
-      - '**.md'
-      - '**.txt'
-      - '**.png'
-      - '**.jpg'
-      - '**.jpeg'
-      - '**.gif'
-      - '**.svg'
-      - '**.ico'
-      - '**.pdf'
-      - '**.doc'
-      - '**.docx'
-      - 'LICENSE'
-      - 'NOTICE'
-      - 'DISCLAIMER'
-      - '.asf.yaml'
-      - '.gitignore'
-      - '.licenserc.yaml'
-      - '.github/ISSUE_TEMPLATE/**'
-      - '.github/PULL_REQUEST_TEMPLATE'
-      - '**/resources/static/**'
   push:
     branches:
       - master
diff --git a/.github/workflows/e2e-k8s.yml b/.github/workflows/e2e-k8s.yml
index 5c16c03b34..c0b6775f8b 100644
--- a/.github/workflows/e2e-k8s.yml
+++ b/.github/workflows/e2e-k8s.yml
@@ -16,28 +16,8 @@
 name: e2e
 
 on:
+  # Required checks must report a result even for documentation-only PRs.
   pull_request:
-    paths-ignore:
-      - '**.md'
-      - '**.txt'
-      - '**.png'
-      - '**.jpg'
-      - '**.jpeg'
-      - '**.gif'
-      - '**.svg'
-      - '**.ico'
-      - '**.pdf'
-      - '**.doc'
-      - '**.docx'
-      - 'LICENSE'
-      - 'NOTICE'
-      - 'DISCLAIMER'
-      - '.asf.yaml'
-      - '.gitignore'
-      - '.licenserc.yaml'
-      - '.github/ISSUE_TEMPLATE/**'
-      - '.github/PULL_REQUEST_TEMPLATE'
-      - '**/resources/static/**'
   push:
     branches:
       - master
@@ -398,15 +378,20 @@ jobs:
 
   requirement:
     name: e2e
-    if: ${{ always() && needs.changes.outputs.run_e2e == 'true' }}
+    if: ${{ always() }}
     needs:
       - changes
+      - build-docker-images
       - e2e-storage
       - e2e-case
     runs-on: ubuntu-latest
     steps:
       - name: checking job status
         run: |
+          [[ "${{ needs.changes.result }}" == "success" ]] || exit 1
+          if [[ "${{ needs.changes.outputs.run_e2e }}" == "true" ]]; then
+            [[ "${{ needs.build-docker-images.result }}" == "success" ]] || 
exit 1
+          fi
           if [[ "${{ needs.changes.outputs.run_storage }}" == "true" ]]; then
             [[ "${{ needs.e2e-storage.result }}" == "success" ]] || exit -1
           fi

Reply via email to