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

janhoy pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new 4c9a0e35a42 Add concurrency groups to all PR-triggered workflows 
(branch_9x) (#4319)
4c9a0e35a42 is described below

commit 4c9a0e35a42947ba2b64aecfeb5312e2e51ff8ae
Author: Jan Høydahl <[email protected]>
AuthorDate: Thu Apr 23 10:08:34 2026 +0200

    Add concurrency groups to all PR-triggered workflows (branch_9x) (#4319)
---
 .github/workflows/bin-solr-test.yml           |  4 ++++
 .github/workflows/docker-test.yml             |  4 ++++
 .github/workflows/gradle-extraction-check.yml |  4 ++++
 .github/workflows/gradle-precommit.yml        |  4 ++++
 .github/workflows/solrj-test.yml              |  4 ++++
 .github/workflows/tests-via-crave.yml         | 24 +++++++++++++++++-------
 .github/workflows/validate-changelog.yml      |  4 ++++
 7 files changed, 41 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/bin-solr-test.yml 
b/.github/workflows/bin-solr-test.yml
index 5ffbbff884d..30bbc5433cf 100644
--- a/.github/workflows/bin-solr-test.yml
+++ b/.github/workflows/bin-solr-test.yml
@@ -11,6 +11,10 @@ on:
       - 'solr/core/src/java/org/apache/solr/cli/**'
       - 'solr/prometheus-exporter/**'
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || 
github.ref }}
+  cancel-in-progress: true
+
 jobs:
   test:
     name: Run Solr Script Tests
diff --git a/.github/workflows/docker-test.yml 
b/.github/workflows/docker-test.yml
index 74557283d92..7f40ee7807e 100644
--- a/.github/workflows/docker-test.yml
+++ b/.github/workflows/docker-test.yml
@@ -10,6 +10,10 @@ on:
       - 'solr/docker/**'
       - 'solr/packaging/**'
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || 
github.ref }}
+  cancel-in-progress: true
+
 jobs:
   test:
     name: Build and test Docker image
diff --git a/.github/workflows/gradle-extraction-check.yml 
b/.github/workflows/gradle-extraction-check.yml
index 61b21cb4ca4..f2a3f645a8f 100644
--- a/.github/workflows/gradle-extraction-check.yml
+++ b/.github/workflows/gradle-extraction-check.yml
@@ -8,6 +8,10 @@ on:
     paths:
       - 'solr/modules/extraction/**'
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || 
github.ref }}
+  cancel-in-progress: true
+
 jobs:
   test:
     name: extraction module tests with docker
diff --git a/.github/workflows/gradle-precommit.yml 
b/.github/workflows/gradle-precommit.yml
index 7cc7cd95cf9..1d878fb98b5 100644
--- a/.github/workflows/gradle-precommit.yml
+++ b/.github/workflows/gradle-precommit.yml
@@ -5,6 +5,10 @@ on:
     branches:
       - '*'
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || 
github.ref }}
+  cancel-in-progress: true
+
 jobs:
   test:
     name: gradle check
diff --git a/.github/workflows/solrj-test.yml b/.github/workflows/solrj-test.yml
index 68942e7b87d..6ed6d5254ce 100644
--- a/.github/workflows/solrj-test.yml
+++ b/.github/workflows/solrj-test.yml
@@ -8,6 +8,10 @@ on:
       - '.github/workflows/solrj-test.yml'
       - 'solr/solrj/**'
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || 
github.ref }}
+  cancel-in-progress: true
+
 jobs:
   test:
     name: Run SolrJ Tests
diff --git a/.github/workflows/tests-via-crave.yml 
b/.github/workflows/tests-via-crave.yml
index 1476d9c9660..b8b7e0b9db5 100644
--- a/.github/workflows/tests-via-crave.yml
+++ b/.github/workflows/tests-via-crave.yml
@@ -5,6 +5,10 @@ on:
     branches:
       - '*'
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || 
github.ref }}
+  cancel-in-progress: true
+
 jobs:
   test:
     name: Run Solr Tests using Crave.io resources
@@ -12,24 +16,30 @@ jobs:
     runs-on: self-hosted
     timeout-minutes: 40
 
+    env:
+      # Use a PR-scoped workspace path so that each new run for the same PR
+      # destroys any leftover resources from a previous run (including 
cancelled
+      # runs whose cleanup step may not have completed in time).
+      CRAVE_WORKSPACE: /crave-devspaces/pipeline/prs/${{ 
github.event.pull_request.number }}
+
     steps:
     - name: Destroy previous clone
-      run: crave clone destroy -y 
/crave-devspaces/pipeline/runs/${GITHUB_RUN_ID}_${GITHUB_RUN_NUMBER} || echo 
"Clone did not exist"
+      run: crave clone destroy -y ${CRAVE_WORKSPACE} || echo "Clone did not 
exist"
       continue-on-error: true
     - name: Crave clone sources
-      run: crave clone create --projectID 39 
/crave-devspaces/pipeline/runs/${GITHUB_RUN_ID}_${GITHUB_RUN_NUMBER}
+      run: crave clone create --projectID 39 ${CRAVE_WORKSPACE}
     - name: Checkout the correct branch
       run: |
-        git -C 
/crave-devspaces/pipeline/runs/${GITHUB_RUN_ID}_${GITHUB_RUN_NUMBER} fetch 
origin ${GITHUB_REF}:${GITHUB_REF}
-        git -C 
/crave-devspaces/pipeline/runs/${GITHUB_RUN_ID}_${GITHUB_RUN_NUMBER} checkout 
${GITHUB_REF}
+        git -C ${CRAVE_WORKSPACE} fetch origin ${GITHUB_REF}:${GITHUB_REF}
+        git -C ${CRAVE_WORKSPACE} checkout ${GITHUB_REF}
     - name: Initialize, build, test
       run: |
-        cd /crave-devspaces/pipeline/runs/${GITHUB_RUN_ID}_${GITHUB_RUN_NUMBER}
+        cd ${CRAVE_WORKSPACE}
         crave run --clean --message "PR: ${GITHUB_REF_NAME}" -- ./gradlew 
--console=plain test
     - name: Cleanup
       if: ${{ always() }}
       run: |
-        pushd 
/crave-devspaces/pipeline/runs/${GITHUB_RUN_ID}_${GITHUB_RUN_NUMBER}
+        pushd ${CRAVE_WORKSPACE}
         crave stop --all
         popd
-        crave clone destroy -y 
/crave-devspaces/pipeline/runs/${GITHUB_RUN_ID}_${GITHUB_RUN_NUMBER}
+        crave clone destroy -y ${CRAVE_WORKSPACE}
diff --git a/.github/workflows/validate-changelog.yml 
b/.github/workflows/validate-changelog.yml
index 028ddd8c176..2d6c3a71d78 100644
--- a/.github/workflows/validate-changelog.yml
+++ b/.github/workflows/validate-changelog.yml
@@ -5,6 +5,10 @@ on:
     branches:
       - '*'
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || 
github.ref }}
+  cancel-in-progress: true
+
 jobs:
   validate-changelog:
     name: Check changelog entry

Reply via email to