feat(scorecard): Add SonarQube metric providers#2576
feat(scorecard): Add SonarQube metric providers#2576christoph-jerolimov merged 25 commits intoredhat-developer:mainfrom
Conversation
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Changed Packages
|
Review Summary by QodoAdd SonarQube metric providers for scorecard with multi-instance support
WalkthroughsDescription• Add SonarQube backend module with four metric providers - Quality gate status (boolean) - Open issues count (number) - Security rating (number, A=1 to E=5) - Security issues/vulnerabilities count (number) • Support multiple SonarQube instances with named configuration • Implement SonarQubeClient with Basic/Bearer auth and base64 encoding • Include comprehensive unit tests and configuration schema • Add README documentation and example catalog entity Diagramflowchart LR
Config["Config Schema<br/>config.d.ts"]
Client["SonarQubeClient<br/>API Integration"]
BoolProvider["BooleanMetricProvider<br/>Quality Gate"]
NumProvider["NumberMetricProvider<br/>Issues/Rating"]
Factory["MetricProviderFactory<br/>Provider Creation"]
Module["Backend Module<br/>Registration"]
Config -->|"Instance Config"| Client
Client -->|"API Calls"| BoolProvider
Client -->|"API Calls"| NumProvider
Factory -->|"Creates"| BoolProvider
Factory -->|"Creates"| NumProvider
Module -->|"Registers"| Factory
File Changes1. workspaces/scorecard/plugins/scorecard-backend-module-sonarqube/config.d.ts
|
Code Review by Qodo
1. Instance apiKey wrongly required
|
HusneShabbir
left a comment
There was a problem hiding this comment.
@christoph-jerolimov this will unblock your CI
cff84f2 to
9dbdb30
Compare
|
I think we can implement a similar threshold configuration logic used in the Github and Jira modules here |
|
This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution! |
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
…ues, and security Add four metric providers to the scorecard-backend-module-sonarqube plugin: - Quality gate status (boolean) - Open issues count (number) - Security rating (number, A=1 to E=5) - Security issues/vulnerabilities count (number) Includes SonarQubeClient, config, factory, example catalog entity, and unit tests. SonarQube baseUrl defaults to https://sonarcloud.io; token is optional for public projects. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
…config schema - Add config.d.ts with typed config schema supporting default + named instances - Refactor SonarQubeClient to resolve instance by name from sonarqube.instances[] - Parse sonarqube.org/project-key annotation for optional instance prefix (instance/project-key) - Use apiKey + authType (Basic/Bearer) from config.d.ts instead of token - Falls back to default instance when no instance prefix in annotation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
SonarQube expects Basic auth as base64(apiKey:) with an appended colon. Bearer auth passes the apiKey directly without encoding. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
…blic Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
…ror thresholds for security rating Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
cb1a874 to
9027089
Compare
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
…are longer then one line Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
9027089 to
0b784e0
Compare
|
@imykhno, I've addressed your comments:
I've also changed:
Please take a look. :) |
9042ec8 to
c47fcf6
Compare
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
c47fcf6 to
060b87a
Compare
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2576 +/- ##
==========================================
+ Coverage 60.56% 60.63% +0.07%
==========================================
Files 2005 2012 +7
Lines 62790 62938 +148
Branches 16453 16473 +20
==========================================
+ Hits 38026 38161 +135
- Misses 23602 23615 +13
Partials 1162 1162
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Signed-off-by: Ihor Mykhno <imykhno@redhat.com>
Signed-off-by: Ihor Mykhno <imykhno@redhat.com>
… tests Signed-off-by: Ihor Mykhno <imykhno@redhat.com>
Signed-off-by: Ihor Mykhno <imykhno@redhat.com>
…ests Signed-off-by: Ihor Mykhno <imykhno@redhat.com>
…update README Signed-off-by: Ihor Mykhno <imykhno@redhat.com>
|
imykhno
left a comment
There was a problem hiding this comment.
Thank you for implementing the new SonarQube module. I have tested it locally, and the new functionality works as expected (see the attached recording):
- the uploaded data matches what is displayed on the source
- tooltip displayed when text is too long
- translation works for all supported languages
- metric threshold is customizable form
app-config.yamlfiles
Screen.Recording.2026-05-04.at.11.21.28.mov
/lgtm
|
Thanks @imykhno for the follow up and cleanups. I've tested the plugin one more time locally and it works fine. Let us |







Hey, I just made a Pull Request!
New module with new metrics from sonarqube/sonarcloud; agentic-eng. by @imykhno, myself and Claude. 😀
TODOs✔️ Checklist