Skip to content

feat(ci): SonarCloud integration for SAST and technical debt tracking#376

Merged
raifdmueller merged 3 commits into
mainfrom
357-sonarqube-integration-sast
May 26, 2026
Merged

feat(ci): SonarCloud integration for SAST and technical debt tracking#376
raifdmueller merged 3 commits into
mainfrom
357-sonarqube-integration-sast

Conversation

@paulefl
Copy link
Copy Markdown
Collaborator

@paulefl paulefl commented May 7, 2026

Summary

Adds SonarCloud integration for static application security testing (SAST) and technical debt tracking.

Changes:

  • sonar-project.properties: Project configuration with 85% coverage threshold, quality gates (A-level)
  • .github/workflows/sonarcloud.yml: CI/CD workflow for push/PR analysis with quality gate checks
  • README.adoc: SonarCloud badges (Quality Gate status, Code Coverage)

Features:

  • ✅ Automated SAST on every push and PR
  • ✅ Coverage reporting (>80% threshold)
  • ✅ Technical debt index and trending
  • ✅ Code smell and security hotspot detection
  • ✅ PR comments with analysis summary
  • ✅ Quality gate blocks merges on failure

Manual Setup Required (One-Time):

    • Link GitHub repo
    • Generate SONAR_TOKEN in project
    • Add SONAR_TOKEN to GitHub Secrets
    • Configure branch protection: require quality gate

Fixes #357

🤖 Generated with Claude Code

…king

Adds comprehensive static analysis configuration:
- sonar-project.properties: Coverage thresholds (85%), quality gate configuration
- .github/workflows/sonarcloud.yml: Runs on push/PR with quality gate checks
- README.adoc: SonarCloud quality gate and coverage badges

Configuration includes:
- Go coverage reporting (coverage.out from go test)
- Coverage thresholds: >80% code coverage, <5% duplications
- Quality gate: A-level maintainability, security, and reliability
- PR integration: Comments with analysis summary
- Excludes: test files, vendor directory, integration tests

Manual setup required (one-time):
1. Create SonarCloud account at https://sonarcloud.io
2. Link GitHub repo: docToolchain/Bausteinsicht
3. Generate SONAR_TOKEN in project settings
4. Add SONAR_TOKEN to GitHub Secrets
5. Set GitHub branch protection: require quality gate

Fixes #357

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
paulefl and others added 2 commits May 7, 2026 07:18
Replace specific commit SHA with stable v4 tag to avoid action resolution errors.
Optional step with fail_ci_if_error: false won't block pipeline.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Remove sonar.tests with wildcard pattern (not supported by SonarCloud)
- Simplify sonar.exclusions to directory names only (vendor, .git, .devcontainer)
- SonarCloud auto-detects test files (*_test.go) without explicit config
- This fixes SonarCloud analysis error: 'Wildcards ** and * are not supported'

Fixes: sonarcloud.yml analysis failure in PR #376

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@paulefl
Copy link
Copy Markdown
Collaborator Author

paulefl commented May 7, 2026

@rdmueller
Open Point : Do we want to have this feature , yes or no?
If yes Repo must be connected with sonarcloud as mentioned in description.
If no branch and issue can be deleted/closed

Copy link
Copy Markdown
Collaborator

@raifdmueller raifdmueller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

Good SonarCloud setup with sensible defaults. The coverage badge in README uses a placeholder token — replace with a proper SONAR_TOKEN secret reference or remove before going live. Not blocking for merge.

@raifdmueller raifdmueller merged commit bddc9d1 into main May 26, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: SonarQube Integration für SAST & Technical Debt Tracking

2 participants