1
0
mirror of https://github.com/mc1arke/sonarqube-community-branch-plugin.git synced 2024-11-28 08:58:55 +02:00
Commit Graph

117 Commits

Author SHA1 Message Date
Michael Clarke
22d4722034 Include the Nodes dependency in the workspace to fix plugin builds
The Nodes dependency used for GraphQL communication in the Github Pull Request decorator is no longer available on Bintray due to Bintray being decommissioned, and is not available in the target version from any other repository. The JAR is therefore being included in the workspace and referenced directly in the build.gradle dependencies, and the Jackson dependency that was previously inherited through the Nodes dependency is being added directly to the project as a runtime dependency to ensure the relevant classes are still available during plugin execution.
2021-05-11 21:36:32 +01:00
Michael Clarke
284fe220d2
Update version numbers in README 2021-04-01 15:38:09 +01:00
Michael Clarke
7ef59fa87d
Return to SNAPSHOT version post release 2021-04-01 15:35:57 +01:00
GitHub
dc8e5757d3 [Gradle Release Plugin] - new version commit: '1.7.1'. 2021-04-01 12:40:24 +00:00
Michael Clarke
9a87101599
Initiate release 1.7.0 2021-04-01 13:37:53 +01:00
Michael Clarke
74e9c5fe3b Add ability to generate Docker Image containing plugin
This change adds the relevant docker files to allow building a development docker image containing the code in this repository, or generating an image using a released version of the plugin, with either of these being backed by a particular base Docker image of Sonarqube's community releases. The `.env` file contains the variables required to configure what builds is performed with docker-compose.yml then driving the relevant creation from there.
2021-03-30 22:00:41 +01:00
Julien Roy
a8dca4515b Add support of summaryComment on GitHub 2021-03-30 21:49:48 +01:00
Keyi Yin
87a45607d6
#181: Report status to correct URL for Gitlab Merge Request from forked project
When submitting the status of a merge request to Gitlab, the plugin was attempting to submit to a commit on the MR's target project, but was getting a `404 Not Found` response from the Gitlab API where the source project was not the same as the target project, such as the source project being a fork. This change retrieves the MR details from the Gitlab API and retrieves the source project ID for use during subsequent decoration calls, so the commit will be searched for in the correct project.
2021-03-06 22:56:35 +00:00
Michael Clarke
9970d5c704 #309: Add support for Sonarqube 8.7
Sonarqube 8.7 removed the concept of the `OrganizationDto` and removed the reference to this class in the `BranchSupportDelegate` interface, so the `CommunityBranchSupportDelegate` implementation has had to update the relevant method signature, therefore making this version of the plugin binary incompatible with older versions of Sonarqube.

Alongside this, various webservice endpoints for configuring the global ALM definitions have been moved into the Community edition from the commercial Sonarqube editions, so have been removed from this plugin to prevent the bundled definitions conflicting with the plugin versions.

As Sonarqube Community Edition now has direct UI options for configuring Bitbucket Cloud, the relevant endpoints have been introduced for supporting this UI, and the Bitbucket Cloud client used for Pull Request decorating has been updated to use OAuth 2 credential negotiation for authenticating, rather than using the Basic authentication previously used on all requests.
2021-03-06 22:18:44 +00:00
Teake Nutma
3d2bd86488 Send total coverage back to GitLab instead of new coverage
The coverage send back via the GitLab API should be the total coverage
of the project, not the coverage of the new code in the PR. The GitLab
docs explicitly mention this:
https://docs.gitlab.com/ee/api/commits.html#post-the-build-status-to-a-commit

The coverage reported by decorating the PR via a comment is not affected;
this still shows both the total and new coverage.

