Skip to content

Feature: Integrate SonarCloud - #17

Merged
rmottanet merged 4 commits into
mainfrom
ci/sonar
Jan 24, 2026
Merged

Feature: Integrate SonarCloud#17
rmottanet merged 4 commits into
mainfrom
ci/sonar

Conversation

@rmottanet

Copy link
Copy Markdown
Owner

This pull request introduces a comprehensive SonarCloud integration to establish automated code quality and security analysis within our CI/CD pipeline. The implementation includes a dedicated GitHub Actions workflow, project configuration, and README badge for real-time quality visibility.


Changes Implemented:

  • sonarqube.yml: A new GitHub Actions workflow that triggers on pushes to the main branch and on pull request events (opened, synchronize, reopened). It performs a complete SonarQube scan using the official SonarSource/sonarqube-scan-action@v6 action with shallow clone disabled for accurate analysis.

  • sonar-project.properties: Configuration file defining the SonarCloud project key (rmottanet_gitnap) and organization (rmottanet). This file provides the foundation for future custom analysis parameters (source directories, exclusions, etc.).

  • README.md Update: Added a SonarCloud Quality Gate status badge for immediate visibility into the project's code health directly from the repository's main page.

  • GitHub Secrets: Configuration of the SONAR_TOKEN secret in repository settings to enable secure authentication with SonarCloud's API (setup instructions documented in commit messages).


Technical Details:

  • Workflow Strategy: The analysis runs on the ubuntu-latest runner using fetch-depth: 0 to ensure proper blame data and issue tracking across commits.
  • Trigger Events: Configured to analyze both main branch stability (push) and pull request impact (pull_request), enabling quality gates before merges.
  • Minimal Configuration: Initial setup focuses on core functionality with extensible properties for future rule customization and language-specific analysis.

Motivation:

This integration establishes a foundational code quality framework that provides:

  • Automated Quality Gates: Continuous static analysis for bugs, vulnerabilities, code smells, and security hotspots.
  • Pull Request Integration: Immediate feedback on code changes before merging, reducing technical debt accumulation.
  • Visibility: Public quality status badge promotes transparency and maintains code health awareness.
  • Scalable Foundation: The configured pipeline supports future expansion for test coverage integration, multi-language analysis, and custom quality profiles.

The implementation follows security best practices by using GitHub Secrets for token management and employs the standard SonarCloud integration pattern for maintainability.

@rmottanet rmottanet self-assigned this Jan 24, 2026
@rmottanet rmottanet added the enhancement New feature or request label Jan 24, 2026
@github-advanced-security

Copy link
Copy Markdown
Contributor

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Comment thread .github/workflows/sonar.yml Fixed
workflow does not contain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@sonarqubecloud

Copy link
Copy Markdown

@rmottanet
rmottanet merged commit f872e92 into main Jan 24, 2026
5 checks passed
@rmottanet
rmottanet deleted the ci/sonar branch January 24, 2026 20:23
@github-project-automation github-project-automation Bot moved this to Done in @ws2git Jan 24, 2026
@rmottanet rmottanet added this to @CL1 Jul 11, 2026
@github-project-automation github-project-automation Bot moved this to Done in @CL1 Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants