Repository navigation
Sonarqube mig - #9460
Sonarqube mig#9460amitkumar489 wants to merge 7 commits into
Conversation
Signed-off-by: amitkumar489 <[email protected]>
Signed-off-by: amitkumar489 <[email protected]>
Changed Packages
|
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR migrates the SonarQube card UI from Material-UI v4 components/styles to Backstage UI (BUI) components with CSS modules, removing deprecated MUI dependencies.
Changes:
- Replaced MUI components (
Grid,Typography,Avatar,Chip,Tooltip) with BUI primitives (Flex,Box,Text,Tag) and CSS modules. - Introduced CSS module styles for the SonarQube card subcomponents (Value, Rating, RatingCard, MetricInsights, Percentage).
- Updated dependencies to add
@backstage/ui,@remixicon/react, andreact-aria-components, and removed MUI v4 packages.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| workspaces/sonarqube/plugins/sonarqube/src/components/SonarQubeCard/Value.tsx | Switches value rendering from MUI Typography/JSS to BUI Text + CSS modules. |
| workspaces/sonarqube/plugins/sonarqube/src/components/SonarQubeCard/Value.module.css | Adds CSS module styling for the Value component. |
| workspaces/sonarqube/plugins/sonarqube/src/components/SonarQubeCard/SonarQubeCard.tsx | Replaces MUI Grid/JSS with BUI layout primitives and CSS modules. |
| workspaces/sonarqube/plugins/sonarqube/src/components/SonarQubeCard/SonarQubeCard.module.css | Adds CSS module styling for SonarQubeCard header/action/lastAnalyzed. |
| workspaces/sonarqube/plugins/sonarqube/src/components/SonarQubeCard/RatingCard.tsx | Migrates rating card layout/typography to BUI + CSS modules. |
| workspaces/sonarqube/plugins/sonarqube/src/components/SonarQubeCard/RatingCard.module.css | Adds CSS module styling for RatingCard layout. |
| workspaces/sonarqube/plugins/sonarqube/src/components/SonarQubeCard/Rating.tsx | Replaces MUI Avatar/JSS color logic with CSS-module-based rating badges. |
| workspaces/sonarqube/plugins/sonarqube/src/components/SonarQubeCard/Rating.module.css | Adds CSS module styling for rating badges A–E. |
| workspaces/sonarqube/plugins/sonarqube/src/components/SonarQubeCard/Percentage.tsx | Migrates circle sizing to CSS module; replaces theme-derived colors with constants. |
| workspaces/sonarqube/plugins/sonarqube/src/components/SonarQubeCard/Percentage.module.css | Adds CSS module sizing for the percentage circle. |
| workspaces/sonarqube/plugins/sonarqube/src/components/SonarQubeCard/MetricInsights.tsx | Migrates chips/icons/tooltips to BUI + remixicon + react-aria tooltip trigger. |
| workspaces/sonarqube/plugins/sonarqube/src/components/SonarQubeCard/MetricInsights.module.css | Adds CSS module styling for the quality-gate badge variants. |
| workspaces/sonarqube/plugins/sonarqube/package.json | Removes MUI v4 deps and adds BUI + remixicon + react-aria-components. |
| workspaces/sonarqube/.changeset/eighty-baboons-eat.md | Declares a major version bump and describes the migration. |
| sonarqube/plugins/sonarqube/src/components/SonarQubeCard/SonarQubeCard.module.css | Adds a second SonarQubeCard CSS module file in a different path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: amitkumar489 <[email protected]>
Signed-off-by: amitkumar489 <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated 11 comments.
Comments suppressed due to low confidence (1)
workspaces/sonarqube/plugins/sonarqube/package.json:79
- The plugin now depends on
@backstage/uiand no longer depends on MUI, but the package dev app still importsGridfrom@material-ui/core/Grid(workspaces/sonarqube/plugins/sonarqube/dev/index.tsx:19) and also doesn’t import@backstage/ui/css/styles.css(which other dev apps in this repo do). As-is,yarn start/ the dev build for this plugin will likely be broken or unstyled unless the dev app is migrated away from MUI (preferred) or MUI is kept as a dev dependency and BUI CSS is imported.
"dependencies": {
"@backstage-community/plugin-sonarqube-react": "workspace:^",
"@backstage/catalog-model": "backstage:^",
"@backstage/core-compat-api": "backstage:^",
"@backstage/core-components": "backstage:^",
"@backstage/core-plugin-api": "backstage:^",
"@backstage/errors": "backstage:^",
"@backstage/frontend-app-api": "backstage:^",
"@backstage/frontend-plugin-api": "backstage:^",
"@backstage/plugin-catalog-react": "backstage:^",
"@backstage/ui": "^1.7.0",
"@remixicon/react": "^4.3.0",
"react-aria-components": "^1.4.0",
"@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0",
"cross-fetch": "^4.0.0",
"luxon": "^3.0.0",
"rc-progress": "4.0.0",
"react-use": "^17.2.4"
},
|
Hey, can you include screenshots of what the UI looks like before and after the changes, make sure that the CI passes and also address the copilot comments if they make sense (or if they don't just mark them as resolved with a justification of why its fine to ignore them)? |
Signed-off-by: amitkumar489 <[email protected]>
Signed-off-by: amitkumar489 <[email protected]>
Signed-off-by: amitkumar489 <[email protected]>
|
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! |
There was a problem hiding this comment.
🟡 Changes recommended
Quality-gate badges fail to render, and undeclared development dependencies plus incompatible peer ranges can break the development app and supported consumer installations.
9 open issues
Align peer dependency ranges with BUI's React requirements · New Retain Material UI as a devDependency for the development entry point · New Replace collection-only Tag with standalone Badge · New Use supported status tokens and higher-priority overrides · New Use BUI's styled Tooltip components for readable hints · New Use a context-aware link to enable tooltip interactions · New Use a supported neutral token for missing ratings · New Import BUI styles in sample apps and document the migration · New Increase Text override specificity or configure Text props · New
20 resolved since last review
The changeset targets@backstage-community/plugin-sonarqube-react, but the dependency updates…gateLinkToolTipis a constant empty string and is never set whenvalue.projectUrlexists, so… This file appears to be an accidental duplicate: the actual component imports…badgeSuccesssets a strong background color, but it doesn’t set a foreground/text color. Since…badgeErrorsets a strong background color, but it doesn’t set a foreground/text color. Since this… Reading CSS variables viawindow.getComputedStyleon every render is unnecessary here and adds… To match the existing BUI usage pattern in this repo, importTooltip/TooltipTriggerfrom… This layout previously usedjustifyContent="space-between"to keep the metrics grid and the "Last… The README header looks like it accidentally includes the word "test", which doesn’t relate to the… This CSS module is duplicated in a second path (sonarqube/plugins/...) while the TSX changes… Usingcolor: var(--bui-fg-primary)on strong colored backgrounds (green/yellow/orange/red) can… Hard-coded status colors bypass Backstage theming (including dark mode) and can drift from the… Hard-coded status colors bypass Backstage theming (including dark mode) and can drift from the… The spacing between left/right slots is currently applied twice (gapon.upperplus… The spacing between left/right slots is currently applied twice (gapon.upperplus….badgeLabelis no longer referenced from the component, so it’s dead CSS and can be removed. In CSS Modules,:rootis a global selector. Using:global(:root)makes that intent explicit and… In CSS Modules,:rootis a global selector. Using:global(:root)makes that intent explicit and… After switching toTooltip/TooltipTriggerfrom@backstage/ui, this direct dependency on… The PR otherwise moves styling from JS/JSS to CSS modules, but this inline style block reintroduces…
Review effort: Balanced
| "@material-ui/core": "^4.12.2", | ||
| "@material-ui/icons": "^4.9.1", | ||
| "@material-ui/styles": "^4.10.0", | ||
| "@backstage/ui": "backstage:^", |
| "@material-ui/core": "^4.12.2", | ||
| "@material-ui/icons": "^4.9.1", | ||
| "@material-ui/styles": "^4.10.0", | ||
| "@backstage/ui": "backstage:^", |
| <Tag | ||
| className={`${badgeClass} ${props.compact ? styles.badgeCompact : ''}`} | ||
| > |
| @layer components { | ||
| .badgeLabel { | ||
| color: var(--bui-fg-primary); | ||
| } | ||
|
|
||
| .badgeCompact { | ||
| margin: 0; | ||
| height: 28px; | ||
| } | ||
|
|
||
| .badgeError { | ||
| background-color: var(--bui-status-error); | ||
| } | ||
|
|
||
| .badgeSuccess { | ||
| background-color: var(--bui-status-ok); | ||
| } | ||
|
|
||
| .badgeUnknown { | ||
| background-color: var(--bui-bg-surface-3); | ||
| } |
| import { Tag, Text } from '@backstage/ui'; | ||
| import { TooltipTrigger, Tooltip } from 'react-aria-components'; |
| <a href={value.projectUrl} target="_blank" rel="noopener noreferrer"> | ||
| {qualityBadge} | ||
| </a> |
| height: var(--bui-space-6); | ||
| width: var(--bui-space-6); | ||
| color: var(--bui-fg-primary); | ||
| background-color: var(--bui-bg-surface-3); |
| } from '@backstage-community/plugin-sonarqube-react'; | ||
| import Grid from '@material-ui/core/Grid'; | ||
| import { makeStyles } from '@material-ui/core/styles'; | ||
| import { Box, Flex } from '@backstage/ui'; |
| .value { | ||
| font-size: 1.5rem; | ||
| font-weight: 500; | ||
| } | ||
|
|
||
| .compact { | ||
| line-height: 1; | ||
| } |
awanlin
left a comment
There was a problem hiding this comment.
Hi @amitkumar489, thanks for the contribution. There's merge conflicts and Copilot found a number of items that must be addressed. 👍



Hey, I just made a Pull Request!
migrated the @backstage-community/plugin-sonarqube plugin from Material-UI (MUI) v4 to Backstage UI (BUI) v1.7.0, eliminating deprecated Material-UI dependencies while improving theming consistency and reducing bundle size.
✔️ Checklist
Signed-off-byline in the message. (more info)