RC-349: Make lits plugin version configurable in ruling tests - #6191
romainbrenguier wants to merge 6 commits into
Conversation
Replace hardcoded sonar-lits-plugin version with a system property (sonar.lits.version) defaulting to LATEST_RELEASE, allowing CI to override it with a specific version from a sonar-lits PR build. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| .addPlugin(MavenLocation.of("org.sonarsource.sonar-lits-plugin", "sonar-lits-plugin", | ||
| System.getProperty("sonar.lits.version", "LATEST_RELEASE"))); |
There was a problem hiding this comment.
⚠️ Bug: Default lits version now floats, silently bumping 0.11.0.2659
The PR is described as making the lits version configurable, but it also changes the default from the pinned 0.11.0.2659 to the LATEST_RELEASE alias. Maven Central metadata for org.sonarsource.sonar-lits-plugin already lists a newer release (0.12.0.5861), so every ruling run without -Dsonar.lits.version now silently uses a different plugin than before and will keep floating onto future releases — ruling QA (4 matrix jobs across Linux/Windows) becomes non-reproducible and can break on an unrelated lits release, with no repo change to point at. Keep the previously pinned version as the default so the property only overrides it when CI explicitly asks for a PR build.
Keep the pinned version as the default value of the new property:
.addPlugin(MavenLocation.of("org.sonarsource.sonar-lits-plugin", "sonar-lits-plugin",
System.getProperty("sonar.lits.version", "0.11.0.2659")));
- Apply fix
Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎
| extra_args+=(-Dparallel=methods -DuseUnlimitedThreads=true) | ||
| fi | ||
| mvn package ${MAVEN_OUTPUT_ARGS} "-Pit-ruling,${{ matrix.item.profile }}" -Dsonar.runtimeVersion=${{ matrix.item.sq_version }} -Dmaven.test.redirectTestOutputToFile=false "${extra_args[@]}" | ||
| mvn package ${MAVEN_OUTPUT_ARGS} "-Pit-ruling,${{ matrix.item.profile }}" -Dsonar.runtimeVersion=${{ matrix.item.sq_version }} -Dsonar.lits.version=0.13.0.6081 -Dmaven.test.redirectTestOutputToFile=false "${extra_args[@]}" |
There was a problem hiding this comment.
⚠️ Bug: CI pinned to unreleased lits build 0.13.0.6081
This commit hardcodes -Dsonar.lits.version=0.13.0.6081 into the shared ruling-qa job, and the commit itself is titled "[DO NOT MERGE]". Version 0.13.0.6081 of org.sonarsource.sonar-lits-plugin:sonar-lits-plugin is not a public release (latest published is 0.11.0.2659); it is a build produced for sonar-lits#172, so once that build ages out of the internal repository the resolution in JavaRulingTest.createOrchestrator() fails and every ruling-qa matrix entry (Linux and Windows) breaks on master. It also contradicts the PR's stated goal of running ruling against the default LATEST_RELEASE. Revert this line before merging, or keep the pin only on the throwaway validation branch.
Drop the temporary hardcoded lits version so CI uses the configurable default before merging.:
mvn package ${MAVEN_OUTPUT_ARGS} "-Pit-ruling,${{ matrix.item.profile }}" -Dsonar.runtimeVersion=${{ matrix.item.sq_version }} -Dmaven.test.redirectTestOutputToFile=false "${extra_args[@]}"
- Apply fix
Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎
Ruling Diff SummaryDetected changes in 1 rule files: 9 issues removed, 0 issues added. S9398 (
|
❌ ErrorsYour PR has failed checks. Please review the issues below and take necessary action before merging. 🚦 4 Pipeline jobs failed
Useful? React with 👍 / 👎 This comment will be updated automatically if new data arrives.🔗 Commit SHA: 7b51521 | Docs | View more details | Give us feedback! |
|
❌ Ruling needs updating. A fix PR has been created: #6194 Please review and merge it into your branch. |
| final var prBranch = "eclipse-jetty-same-issues-as-main"; | ||
|
|
||
| MavenBuild prBuild = test_existing_project("org.eclipse.jetty:jetty-project", prSourceCode) | ||
| MavenBuild prBuild = test_existing_project("https://github.com/SonarSource/ruling_java/tree/85d8a90d7dfa711f91388a0c869f89eb434b04d3", prSourceCode) |
There was a problem hiding this comment.
⚠️ Bug: Jetty PR analysis given a GitHub URL as sonar.projectKey
test_existing_project(...) passes its first argument straight to sonar.projectKey (line 450), so the PR build now analyses project key https://github.com/SonarSource/ruling_java/tree/85d8a90... instead of the provisioned org.eclipse.jetty:jetty-project. That key contains / (not a legal SonarQube project key character) and was never provisioned or associated with the rules profile, so the PR-branch analysis fails or lands on an unrelated project — the sonar.pullrequest.base incremental cache from the main-branch run (line 247) no longer applies, and the timing assertions on time2 plus the LITS diff for eclipse-jetty-similar-to-main become meaningless. If the intent was to pin the ruling sources (commit message "Pin Jetty ruling project"), that belongs in the its/sources submodule pointer, which is still at 706cf13 and unchanged by this commit.
Restore the provisioned project key; pin the ruling sources via the its/sources submodule commit instead.:
MavenBuild prBuild = test_existing_project("org.eclipse.jetty:jetty-project", prSourceCode)
- Apply fix
Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎
CI failed: Java ruling tests failed due to an invalid SonarQube project key validation error and missing actual ruling output directories for diff comparison.OverviewTwo related failure patterns were found across 9 logs analyzed: a SonarQube project key validation failure caused by an invalid URL in the ruling test configuration, and a subsequent artifact diff failure due to missing actual output directories when ruling tests failed. FailuresSonarQube Project Validation Failure (confidence: high)
Missing Actual Ruling Directory Diff Failure (confidence: high)
Summary
Code Review
|
| Auto-apply | Compact | Unblock |
|
|
|
Was this helpful? React with 👍 / 👎 | Gitar
|





Summary
0.11.0.2659) with a configurable system propertysonar.lits.version, defaulting toLATEST_RELEASETest plan
LATEST_RELEASEversion-Dsonar.lits.version=X.Y.Z.N🤖 Generated with Claude Code