Note that there is an open GitLab issue for natively displaying new coverage
for just the diff of a PR (https://gitlab.com/gitlab-org/gitlab/-/issues/20895),
but this is not yet implemented.

In addition, reporting coverage back is optional. So if there is no coverage
information, we do not report it back.
2021-03-06 21:56:59 +00:00
jgrant216
9d1dac3657
#298: Prevent NullPointerException when branch with cancelled analysis is rescanned
When a background task for a pull request analysis is cancelled, a subsequent attempt to re-scan the pull request fails in the scanner since the `analysisDate` field is no longer present against the pull request. This change handles this missing date in a better manner, defaulting to having a `0` analysis date in the same way an error parsing the analysis date would.
2021-03-06 21:00:58 +00:00
Martin Theiss
2abee0917a Remove resolved SECURITY_HOTSPOTS from BitBucket annotations 2021-01-23 11:27:28 +00:00
Heiko Rothe
68aff708a5
Fix Bitbucket Server code annotations (#284)
In #237 the property names of the annotation model were changed to fix a bug with how code annotations are reported to Bitbucket Cloud. This PR however did not take into consideration that the previous naming was actually correct and required for Bitbucket Server. With this change Bitbucket Cloud will continue to receive the message as summary (API docs), while Bitbucket Server receives the message as message again (API docs).

The @JsonProperty annotations have been moved to the getters so that they support overrides, as mixing property-level and method-level annotations does not work for this use case. Technically this is only needed for the message property, but for consistency reasons this has been done for all fields and has been verified that this is mapped correctly for both cloud and server.
2021-01-23 10:46:37 +00:00
Michael Clarke
d5232b4c15
Update version numbers 2020-11-23 22:38:09 +00:00
Michael Clarke
8d38a6fd7a
Return to SNAPSHOT version post release 2020-11-23 22:31:14 +00:00
GitHub
d8cd26fd1d [Gradle Release Plugin] - new version commit: '1.6.1'. 2020-11-23 22:29:55 +00:00
Michael Clarke
898ff84e58
Initiate release 1.6.0 2020-11-23 22:27:35 +00:00
Marvin Wichmann
c4a7ab4446 #209: Allow the Bitbucket clients to have different upload limits
This commit fixes an issue with Bitbucket Cloud if more than 100 annotations
are present. Annotations will be chunked from now on on batches of 100 until
the total allowed of 1000 is reached.

For Bitbucket Server nothing changed.

Closes #209
2020-11-23 22:24:11 +00:00
Dmytro Znaiko
4312c296fa remove the duplicate JUnit dependency from build.gradle 2020-11-09 22:09:35 +00:00
Michael Clarke
05f378e8f7 Add support for Sonarqube 8.5.0
Sonarqube 8.5.0 removed the `BranchSupport.Branch` class which breaks backwards-compatibility with previous Sonarqube versions, and requires updating how the ComponentKey is checked and generated during the creation of the analysis report. This version of Sonarqube also moves the bundled plugins into their own directory, so the build classpath has been updated to exclude those plugins from being able to be part of the compilation path, and updates the class-loading unit tests to reference a plugin class and file path that is still available in the newer Sonarqube version.

Includes additional Web Service parameters introduced in Sonarqube 8.4.0 for configuring Github ALM integration so that these values can be persisted when provided, even though the plugin does not actually require them.
2020-11-08 22:19:41 +00:00
Michael Clarke
5fbd7e1a7f
Update version numbers and feature information 2020-10-27 22:20:50 +00:00
Michael Clarke
2c0ddb2b45
Return to SNAPSHOT version post release 2020-10-27 22:16:15 +00:00
GitHub
750c2360b6 [Gradle Release Plugin] - new version commit: '1.5.1'. 2020-10-27 21:54:14 +00:00
Michael Clarke
32c3263e33
Initiate release 1.5.0 2020-10-27 21:51:46 +00:00
Michael Clarke
c373d0140b #243: Handle no messages in error response from Bitbucket
There are situations where Bitbucket server is returning an error during API calls, but has no messages specified in the response body, so is causing a `NullPointerException` to be thrown by the plugin whilst attempting to provide details on the error. Specifically checking for the messages not being present allows for the underlying HTTP status code to be returned in the exception details so the user can get a better understanding of what the issue is.
2020-10-27 21:37:08 +00:00
jcuzzi
f02f46217a
Add PR Decoration Support for Azure DevOps Server 2020-10-27 20:52:51 +00:00
Thomas de Grenier de Latour
6aa89b94ab
Reduce memory usage of the PostAnalysisIssueVisitor
The collection of `DefaultIssue` objects hold by the `PostAnalysisIssueVisitor` can take a significant amount of memory in the CE process heap when there are numerous issues. A `DefaultIssue` alone can weigh several 10s of kilobytes.

This change introduces a `PostAnalysisIssueVisitor.LightIssue` that contains a subset of the fields from `DefaultIssue` that are required during Pull Request decoration, thereby allowing the full `DefaultIssue` instances not to be retained on the heap.
2020-10-26 20:37:16 +00:00
ksl67
ff725c60b8
Shows the correct summary in Bitbucket Pull Request Decoration
The Bitbucket decoration was incorrectly mapping the issue URL into the annotation summary field, so Bitbucket was rendering a link instead of the issue summary. The relevant annotations are being updated to ensure the correct fields are set on the Bitbucket decoration.
2020-10-24 16:30:23 +01:00
Dmytro
3c1b05c018
Fix code smell image path in the analysis summary
The code smell line was previously referencing the vulnerability image in the analysis summary.
2020-10-24 16:19:45 +01:00
PiekJ
af9251911d
#93: Escape HTML tags on on pull request decoration
Adds html escaping to the Markdown text formatter and removes whitespace from the begining and end of the text.
2020-10-24 15:54:12 +01:00
PiekJ
0e8cbea9ad
#201 Fix setting project ID for GitLab merge request decoration
SonarQube 8.2 introduced the ability to set the repository ID through the front-end for use when decorating a Gitlab Merge Request, although this was missed from the plugin when implementing the appropriate interfaces. This change therefore introduces the required implementation, and additional only attempts to resolve the server ID from scanner properties when the ID has not been set through the front-end,
2020-08-03 21:38:20 +01:00
useful-devops-tools
a606728949
Add support for multiple pull request decoration in mono repo
If multiple micro-services are modified at once then only the final Sonarqube PR decoration appeared in the checks tab of Github. This change updates the name of the Status check to include the Sonarqube project name so that multiple checks can be attached to the one pull request.
2020-07-26 21:19:47 +01:00
Michael Clarke
f624269d85 Add support for Sonarqube 8.2.0
Sonarqube 8.2 introduced a new `ProjectDto` with associated changes in `ProjectAlmSettingsDao` to require this new class in various methods, as well as changes in `ComponentFinder` to allow retrieval of instances of a project. This change makes use of these new classes and methods to allow the Web Services for setting up ALM bindings to operate.

As this class and the associated methods did not exist in previous versions of Sonarqube, this change breaks backwards compatibility, so means the plugin will now only support Sonarqube 8.2.

Sonarqube 8.2 also provides the ability to set the optional URL parameter on a Gitlab project so that scans run outside of Gitlab CI operate properly, so the additional parameter is now included in the appropriate WebServices and the Gitlab decorator.
2020-07-17 22:10:29 +01:00
Michael Clarke
7cf8e36a68
Update version numbers and configuration guidance
Adds the new releases into the version numbers tables, and removes configuration guidance that is no longer possible under Sonarqube 8.1.
2020-07-16 23:28:17 +01:00
Michael Clarke
0c31c9fd22
Return to SNAPSHOT version post release 2020-07-16 22:51:52 +01:00
GitHub
d31fb77cf8 [Gradle Release Plugin] - new version commit: '1.4.1'. 2020-07-16 21:42:33 +00:00
Michael Clarke
80b9844647
Initiate release 1.4.0 2020-07-16 22:40:31 +01:00
Marvin Wichmann
7a5ae26fbc Adds support for Bitbucket Cloud Code Insights
This commit provides support for the newly created bitbucket cloud code insights
API endpoints. The implementation has been done under the consideration that in
newer versions no dedicated ALM support for bitbucket cloud exists, thus this
implementation is minimal invasive.

One thing to note here:

* For local testing the link on CloudCreateReportRequest has to be set manually to a non localhost URL since
bitbuckets API doesn't support it.
2020-07-16 22:30:36 +01:00
CrazyMax
54c7d4e4f4
Fix automated release through Github actions
The release process has been updated to look for a commit to the gradle.properties file that removes the '-SNAPSHOT' suffix from the version number rather than being triggered off the push of a tag.
2020-07-15 21:51:21 +01:00
cncgoko
79f6c5a99d
#189: Fix single line Github annotations appearing on wrong line
On Github Pull Request decoration, annotation for single line issues are reported on the wrong line, because end line of the annotated error is incorrectly incremented by one.
2020-06-27 18:47:27 +01:00
Valentyn Klindukh
9ac9f6a475
Use the correct properties when decorating Bitbucket Pull Requests
As part of the migration so using the new Sonarqube 8.1 APIs, the order of the ALM Slug and ALM Repo are being injected the wrong way round into the Bitbucket URL, so the project is not being found. Switching the properties to the correct order overcomes this issue and allows Pull Request decoration to complete.
2020-06-27 17:31:43 +01:00
cncgoko
282085d8eb
#190 - Don't decorate with fixed issue
Only decorate with unresolved and non closed issues on Github pull requests.
Currently, fixed issues are still displayed on line 0 of the file, although it is correctly marked as fixed in Sonarqube.
2020-06-13 15:24:39 +01:00
Natan Deitch
230d84e325 #90: Use correct field to retrieve Github repository name
The Github ALM Binding Web Service uses the `AlmRepo` field to store the repository name, but the Github decorator was using `AlmSlug` to try and retrieve the repository name, so was getting a `null` value back and failing to find a matching repository. Switching to using `AlmRepo` in the decorator overcomes this issues.
2020-06-07 15:16:16 +01:00
Markus Heberling
e274c252e5 [GITLAB] support multiple pipelines on a single commit 2020-06-07 15:16:16 +01:00
Uwe Jäger
a8d99abd3c Fix adding discussions for gitlab 2020-06-07 15:16:16 +01:00
Markus Heberling
6570885b83 [GITLAB] use same property names as sonar developer edition 2020-06-07 15:16:16 +01:00
Markus Heberling
15ab941598 [GITLAB] auto config branch/MR 2020-06-07 15:16:16 +01:00
Markus Heberling
6d67a9cd3f [GITLAB] allow overrding of autodetected gitlab ci values 2020-06-07 15:16:16 +01:00
Markus Heberling
062c4e422d [Gitlab] reenable deletion of comments 2020-06-07 15:16:16 +01:00
Markus Heberling
5ffd525116 [GITLAB] URL needs to point to the GitLab API
Fixes #84
2020-06-07 15:16:16 +01:00