Skip to content

Commit

Permalink
Fix authentication issue in QA
Browse files Browse the repository at this point in the history
With the latest scanner, thr SONAR_TOKEN env variable has higher priority than sonar.login/sonar.password
  • Loading branch information
henryju committed Dec 2, 2024
1 parent 44c0131 commit bfdc6da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ env:
ARTIFACTORY_PRIVATE_USERNAME: vault-${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-private-reader
ARTIFACTORY_PRIVATE_PASSWORD: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-private-reader access_token]
ARTIFACTORY_ACCESS_TOKEN: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-private-reader access_token]
SONAR_HOST_URL: VAULT[development/kv/data/next data.url]
SONAR_TOKEN: VAULT[development/kv/data/next data.token]

auto_cancellation: $CIRRUS_BRANCH != $CIRRUS_DEFAULT_BRANCH

Expand Down Expand Up @@ -98,6 +96,8 @@ test_linux_task:
env:
JDK_VERSION: "17"
DEPLOY_PULL_REQUEST: "false"
SONAR_HOST_URL: VAULT[development/kv/data/next data.url]
SONAR_TOKEN: VAULT[development/kv/data/next data.token]
<<: *MAVEN_CACHE_DEFINITION
script:
- source cirrus-env QA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ class SonarQubeDeveloperEditionTests extends AbstractConnectedTests {

public static final String CONNECTION_ID = "orchestrator";
public static final String CONNECTION_ID_WRONG_CREDENTIALS = "wrong-credentials";
private static final String SCANNER_VERSION = "6.0.0.4432";

@RegisterExtension
static OrchestratorExtension ORCHESTRATOR = OrchestratorUtils.defaultEnvBuilder()
Expand Down Expand Up @@ -1396,7 +1395,6 @@ private static void waitForAnalysisToBeReady(String configScopeId) {
private void analyzeProject(String projectDirName, String projectKey, String... properties) {
var projectDir = Paths.get("projects/" + projectDirName).toAbsolutePath();
ORCHESTRATOR.executeBuild(SonarScanner.create(projectDir.toFile())
.setScannerVersion(SCANNER_VERSION)
.setProjectKey(projectKey)
.setSourceDirs("src")
.setProperties(properties)
Expand Down

0 comments on commit bfdc6da

Please sign in to comment.