|
2 | 2 |
|
3 | 3 | ## Summary |
4 | 4 | This version of the PTB adds nox task `sonar:check`, see #451. This allows us to |
5 | | -use SonarQube Cloud to analyze, visualize, & track linting, security, & coverage. In |
6 | | -order to properly set it up, you'll need to do the following instruction for each **public** project. |
7 | | -At this time, PTB currently does not support setting up SonarQube for a **private** project. |
| 5 | +use SonarQube Cloud to analyze, visualize, & track linting, security, & coverage. To |
| 6 | +set it up, you'll need to execute the following instructions. |
8 | 7 |
|
| 8 | +### For a public project |
9 | 9 | 1. Specify in the `noxconfig.py` the relative path to the project's source code in `Config.source` |
10 | 10 | ```python |
11 | | - source: Path = Path("exasol/toolbox") |
12 | | - ``` |
13 | | -2. Add the 'SONAR_TOKEN' to the 'Organization secrets' in GitHub (this requires a person being a GitHub organization owner). |
14 | | -3. Activate the SonarQubeCloud App |
| 11 | + source: Path = Path("exasol/<project-source-folder>") |
| 12 | + ``` |
| 13 | +2. Add the 'SONAR_TOKEN' to the 'Organization secrets' in GitHub (this requires a person being a GitHub organization owner) |
| 14 | +3. Activate the [SonarQubeCloud App](https://github.com/apps/sonarqubecloud) |
15 | 15 | 4. Create a project on SonarCloud |
16 | 16 | 5. Add the following information to the project's file `pyproject.toml` |
17 | 17 | ```toml |
| 18 | + |
18 | 19 | [tool.sonar] |
19 | 20 | projectKey = "com.exasol:<project-key>" |
20 | 21 | hostUrl = "https://sonarcloud.io" |
21 | 22 | organization = "exasol" |
22 | | - ``` |
| 23 | + ``` |
23 | 24 | 6. Post-merge, update the branch protections to include SonarQube analysis |
24 | 25 |
|
| 26 | +### For a private project |
| 27 | +1. Specify in the `noxconfig.py` the relative path to the project's source code in `Config.source` |
| 28 | + ```python |
| 29 | + source: Path = Path("exasol/<project-source-folder>") |
| 30 | + ``` |
| 31 | +2. Add the 'PRIVATE_SONAR_TOKEN' to the 'Organization secrets' in GitHub (this requires a person being a GitHub organization owner) |
| 32 | +3. Activate the [exasonarqubeprchecks App](https://github.com/apps/exasonarqubeprchecks) |
| 33 | +4. Create a project on https://sonar.exasol.com |
| 34 | +5. Add the following information to the project's file `pyproject.toml` |
| 35 | + ```toml |
| 36 | + [tool.sonar] |
| 37 | + projectKey = "com.exasol:<project-key>" |
| 38 | + hostUrl = "https://sonar.exasol.com" |
| 39 | + organization = "exasol" |
| 40 | + ``` |
| 41 | +6. Post-merge, update the branch protections to include SonarQube analysis from exasonarqubeprchecks |
| 42 | + |
25 | 43 | ## ✨ Features |
26 | 44 | * #451: Added nox task to execute pysonar & added Sonar to the CI |
27 | 45 |
|
|
0 commit comments