Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SonarQube 8.1 Support #58

Merged
merged 9 commits into from
Jun 7, 2020
Merged

SonarQube 8.1 Support #58

merged 9 commits into from
Jun 7, 2020

Commits on Jun 7, 2020

  1. Add support for Sonarqube 8.1.0

    Sonarqube 8.1 removed the concept of short and long lived branches, instead simplifying the setup to either `BRANCH` or `PULL_REQUEST`. This release of Sonarqube also moved the management of Pull Request decoration into a standard User Interface calling a set of 'ALM' services that provide the management of decorators, and the binding of each project to these decorators. However the implementation of these services is not included in the Community Edition of Sonarqube, although the UI is made visible based on the presence of the branch management components provided by this plugin.
    
    This change therefore introduces the services required to support UI components for the management of Pull Request decoration, as well as updating the handling of the configuration and loading of branches to support the removal of the SHORT/LONG branch constructs. As these changes require the reference of classes that were not present in older version of Sonarqube (namely `AlmSettingsDao` and `ProjectAlmSettingsDao`), the compatibility interfaces for these versions have been removed, as well as any methods and classes that existed purely to allow these versions to be supported by this plugin, meaning this version of the plugin is not backwards compatible with previous Sonarqube versions.
    
    Given the standard UI provides a restricted set of fields for creating and binding each Pull Request decorator, some of the patterns that were previously used by this plugin for configuring the decoration of Pull Requests do not fit into this UI, and were awkward to find/manage when moved to another screen in the UI. This results in the configuration for disabling the addition and removing of comments on Merge Requests being removed from the plugin, with the Gitlab decorator removing the deleting of old comments since this was leading to discussion boxes being shown in Gitlab with no content, and the BitBucket decorator removing since it can't work out which user posted comments based purely on the configuration provided by Sonarqube.
    
    To ensure the UI works for all configuration options, the services for configuring and binding Azure DevOps configuration have been included in this change-set, although no decorator currently exists for this ALM, so any project attempting to use this configuration will get a warning appear in the CE logs when attempting to use this decorator. Similarly, as the UI does not provide any options for configuring the URL for the Gitlab API, or the Slug/name of the project on the binding, a `Sensor` has been added into the scanner to detect these properties from injection by the Gitlab CI Runner, as well as injection directly from scanner arguments of `com.github.mc1arke.sonarqube.plugin.branch.pullrequest.gitlab.url` and `com.github.mc1arke.sonarqube.plugin.branch.pullrequest.gitlab.repositorySlug` for the repository URL and repository-name configuration entries.
    mc1arke committed Jun 7, 2020
    Configuration menu
    Copy the full SHA
    af9c21b View commit details
    Browse the repository at this point in the history
  2. [GITLAB] URL needs to point to the GitLab API

    Fixes #84
    tisoft authored and mc1arke committed Jun 7, 2020
    Configuration menu
    Copy the full SHA
    8a1b257 View commit details
    Browse the repository at this point in the history
  3. [Gitlab] reenable deletion of comments

    tisoft authored and mc1arke committed Jun 7, 2020
    Configuration menu
    Copy the full SHA
    26aad3a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2ecb76b View commit details
    Browse the repository at this point in the history
  5. [GITLAB] auto config branch/MR

    tisoft authored and mc1arke committed Jun 7, 2020
    Configuration menu
    Copy the full SHA
    a848b95 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    365f4f0 View commit details
    Browse the repository at this point in the history
  7. Fix adding discussions for gitlab

    uwej711 authored and mc1arke committed Jun 7, 2020
    Configuration menu
    Copy the full SHA
    35c40fe View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    928c766 View commit details
    Browse the repository at this point in the history
  9. #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.
    ndeitch authored and mc1arke committed Jun 7, 2020
    Configuration menu
    Copy the full SHA
    89b5982 View commit details
    Browse the repository at this point in the history