BUILD-10287 Use sonar.scm.revision instead of sonar.analysis.sha1#204
Closed
julien-carsique-sonarsource wants to merge 1 commit intomasterfrom
Closed
BUILD-10287 Use sonar.scm.revision instead of sonar.analysis.sha1#204julien-carsique-sonarsource wants to merge 1 commit intomasterfrom
julien-carsique-sonarsource wants to merge 1 commit intomasterfrom
Conversation
This was referenced Feb 3, 2026
Replace the obsolete sonar.analysis.sha1 property with sonar.scm.revision across all build-* actions (maven, gradle, npm, yarn, poetry). The value is set to PULL_REQUEST_SHA for pull requests, and falls back to GITHUB_SHA for other builds. Changes: - build-maven: Added sonar.scm.revision with conditional logic - build-gradle: Simplified branch-specific logic and use sonar.scm.revision - build-npm: Changed from sonar.analysis.sha1 to sonar.scm.revision - build-yarn: Changed from sonar.analysis.sha1 to sonar.scm.revision - build-poetry: Changed from sonar.analysis.sha1 to sonar.scm.revision Tests: - Updated all spec files to verify sonar.scm.revision is used - Added specific tests for PULL_REQUEST_SHA usage in PR scenarios
2294a8e to
1df28d9
Compare
SonarQube reviewer guideSummary: Standardize Sonar analysis by using pull request base SHA instead of commit SHA for PR analysis across all build systems (Gradle, Maven, npm, Poetry, Yarn). Review Focus:
Start review at:
|
Contributor
Author
|
Superseded by #205 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




BUILD-10287
This PR replaces the obsolete
sonar.analysis.sha1property withsonar.scm.revisionacross all build-* actions.Prefer #205 if it works without
sonar.scm.revisionparameter.Changes
Property Migration:
sonar.analysis.sha1(obsolete)sonar.scm.revisionwith proper value assignmentValue Logic:
sonar.scm.revision=PULL_REQUEST_SHAsonar.scm.revision=GITHUB_SHAAffected Files
Build Scripts:
build-maven/build.sh- Added conditional logic for sonar.scm.revisionbuild-gradle/build.sh- Simplified branch-specific logic and migrated propertybuild-npm/build.sh- Migrated from sonar.analysis.sha1 to sonar.scm.revisionbuild-yarn/build.sh- Migrated from sonar.analysis.sha1 to sonar.scm.revisionbuild-poetry/build.sh- Migrated from sonar.analysis.sha1 to sonar.scm.revisionTest Coverage:
sonar.scm.revisionis used correctlyPULL_REQUEST_SHAusage in PR scenariosTests