Files
Cloud-20Engineering/ConsoleApps/SonarClient/SonarClient/sonar-client.md
Johannes Oenema Effectory 91980817e0 Merged PR 63702: Add Sonar Client to update permissions and tags in Sonar Projects to new team structure
Add Sonar Client to update permissions and tags in Sonar Projects to new team structure

Related work items: #125680
2025-11-05 15:18:52 +00:00

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

  1. Retrieve a personal token from SonarCloud:
  2. In Rider
    • Right-click on the SonarClient project
    • Select Tools > .NET User Secrets
    • This will open secrets.json
    • Add the following:
    {
       "sonar": {
          "api_key": "[add token here]"
       }
    }`
    
  3. Run the application
  4. When done revoke the token