mirror of
https://dev.azure.com/effectory/Survey%20Software/_git/Cloud%20Engineering
synced 2026-02-27 18:52:18 +01:00
Add Sonar Client to update permissions and tags in Sonar Projects to new team structure Related work items: #125680
45 lines
1.2 KiB
Markdown
45 lines
1.2 KiB
Markdown
# SonarClient Console Application
|
|
|
|
## Overview
|
|
|
|
SonarClient is a console application designed to interact with SonarQube/SonarCloud REST APIs. This tool
|
|
provides functionality to manage, query, and analyze code quality metrics and security findings from SonarQube
|
|
instances.
|
|
|
|
Depending on the operations, the application will reach out to v1 or v2 of the SonarQube API.
|
|
|
|
Documentation for the v1 API can be found here: https://sonarcloud.io/web_api
|
|
Documentation for the v2 API can be found here: https://api-docs.sonarsource.com/
|
|
|
|
## Features
|
|
|
|
- **Update Permissions And Tags**: Update permissions and tags for all projects. Added for migration to new team structure.
|
|
|
|
## Operations
|
|
|
|
- Retrieve all projects
|
|
- Set tags for a project
|
|
- Apply permission template on a project
|
|
|
|
## Usage
|
|
|
|
1. Retrieve a personal token from SonarCloud:
|
|
- Go to: https://sonarcloud.io/account/security
|
|
- Enter token name
|
|
- Click `Generate Token`
|
|
- Copy token
|
|
2. In Rider
|
|
- Right-click on the `SonarClient` project
|
|
- Select `Tools > .NET User Secrets`
|
|
- This will open `secrets.json`
|
|
- Add the following:
|
|
```json
|
|
{
|
|
"sonar": {
|
|
"api_key": "[add token here]"
|
|
}
|
|
}`
|
|
3. Run the application
|
|
4. When done revoke the token
|
|
|