Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This Splits the AzureDevOpsServerPullRequestDecorator into distinct decorator and client implementations to allow separation of responsibilities. As part of extracting the client logic from the decorator, the decoration flow has been simplified to improve error handling and reduce nested logic, and fields that were not used in the decorator or client, and were not required by the Azure DevOps API have been removed from the client model.
As Sonarqube now requires that the project's ALM binding has the project and repository names set, these were never being read from the scanner properties so the associated environment detection has been removed for everything other than the pull request ID.
The Azure Devops Decorator does not currently close comment threads where the issue no longer exists. As the concept of submitting comments to threads and reporting an overall pipeline status is similar between Gitlab and Azure Devops, the common co-ordination of retrieving existing threads, checking if they contain SonarQube comments, closing any outdated issues, reporting new issues, and submitting a pipeline result has been moved into a
DiscussionAwarePullRequestDecorator
with both the Gitlab and Azure DevOps decorator extending this base decorator and providing the implementations for the actual interactions and response handling for the relevant ALMs.As there is no reliable way of obtaining the details of the current user details on the version of the Azure DevOps API used by the plugin, the filtering for messages posted by the SonarQube user presumes that any thread started with a message containing the
View in SonarQube
link is a SonarQube comment, and therefore includes that thread in any subsequent cleanup activities.