mirror of
https://dev.azure.com/effectory/Survey%20Software/_git/Cloud%20Engineering
synced 2026-02-27 10:45:02 +01:00
Add Sonar Client to update permissions and tags in Sonar Projects to new team structure Related work items: #125680
1.2 KiB
1.2 KiB
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
- Retrieve a personal token from SonarCloud:
- Go to: https://sonarcloud.io/account/security
- Enter token name
- Click
Generate Token - Copy token
- In Rider
- Right-click on the
SonarClientproject - Select
Tools > .NET User Secrets - This will open
secrets.json - Add the following:
{ "sonar": { "api_key": "[add token here]" } }` - Right-click on the
- Run the application
- When done revoke the token