configure-sonarcloud-collection

Configures SonarCloud static analysis and coverage reporting for Ansible collection repositories.

8|7|Updated Feb 14, 2023
One-click install
npx skills add https://github.com/eclipse-slm/slm --skill configure-sonarcloud-collection-eclipse-slm
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: configure-sonarcloud-collection
Source: https://github.com/eclipse-slm/slm/tree/main/.agents/skills/configure-sonarcloud-collection
Command: npx skills add https://github.com/eclipse-slm/slm --skill configure-sonarcloud-collection-eclipse-slm

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Setting up SonarCloud static analysis for an Ansible collection involves coordinating project properties, GitHub Actions workflows, XML coverage output, and org-level secrets, which is error-prone and inconsistent across repositories. ## Core Features & Use Cases - Project Configuration: Generates a root sonar-project.properties aligned with the SonarCloud project key, collection layout, and Python version. - CI Workflow Setup: Copies canonical workflow_run or workflow_call GitHub Actions templates that run the SonarScanner with the org SONAR_TOKEN secret. - Coverage Integration: Ensures coverage.xml is produced at the repository root via pytest or tox so SonarCloud displays coverage metrics. - Use Case: A maintainer onboarding the amazon.aws collection to SonarCloud uses this Skill to add the properties file, wire the scanner workflow into all_green_check.yaml, and document fork/secret behavior for contributors. ## Quick Start Set up SonarCloud static analysis with a scanner workflow and coverage reporting for this Ansible collection repository.

Frequently Asked Questions about configure-sonarcloud-collection

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add SonarCloud analysis to an Ansible collection?▼

Create a sonar-project.properties at the repo root matching the SonarCloud project key, then add a GitHub Actions workflow that runs the SonarScanner with the org SONAR_TOKEN secret. Copy canonical templates so the workflow stays identical across ansible-collections repos.

How do I get coverage to show in SonarCloud for Python projects?▼

SonarCloud reads coverage from a coverage.xml file at the repository root via sonar.python.coverage.reportPaths. Run pytest or tox with --cov-report xml:coverage.xml before the Sonar step so the file exists when the scanner executes.

Why does SonarCloud not run on pull requests from forks?▼

GitHub does not expose secrets to workflows triggered by fork pull requests, so jobs needing SONAR_TOKEN cannot authenticate. Use a workflow_run follow-up pattern where an untrusted job uploads coverage artifacts and a trusted workflow downloads them and runs the scanner.

What is the difference between workflow_run and workflow_call SonarCloud templates?▼

The workflow_run template follows the amazon.aws pattern where a trusted workflow downloads coverage artifacts after tests complete. The workflow_call template is a reusable workflow called from an aggregator like all_green_check.yaml with explicit secrets passed, as in kubernetes.core.

When should I not use this SonarCloud setup skill?▼

Do not use it to view or fix existing Sonar findings on an already-configured project; that belongs to remediation work. It also does not cover the second-phase coverage rollout with badges and artifact wiring, which is a separate follow-up step.