1
0
mirror of https://github.com/mc1arke/sonarqube-community-branch-plugin.git synced 2025-02-19 19:10:33 +02:00

364 Commits

Author SHA1 Message Date
dependabot[bot]
34167a3a18 Bump org.assertj:assertj-core from 3.26.3 to 3.27.3
Bumps [org.assertj:assertj-core](https://github.com/assertj/assertj) from 3.26.3 to 3.27.3.
- [Release notes](https://github.com/assertj/assertj/releases)
- [Commits](https://github.com/assertj/assertj/compare/assertj-build-3.26.3...assertj-build-3.27.3)

---
updated-dependencies:
- dependency-name: org.assertj:assertj-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-26 10:31:09 +00:00
dependabot[bot]
389b2240e2 Bump org.mockito:mockito-core from 5.14.2 to 5.15.2
Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.14.2 to 5.15.2.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v5.14.2...v5.15.2)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-26 10:24:23 +00:00
dependabot[bot]
3595277818 Bump org.junit:junit-bom from 5.11.3 to 5.11.4
Bumps [org.junit:junit-bom](https://github.com/junit-team/junit5) from 5.11.3 to 5.11.4.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.3...r5.11.4)

---
updated-dependencies:
- dependency-name: org.junit:junit-bom
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-26 10:23:44 +00:00
Michael Clarke
898ebdd24a Return to SNAPSHOT version post release 2024-12-11 21:01:04 +00:00
GitHub
8a0416e7ba [Gradle Release Plugin] - new version commit: '1.23.1'. 2024-12-11 20:53:59 +00:00
Michael Clarke
f76723406d Initiate release 1.23.0 1.23.0 2024-12-11 20:52:34 +00:00
dependabot[bot]
7971a9a932
Bump com.fasterxml.jackson.datatype:jackson-datatype-jsr310 (#1006) 2024-12-11 19:53:03 +00:00
Krapp
06a6e0925d
Fix docker compose instructions using old docker-compose binary instead of compose plugin (#1008) 2024-12-11 19:50:36 +00:00
dependabot[bot]
37d125c8b9
Bump org.wiremock:wiremock from 3.9.2 to 3.10.0 (#1010) 2024-12-11 19:47:51 +00:00
Michael Clarke
b3366cd3e5
#1011: Add support for Sonarqube 24.12 (#1013) 2024-12-11 19:47:19 +00:00
Jacky Lam
d4298a8936
#415: Make Github check name consistent with Sonarqube commercial edition
The check name for decorating Github Pull Requests is currently based on the project name, which prevents setting a global policy for an action having completed on all projects based on a single name. To bring the plugin in-line with the commercial edition, a static name is being used during decoration unless the project is declared as a mono-repo, in which case the project name will be added to the check name.
2024-11-25 07:21:17 +00:00
Michael Clarke
3ca9bae189 Upgrade all tests to JUnit 5
JUnit 4 has been removed from the project and all tests updated to use
JUnit 5. Where possible calls to Mockito's `mock` has been altered to
use the `no-args` version, and ArgumentCaptor's `forClass` replaced with
`captor` to reduce verbosity.
2024-11-17 17:06:42 +00:00
Michael Clarke
419f59f6e5 #893: Report build status to Bitbucket
The Bitbucket decorators submit a report to Bitbucket containing the
quality gate summary, but don't submit a report that influences the
build status. A second call is being made to submit abuild status that
is either successful is the Quality Gate has passed, or failed is the
Quality Gate did not pass.
2024-11-17 12:18:22 +00:00
Michael Clarke
625965018e Check agent is correctly installed during plugin startup
Users currently submit a number of reports for Sonarqube reporting that
branch analysis is not available despite them having the plugin
installed, which are typically triggered by the user not having set up
the Java agent on one of the components correctly. This is compounded by
the Sonarqube plugin screen showing the plugin as being installed in
these scenarios even where the plugin's classes and configuration have
not been fully loaded into Sonarqube. To overcome this, the plugin
bootstrap class is now checking for the agent having made an alteration
to one of the bootstrap methods as an indication that the agent has run
successfully for both the Compute Engine and Web components, with the
plugin failing to start if either component doesn't detect the agent
modifications, and therefore preventing the Sonarqube server starting.
Whilst this won't fully resolve the problem of users not installing the
plugin properly, it prevents them believing the plugin is installed and
then only finding out things aren't right at the point they try and
submit an analysis with branch or pull request properties.
2024-11-17 12:09:54 +00:00
Michael Clarke
c28e16e0b5 Remove old Gitlab and Azure Devops summary comments on new decoration
The plugin historically left old comments in place but resolved
conversations where comments had become outdated or the underlying issue
had been resolved. However, in Gitlab, the summary comments always
remained visible even when resolved as they were the first comment in
the thread so were not minimised by the Gitlab UI. For a merge request
being scanned multiple times as issues are being fixed, other review
comments responded to, and rebasing activities performed, this can lead
to a number of summary comments being added where the last comment is
typically only the one that developers are about.

As editing comments is not good practice since it's unclear what any
resulting comments in the thread are referring to and Gitlab does not
send emails to notify that comments have changed, the summary comment
is continuing to be posted as a new comment, but the old summary
comments are now being deleted. Where a thread has spawned from an old
summary comment, that comment will not be deleted, but a note added to
notify the users that the summary comment is outdated and the thread can
be resolved once the discussion reaches a conclusion.
2024-11-17 12:05:24 +00:00
Michael Clarke
eaad89e09c Switch to new Software Quality metrics when decorating Pull Requests
Sonarqube has deprecated the previous Bug, Vulnerability, and Code Smell
rule types, instead replacing them with Software Quality attributes and
a potential rating against multiple attributes for a single rule. As the
rule types were only being used to report individual issues in the
Gitlab and Azure decorators, and for creating the overall summary
message to match what was previously shown on the Pull Request's
overview within Sonarqube, the types have been removed from all
decoration. Where summary messages are used in a decorator they now show
equivalent information as is shown on the Pull Request overview page in
Sonarqube - New issues, accepted issues, resolved issues, coverage,
duplications, and security hotspot metrics, plus any failed quality gate
conditions. Where the issue rating is reported in decoration, the
highest rating across all the Software Qualities assigned to a rule is
used in the new setup. The individual issues posted on Gitlab and Azure
decorations have been simplified to only contain the message from the
finding and the link to view the finding in Sonarqube, rather than
including attributes about resolution time and issue type which are
unlikely to have been useful to most users.
2024-11-17 10:00:20 +00:00
Michael Clarke
c7843a3d96 #958: Set plugin group ID to root in container build
Not all the Sonarqube image variants contain a group named sonarqube, so
the `chown` command fails as it's unable to find the target group. To
overcome this the group is being set to `0` which should always exist
as the root user's group.
2024-11-17 08:33:46 +00:00
Michael Clarke
fd5d52e4f0 Remove the unsupported Nodes GraphQL library
The library that had been used to integrate with GitHub's GraphQL APIs
is no longer maintained. As the rest of the project uses Rest APIs to
integrate with services, there's a fairly mature GitHub Java library,
and switching to any other GraphQL library is likely to require as much
effort as switching to a Rest implementation, this change is removing
the GraphQL implementation and moving to the github-api library bundled
within Sonarqube. As GitHub's Rest API does not support minimising
comments, old summary comments are being deleted rather than minimised
after a new summary comment is added. Additionally, the 'bridging'
features used in the github-api library cause issues when mockito
attempts to mock/spy a bridged class, so an unbridged version of the
library has been specified at the start of the test runtime classpath to
allow unit testing using the affected classes.

Includes an upgrade to the docker-compose file to use a newer Postgres
version and resolve some linting issues.
2024-11-13 13:57:40 +00:00
dependabot[bot]
3d1e9387ca Bump org.mockito:mockito-core from 5.13.0 to 5.14.2
Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.13.0 to 5.14.2.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v5.13.0...v5.14.2)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-11 16:36:39 +00:00
dependabot[bot]
77c84a379d Bump org.junit:junit-bom from 5.11.0 to 5.11.3
Bumps [org.junit:junit-bom](https://github.com/junit-team/junit5) from 5.11.0 to 5.11.3.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.0...r5.11.3)

---
updated-dependencies:
- dependency-name: org.junit:junit-bom
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-11 16:35:33 +00:00
dependabot[bot]
faeebb1b6a Bump com.fasterxml.jackson.datatype:jackson-datatype-jsr310
Bumps com.fasterxml.jackson.datatype:jackson-datatype-jsr310 from 2.17.2 to 2.18.1.

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.datatype:jackson-datatype-jsr310
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-11 16:34:17 +00:00
dependabot[bot]
474553bfff Bump org.wiremock:wiremock from 3.9.1 to 3.9.2
Bumps [org.wiremock:wiremock](https://github.com/wiremock/wiremock) from 3.9.1 to 3.9.2.
- [Release notes](https://github.com/wiremock/wiremock/releases)
- [Commits](https://github.com/wiremock/wiremock/compare/3.9.1...3.9.2)

---
updated-dependencies:
- dependency-name: org.wiremock:wiremock
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-11 16:31:19 +00:00
Jacky Lam
8cfa03aef5
Update helm chart example not to use deprecated fields
Helm chart values jvmOpts and jvmCeOpts were deprecated in v8.3.1.
2024-11-11 16:25:43 +00:00
Michael Clarke
a228d9f7ef #972: Ensure a consistent timezone is used in comparisons
The service code uses DateUtils to convert a long into a String format,
which DateUtils converting the long to an instant, then an
OffsetDateTime before passing this through a formatter, using the local
timezone during the OffsetDateTime conversion.
As the test was using a pre-created String based on the UTC timezone,
the test does not correctly compare the values when being executed in a
different timezone. To overcome this, the test has been altered to use
the same DateUtils methods to convert from the long to a String, thereby
ensuring the same timezone handling is using in both test and live code.
2024-10-05 12:19:50 +01:00
Michael Clarke
5932956c29 Return to SNAPSHOT version post release 2024-09-07 18:19:57 +01:00
GitHub
ba87ec669f [Gradle Release Plugin] - new version commit: '1.22.1'. 2024-09-07 17:05:23 +00:00
Michael Clarke
44945374bd Initiate release 1.22.0 1.22.0 2024-09-07 18:00:51 +01:00
Michael Clarke
fde1c7770c #958: Remove group assignment during container build
The sonarqube images no longer create a sonarqube group for the
sonarqube user to be placed into, instead they put the sonarqube user in
the root group. To prevent the plugin builds failing when attempting to
set the plugin ownership to a group that doesn't exist, the `chown`
command is being altered to only set the user ownership, not the
associated group.
2024-09-07 17:52:12 +01:00
dependabot[bot]
0648ca45c7 Bump org.junit:junit-bom from 5.10.3 to 5.11.0
Bumps [org.junit:junit-bom](https://github.com/junit-team/junit5) from 5.10.3 to 5.11.0.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.10.3...r5.11.0)

---
updated-dependencies:
- dependency-name: org.junit:junit-bom
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-06 19:12:11 +01:00
dependabot[bot]
10ee795c56 Bump org.wiremock:wiremock from 3.8.0 to 3.9.1
Bumps [org.wiremock:wiremock](https://github.com/wiremock/wiremock) from 3.8.0 to 3.9.1.
- [Release notes](https://github.com/wiremock/wiremock/releases)
- [Commits](https://github.com/wiremock/wiremock/compare/3.8.0...3.9.1)

---
updated-dependencies:
- dependency-name: org.wiremock:wiremock
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-06 19:10:36 +01:00
dependabot[bot]
eb96c9fe70 Bump org.mockito:mockito-core from 5.12.0 to 5.13.0
Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.12.0 to 5.13.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v5.12.0...v5.13.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-06 19:05:58 +01:00
Michael Clarke
7fb5a568b9 #934: Use static report key for non-monorepo Bitbucket decoration
The Bitbucket decoration is currently using the project key to create
the analysis report key, but the Sonarqube documentation states this
should be a static value across all projects. To ensure that the
Bitbucket `Required report` configuration can be created as per the
guidance in Sonarqube documentation, the static key is being used where
the repository has not been set as a monorepo.
2024-09-06 19:05:42 +01:00
Michael Clarke
405c894f22 #909: Use default branch as Pull Request base when target does not exist
The resolution of Pull Request details currently uses the project
default branch when a pull request is analysed without specifying a
target branch. However, when a target branch is specified, the plugin
expects that branch to exist and throws an exception if the target
branch is not found. To overcome this, the target branch is being
resolved to the default branch where no target branch is specified or
the requested target branch does not exist. As the API used to gather
branch information does not return PULL_REQUEST details, the result of
this searching is that a pull request will either target a branch from
the main branch, or target the main branch, there is no further nesting
or pull requests and branches.
2024-09-06 19:03:59 +01:00
Michael Clarke
6d328056a4 #959: Ensure multi-line string are enclosed in blockquotes
The Github Cloud API now returns an error about the input message being
malformed, seemingly due to a change in how new lines in messages are
being handled. As the use of blockquotes around multi-line messages
appears to continue to work, the analysis messages are being wrapped in
blockquotes rather than double-quotes where they contain newline
characters. This requires an interim measure of cloning the InputObject
class from the nodes library to alter the String comparison and wrapping
since the library is no longer maintained.
2024-09-06 18:59:34 +01:00
Michael Clarke
92f74f7e07 #945: Gather statistics for issues fixed in a pull request
Sonarqube currently reports a fixed issues metric for pull requests, but
the plugin isn't providing the data to allow that value to be
calculated. To resolve this an additional IssueVisitor has been
introduced that compares the issues from the target branch with the
findings on the source branch and finds any target code blocks that no
longer exists - implying the issue line has been removed - or any code
that still exists but is now reporting the issue as fixed, and reports
them to the PullRequestFixedIssuesRepository which is used within
Sonarqube to gather the count of issues fixed in the current analysis.
2024-08-18 13:37:22 +01:00
Michael Clarke
c9ff809107 #940: Use correct component IDs when extracting analysis date
The component ID was being used to create a map of analysis dates to
items, but the Pull Request's component ID did not map into this item,
so the Pull Request web service was always returning the analysis date
as empty. The service has been altered to use the root component ID as
was used in the search to ensure the IDs align.
2024-08-11 21:17:51 +01:00
Michael Clarke
137e8e66e1 #715: Handle duplication information not being present
Where Sonarqube does not have duplication information recorded on a
branch, such as there being no code to analyse, the duplication
information may be null. THe plugin is being altered to show this as a
`0` rather than throwing an exception when trying to format the missing
value.
2024-08-11 16:59:20 +01:00
Michael Clarke
6d7320cecb Return to SNAPSHOT version post release 2024-08-11 16:02:49 +01:00
GitHub
dc77c262fe [Gradle Release Plugin] - new version commit: '1.21.1'. 2024-08-11 13:40:06 +00:00
Michael Clarke
43c5421b81 Initiate release 1.21.0 1.21.0 2024-08-11 14:38:32 +01:00
nyyu
757a33e7a3 #926: Update to SonarQube 10.6 2024-08-11 14:31:16 +01:00
Michael Clarke
fce27c89b3 Return to SNAPSHOT version post release 2024-08-11 14:17:32 +01:00
GitHub
db365586bb [Gradle Release Plugin] - new version commit: '1.20.1'. 2024-08-11 12:57:54 +00:00
Michael Clarke
0b3984e6e5 Initiate release 1.20.0 1.20.0 2024-08-11 13:56:21 +01:00
Michael Clarke
182911d6d6 Upgrade to the latest Gradle version
Bumps to Gradle 8.9. Includes moving to the `Jammy` JDK Docker image
rather than the `Alpine` image to allow building on Arm architectures.
2024-08-11 12:16:24 +01:00
Dennis
c5a5a7308c SonarQube 10.5 compatibility 2024-08-11 09:03:20 +01:00
Mykola Rybak
9ec99e0fdf Fix detection of previous PR annotation comments
MarkdownFormatterFactory uses System.lineSeparator() as the end-of-line
character for annotation comments.

GraphqlGithubClient.postSummaryComment(), however, uses hardcoded \r\n
as end-of-line character, so it isn't able to match legitimate comments
if SonarQube is not running on Windows.

This change updates GraphqlGithubClient to also use system end-of-line
char.
2024-08-11 08:57:56 +01:00
dependabot[bot]
6e50df12ff Bump org.assertj:assertj-core from 3.25.3 to 3.26.3
Bumps [org.assertj:assertj-core](https://github.com/assertj/assertj) from 3.25.3 to 3.26.3.
- [Release notes](https://github.com/assertj/assertj/releases)
- [Commits](https://github.com/assertj/assertj/compare/assertj-build-3.25.3...assertj-build-3.26.3)

---
updated-dependencies:
- dependency-name: org.assertj:assertj-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-10 20:18:29 +01:00
dependabot[bot]
d3a3df886c Bump com.fasterxml.jackson.datatype:jackson-datatype-jsr310
Bumps com.fasterxml.jackson.datatype:jackson-datatype-jsr310 from 2.17.0 to 2.17.2.

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.datatype:jackson-datatype-jsr310
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-10 20:13:34 +01:00
dependabot[bot]
d76e1b4ca4 Bump org.wiremock:wiremock from 3.5.2 to 3.8.0
Bumps [org.wiremock:wiremock](https://github.com/wiremock/wiremock) from 3.5.2 to 3.8.0.
- [Release notes](https://github.com/wiremock/wiremock/releases)
- [Commits](https://github.com/wiremock/wiremock/compare/3.5.2...3.8.0)

---
updated-dependencies:
- dependency-name: org.wiremock:wiremock
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-10 20:11:53 +01:00