From 8e6a27da5d7e179458e01bb187be2575ccac7222 Mon Sep 17 00:00:00 2001 From: Romain Brenguier Date: Wed, 8 Jul 2026 15:54:29 +0200 Subject: [PATCH 01/13] Add ruling diff comment workflow Based on action from core-languages-tooling. --- .github/workflows/ruling-diff-comment.yml | 56 +++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/ruling-diff-comment.yml diff --git a/.github/workflows/ruling-diff-comment.yml b/.github/workflows/ruling-diff-comment.yml new file mode 100644 index 00000000000..adf1892f4a1 --- /dev/null +++ b/.github/workflows/ruling-diff-comment.yml @@ -0,0 +1,56 @@ +name: Ruling Diff Comment + +on: + pull_request: + types: [opened, synchronize, reopened] + paths: + # Trigger on ruling JSON file changes + - 'its/ruling/src/test/resources/**/*.json' + # Uncomment to test action changes + - '.github/workflows/ruling-diff-comment.yml' + workflow_dispatch: + inputs: + pr-number: + description: 'Pull request number' + required: true + type: string + base-sha: + description: 'Base commit SHA for diff' + required: true + type: string + head-sha: + description: 'Head commit SHA for diff' + required: true + type: string + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +permissions: + contents: read + pull-requests: write + +jobs: + ruling-diff-comment: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + + # Use the action from the branch we just pushed + - name: Post ruling diff comment + uses: SonarSource/core-languages-tooling-public/ruling-diff-comment@romain/ruling-diff-action + with: + pr-number: ${{ inputs.pr-number || github.event.pull_request.number }} + repository: ${{ github.repository }} + base-sha: ${{ inputs.base-sha || github.event.pull_request.base.sha }} + head-sha: ${{ inputs.head-sha || github.event.pull_request.head.sha }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 8b1d78c0762cc66590f6fa58a4c11ebf917ee9cf Mon Sep 17 00:00:00 2001 From: Romain Brenguier Date: Wed, 8 Jul 2026 15:56:00 +0200 Subject: [PATCH 02/13] DO NOT MERGE Introduce some diff for testing. --- .../src/test/resources/commons-beanutils/java-S1134.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/its/ruling/src/test/resources/commons-beanutils/java-S1134.json b/its/ruling/src/test/resources/commons-beanutils/java-S1134.json index 7903ed35965..6e83b879d1c 100644 --- a/its/ruling/src/test/resources/commons-beanutils/java-S1134.json +++ b/its/ruling/src/test/resources/commons-beanutils/java-S1134.json @@ -15,13 +15,13 @@ "commons-beanutils:commons-beanutils:src/main/java/org/apache/commons/beanutils2/PropertyUtilsBean.java": [ 345, 702, -722, +719, 886, 980, 999, 1028, 1166, -1182, +1203, 1280, 1296 ], From a64f341fd3e300d1f45ac57ed178fe2b0b3ea52a Mon Sep 17 00:00:00 2001 From: Romain Brenguier Date: Wed, 8 Jul 2026 15:59:05 +0200 Subject: [PATCH 03/13] Optimize ruling tests for faster CI - Exclude most ruling tests (guava, mall, jetty, etc.) using @Ignore - Keep only commons-beanutils test active for PR validation - Add test changes to commons-beanutils S1134 to demonstrate diff comments This is a temporary change to speed up CI for demonstrating the ruling diff comment feature. Not intended for merge to master. Co-Authored-By: Claude Sonnet 4.5 --- .../src/test/java/org/sonar/java/it/JavaRulingTest.java | 8 ++++++++ .../src/test/resources/commons-beanutils/java-S1134.json | 7 ++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/its/ruling/src/test/java/org/sonar/java/it/JavaRulingTest.java b/its/ruling/src/test/java/org/sonar/java/it/JavaRulingTest.java index 41f81ec4652..fb1644f3e7d 100644 --- a/its/ruling/src/test/java/org/sonar/java/it/JavaRulingTest.java +++ b/its/ruling/src/test/java/org/sonar/java/it/JavaRulingTest.java @@ -48,6 +48,7 @@ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.ClassRule; +import org.junit.Ignore; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.slf4j.Logger; @@ -189,6 +190,7 @@ private static void copyFile(Path source, Path targetDir) { } @Test + @Ignore("Excluded to speed up CI for PR demo") public void spring_mall() throws Exception { String projectName = "mall"; MavenBuild build = test_project("com.macro.mall:mall", projectName); @@ -201,6 +203,7 @@ public void spring_mall() throws Exception { } @Test + @Ignore("Excluded to speed up CI for PR demo") public void guava() throws Exception { String projectName = "guava"; MavenBuild build = test_project("com.google.guava:guava", projectName); @@ -227,6 +230,7 @@ public void apache_commons_beanutils() throws Exception { } @Test + @Ignore("Excluded to speed up CI for PR demo") public void eclipse_jetty_incremental() throws Exception { if (isCommunityEditionTestsOnly()) { return; @@ -346,6 +350,7 @@ private static String getFileLocationAbsolutePath(FileLocation location) { } @Test + @Ignore("Excluded to speed up CI for PR demo") public void sonarqube_server() throws Exception { // sonarqube-6.5/server/sonar-server (v.6.5) String projectName = "sonar-server"; @@ -355,6 +360,7 @@ public void sonarqube_server() throws Exception { } @Test + @Ignore("Excluded to speed up CI for PR demo") public void jboss_ejb3_tutorial() throws Exception { // https://github.com/jbossejb3/jboss-ejb3-tutorial (18/01/2015) String projectName = "jboss-ejb3-tutorial"; @@ -374,6 +380,7 @@ public void jboss_ejb3_tutorial() throws Exception { } @Test + @Ignore("Excluded to speed up CI for PR demo") public void regex_examples() throws IOException { String projectName = "regex-examples"; MavenBuild build = test_project("org.regex-examples:regex-examples", projectName) @@ -385,6 +392,7 @@ public void regex_examples() throws IOException { * Vibe-bot runs this test when testing samples; so it's excluded from the GitHub Actions workflow. */ @Test + @Ignore("Excluded to speed up CI for PR demo") public void vibebot() throws IOException { String projectName = "vibebot"; File pomFile = FileLocation.of("../vibebot/pom.xml").getFile().getCanonicalFile(); diff --git a/its/ruling/src/test/resources/commons-beanutils/java-S1134.json b/its/ruling/src/test/resources/commons-beanutils/java-S1134.json index 6e83b879d1c..e61f2bac1ac 100644 --- a/its/ruling/src/test/resources/commons-beanutils/java-S1134.json +++ b/its/ruling/src/test/resources/commons-beanutils/java-S1134.json @@ -1,14 +1,11 @@ { "commons-beanutils:commons-beanutils:src/main/java/org/apache/commons/beanutils2/BasicDynaClass.java": [ -190 +190, +215 ], "commons-beanutils:commons-beanutils:src/main/java/org/apache/commons/beanutils2/BeanUtilsBean.java": [ -213, 425 ], -"commons-beanutils:commons-beanutils:src/main/java/org/apache/commons/beanutils2/DynaClass.java": [ -60 -], "commons-beanutils:commons-beanutils:src/main/java/org/apache/commons/beanutils2/LazyDynaMap.java": [ 247 ], From cb5d6107b53fb47df6fe0c956bf318235d84dc91 Mon Sep 17 00:00:00 2001 From: Romain Brenguier Date: Wed, 8 Jul 2026 16:22:04 +0200 Subject: [PATCH 04/13] Parametrize action for sonar-java --- .github/workflows/ruling-diff-comment.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ruling-diff-comment.yml b/.github/workflows/ruling-diff-comment.yml index adf1892f4a1..2208e34e964 100644 --- a/.github/workflows/ruling-diff-comment.yml +++ b/.github/workflows/ruling-diff-comment.yml @@ -52,5 +52,7 @@ jobs: repository: ${{ github.repository }} base-sha: ${{ inputs.base-sha || github.event.pull_request.base.sha }} head-sha: ${{ inputs.head-sha || github.event.pull_request.head.sha }} + ruling-root: 'its/ruling/src/test/resources' + sources-root: 'its/sources' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From efd239468acf8aa262dbca16e19663505505a8d1 Mon Sep 17 00:00:00 2001 From: Romain Brenguier Date: Wed, 8 Jul 2026 17:04:03 +0200 Subject: [PATCH 05/13] Initialize submodules for ruling diff workflow The submodules must be initialized to access source files for generating code snippets in ruling diff comments. Co-Authored-By: Claude Sonnet 4.5 --- .github/workflows/ruling-diff-comment.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ruling-diff-comment.yml b/.github/workflows/ruling-diff-comment.yml index 2208e34e964..c436cdc8322 100644 --- a/.github/workflows/ruling-diff-comment.yml +++ b/.github/workflows/ruling-diff-comment.yml @@ -38,6 +38,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + submodules: true - name: Install uv uses: astral-sh/setup-uv@v5 From 4afa192521ebb163c15a3def73651d4621790efa Mon Sep 17 00:00:00 2001 From: Romain Brenguier Date: Thu, 9 Jul 2026 10:56:38 +0200 Subject: [PATCH 06/13] Test new github action --- .../workflows/test-ruling-update-notify.yml | 69 +++++++++++++++++++ .../commons-beanutils/java-S1448.json | 2 +- .../commons-beanutils/java-S1488.json | 32 --------- .../resources/test-project/java-S1234.json | 1 + 4 files changed, 71 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/test-ruling-update-notify.yml delete mode 100644 its/ruling/src/test/resources/commons-beanutils/java-S1488.json create mode 100644 its/ruling/src/test/resources/test-project/java-S1234.json diff --git a/.github/workflows/test-ruling-update-notify.yml b/.github/workflows/test-ruling-update-notify.yml new file mode 100644 index 00000000000..52864953e64 --- /dev/null +++ b/.github/workflows/test-ruling-update-notify.yml @@ -0,0 +1,69 @@ +# Test workflow for ruling-update-and-notify action +# Place this in ~/git/sonar-java/.github/workflows/test-ruling-update-notify.yml + +name: Test Ruling Update and Notify + +on: + pull_request: + paths: + - 'its/ruling/src/test/resources/**' + - '.github/workflows/test-ruling-update-notify.yml' + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + +jobs: + test-ruling-update: + runs-on: ubuntu-latest + name: Test Ruling Update Action + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + cache: 'maven' + + - name: Install uv (for ruling-diff-comment) + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + + - name: Build project + run: mvn clean install -DskipTests -Dskip.npm + + - name: Run ruling tests + id: ruling + continue-on-error: true + run: | + cd its/ruling + mvn clean verify -Pit-ruling,without-sonarqube-project -Dsonar.runtimeVersion=LATEST_RELEASE -Dmaven.test.redirectTestOutputToFile=false + + - name: Update ruling and notify + if: always() + uses: SonarSource/core-languages-tooling-public/ruling-update-and-notify@romain/ruling-diff-action + with: + pr-number: ${{ github.event.pull_request.number }} + ruling-failed: ${{ steps.ruling.outcome == 'failure' }} + sync-command: | + # Copy actual results to expected + if [ -d its/ruling/target/actual ]; then + cp -r its/ruling/target/actual/* its/ruling/src/test/resources/ + fi + ruling-root: 'its/ruling/src/test/resources' + sources-root: 'its/sources' + env: + GH_TOKEN: ${{ github.token }} + + - name: Show test outcome + run: | + echo "Ruling test outcome: ${{ steps.ruling.outcome }}" + echo "This is a test - check the PR for ruling diff comments" \ No newline at end of file diff --git a/its/ruling/src/test/resources/commons-beanutils/java-S1448.json b/its/ruling/src/test/resources/commons-beanutils/java-S1448.json index 9beb36ea03f..91e155501e1 100644 --- a/its/ruling/src/test/resources/commons-beanutils/java-S1448.json +++ b/its/ruling/src/test/resources/commons-beanutils/java-S1448.json @@ -1,4 +1,4 @@ -{ + "commons-beanutils:commons-beanutils:src/main/java/org/apache/commons/beanutils2/PropertyUtilsBean.java": [ 93 ] diff --git a/its/ruling/src/test/resources/commons-beanutils/java-S1488.json b/its/ruling/src/test/resources/commons-beanutils/java-S1488.json deleted file mode 100644 index 44950c34791..00000000000 --- a/its/ruling/src/test/resources/commons-beanutils/java-S1488.json +++ /dev/null @@ -1,32 +0,0 @@ -{ -"commons-beanutils:commons-beanutils:src/main/java/org/apache/commons/beanutils2/BeanMap.java": [ -766 -], -"commons-beanutils:commons-beanutils:src/main/java/org/apache/commons/beanutils2/PropertyUtilsBean.java": [ -1265 -], -"commons-beanutils:commons-beanutils:src/main/java/org/apache/commons/beanutils2/converters/DateTimeConverter.java": [ -528, -570 -], -"commons-beanutils:commons-beanutils:src/test/java/org/apache/commons/beanutils2/BasicDynaBeanTestCase.java": [ -986 -], -"commons-beanutils:commons-beanutils:src/test/java/org/apache/commons/beanutils2/BeanMapTestCase.java": [ -181, -208, -226 -], -"commons-beanutils:commons-beanutils:src/test/java/org/apache/commons/beanutils2/DynaBeanUtilsTestCase.java": [ -1237 -], -"commons-beanutils:commons-beanutils:src/test/java/org/apache/commons/beanutils2/DynaPropertyUtilsTestCase.java": [ -2614 -], -"commons-beanutils:commons-beanutils:src/test/java/org/apache/commons/beanutils2/bugs/Jira347TestCase.java": [ -150 -], -"commons-beanutils:commons-beanutils:src/test/java/org/apache/commons/beanutils2/memoryleaktests/MemoryLeakTestCase.java": [ -528 -] -} diff --git a/its/ruling/src/test/resources/test-project/java-S1234.json b/its/ruling/src/test/resources/test-project/java-S1234.json new file mode 100644 index 00000000000..b33572d2528 --- /dev/null +++ b/its/ruling/src/test/resources/test-project/java-S1234.json @@ -0,0 +1 @@ +{"test:test.java": [42]} From 17e280a10e73e2eefa9cde0753028e7281369119 Mon Sep 17 00:00:00 2001 From: Romain Brenguier Date: Thu, 9 Jul 2026 12:41:47 +0200 Subject: [PATCH 07/13] Fix malformed JSON in ruling file The file was missing the opening brace '{', causing JSON parse errors. Fixed format: - Before: "key": [values]... - After: {"key": [values]...} --- .../src/test/resources/commons-beanutils/java-S1448.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/its/ruling/src/test/resources/commons-beanutils/java-S1448.json b/its/ruling/src/test/resources/commons-beanutils/java-S1448.json index 91e155501e1..2fddb4d5525 100644 --- a/its/ruling/src/test/resources/commons-beanutils/java-S1448.json +++ b/its/ruling/src/test/resources/commons-beanutils/java-S1448.json @@ -1,5 +1,5 @@ - +{ "commons-beanutils:commons-beanutils:src/main/java/org/apache/commons/beanutils2/PropertyUtilsBean.java": [ 93 ] -} +} \ No newline at end of file From 4c55dc4145aa6b2f4624a5fa65228d1634a2fd42 Mon Sep 17 00:00:00 2001 From: Romain Brenguier Date: Thu, 9 Jul 2026 13:28:05 +0200 Subject: [PATCH 08/13] fixup! Add ruling diff comment workflow --- .github/workflows/test-ruling-update-notify.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-ruling-update-notify.yml b/.github/workflows/test-ruling-update-notify.yml index 52864953e64..f3cc2a0aeff 100644 --- a/.github/workflows/test-ruling-update-notify.yml +++ b/.github/workflows/test-ruling-update-notify.yml @@ -49,7 +49,7 @@ jobs: - name: Update ruling and notify if: always() - uses: SonarSource/core-languages-tooling-public/ruling-update-and-notify@romain/ruling-diff-action + uses: SonarSource/core-languages-tooling-public/ruling-update-and-notify@romain/ruling-sync-PR with: pr-number: ${{ github.event.pull_request.number }} ruling-failed: ${{ steps.ruling.outcome == 'failure' }} @@ -66,4 +66,4 @@ jobs: - name: Show test outcome run: | echo "Ruling test outcome: ${{ steps.ruling.outcome }}" - echo "This is a test - check the PR for ruling diff comments" \ No newline at end of file + echo "This is a test - check the PR for ruling diff comments" From 9f3859f774241e88baec78a471502eba3a5fd0b3 Mon Sep 17 00:00:00 2001 From: Romain Brenguier Date: Thu, 9 Jul 2026 13:56:37 +0200 Subject: [PATCH 09/13] Add ruling-update-notify job to main build workflow Integrates the ruling-update-and-notify action to respond to Ruling QA failures. This job: - Runs after all ruling-qa matrix jobs complete - Only runs on pull requests - Posts ruling diff comments to PRs - Prepares for future fix PR creation (currently disabled) The sync-command needs to be implemented to download actual results from the ruling-qa job artifacts before enabling fix PR creation. --- .github/workflows/build.yml | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index adc919372bd..41a5024ca0e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -117,6 +117,52 @@ jobs: expected-dir: src/test/resources actual-dir: target/actual + ruling-update-notify: + name: Ruling Update and Notify + needs: ruling-qa + if: always() && github.event_name == 'pull_request' + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + + - name: Check ruling-qa results + id: check-ruling + run: | + # Check if any ruling-qa job failed + RULING_FAILED=false + if [[ "${{ contains(needs.ruling-qa.result, 'failure') }}" == "true" ]]; then + RULING_FAILED=true + fi + echo "ruling-failed=$RULING_FAILED" >> "$GITHUB_OUTPUT" + + - name: Update ruling and notify + uses: SonarSource/core-languages-tooling-public/ruling-update-and-notify@romain/ruling-sync-PR + with: + pr-number: ${{ github.event.pull_request.number }} + ruling-failed: ${{ steps.check-ruling.outputs.ruling-failed }} + sync-command: | + # For sonar-java, we need to download and extract the actual results + # from the failed ruling-qa job artifacts + echo "Sync command for sonar-java ruling results" + # TODO: Implement artifact download and sync logic + ruling-root: 'its/ruling/src/test/resources' + sources-root: 'its/sources' + create-fix-pr: 'false' # Disable fix PR creation for now until sync-command is implemented + env: + GH_TOKEN: ${{ github.token }} + plugin-qa: strategy: fail-fast: false From 407502d67cfb6960313afc3b968aeb90b6950418 Mon Sep 17 00:00:00 2001 From: Romain Brenguier Date: Thu, 9 Jul 2026 13:58:27 +0200 Subject: [PATCH 10/13] Fix ruling-qa failure detection for matrix jobs Changed from checking contains(needs.ruling-qa.result, 'failure') to checking if needs.ruling-qa.result != 'success'. For matrix jobs, the result is only 'success' if ALL matrix jobs succeeded, otherwise it's 'failure'. --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 41a5024ca0e..2f9eeaa3f0f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -141,11 +141,13 @@ jobs: id: check-ruling run: | # Check if any ruling-qa job failed + # For matrix jobs, needs.ruling-qa.result can be 'success' only if ALL jobs succeeded RULING_FAILED=false - if [[ "${{ contains(needs.ruling-qa.result, 'failure') }}" == "true" ]]; then + if [[ "${{ needs.ruling-qa.result }}" != "success" ]]; then RULING_FAILED=true fi echo "ruling-failed=$RULING_FAILED" >> "$GITHUB_OUTPUT" + echo "Ruling QA result: ${{ needs.ruling-qa.result }}, failed=$RULING_FAILED" - name: Update ruling and notify uses: SonarSource/core-languages-tooling-public/ruling-update-and-notify@romain/ruling-sync-PR From e924dc8003d96b6315380b19f933c3988f94f4ec Mon Sep 17 00:00:00 2001 From: Romain Brenguier Date: Thu, 9 Jul 2026 14:17:37 +0200 Subject: [PATCH 11/13] Simplify ruling-update-notify workflow integration Removed complex sync-command - the action now handles artifact download automatically. The workflow just needs to specify the basic parameters. This makes integration much cleaner and easier to maintain. --- .github/workflows/build.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2f9eeaa3f0f..9112e0f73ba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -154,14 +154,8 @@ jobs: with: pr-number: ${{ github.event.pull_request.number }} ruling-failed: ${{ steps.check-ruling.outputs.ruling-failed }} - sync-command: | - # For sonar-java, we need to download and extract the actual results - # from the failed ruling-qa job artifacts - echo "Sync command for sonar-java ruling results" - # TODO: Implement artifact download and sync logic ruling-root: 'its/ruling/src/test/resources' sources-root: 'its/sources' - create-fix-pr: 'false' # Disable fix PR creation for now until sync-command is implemented env: GH_TOKEN: ${{ github.token }} From 8db3f801587f6facb5e9f1d4cba8ec66bac9af83 Mon Sep 17 00:00:00 2001 From: Romain Brenguier Date: Thu, 9 Jul 2026 15:58:21 +0200 Subject: [PATCH 12/13] Delete workflow that duplicates what's done in build --- .../workflows/test-ruling-update-notify.yml | 69 ------------------- 1 file changed, 69 deletions(-) delete mode 100644 .github/workflows/test-ruling-update-notify.yml diff --git a/.github/workflows/test-ruling-update-notify.yml b/.github/workflows/test-ruling-update-notify.yml deleted file mode 100644 index f3cc2a0aeff..00000000000 --- a/.github/workflows/test-ruling-update-notify.yml +++ /dev/null @@ -1,69 +0,0 @@ -# Test workflow for ruling-update-and-notify action -# Place this in ~/git/sonar-java/.github/workflows/test-ruling-update-notify.yml - -name: Test Ruling Update and Notify - -on: - pull_request: - paths: - - 'its/ruling/src/test/resources/**' - - '.github/workflows/test-ruling-update-notify.yml' - workflow_dispatch: - -permissions: - contents: write - pull-requests: write - -jobs: - test-ruling-update: - runs-on: ubuntu-latest - name: Test Ruling Update Action - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - - - name: Set up JDK - uses: actions/setup-java@v4 - with: - java-version: '21' - distribution: 'temurin' - cache: 'maven' - - - name: Install uv (for ruling-diff-comment) - uses: astral-sh/setup-uv@v5 - with: - enable-cache: true - - - name: Build project - run: mvn clean install -DskipTests -Dskip.npm - - - name: Run ruling tests - id: ruling - continue-on-error: true - run: | - cd its/ruling - mvn clean verify -Pit-ruling,without-sonarqube-project -Dsonar.runtimeVersion=LATEST_RELEASE -Dmaven.test.redirectTestOutputToFile=false - - - name: Update ruling and notify - if: always() - uses: SonarSource/core-languages-tooling-public/ruling-update-and-notify@romain/ruling-sync-PR - with: - pr-number: ${{ github.event.pull_request.number }} - ruling-failed: ${{ steps.ruling.outcome == 'failure' }} - sync-command: | - # Copy actual results to expected - if [ -d its/ruling/target/actual ]; then - cp -r its/ruling/target/actual/* its/ruling/src/test/resources/ - fi - ruling-root: 'its/ruling/src/test/resources' - sources-root: 'its/sources' - env: - GH_TOKEN: ${{ github.token }} - - - name: Show test outcome - run: | - echo "Ruling test outcome: ${{ steps.ruling.outcome }}" - echo "This is a test - check the PR for ruling diff comments" From 87da5e41f78eabdaa90ac63ccdbc693b3d8b77f7 Mon Sep 17 00:00:00 2001 From: Romain Brenguier Date: Thu, 9 Jul 2026 17:30:30 +0200 Subject: [PATCH 13/13] Simplify Ruling QA matrix to single job for testing Temporarily keep only one matrix item (without-sonarqube-project on sonar-m-public) to make testing of the ruling-update-notify action faster and simpler. --- .github/workflows/build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9112e0f73ba..50b9d883b5b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,9 +57,10 @@ jobs: matrix: item: - { runner: sonar-m-public, profile: without-sonarqube-project, sq_version: LATEST_RELEASE } - - { runner: sonar-m-public, profile: only-sonarqube-project, sq_version: LATEST_RELEASE } - - { runner: github-windows-latest-m, profile: without-sonarqube-project, sq_version: LATEST_RELEASE } - - { runner: github-windows-latest-m, profile: only-sonarqube-project, sq_version: LATEST_RELEASE } + # Temporarily disabled for testing ruling-update-notify action: + # - { runner: sonar-m-public, profile: only-sonarqube-project, sq_version: LATEST_RELEASE } + # - { runner: github-windows-latest-m, profile: without-sonarqube-project, sq_version: LATEST_RELEASE } + # - { runner: github-windows-latest-m, profile: only-sonarqube-project, sq_version: LATEST_RELEASE } name: Ruling QA needs: - build