Currently, all non-Azure DevOps ALMs will not decorate a pull request if no settings are provided under General Settings > Pull Request Decoration.
On Azure DevOps, the scanner can infer all necessary parameters from the environment variables. This means decoration will always happen, whether users want to or not. Not providing a project binding isn't sufficient, and this was done for BC reasons (as the binding was introduced after the scanner was updated for Azure DevOps; hence, it is optional for Azure DevOps).
But some users want to have the QG on SonarQube, but are not ready yet to deal with the noise generated by the decoration. These users want to opt-out specifically.
We should add a new setting which will allow users to disable decoration for Azure DevOps.
We could add a new project property, something like sonar.pullrequest.decorationDisabled, which would default to false (or null).
We could then add a new property to the payload of api/alm_settings/get_binding, something like prDecoDisabled: boolean, which represents this project property.
We can display a toggle button under General Settings > Pull Request Decoration: Enable PR decoration. If prDecoDisabled is null or false, this toggle will be "On", and the UI will work as it does now. If it's true, however, the toggle will be "Off".
- If switched to "On" in the UI (will not contact the backend), we display the form as usual. Calling any api/alm_settings/set_*_binding endpoint will be the same as setting sonar.pullrequest.decorationDisabled = false.
- If switched to "Off" in the UI, we will call api/alm_settings/delete_binding, which will also set sonar.pullrequest.decorationDisabled = true.
If sonar.pullrequest.decorationDisabled = true, skip the pull request decoration, regardless of ALM.