From 08f2d79500fcf76e7c28405549aaf63f192bc6cc Mon Sep 17 00:00:00 2001 From: C4tWithShell Date: Mon, 8 Apr 2024 17:06:18 +0300 Subject: [PATCH] Update --- README.md | 18 ++++++++++++-- build.gradle | 10 ++++---- .../github/model/CheckRunDetails.java | 12 ++++++++++ ...RestApplicationAuthenticationProvider.java | 9 +++---- .../plugin/almclient/github/v4/Comments.java | 8 ++++++- .../github/v4/GraphqlGithubClient.java | 5 ++-- .../github/GithubPullRequestDecorator.java | 1 + .../pullrequest/report/ReportGenerator.java | 22 +++++++++--------- .../static/checks/CoverageChart/0.png | Bin 0 -> 221 bytes .../static/checks/CoverageChart/100.png | Bin 0 -> 223 bytes .../static/checks/CoverageChart/25.png | Bin 0 -> 279 bytes .../static/checks/CoverageChart/40.png | Bin 0 -> 314 bytes .../static/checks/CoverageChart/50.png | Bin 0 -> 281 bytes .../static/checks/CoverageChart/60.png | Bin 0 -> 287 bytes .../static/checks/CoverageChart/90.png | Bin 0 -> 279 bytes .../checks/CoverageChart/NoCoverageInfo.png | Bin 0 -> 229 bytes .../static/checks/Duplications/10.png | Bin 0 -> 217 bytes .../static/checks/Duplications/20.png | Bin 0 -> 216 bytes .../static/checks/Duplications/20plus.png | Bin 0 -> 246 bytes .../static/checks/Duplications/3.png | Bin 0 -> 223 bytes .../static/checks/Duplications/5.png | Bin 0 -> 200 bytes .../checks/Duplications/NoDuplicationInfo.png | Bin 0 -> 229 bytes .../static/checks/FailedConditionIcon.png | Bin 0 -> 147 bytes .../resources/static/checks/IssueType/bug.png | Bin 0 -> 296 bytes .../static/checks/IssueType/code_smell.png | Bin 0 -> 313 bytes .../checks/IssueType/security_hotspot.png | Bin 0 -> 272 bytes .../static/checks/IssueType/vulnerability.png | Bin 0 -> 306 bytes .../static/checks/QualityGateBadge/failed.png | Bin 0 -> 571 bytes .../static/checks/QualityGateBadge/passed.png | Bin 0 -> 654 bytes .../resources/static/checks/RatingBadge/A.png | Bin 0 -> 344 bytes .../resources/static/checks/RatingBadge/B.png | Bin 0 -> 333 bytes .../resources/static/checks/RatingBadge/C.png | Bin 0 -> 339 bytes .../resources/static/checks/RatingBadge/D.png | Bin 0 -> 337 bytes .../resources/static/checks/RatingBadge/E.png | Bin 0 -> 317 bytes .../static/checks/Severity/blocker.png | Bin 0 -> 209 bytes .../static/checks/Severity/critical.png | Bin 0 -> 280 bytes .../resources/static/checks/Severity/info.png | Bin 0 -> 214 bytes .../static/checks/Severity/major.png | Bin 0 -> 321 bytes .../static/checks/Severity/minor.png | Bin 0 -> 275 bytes src/main/resources/static/common/bug.png | Bin 0 -> 264 bytes .../resources/static/common/code_smell.png | Bin 0 -> 361 bytes .../static/common/security_hotspot.png | Bin 0 -> 316 bytes .../resources/static/common/vulnerability.png | Bin 0 -> 216 bytes .../github/v4/GraphqlGithubClientTest.java | 4 +++- .../GithubPullRequestDecoratorTest.java | 1 + .../report/ReportGeneratorTest.java | 18 +++++++------- ...lectiveElevatedClassLoaderFactoryTest.java | 2 +- 47 files changed, 72 insertions(+), 38 deletions(-) create mode 100644 src/main/resources/static/checks/CoverageChart/0.png create mode 100644 src/main/resources/static/checks/CoverageChart/100.png create mode 100644 src/main/resources/static/checks/CoverageChart/25.png create mode 100644 src/main/resources/static/checks/CoverageChart/40.png create mode 100644 src/main/resources/static/checks/CoverageChart/50.png create mode 100644 src/main/resources/static/checks/CoverageChart/60.png create mode 100644 src/main/resources/static/checks/CoverageChart/90.png create mode 100644 src/main/resources/static/checks/CoverageChart/NoCoverageInfo.png create mode 100644 src/main/resources/static/checks/Duplications/10.png create mode 100644 src/main/resources/static/checks/Duplications/20.png create mode 100644 src/main/resources/static/checks/Duplications/20plus.png create mode 100644 src/main/resources/static/checks/Duplications/3.png create mode 100644 src/main/resources/static/checks/Duplications/5.png create mode 100644 src/main/resources/static/checks/Duplications/NoDuplicationInfo.png create mode 100644 src/main/resources/static/checks/FailedConditionIcon.png create mode 100644 src/main/resources/static/checks/IssueType/bug.png create mode 100644 src/main/resources/static/checks/IssueType/code_smell.png create mode 100644 src/main/resources/static/checks/IssueType/security_hotspot.png create mode 100644 src/main/resources/static/checks/IssueType/vulnerability.png create mode 100644 src/main/resources/static/checks/QualityGateBadge/failed.png create mode 100644 src/main/resources/static/checks/QualityGateBadge/passed.png create mode 100644 src/main/resources/static/checks/RatingBadge/A.png create mode 100644 src/main/resources/static/checks/RatingBadge/B.png create mode 100644 src/main/resources/static/checks/RatingBadge/C.png create mode 100644 src/main/resources/static/checks/RatingBadge/D.png create mode 100644 src/main/resources/static/checks/RatingBadge/E.png create mode 100644 src/main/resources/static/checks/Severity/blocker.png create mode 100644 src/main/resources/static/checks/Severity/critical.png create mode 100644 src/main/resources/static/checks/Severity/info.png create mode 100644 src/main/resources/static/checks/Severity/major.png create mode 100644 src/main/resources/static/checks/Severity/minor.png create mode 100644 src/main/resources/static/common/bug.png create mode 100644 src/main/resources/static/common/code_smell.png create mode 100644 src/main/resources/static/common/security_hotspot.png create mode 100644 src/main/resources/static/common/vulnerability.png diff --git a/README.md b/README.md index 68eabd2..d6c5407 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=mc1arke_sonarqube-community-branch-plugin&metric=alert_status)](https://sonarcloud.io/dashboard?id=mc1arke_sonarqube-community-branch-plugin) -[![Build Status](https://img.shields.io/github/actions/workflow/status/mc1arke/sonarqube-community-branch-plugin/.github/workflows/build.yml?branch=master&logo=github)](https://github.com/mc1arke/sonarqube-community-branch-plugin?workflow=build) +[![Build Status](https://img.shields.io/github/actions/workflow/status/soramitsu/soramitsu-sonarqube-community-branch-plugin/.github/workflows/build.yml?branch=master&logo=github)](https://github.com/mc1arke/sonarqube-community-branch-plugin?workflow=build) # Sonarqube Community Branch Plugin @@ -23,6 +22,12 @@ Use the following table to find the correct plugin version for each SonarQube ve SonarQube Version | Plugin Version ------------------|--------------- +10.4 | 1.17.2 +10.3 | 1.16.1 +10.2 | 1.16.0 +10.1 | 1.15.0 +10.0 | 1.15.0 +9.9 (LTS) | 1.14.0 9.8+ | 1.14.0 9.7 | 1.13.0 9.1 - 9.6 | 1.12.0 @@ -35,6 +40,8 @@ SonarQube Version | Plugin Version 7.8 - 8.0 | 1.3.2 7.4 - 7.7 | 1.0.2 +Older versions are listed on the Github release page but are no longer supported. + # Features The plugin is intended to support the @@ -71,6 +78,13 @@ __Note:__ If you're setting the `SONAR_WEB_JAVAADDITIONALOPTS` or `SONAR_CE_JAVA your container launch then you'll need to add the `javaagent` configuration to your overrides to match what's in the provided Dockerfile. +## Docker Compose + +A `docker-compose.yml` file is provided. +It uses the env variables available in `.env`. + +To use it, clone the repository and execute `docker-compose up`. Note that you need to have docker-compose installed in your system and added to your PATH + ## Kubernetes with official Helm Chart When using diff --git a/build.gradle b/build.gradle index 4e8e3c5..6a047db 100644 --- a/build.gradle +++ b/build.gradle @@ -62,17 +62,17 @@ tasks.withType(JavaCompile) { dependencies { compileOnly(fileTree(dir: sonarLibraries, include: '**/*.jar', exclude: 'extensions/*.jar')) testImplementation(fileTree(dir: sonarLibraries, include: '**/*.jar', exclude: 'extensions/*.jar')) - testImplementation('org.mockito:mockito-core:5.8.0') - testImplementation('org.assertj:assertj-core:3.25.1') - testImplementation('org.wiremock:wiremock:3.3.1') + testImplementation('org.mockito:mockito-core:5.11.0') + testImplementation('org.assertj:assertj-core:3.25.3') + testImplementation('org.wiremock:wiremock:3.5.2') zip("sonarqube:sonarqube:${sonarqubeVersion}@zip") implementation('org.bouncycastle:bcpkix-jdk15on:1.70') implementation(files('lib/nodes-0.5.0.jar')) - runtimeOnly('com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.16.1') + runtimeOnly('com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.0') compileOnly('com.google.code.findbugs:jsr305:3.0.2') implementation('org.javassist:javassist:3.30.2-GA') implementation('com.squareup.okhttp3:logging-interceptor:4.12.0') - testImplementation(platform('org.junit:junit-bom:5.10.1')) + testImplementation(platform('org.junit:junit-bom:5.10.2')) testImplementation('org.junit.jupiter:junit-jupiter') testImplementation('junit:junit:4.13.2') testRuntimeOnly('org.junit.vintage:junit-vintage-engine') diff --git a/src/main/java/com/github/mc1arke/sonarqube/plugin/almclient/github/model/CheckRunDetails.java b/src/main/java/com/github/mc1arke/sonarqube/plugin/almclient/github/model/CheckRunDetails.java index 47a4974..502598b 100644 --- a/src/main/java/com/github/mc1arke/sonarqube/plugin/almclient/github/model/CheckRunDetails.java +++ b/src/main/java/com/github/mc1arke/sonarqube/plugin/almclient/github/model/CheckRunDetails.java @@ -36,6 +36,7 @@ public class CheckRunDetails { private final List annotations; private final CheckConclusionState checkConclusionState; private final int pullRequestId; + private final String projectKey; private CheckRunDetails(Builder builder) { summary = builder.summary; @@ -49,6 +50,7 @@ private CheckRunDetails(Builder builder) { annotations = builder.annotations; checkConclusionState = builder.checkConclusionState; pullRequestId = builder.pullRequestId; + projectKey = builder.projectKey; } public String getSummary() { @@ -95,6 +97,10 @@ public int getPullRequestId() { return pullRequestId; } + public String getProjectKey() { + return projectKey; + } + public static Builder builder() { return new Builder(); } @@ -111,6 +117,7 @@ public static final class Builder { private List annotations; private CheckConclusionState checkConclusionState; private int pullRequestId; + private String projectKey; private Builder() { super(); @@ -171,6 +178,11 @@ public Builder withPullRequestId(int pullRequestId) { return this; } + public Builder withProjectKey(String projectKey) { + this.projectKey = projectKey; + return this; + } + public CheckRunDetails build() { return new CheckRunDetails(this); } diff --git a/src/main/java/com/github/mc1arke/sonarqube/plugin/almclient/github/v3/RestApplicationAuthenticationProvider.java b/src/main/java/com/github/mc1arke/sonarqube/plugin/almclient/github/v3/RestApplicationAuthenticationProvider.java index 5555506..40f8c60 100644 --- a/src/main/java/com/github/mc1arke/sonarqube/plugin/almclient/github/v3/RestApplicationAuthenticationProvider.java +++ b/src/main/java/com/github/mc1arke/sonarqube/plugin/almclient/github/v3/RestApplicationAuthenticationProvider.java @@ -78,12 +78,9 @@ public RepositoryAuthenticationToken getInstallationToken(String apiUrl, String Instant issued = clock.instant().minus(10, ChronoUnit.SECONDS); Instant expiry = issued.plus(2, ChronoUnit.MINUTES); - String jwtToken = new DefaultJwtBuilder() - .expiration(Date.from(expiry)) - .issuedAt(Date.from(issued)) - .claim("iss", appId) - .signWith(createPrivateKey(apiPrivateKey), Jwts.SIG.RS256) - .compact(); + String jwtToken = new DefaultJwtBuilder().issuedAt(Date.from(issued)).expiration(Date.from(expiry)) + .claim("iss", appId).signWith(createPrivateKey(apiPrivateKey), Jwts.SIG.RS256).compact(); + Optional repositoryAuthenticationToken = findTokenFromAppInstallationList(getV3Url(apiUrl) + "/app/installations", jwtToken, projectPath); return repositoryAuthenticationToken.orElseThrow(() -> new InvalidConfigurationException(InvalidConfigurationException.Scope.PROJECT, diff --git a/src/main/java/com/github/mc1arke/sonarqube/plugin/almclient/github/v4/Comments.java b/src/main/java/com/github/mc1arke/sonarqube/plugin/almclient/github/v4/Comments.java index 5bb595f..7331a7b 100644 --- a/src/main/java/com/github/mc1arke/sonarqube/plugin/almclient/github/v4/Comments.java +++ b/src/main/java/com/github/mc1arke/sonarqube/plugin/almclient/github/v4/Comments.java @@ -49,12 +49,14 @@ public static class CommentNode { private final Actor author; @GraphQLProperty(name = "isMinimized") private final boolean minimized; + private final String body; @JsonCreator - public CommentNode(@JsonProperty("id") String id, @JsonProperty("author") Actor author, @JsonProperty("isMinimized") boolean minimized) { + public CommentNode(@JsonProperty("id") String id, @JsonProperty("author") Actor author, @JsonProperty("isMinimized") boolean minimized, @JsonProperty("body") String body) { this.id = id; this.author = author; this.minimized = minimized; + this.body = body; } public String getId() { @@ -68,5 +70,9 @@ public Actor getAuthor() { public boolean isMinimized() { return minimized; } + + public String getBody() { + return body; + } } } diff --git a/src/main/java/com/github/mc1arke/sonarqube/plugin/almclient/github/v4/GraphqlGithubClient.java b/src/main/java/com/github/mc1arke/sonarqube/plugin/almclient/github/v4/GraphqlGithubClient.java index abcbae8..4b40d70 100644 --- a/src/main/java/com/github/mc1arke/sonarqube/plugin/almclient/github/v4/GraphqlGithubClient.java +++ b/src/main/java/com/github/mc1arke/sonarqube/plugin/almclient/github/v4/GraphqlGithubClient.java @@ -116,7 +116,7 @@ public String createCheckRun(CheckRunDetails checkRunDetails, boolean postSummar if (postSummaryComment) { - postSummaryComment(graphqlUrl, headers, checkRunDetails.getPullRequestId(), checkRunDetails.getSummary()); + postSummaryComment(graphqlUrl, headers, checkRunDetails.getPullRequestId(), checkRunDetails.getSummary(), checkRunDetails.getProjectKey()); } return graphQLResponseEntity.getResponse().getCheckRun().getId(); @@ -128,7 +128,7 @@ public String getRepositoryUrl() { return repositoryAuthenticationToken.getRepositoryUrl(); } - private void postSummaryComment(String graphqlUrl, Map headers, int pullRequestKey, String summary) throws IOException { + private void postSummaryComment(String graphqlUrl, Map headers, int pullRequestKey, String summary, String projectId) throws IOException { String login = getLogin(graphqlUrl, headers); GetRepository.PullRequest pullRequest = getPullRequest(graphqlUrl, headers, pullRequestKey); @@ -137,6 +137,7 @@ private void postSummaryComment(String graphqlUrl, Map headers, getComments(pullRequest, graphqlUrl, headers, pullRequestKey).stream() .filter(c -> "Bot".equalsIgnoreCase(c.getAuthor().getType()) && login.equalsIgnoreCase(c.getAuthor().getLogin())) .filter(c -> !c.isMinimized()) + .filter(c -> c.getBody().contains(String.format("**Project ID:** %s\r\n", projectId))) .map(Comments.CommentNode::getId) .forEach(commentId -> this.minimizeComment(graphqlUrl, headers, commentId)); diff --git a/src/main/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/github/GithubPullRequestDecorator.java b/src/main/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/github/GithubPullRequestDecorator.java index 197702e..bacf7dc 100644 --- a/src/main/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/github/GithubPullRequestDecorator.java +++ b/src/main/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/github/GithubPullRequestDecorator.java @@ -79,6 +79,7 @@ public DecorationResult decorateQualityGateStatus(AnalysisDetails analysisDetail .withExternalId(analysisDetails.getAnalysisId()) .withName(String.format("%s Sonarqube Results", analysisDetails.getAnalysisProjectName())) .withTitle("Quality Gate " + (analysisDetails.getQualityGateStatus() == QualityGate.Status.OK ? "success" : "failed")) + .withProjectKey(analysisDetails.getAnalysisProjectKey()) .build(); try { diff --git a/src/main/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/report/ReportGenerator.java b/src/main/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/report/ReportGenerator.java index c1237ef..e17b25b 100644 --- a/src/main/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/report/ReportGenerator.java +++ b/src/main/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/report/ReportGenerator.java @@ -90,9 +90,9 @@ public AnalysisIssueSummary createAnalysisIssueSummary(PostAnalysisIssueVisitor. .withProjectKey(analysisDetails.getAnalysisProjectKey()) .withResolution(issue.resolution()) .withSeverity(issue.severity()) - .withSeverityImageUrl(String.format("%s/checks/Severity/%s.svg?sanitize=true", baseImageUrl, issue.severity().toLowerCase())) + .withSeverityImageUrl(String.format("%s/checks/Severity/%s.png", baseImageUrl, issue.severity().toLowerCase())) .withType(issue.type().name()) - .withTypeImageUrl(String.format("%s/checks/IssueType/%s.svg?sanitize=true", baseImageUrl, issue.type().name().toLowerCase())) + .withTypeImageUrl(String.format("%s/checks/IssueType/%s.png", baseImageUrl, issue.type().name().toLowerCase())) .build(); } @@ -131,10 +131,10 @@ public AnalysisSummary createAnalysisSummary(AnalysisDetails analysisDetails) { .withSummaryImageUrl(baseImageUrl + "/common/icon.png") .withBugCount(issueCounts.get(RuleType.BUG)) .withBugUrl(getIssuesUrlForRuleType(analysisDetails, RuleType.BUG)) - .withBugImageUrl(baseImageUrl + "/common/bug.svg?sanitize=true") + .withBugImageUrl(baseImageUrl + "/common/bug.png") .withCodeSmellCount(issueCounts.get(RuleType.CODE_SMELL)) .withCodeSmellUrl(getIssuesUrlForRuleType(analysisDetails, RuleType.CODE_SMELL)) - .withCodeSmellImageUrl(baseImageUrl + "/common/code_smell.svg?sanitize=true") + .withCodeSmellImageUrl(baseImageUrl + "/common/code_smell.png") .withCoverage(coverage) .withNewCoverage(newCoverage) .withCoverageUrl(getComponentMeasuresUrlForCodeMetrics(analysisDetails, CoreMetrics.NEW_COVERAGE_KEY)) @@ -149,13 +149,13 @@ public AnalysisSummary createAnalysisSummary(AnalysisDetails analysisDetails) { .collect(Collectors.toList())) .withStatusDescription(QualityGate.Status.OK == analysisDetails.getQualityGateStatus() ? "Passed" : "Failed") .withStatusImageUrl(QualityGate.Status.OK == analysisDetails.getQualityGateStatus() - ? baseImageUrl + "/checks/QualityGateBadge/passed.svg?sanitize=true" - : baseImageUrl + "/checks/QualityGateBadge/failed.svg?sanitize=true") + ? baseImageUrl + "/checks/QualityGateBadge/passed.png" + : baseImageUrl + "/checks/QualityGateBadge/failed.png") .withTotalIssueCount(issueTotal) .withSecurityHotspotCount(issueCounts.get(RuleType.SECURITY_HOTSPOT)) .withVulnerabilityCount(issueCounts.get(RuleType.VULNERABILITY)) .withVulnerabilityUrl(getIssuesUrlForRuleType(analysisDetails, RuleType.VULNERABILITY)) - .withVulnerabilityImageUrl(baseImageUrl + "/common/vulnerability.svg?sanitize=true") + .withVulnerabilityImageUrl(baseImageUrl + "/common/vulnerability.png") .build(); } @@ -201,7 +201,7 @@ private String getDashboardUrl(AnalysisDetails analysisDetails) { private static String createCoverageImage(BigDecimal coverage, String baseImageUrl) { if (null == coverage) { - return baseImageUrl + "/checks/CoverageChart/NoCoverageInfo.svg?sanitize=true"; + return baseImageUrl + "/checks/CoverageChart/NoCoverageInfo.png"; } BigDecimal matchedLevel = BigDecimal.ZERO; for (BigDecimal level : COVERAGE_LEVELS) { @@ -210,12 +210,12 @@ private static String createCoverageImage(BigDecimal coverage, String baseImageU break; } } - return baseImageUrl + "/checks/CoverageChart/" + matchedLevel + ".svg?sanitize=true"; + return baseImageUrl + "/checks/CoverageChart/" + matchedLevel + ".png"; } private static String createDuplicateImage(BigDecimal duplications, String baseImageUrl) { if (null == duplications) { - return baseImageUrl + "/checks/Duplications/NoDuplicationInfo.svg?sanitize=true"; + return baseImageUrl + "/checks/Duplications/NoDuplicationInfo.png"; } String matchedLevel = "20plus"; for (DuplicationMapping level : DUPLICATION_LEVELS) { @@ -224,7 +224,7 @@ private static String createDuplicateImage(BigDecimal duplications, String baseI break; } } - return baseImageUrl + "/checks/Duplications/" + matchedLevel + ".svg?sanitize=true"; + return baseImageUrl + "/checks/Duplications/" + matchedLevel + ".png"; } private static String formatQualityGateCondition(QualityGate.Condition condition) { diff --git a/src/main/resources/static/checks/CoverageChart/0.png b/src/main/resources/static/checks/CoverageChart/0.png new file mode 100644 index 0000000000000000000000000000000000000000..1ca414a18e68fa6c90f9a987f7744df31843a8cf GIT binary patch literal 221 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=%3?!FCJ6-`&x&b~Ru0Z;#iS-p@`>S9CWI)hW zBm2wxAof)g$15g|7tI}j>=YhXkVd|eAirP+zRx)~FPu6aD0SUGSmsC!#|fZJpr?yt z2*>s0gap4J^Mr&4z182}y<}m#7A~#&he_g%n2|w;P1=du2M!$gILFbyp|SC!V9%*+ zpu);?3C}sg4*gmZcu2poQFz7Qn=A_wT^$ZH9E%ZWNK27l2Q-|))78&qol`;+0JS<$ A(f|Me literal 0 HcmV?d00001 diff --git a/src/main/resources/static/checks/CoverageChart/100.png b/src/main/resources/static/checks/CoverageChart/100.png new file mode 100644 index 0000000000000000000000000000000000000000..71b20b92fef2c66e01267c2daf0bd18b00259e6d GIT binary patch literal 223 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=%3?!FCJ6-`&1_3@Hu0Wb$6%Mo#Ccc`10mxnp z;-;N{dJU+Bza+>nn1Szn&Zis415ZkQx#b@$bE#ySEKthd)5S4_<9c#J!n>%n0|yQ) z|NsC0a!wwfc>b>A+6Fh+jSM>K(q7mDW&ZUZjBjXc{K(z&NJDjMV?}8x$=anp+8{T0x;Tb#TzBn_ z6lzf5agNsL-m!k=_x&px`u6Nkxu@dt#QI_NoUl_mVhyYKqTlKEa9_XkdP5MqaQBAq zRuc~dre2#U@sPLuo~}#5Wtk`P9c(XW^PM~Jt14<^x?qh^n&-}Xh8c5N9_%-AuR;8>vHeve`>Q678M!jaCGr=I9eEeC6lN>=)`c(6Gj`xw!VKhwRZE3cN?kN|1hTIh+g~=aPsx+Z$dyW~ zk_U<~tYY9?%B(A|)&MkDvLwhan1N6B*S9a9FPvPJ%fsgX?|N5<^vxTA#)gu6FKuK2 zDvI`WaSY+O9@^(A)S$q_!ag;Y<&N1L;7ioRs0Ew3U20>pw0!UO+ezH}$+$s>we^Du R`x~G&44$rjF6*2UngF&qWLy9M literal 0 HcmV?d00001 diff --git a/src/main/resources/static/checks/CoverageChart/60.png b/src/main/resources/static/checks/CoverageChart/60.png new file mode 100644 index 0000000000000000000000000000000000000000..17dae4e85360692c949170fadb3126890e585eb6 GIT binary patch literal 287 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$3?vg*uel1OLIQk3T!C~~gqrkh4#nwQYEyZ_ zs-)72<^1ZzuUXh!F}4Sy^n6(e14v#qaZJgP=UvPKWCvGElx8UTHHcj^c1S9eyJ+sf zu!;dF&bgGi``24Npt+JIL4LsuT))13?v!4|dos`P^Yshen@ zc)B=-a9j`VjpS=k5O6-tm$&0J&-eYyg;iC)t@r&b$8dG&)*H@_MgC`eT$W9*ePrnV z-bAvs?>NWFHJS>A$E4lGn2)co(E2~=M~*q;n{eh8y<0wu_TKB*=;bQ?CMajZU&hU0 Wtf}?c>F0r#F?hQAxvXn_ydz{8wcJwx%Zp5wFs@<&}QE|{+j$zu4tE#-QhQ^5b?b1F;Ov@Gj> z=j1L5iI^$H;`@jpwY%G?_42!fFaAHy{rbM(afj!OuE>{#qZ7(8A5T-G@yGywo4A!Snl literal 0 HcmV?d00001 diff --git a/src/main/resources/static/checks/CoverageChart/NoCoverageInfo.png b/src/main/resources/static/checks/CoverageChart/NoCoverageInfo.png new file mode 100644 index 0000000000000000000000000000000000000000..f2adfb2f305850083e9b7959a00b8aec736aaa27 GIT binary patch literal 229 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$3?vg*uel1O%mREuT!Hi%Ft~d4>e;hrPn|ji z;i8eJPoF+_?i^h3rR}cIK%IgmL4LsupYO8S$(}f$B>nYJUXIC|*Edf80@>p0>Eal| zaozT;C*J`B4(Gt&D5qo7e#dW9Q2ldtvN_uU=M|ksd!lp}iT?i9drIQ?`K1%Klm^_g x+p1 x>Kd%VbNGWk@h^I45%GIIFAvXD$5rPg8Km~hulw=x=ntTw44$rjF6*2UngCxrRyhCw literal 0 HcmV?d00001 diff --git a/src/main/resources/static/checks/Duplications/20.png b/src/main/resources/static/checks/Duplications/20.png new file mode 100644 index 0000000000000000000000000000000000000000..dfc515ba00acc53f11476f50099c4dd124058181 GIT binary patch literal 216 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=%3?!FCJ6-`&1_3@Hu0Z--3B#*0HaL1&#`dNR zBEtTO8RVh1=ardRsWuPAZk|4ie2ENaaZ=MKXyO8ZEeKs$5s_H90pp=KF zi(?4K_2h&Vyg{|+4jj1q|NsAfULMhSp`(9pOTM!=qKV~5Lz4wrSzuNpdC2FU^uNUGBAnGaC2P)U$qFvI7YIlRw0E}T3b`3pE(FE4aE@Q3qHDxf?X3Nc<-2y5KmAx)zopr08yn_tpET3 literal 0 HcmV?d00001 diff --git a/src/main/resources/static/checks/Duplications/3.png b/src/main/resources/static/checks/Duplications/3.png new file mode 100644 index 0000000000000000000000000000000000000000..71b20b92fef2c66e01267c2daf0bd18b00259e6d GIT binary patch literal 223 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=%3?!FCJ6-`&1_3@Hu0Wb$6%Mo#Ccc`10mxnp z;-;N{dJU+Bza+>nn1Szn&Zis415ZkQx#b@$bE#ySEKthd)5S4_<9c#J!n>%n0|yQ) z|NsC0a!wwfc>b>A+6Fh+jSM>K(q7mDW&ZUZjBjXc{K(z&NH$6>u0VRzb-@i+g~3P<eApIple!&cUpKqSe31B;ML|VEftDOxf?&9g<7{YNqIYA@$ z5=VN%gKw6_&rUG4O*-6}WcH57u#Jc3kh^4+kc7kyKZ6$>1%3%OEK3(O1*jVE#wfg% fc4*6NGiG48C?;NfW)*iX&^!iDS3j3^P6e;hrPn|ji z;i8eJPoF+_?i^h3rR}cIK%IgmL4LsupYO8S$(}f$B>nYJUXIC|*Edf80@>p0>Eal| zaozT;C*J`B4(Gt&D5qo7e#dW9Q2ldtvN_uU=M|ksd!lp}iT?i9drIQ?`K1%Klm^_g x+p=4T^vI=t|teG1(_rnB#IQI31}pw mrv#+v`!We9=tVHCVPQyH%c}n?W6Bhuat2RVKbLh*2~7YNc_!un literal 0 HcmV?d00001 diff --git a/src/main/resources/static/checks/IssueType/bug.png b/src/main/resources/static/checks/IssueType/bug.png new file mode 100644 index 0000000000000000000000000000000000000000..4e9b85d74bd00b759b926aaac5fa76f53508a04a GIT binary patch literal 296 zcmV+@0oVSCP)LV6~tsREC$yimc=d@{0r@MB6k{zxL5B00000%t(EDTJRwz0H)-UDFOg}#xIzETSSsOg%Bh=`czC;)2i#hY&t5fO2x0J`Eq-Jytx zC)+;7C9IlwH;0Ozh+msnH!{}bLL2~gMO*_;MVl9~2sje45199-H)Wvi#HU{aS8g=-4o$VaKD0TLnPj(pW@9#8{~S09x95hK731H39ws$$onMJVi>100000 LNkvXXu0mjfmTq|T literal 0 HcmV?d00001 diff --git a/src/main/resources/static/checks/IssueType/security_hotspot.png b/src/main/resources/static/checks/IssueType/security_hotspot.png new file mode 100644 index 0000000000000000000000000000000000000000..57109b53ffddb626acf9c4509cfbed7c72dfc27e GIT binary patch literal 272 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6n3BBRT^Rni_n+Ah-nx9jEjQ1r+K*tbm#{NPIU{p5+x*fv9s;m;>|bLD}=cpQrGZwu{n0@ zjL)8Tx$pKCPx4H22ybH){v=ToI#pXO`CQ3<*>;P-!k|9siT(=?F!s+*Hpw)hGtB-yJN$>}g`(q@kwPVRu7xzbLdq;=+Ed!z27bUM{ zE2`A<`U?N>PT}nOzT-bzj+jyQ0iQn2M@Igl0h5yZx1DiimADeQ`TCw^-+p~zzs{Kb UN@8g-E6`I6p00i_>zopr06mOwG5`Po literal 0 HcmV?d00001 diff --git a/src/main/resources/static/checks/IssueType/vulnerability.png b/src/main/resources/static/checks/IssueType/vulnerability.png new file mode 100644 index 0000000000000000000000000000000000000000..58e13e268080c6a786cea07bf2ee42fe2cd7a3e0 GIT binary patch literal 306 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt`7JzX3_ zEP8t{*=rvQlwtkQZ+|r5q2|mz43)fUsfIR@Eh^ogv{I&&Cz{Oa*(Bk+M&zYt^M(_L zK2)!(yLat%7n&;P_o15k=J11nuWlP^>W$dRT zA1IfZ)IU_5{a5tXy96EKx0(MK_dL+L@-sE^Cu4^P)5`c1prz-Gli5mD{{8*@@$&lS=k&?U@w>n9xV+|vj^S^3 z;A(RI`uh3c;_tAv-(_yrIYs^S^!VN1_R`h#%+KO@fZkzh-CSkdS7F;vTGv5L?yRut zo1x=+g4jn=^1{aQzr*dQt=w8al zy@AKuY?l;jTg>74=8GDyX7Eb0Rkd=7U*hHJy={|Inb1t`5exx3^`|*P6m;WQTUAx3 znPLt02k5l_fNm6e8|Y6c!^t)IpR!65(;xtl#rZ%l(Rxhd$d6frj zeZ58WK$jV!mP0JzT7T<+RsALjK7fDvgfx%m{ zI{ad2^pIoG1FmSN;#NPygQGs}q)xge({5-RwPffgB+WE`hd=ZBN9#*;enkKP002ov JPDHLkV1n2xBO3q! literal 0 HcmV?d00001 diff --git a/src/main/resources/static/checks/QualityGateBadge/passed.png b/src/main/resources/static/checks/QualityGateBadge/passed.png new file mode 100644 index 0000000000000000000000000000000000000000..6bee57b215a9be32301523ef11c4296669df9660 GIT binary patch literal 654 zcmeAS@N?(olHy`uVBq!ia0vp^wm>Yz!3-qtyQx_KsWSmSA+A80VHGyCnt=g`fKn@= zvj6}8|Musb_$G1IHLM-iJ9yUdy!rWN^^?_cC*z)ff9`tF)o{1rpMQVkx5|rb6#4x7 z^M_v_4!k;$c{WpbmoDd8&L4k&-1&Ux`lstVU+moWd|S`Wp4RKFVaLM)js{rlwNTln za_PgRGw;r9dbVl7g9S70&M3WDT5zEt>2y-mi74qU(t;ZVkG?s&^x@L_tMyfvtFq2! zc^&q$-*5lx@2|8oX-)^6)VHf|w)c7s^bT)HkY6yv+v~Gbz8u)+Wb5kkzVPp=Kn4cJ z6i*k&5R21Gr(7>OWFX+myR0pyMTfK8+HCLldqMyH&sREOVfewJ;q#)%vvY3Fy_z*u zSU=0C_y1(SRjjH?QxE=439>J;YjpQ`;y-igpBZ&$=JhHq^W0{Zw_xV}qo>;x7lp`h z1b(eDf0HCBXzAK}GoNAg76<#=Y7KF>7c^XcsnhTHyyED$YN^eks+D=|OHTf}Q$G8K zVEp=xdXZQ6FbH2Sk1kkMW7=`kQ&o2J>se+Sb}cI~xcZPk@Y230tHZ}$M8?i=-F(zL zw$Ax;p^X|nes@>{54JeRTdMSbR%K{zf8pjWwop4c7^TO#60&y;Ks}s zQ@h^ZsO=8%-C{f4$H84Jv*M$8@TMItw?tIc_}M2NWpaNbAoT2r``?|OwZEpHcoTWY k-)yPNlXv&{c254ztKjVBJ;%bq6O^z#UHx3vIVCg!03G8sF#rGn literal 0 HcmV?d00001 diff --git a/src/main/resources/static/checks/RatingBadge/A.png b/src/main/resources/static/checks/RatingBadge/A.png new file mode 100644 index 0000000000000000000000000000000000000000..d354145da6943b129974973a3635b8bc215fc3cf GIT binary patch literal 344 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbK}QGic~E0AVb#lWx{OhOnyHk=C- zSpky*vR5%EZdLsE|KG7U$9UH9T=;Nd;;o6PXHu>AS%3TU?bGj1Z-2gh_Wjx2FL&>J zzO(Dau60k=Eqt)B?n+(h#nOo55js0{GbP0l+XkKx^tKw literal 0 HcmV?d00001 diff --git a/src/main/resources/static/checks/RatingBadge/B.png b/src/main/resources/static/checks/RatingBadge/B.png new file mode 100644 index 0000000000000000000000000000000000000000..d700ae6a7522d311a92e63a8b32c017a6942bc8f GIT binary patch literal 333 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbK}W`IwKE0ErBRe04^ULXlV*MLZ5 z<5eLj7b19FaNRXQpvarA$De-Oc~EL${WE`mDw2SgttR zt!rAD=v3Pf(L2-4Rp%Qt4nWKEI2-j`_L&nGS!IoWz`o_mdr;MBJ*BKeTU)tLMGr=jWe~liR(APwA74?UJb`Zd$zine6^>?{C{N R={C?o44$rjF6*2UngBx)oYMdR literal 0 HcmV?d00001 diff --git a/src/main/resources/static/checks/RatingBadge/C.png b/src/main/resources/static/checks/RatingBadge/C.png new file mode 100644 index 0000000000000000000000000000000000000000..711a58ea2b676583075586172d42e28cb1df0017 GIT binary patch literal 339 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbK}PJmB{E0F%WmErY1wpaUDUjxy8 z)|dNOU+o2Qq39)$v6uD5LADqBK_YJsOMbqY{r~^}f4|?oJ8k~!!_i;w_I`gl^XtQ| zkC%d9AK?A_3TP8hT10`2233GxeOV7oGL z@6}~JpZ}{} z%S_Hj0gKG5CaYd+28R4|5AD#eUFOnM=k|F|$7iE_<`&gnV@3btE;wrPl(Fr7yMSg@$oBz9^+h?`ixRfywZ=K2T(I!FL56D$ex3ugFx<@3a;eQa!B z_U)OVtD~*OndTl2lx*{KaSV~ToZA0fs6~ONC0XNIaIwO?r>}n7KbdGSP4YYc?)w{B z7+x>isIxIsaixJ|r_p5Zbs6DDk6iGy`u6jm(4kLL!`Nq?|9$%B&$H*4xC&hMXLj&8 z<|b71TwKX*p*7z!REp7GUTwNuZsnU-f2~g4`1i~3#B1g2tOgfv7tJzWy?KSmt$Bat Y<+FIhlcq|x16{=6>FVdQ&MBb@0B3!ey#N3J literal 0 HcmV?d00001 diff --git a/src/main/resources/static/checks/RatingBadge/E.png b/src/main/resources/static/checks/RatingBadge/E.png new file mode 100644 index 0000000000000000000000000000000000000000..1272b0c14b2a365bcb993d694f6226ca7f9f3f5f GIT binary patch literal 317 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbK}Y=BRQE0DfwY=6br9!LVwWnJCN zAg&!yQf?)kmr z(q_rWZ1+F?`CpyuGsnnbV`1gBDB*BMKP5TuV~kxpp3kw5c^JPZ$ZK;)a*Iij*UTj= z`{w5NZtr82Hy2>I@%L5EpCXya0H1;my%Rs}f1Kx56~0z;4d@sKPgg&ebxsLQ0A5Io Aa{vGU literal 0 HcmV?d00001 diff --git a/src/main/resources/static/checks/Severity/blocker.png b/src/main/resources/static/checks/Severity/blocker.png new file mode 100644 index 0000000000000000000000000000000000000000..31e48907aaae0dcb3bb7427532a23f4ad814f6e8 GIT binary patch literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFv3GfMV1=3fH?XMc!14$4vf-vl^ znK-}&#Tnin0IK6I3GxeOST*VML?uG5PH>SP-c|jEDqP&SYt=a9; l9UGVuH4k4&+3dl_#t>9%cH_&+G?0TCJYD@<);T3K0RS&tMAHBO literal 0 HcmV?d00001 diff --git a/src/main/resources/static/checks/Severity/critical.png b/src/main/resources/static/checks/Severity/critical.png new file mode 100644 index 0000000000000000000000000000000000000000..a5cac745c41f5c8783b015a9546b7301b40e7c7b GIT binary patch literal 280 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!Wq?nJE0DfwY=6br{;HAvWgQbB z1B8t1u9-MoHL`Gj zZC0+odw=`={>dxM7yR@-uqGy@Q7c^k;i?#0W}%KzVdvtK%FXUadQI(fF$g=60B z^;)wWwrd@|!L&~FaGV3f55wYbb+JYpx+$o#j!uUfbL-MboFyt I=akR{0PAXPMgRZ+ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/checks/Severity/info.png b/src/main/resources/static/checks/Severity/info.png new file mode 100644 index 0000000000000000000000000000000000000000..e6320897a1d29a05ed683442a0f7970a5f12685d GIT binary patch literal 214 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFv3GfMV1=8O0uX@eD=Dpx56wSX1 z6!D&O4Mc(wOVdjUpgQi7AirRSRsEkIUzxl|N9(F7*Y7f*aG0lyV+hCf8a&xb&j=}*Bp;v7NWkwnA**xFgJF-FQ(2Y|Gyc2KrB&=aGbO^d7 wa7=AS*^EXm1MP%qS`BOFi{z|2d4PeTc%#{hS3y-Xfi^IBy85}Sb4q9e0HT0Vr2qf` literal 0 HcmV?d00001 diff --git a/src/main/resources/static/checks/Severity/major.png b/src/main/resources/static/checks/Severity/major.png new file mode 100644 index 0000000000000000000000000000000000000000..80ae9b126ac60725f2251939a192bfb99c53baca GIT binary patch literal 321 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbK}V1Q4EE0DfyV0P8m{t5&c*@M}3 zK<+gYhfBH+SBydID<)tCMqoCWyli53+1TN#spC~c+v^4}?Z)<{Ca0eQ4V5Yh@(X5Q zpZMiU&!;^G$C->`Iy0S;>?PDMIYnc^m zWPp;@o-U3d5|>l^FY+B$;BeJX3cOx+_violu}91zHwnu>aX92US?qAF%jHFRcXCW$ zix*5QVp^ZMDSpW$St}wfUHlJkwiX3D+ghF8p(=lt zr7a97pW^A_7$R{w_q@4SgMxtTMSGq_LPrk#yRIe473a94z3JdCU&GhAOrlA<;^LSr z7@5DgDkug{Zo2f$xqs7pW`hH}IZtgoEXdZPeEH@B$CD--MAxxh*{3{};YP&6PYLQr fm)h(VZ~nh-Hal1U$IH8c_Az+6`njxgN@xNA+h||5 literal 0 HcmV?d00001 diff --git a/src/main/resources/static/common/code_smell.png b/src/main/resources/static/common/code_smell.png new file mode 100644 index 0000000000000000000000000000000000000000..5f26f0ccf264d1a3a04e2f69694c566de6aca8b0 GIT binary patch literal 361 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbK}a)3{WE09i4PXi(#fH2@>Mn(pl zosyCQWM^bR)TCx+X2PY?(^HZ4LfBbZDXFQc=^&71w^4U3&>Dr3AirRS->;s2+c7K4 zne*d=tvn}Jb=gQ=zp}2mGVSn`0&h(TeV|5HRY=e~5m-=3=}eEQRLwH=jt&Y!QAwmO;0MQvrZTzPHxxnq5o82j|qE=Lp! zOD^P}XdEULo3q1A^_r)()W<_btZdsvB6FVZHE($N+b&AV+cPKjWLyT1!kOL7^Xn%+ z<#dusSYCUh;lQzgoFI;_E$=TVu%DmwDE^c4x#J($Y-+eHbCqi%fDUBvboFyt=akR{ E0Q1a@8~^|S literal 0 HcmV?d00001 diff --git a/src/main/resources/static/common/security_hotspot.png b/src/main/resources/static/common/security_hotspot.png new file mode 100644 index 0000000000000000000000000000000000000000..3dba066b6a7659c807de8340c0fcc7956ead377f GIT binary patch literal 316 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbK}cz{ocE09i4Pm76(0g`Z(mIh>l z0GI(}r)Fe8WIE>uKz3GEN@ivzkjq@_X9_f0rX-|q{*E7z_nKei)(seP8tx?j_I7(Fg~c22Ka^M)(=m6wSmSK~KM z=50K|uefq0Z8i386q|6-pRZ8-LXY2r6|5PJ{Z+3I2}oShXU3!93rho uED{$b8!suaIT?y~7|NbVFlTFGVq-XNqMY(Dhp!K4HiM_DpUXO@geCyx+D3~2 literal 0 HcmV?d00001 diff --git a/src/test/java/com/github/mc1arke/sonarqube/plugin/almclient/github/v4/GraphqlGithubClientTest.java b/src/test/java/com/github/mc1arke/sonarqube/plugin/almclient/github/v4/GraphqlGithubClientTest.java index 8efd476..5699cca 100644 --- a/src/test/java/com/github/mc1arke/sonarqube/plugin/almclient/github/v4/GraphqlGithubClientTest.java +++ b/src/test/java/com/github/mc1arke/sonarqube/plugin/almclient/github/v4/GraphqlGithubClientTest.java @@ -159,6 +159,7 @@ void verifyCheckRunSubmitsCorrectAnnotations() throws IOException { " {" + " \"id\": \"MDEyOklzc3VlQ29tbWVudDE1MDE3\"," + " \"isMinimized\": false," + + " \"body\": \"**Project ID:** project-key-test\\r\\n\"," + " \"author\": {" + " \"__typename\": \"Bot\"," + " \"login\": \"test-sonar\"" + @@ -207,6 +208,7 @@ void verifyCheckRunSubmitsCorrectAnnotations() throws IOException { .withName("Name") .withTitle("Title") .withPullRequestId(999) + .withProjectKey("project-key-test") .build(); @@ -299,7 +301,7 @@ void verifyCheckRunSubmitsCorrectAnnotations() throws IOException { assertEquals(requestEntities.get(2), getPullRequestRequestEntityArgumentCaptor.getValue()); assertEquals( "query { repository (owner:\"owner\",name:\"repository\") { url pullRequest : pullRequest (number:999) { comments : comments (first:100) { nodes" + - " { author { type : __typename login } id minimized : isMinimized } pageInfo { hasNextPage endCursor } } id } } } ", + " { author { type : __typename login } id minimized : isMinimized body } pageInfo { hasNextPage endCursor } } id } } } ", getPullRequestRequestEntityArgumentCaptor.getValue().getRequest() ); diff --git a/src/test/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/github/GithubPullRequestDecoratorTest.java b/src/test/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/github/GithubPullRequestDecoratorTest.java index 10f595b..b60b401 100644 --- a/src/test/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/github/GithubPullRequestDecoratorTest.java +++ b/src/test/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/github/GithubPullRequestDecoratorTest.java @@ -147,6 +147,7 @@ void verifyCorrectArgumentsAndReturnValuesUsed() throws IOException { .withSeverity(i % 5 < 1 ? CheckAnnotationLevel.NOTICE : i % 5 > 2 ? CheckAnnotationLevel.FAILURE : CheckAnnotationLevel.WARNING) .build()).collect(Collectors.toList())) .withCheckConclusionState(CheckConclusionState.SUCCESS) + .withProjectKey(analysisDetails.getAnalysisProjectKey()) .build()); assertThat(decorationResult).usingRecursiveComparison().isEqualTo(expectedResult); } diff --git a/src/test/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/report/ReportGeneratorTest.java b/src/test/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/report/ReportGeneratorTest.java index 3ee31f3..373f8c6 100644 --- a/src/test/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/report/ReportGeneratorTest.java +++ b/src/test/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/report/ReportGeneratorTest.java @@ -55,9 +55,9 @@ class ReportGeneratorTest { - @CsvSource({"12, 0.svg?sanitize=true, 21, 20plus.svg?sanitize=true", - "98, 90.svg?sanitize=true, 1, 3.svg?sanitize=true", - ",NoCoverageInfo.svg?sanitize=true,,NoDuplicationInfo.svg?sanitize=true"}) + @CsvSource({"12, 0.png, 21, 20plus.png", + "98, 90.png, 1, 3.png", + ",NoCoverageInfo.png,,NoDuplicationInfo.png"}) @ParameterizedTest void shouldProduceCorrectAnalysisSummary(String coverage, String coverageImage, String duplications, String duplicationsImage) { AnalysisDetails analysisDetails = mock(AnalysisDetails.class); @@ -182,7 +182,7 @@ void shouldProduceCorrectAnalysisSummary(String coverage, String coverageImage, AnalysisSummary expected = AnalysisSummary.builder() .withBugCount(2) .withBugUrl("http://localhost:9000/project/issues?pullRequest=5&resolved=false&types=BUG&inNewCodePeriod=true&id=projectKey") - .withBugImageUrl("http://localhost:9000/static/communityBranchPlugin/common/bug.svg?sanitize=true") + .withBugImageUrl("http://localhost:9000/static/communityBranchPlugin/common/bug.png") .withCoverage(null == coverage ? null : new BigDecimal(coverage)) .withCoverageUrl("http://localhost:9000/component_measures?id=projectKey&metric=new_coverage&pullRequest=5&view=list") .withCoverageImageUrl("http://localhost:9000/static/communityBranchPlugin/checks/CoverageChart/" + coverageImage) @@ -193,16 +193,16 @@ void shouldProduceCorrectAnalysisSummary(String coverage, String coverageImage, .withNewDuplications(null == duplications ? null : new BigDecimal(duplications)) .withCodeSmellCount(1) .withCodeSmellUrl("http://localhost:9000/project/issues?pullRequest=5&resolved=false&types=CODE_SMELL&inNewCodePeriod=true&id=projectKey") - .withCodeSmellImageUrl("http://localhost:9000/static/communityBranchPlugin/common/code_smell.svg?sanitize=true") + .withCodeSmellImageUrl("http://localhost:9000/static/communityBranchPlugin/common/code_smell.png") .withDashboardUrl("http://localhost:9000/dashboard?id=projectKey&pullRequest=5") .withProjectKey("projectKey") .withSummaryImageUrl("http://localhost:9000/static/communityBranchPlugin/common/icon.png") .withSecurityHotspotCount(1) .withVulnerabilityCount(1) .withVulnerabilityUrl("http://localhost:9000/project/issues?pullRequest=5&resolved=false&types=VULNERABILITY&inNewCodePeriod=true&id=projectKey") - .withVulnerabilityImageUrl("http://localhost:9000/static/communityBranchPlugin/common/vulnerability.svg?sanitize=true") + .withVulnerabilityImageUrl("http://localhost:9000/static/communityBranchPlugin/common/vulnerability.png") .withStatusDescription("Failed") - .withStatusImageUrl("http://localhost:9000/static/communityBranchPlugin/checks/QualityGateBadge/failed.svg?sanitize=true") + .withStatusImageUrl("http://localhost:9000/static/communityBranchPlugin/checks/QualityGateBadge/failed.png") .withTotalIssueCount(5) .withFailedQualityGateConditions(List.of("19 Lines to Cover (is less than 20)", "2 Code Smells (is greater than 0)", @@ -235,9 +235,9 @@ void shouldProduceCorrectAnalysisIssueSummary(RuleType ruleType, String issueUrl .withMessage("message") .withResolution("FIXED") .withSeverity("CRITICAL") - .withSeverityImageUrl("http://target.host:port/path/to/root/static/communityBranchPlugin/checks/Severity/critical.svg?sanitize=true") + .withSeverityImageUrl("http://target.host:port/path/to/root/static/communityBranchPlugin/checks/Severity/critical.png") .withType(ruleType.name()) - .withTypeImageUrl("http://target.host:port/path/to/root/static/communityBranchPlugin/checks/IssueType/" + ruleType.name().toLowerCase(Locale.ENGLISH) + ".svg?sanitize=true") + .withTypeImageUrl("http://target.host:port/path/to/root/static/communityBranchPlugin/checks/IssueType/" + ruleType.name().toLowerCase(Locale.ENGLISH) + ".png") .withProjectKey("project-key") .build(); diff --git a/src/test/java/com/github/mc1arke/sonarqube/plugin/classloader/ReflectiveElevatedClassLoaderFactoryTest.java b/src/test/java/com/github/mc1arke/sonarqube/plugin/classloader/ReflectiveElevatedClassLoaderFactoryTest.java index 5dbefda..633f8f2 100644 --- a/src/test/java/com/github/mc1arke/sonarqube/plugin/classloader/ReflectiveElevatedClassLoaderFactoryTest.java +++ b/src/test/java/com/github/mc1arke/sonarqube/plugin/classloader/ReflectiveElevatedClassLoaderFactoryTest.java @@ -38,7 +38,7 @@ * @author Michael Clarke */ public class ReflectiveElevatedClassLoaderFactoryTest { - + private static final String TARGET_PLUGIN_CLASS = "org.sonar.plugins.java.JavaPlugin"; private static final String BUNDLED_PLUGINS_DIRECTORY = "lib/extensions"; private static final String SONARQUBE_LIB_DIRECTORY = "sonarqube-lib/";