feat: add SonarQube integration to entity pages#662
Conversation
Integrate @backstage-community/plugin-sonarqube to display code quality metrics on Backstage entity pages. - Register @backstage-community/plugin-sonarqube-backend in packages/backend/src/index.ts - Add @backstage-community/plugin-sonarqube and plugin-sonarqube-react to packages/app - Add EntitySonarQubeContentPage in a conditional tab (visible only when the sonarqube.org/project-key annotation is present) to ServiceEntityPage and GenericComponentEntityPage in EntityPage.tsx - Document the sonarqube config block (baseUrl + apiKey) in app-config.yaml Closes openchoreo/openchoreo#3935 Signed-off-by: kavix <kavix@yahoo.com>
|
Warning Review limit reached
Next review available in: 57 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (8)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Signed-off-by: kavix <kavix@yahoo.com>
3878d19 to
7d232a3
Compare
Thanks! I've run Prettier locally to fix the formatting issues, amended the commit with the required DCO sign-off, and updated the PR. Everything should be passing now! |
|
@kavix Please attach a screenshot of Portal UI how it looks like with the SonarQube plugin Also take a pull from the main branch, there are conflicts in the yarn.lock file |
Purpose
Resolves openchoreo/openchoreo#3935
Currently, developers have to leave the developer portal to check their code quality metrics on SonarQube. This PR integrates the
@backstage-community/plugin-sonarqubeecosystem to bring those metrics directly into the entity pages.Goals
Add a dedicated Code Quality tab to the Backstage entity pages that conditionally renders SonarQube metrics when the
sonarqube.org/project-keyannotation is present.Approach
@backstage-community/plugin-sonarqube-backendplugin inpackages/backend/src/index.tsto proxy API requests safely to SonarQube.@backstage-community/plugin-sonarqubeand@backstage-community/plugin-sonarqube-reactinpackages/app.<EntitySonarQubeContentPage />toServiceEntityPageandGenericComponentEntityPageinsidepackages/app/src/components/catalog/EntityPage.tsx.isSonarQubeAvailablepredicate.sonarqubeconfig block (expectingbaseUrlandapiKey) inapp-config.yaml.User stories
As a developer, I want to see my component's SonarQube code quality metrics directly on its Backstage entity page, so that I can easily track technical debt, bugs, and coverage without context-switching.
Release note
Add SonarQube integration to display code quality metrics on Backstage entity pages.
Documentation
N/A - Standard Backstage community plugin integration. The required
sonarqubeconfiguration block has been documented inapp-config.yamlas part of this PR.Training
N/A
Certification
N/A - No impact on certification exams.
Marketing
N/A
Automation tests
Security checks
Samples
N/A
Related PRs
N/A
Migrations (if applicable)
N/A
Test environment
Learning
Leveraged the Backstage community patterns for conditional entity page rendering using the plugin's built-in
isSonarQubeAvailablehook to ensure the Code Quality tab only appears for annotated entities (matching the pattern used by the Jenkins and GitLab integrations).