Browse Source

SONAR-11946 Point to Overview page of a PR in report-task.txt

tags/7.8
Janos Gyerik 5 years ago
parent
commit
e1a6620e18

+ 1
- 3
sonar-scanner-engine/src/main/java/org/sonar/scanner/report/ReportPublisher.java View File



if (onPullRequest(branchConfiguration)) { if (onPullRequest(branchConfiguration)) {
return httpUrl.newBuilder() return httpUrl.newBuilder()
.addPathSegment("project")
.addPathSegment("issues")
.addPathSegment(DASHBOARD)
.addEncodedQueryParameter(ID, encoded(effectiveKey)) .addEncodedQueryParameter(ID, encoded(effectiveKey))
.addEncodedQueryParameter("pullRequest", encoded(branchConfiguration.pullRequestKey())) .addEncodedQueryParameter("pullRequest", encoded(branchConfiguration.pullRequestKey()))
.addQueryParameter(RESOLVED, "false")
.build() .build()
.url(); .url();
} }

+ 2
- 2
sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ReportPublisherTest.java View File

underTest.logSuccess("TASK-123"); underTest.logSuccess("TASK-123");


assertThat(logTester.logs(LoggerLevel.INFO)) assertThat(logTester.logs(LoggerLevel.INFO))
.contains("ANALYSIS SUCCESSFUL, you can browse https://publicserver/sonarqube/project/issues?id=org.sonarsource.sonarqube%3Asonarqube&pullRequest=105&resolved=false")
.contains("ANALYSIS SUCCESSFUL, you can browse https://publicserver/sonarqube/dashboard?id=org.sonarsource.sonarqube%3Asonarqube&pullRequest=105")
.contains("More about the report processing at https://publicserver/sonarqube/api/ce/task?id=TASK-123"); .contains("More about the report processing at https://publicserver/sonarqube/api/ce/task?id=TASK-123");


assertThat(readFileToString(properties.metadataFilePath().toFile(), StandardCharsets.UTF_8)).isEqualTo( assertThat(readFileToString(properties.metadataFilePath().toFile(), StandardCharsets.UTF_8)).isEqualTo(
"projectKey=org.sonarsource.sonarqube:sonarqube\n" + "projectKey=org.sonarsource.sonarqube:sonarqube\n" +
"serverUrl=https://publicserver/sonarqube\n" + "serverUrl=https://publicserver/sonarqube\n" +
"serverVersion=6.4\n" + "serverVersion=6.4\n" +
"dashboardUrl=https://publicserver/sonarqube/project/issues?id=org.sonarsource.sonarqube%3Asonarqube&pullRequest=105&resolved=false\n" +
"dashboardUrl=https://publicserver/sonarqube/dashboard?id=org.sonarsource.sonarqube%3Asonarqube&pullRequest=105\n" +
"ceTaskId=TASK-123\n" + "ceTaskId=TASK-123\n" +
"ceTaskUrl=https://publicserver/sonarqube/api/ce/task?id=TASK-123\n"); "ceTaskUrl=https://publicserver/sonarqube/api/ce/task?id=TASK-123\n");
} }

Loading…
Cancel
Save