Repository navigation
SC-60373 Let the scanners resolve the SonarQube Cloud URL from the region - #367
Conversation
…gion The sonar-region of sonarqube-auth-action selects the SonarQube Cloud instance, and the scanners derive its URL from the region. The build actions no longer read the SonarQube Cloud URLs from Vault, and only pass sonar.region=us for sqc-us and no sonar.host.url for sqc-eu. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Region support starts with the SonarScanner for Gradle 6.1 and for Maven 5.1. The build-maven action pins the Maven plugin. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Code Review ✅ Approved 1 closed / 1 findings🟡 Medium risk · Removing Vault-provided cloud URLs makes scans depend on scanner region support, so older Gradle plugins may fail or use an unintended endpoint. Stops reading SonarQube Cloud host URLs from Vault and lets the scanners resolve the host from ✅ 1 closed✅ Quality: README gives too-low scanner versions for sqc-us region
Verification Rules 2/2 metFunctional validation No results Rules 2 passed 1 not applicable
Auto-approval Not enabledFor more verification details, comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
|



Stacked on #363.
Why
sonarqube-auth-actionnow selects the SonarQube Cloud instance withsonar-regionand no longer provides a host URL. The previous commit of #363 restored the two SonarQube Cloud URLs by reading them from Vault again, only so the scripts could pass-Dsonar.host.url. The scanners already derive the host from the region, so those Vault reads are redundant.What
build-*/action.yml: stop readingdevelopment/kv/data/sonarcloud urlanddevelopment/kv/data/sonarqube-us url, and stop settingSQC_EU_URLandSQC_US_URL.shared/common-functions.sh: forsqc-euandsqc-us, unsetSONAR_HOST_URL.require_sonar_envonly requires the token of these platforms.sqc-usstill setsSONAR_REGION=us.build-*/build.sh: pass-Dsonar.host.urlonly whenSONAR_HOST_URLis set (next), and pass-Dsonar.regionexplicitly whenSONAR_REGIONis set. Maven, Gradle and poetry did not pass the region property before. The Gradle "run sonar" guard now checksSONAR_TOKENonly.How it was checked
shellspec: the full suite passes, exceptupdate-release-channel(check-jsonschemanot installed locally).check-scafailed once on a timing test and passed when rerun.@sonar/scan4.3.0 and 5.0.2, and pysonar, default a blank host tohttps://sonarcloud.io, andsonar.region=usselectshttps://sonarqube.us.Risks
https://sonarcloud.iodefault starts with 6.0). The Maven plugin is pinned bybuild-maven(5.6.0.6792). A consumer on an older Gradle plugin fails onsqc-eu(falls back tolocalhost:9000) orsqc-us(region ignored). Asonar.host.urlin the consumer's build that does not match the region makes the scanner library fail onsqc-us.sonar-dummy-gradle-oss,build-windowsonsqc-us) are the proof.check-scastill reads both URLs from Vault, since it has its own scan.🤖 Generated with Claude Code