Skip to content

Sonarqube mig#9460

Open
amitkumar489 wants to merge 3 commits into
backstage:mainfrom
Infosys:sonarqube_mig
Open

Sonarqube mig#9460
amitkumar489 wants to merge 3 commits into
backstage:mainfrom
Infosys:sonarqube_mig

Conversation

@amitkumar489

Copy link
Copy Markdown

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

  • [+] A changeset describing the change and affected packages. (more info)
  • [+] Added or updated documentation
  • [+] Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • [+] All your commits have a Signed-off-by line in the message. (more info)

Signed-off-by: amitkumar489 <amit.kumar489@infosys.com>
Signed-off-by: amitkumar489 <amit.kumar489@infosys.com>
Copilot AI review requested due to automatic review settings June 12, 2026 08:25
@amitkumar489 amitkumar489 requested review from a team as code owners June 12, 2026 08:25
@amitkumar489 amitkumar489 requested a review from 04kash June 12, 2026 08:25
@backstage-goalie

backstage-goalie Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage-community/plugin-sonarqube workspaces/sonarqube/plugins/sonarqube major v1.1.0

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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, and react-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.

Comment on lines 50 to 85
let gateLabel: string = t('sonarQubeCard.qualityBadgeLabel.notComputed');
let gateColor = classes.badgeUnknown;
let gateLinkToolTip = '';
let badgeClass = styles.badgeUnknown;
const gateLinkToolTip = '';
if (value?.metrics.alert_status) {
const gatePassed = value?.metrics.alert_status === 'OK';
gateLabel = gatePassed
? t('sonarQubeCard.qualityBadgeLabel.gatePassed')
: t('sonarQubeCard.qualityBadgeLabel.gateFailed');
gateColor = gatePassed ? classes.badgeSuccess : classes.badgeError;
}
let clickableAttrs = {};
if (value.projectUrl) {
gateLinkToolTip = t('sonarQubeCard.qualityBadgeTooltip');
clickableAttrs = {
component: 'a',
href: value.projectUrl,
target: '_blank',
rel: 'noopener noreferrer',
clickable: true,
};
badgeClass = gatePassed ? styles.badgeSuccess : styles.badgeError;
}

const qualityBadge = (
<Tooltip title={gateLinkToolTip}>
<Chip
label={gateLabel}
{...clickableAttrs}
className={props.compact ? classes.badgeCompact : ''}
classes={{ root: gateColor, label: classes.badgeLabel }}
icon={value.projectUrl ? <LinkIcon /> : undefined}
/>
</Tooltip>
<Tag
className={`${badgeClass} ${props.compact ? styles.badgeCompact : ''}`}
>
{value.projectUrl ? <RiExternalLinkLine size={16} /> : null}
{gateLabel}
</Tag>
);

if (!gateLinkToolTip && !value.projectUrl) {
return qualityBadge;
}

return (
<TooltipTrigger>
{value.projectUrl ? (
<a href={value.projectUrl} target="_blank" rel="noopener noreferrer">
{qualityBadge}
</a>
) : (
qualityBadge
)}
{gateLinkToolTip && <Tooltip>{gateLinkToolTip}</Tooltip>}
</TooltipTrigger>
);
Comment on lines +7 to +12
.upper {
display: flex;
justify-content: center;
align-items: center;
gap: var(--bui-space-2);
}
Comment on lines +30 to +33
.right {
display: flex;
margin-left: var(--bui-space-1);
}
Comment on lines +21 to +22
const okColor = '#1db679';
const errorColor = '#e82c3c';
Comment on lines +29 to +30
strokeColor={okColor}
trailColor={errorColor}
Comment on lines +14 to +24
.ratingA {
height: var(--bui-space-6);
width: var(--bui-space-6);
color: var(--bui-fg-primary);
background-color: #1db679;
display: flex;
align-items: center;
justify-content: center;
border-radius: var(--bui-radius-2);
font-weight: 600;
}
Comment on lines +106 to +114
<Flex direction="column" align="center" style={{ height: '100%' }}>
<div
style={{
display: 'flex',
flexWrap: 'wrap',
justifyContent: 'space-around',
width: '100%',
}}
>
@@ -0,0 +1,5 @@
---
'@backstage-community/plugin-sonarqube-react': major
Comment on lines +1 to +14
@layer components {
.header {
padding: var(--bui-space-4) var(--bui-space-4) var(--bui-space-4) var(--bui-space-5);
}

.action {
margin: 0;
}

.lastAnalyzed {
color: var(--bui-fg-secondary);
padding: var(--bui-space-2) 0;
}
}
Signed-off-by: amitkumar489 <amit.kumar489@infosys.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants