Browse Source

SC-131 - Removed one of very last mention to VSTS/TFS (#1968)

* SC-131 - Fixed one of the very last mention of VSTS to Azure DevOps + removed SonarQube specific doc for this markdown.

* fixup! SC-131 - Corrected markdown, was the one from SonarCloud.
tags/8.0
mickael-caro-sonarsource 4 years ago
parent
commit
1771582bc9
1 changed files with 11 additions and 36 deletions
  1. 11
    36
      server/sonar-docs/src/pages/analysis/pull-request.md

+ 11
- 36
server/sonar-docs/src/pages/analysis/pull-request.md View File

@@ -3,11 +3,11 @@ title: Pull Request Analysis
url: /analysis/pull-request/
---

<!-- sonarqube -->

_Pull Request analysis is available as part of [Developer Edition](https://redirect.sonarsource.com/editions/developer.html) and [above](https://www.sonarsource.com/plans-and-pricing/)._

<!-- /sonarqube -->
Pull Requests (PRs) are visible in {instance} from the branches and pull requests dropdown menu of your project.

PR analysis allows you to:
@@ -25,18 +25,13 @@ When PR decoration is enabled, {instance} publishes the status of the analysis (

PR analyses on {instance} are deleted automatically after 30 days with no analysis. This can be updated in **Configuration > General > Number of days before purging inactive short living branches**.

<!-- sonarcloud -->
## Integrations for GitHub, Bitbucket Cloud, and Azure DevOps
If your repositories are hosted on GitHub, Bitbucket Cloud, or Azure DevOps, first check out the dedicated integrations for: [BitBucket Cloud](/integrations/bitbucketcloud/), [GitHub](/integrations/github/), and [Azure DevOps](/integrations/vsts/). Chances are that you don't need to read this page further since those integrations handle the configuration and analysis parameters for you.
<!-- /sonarcloud -->

## Analysis Parameters

These parameters enable PR analysis:

| Parameter Name | Description |
| --------------------- | ------------------ |
| `sonar.pullrequest.key` | Unique identifier of your PR. Must correspond to the key of the PR in GitHub or TFS. <br/> E.G.: `sonar.pullrequest.key=5` |
| `sonar.pullrequest.key` | Unique identifier of your PR. Must correspond to the key of the PR in GitHub or Azure DevOps. <br/> E.G.: `sonar.pullrequest.key=5` |
| `sonar.pullrequest.branch` | The name of the branch that contains the changes to be merged.<br/> Ex: `sonar.pullrequest.branch=feature/my-new-feature`|
| `sonar.pullrequest.base` | The long-lived branch into which the PR will be merged. <br/> Default: master <br/> E.G.: `sonar.pullrequest.base=master`|

@@ -45,36 +40,28 @@ This section details how to decorate your PRs with {instance} issues in your SCM

### Specifying Your PR Provider

Specify your PR provider in your global settings at [**Administration > General Settings > Pull Requests > General > Provider**](/#sonarqube-admin#/sonarqube/admin/settings?category=pull_request/). This is the name of the system managing your PR. When using the {instance} Extension for Azure DevOps, the provider is automatically populated. <!-- sonarcloud -->It's the same for GitHub if you are using the Travis CI Add-on and Bitbucket Cloud if you are building with Bitbucket Pipelines.<!-- /sonarcloud -->
Specify your PR provider in your global settings at [**Administration > General Settings > Pull Requests > General > Provider**](/#sonarqube-admin#/sonarqube/admin/settings?category=pull_request/). This is the name of the system managing your PR. When using the {instance} Extension for Azure DevOps, the provider is automatically populated.

### GitHub <!-- sonarqube -->Enterprise<!-- /sonarqube --> PR Decoration
### GitHub Enterprise PR Decoration

<!-- sonarqube -->
[[info]]
| *Minimum GitHub Enterprise version* 2.14
<!-- /sonarqube -->

To add PR decoration to Checks on GitHub <!-- sonarqube -->Enterprise<!-- /sonarqube -->, you need to <!-- sonarqube -->create a GitHub App and configure your SonarQube instance and<!-- /sonarqube --> update your project-level settings.
To add PR decoration to Checks on GitHub Enterprise, you need to create a GitHub App and configure your SonarQube instance and update your project-level settings.

<!-- sonarqube -->
#### Creating Your GitHub App
An instance administrator needs to create a GitHub App and configure your SonarQube instance. See [GitHub Enterprise Integration](/instance-administration/github-application/) for instructions.
<!-- /sonarqube -->

#### Updating Your GitHub Project Settings
In your project settings, set your project repository identifier (for example, SonarSource/sonarqube) at **Administration > General Settings > Pull Requests > Integration with GitHub > Repository identifier**.

### Bitbucket <!-- sonarqube -->Server<!-- /sonarqube --> PR Decoration
### Bitbucket Server PR Decoration

<!-- sonarqube -->
[[info]]
| *Minimum BitBucket Server version* 5.15
<!-- /sonarqube -->

To add PR decoration on Bitbucket Server, you need to set a personal access token and update some settings.

To add PR decoration on Bitbucket <!-- sonarqube -->Server<!-- /sonarqube -->, you need to <!-- sonarqube -->set a personal access token and<!-- /sonarqube --> update some settings.

<!-- sonarqube -->
#### Setting Your Personal Access Token

In your global settings, set the personal access token of the user that will be used to decorate the PRs in the SonarQube UI:
@@ -82,7 +69,6 @@ In your global settings, set the personal access token of the user that will be
* Set the token at [**Administration > General Settings > Pull Requests > Integration with Bitbucket Server > Personal access token**](/#sonarqube-admin#/admin/settings?category=pull_request/)
* The user that will be used to decorate PRs needs write permission.


#### Updating Your Bitbucket Server Settings

In your global settings, set your Bitbucket Server URL (for example, `https://myinstance.mycompany.com/`) at [**Administration > General Settings > Pull Requests > Integration with Bitbucket Server > The URL of the Bitbucket Server**](/#sonarqube-admin#/admin/settings?category=pull_request/). This is the base URL for your Bitbucket Server instance.
@@ -92,27 +78,16 @@ In your project settings at **Administration > General Settings > Pull Requests
* Bitbucket Server project key. You can find it in the Bitbucket Server repository URL (.../projects/**{KEY}**/repos/{SLUG}/browse).
For projects in a personal space, the project key is "~" followed by your username (for example, `~YourUsername`).
* Bitbucket Server repository slug. You can find it in the Bitbucket Server repository URL (.../projects/{KEY}/repos/**{SLUG}**/browse).
<!-- /sonarqube -->

<!-- sonarcloud -->
#### Updating Your Bitbucket Cloud Settings
| Setting Name | Description | Example value |
| --------------------- | ------------------ |------------------ |
| `sonar.pullrequest.bitbucketcloud.repository` | UUID of the Bitbucket Cloud Repo | `{d2615dd4-550d-43e5-80c4-665f951e5d6e}` |
| `sonar.pullrequest.bitbucketcloud.owner` | UUID of the Bitbucket Cloud Owner | `{4f9fd128-1b08-49ec-bf2c-f094163cff4d}` |
<!-- /sonarcloud -->

### Azure DevOps <!-- sonarqube -->Server<!-- /sonarqube --> PR Decoration
### Azure DevOps Server PR Decoration

To add PR decoration on Azure DevOps <!-- sonarqube -->Server<!-- /sonarqube -->, you need to set a personal access token.
To add PR decoration on Azure DevOps Server, you need to set a personal access token.

#### Setting Your Personal Access Token

In <!-- sonarqube -->global and<!-- /sonarqube --> project settings, set the personal access token of the user that will be used to decorate the PRs in the SonarQube UI at [**Administration > General Settings > Pull Requests > Integration with VSTS / TFS > Personal access token**](/#sonarqube-admin#/admin/settings?category=pull_request/).
In global and project settings, set the personal access token of the user that will be used to decorate the PRs in the SonarQube UI at [**Administration > General Settings > Pull Requests > Integration with Azure DevOps > Personal access token**](/#sonarqube-admin#/admin/settings?category=pull_request/).

The user that will be used to decorate PRs needs to be authorized for the scope: 'Code (read and write)'.

<!-- sonarqube -->
### Issue links
During pull request decoration, individual issues will be linked to their SonarQube counterparts automatically. However, for this to work correctly, the instance's **Server base URL** (**[Administration > General](/#sonarqube-admin#/admin/settings)**) must be set correctly. Otherwise the links will default to `localhost`.
<!-- /sonarqube -->

Loading…
Cancel
Save