Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions workspaces/scorecard/.changeset/icy-poets-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@red-hat-developer-hub/backstage-plugin-scorecard-backend-module-dependabot': minor
'@red-hat-developer-hub/backstage-plugin-scorecard-backend-module-filecheck': minor
'@red-hat-developer-hub/backstage-plugin-scorecard-backend-module-sonarqube': minor
'@red-hat-developer-hub/backstage-plugin-scorecard-backend-module-openssf': minor
'@red-hat-developer-hub/backstage-plugin-scorecard-backend-module-github': minor
'@red-hat-developer-hub/backstage-plugin-scorecard-backend-module-jira': minor
'@red-hat-developer-hub/backstage-plugin-scorecard-backend': minor
'@red-hat-developer-hub/backstage-plugin-scorecard-common': minor
'@red-hat-developer-hub/backstage-plugin-scorecard-node': minor
'@red-hat-developer-hub/backstage-plugin-scorecard': minor
---

Backstage version bump to v1.51.2
4 changes: 2 additions & 2 deletions workspaces/scorecard/app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ techdocs:
type: 'local' # Alternatives - 'googleGcs' or 'awsS3'. Read documentation for using alternatives.

auth:
environment: development

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] auth configuration

The guest auth provider config changes from explicit userEntityRef to guest: {} with environment: development. The RBAC admin config still references user:development/guest. Verify the default guest provider identity in Backstage v1.51.2 matches.

Suggested fix: Confirm that the default guest provider identity resolves to user:development/guest so RBAC admin permissions are preserved.

# see https://backstage.io/docs/auth/ to learn about auth providers
providers:
# See https://backstage.io/docs/auth/guest/provider
guest:
userEntityRef: user:development/guest
guest: {}

scaffolder:
# see https://backstage.io/docs/features/software-templates/configuration for software template options
Expand Down
2 changes: 1 addition & 1 deletion workspaces/scorecard/backstage.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "1.49.3"
"version": "1.51.2"
}
14 changes: 7 additions & 7 deletions workspaces/scorecard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@
"directory": "workspaces/scorecard"
},
"devDependencies": {
"@backstage/cli": "^0.36.0",
"@backstage/cli-defaults": "^0.1.0",
"@backstage/cli": "^0.36.2",
"@backstage/cli-defaults": "^0.1.2",
"@backstage/e2e-test-utils": "^0.1.2",
"@backstage/repo-tools": "^0.17.0",
"@backstage/repo-tools": "^0.17.2",
"@changesets/cli": "^2.27.1",
"@jest/environment-jsdom-abstract": "^30.3.0",
"@jest/environment-jsdom-abstract": "30.3.0",
"@playwright/test": "1.60.0",
"@types/jest": "^30.0.0",
"@types/jsdom": "^27.0.0",
"jest": "^30.3.0",
"jest": "30.3.0",
"jsdom": "^27.1.0",
"knip": "^5.27.4",
"node-gyp": "^9.0.0",
Expand All @@ -65,8 +65,8 @@
"@types/react": "^18",
"@types/react-dom": "^18",
"refractor@npm:3.6.0/prismjs": "^1.30.0",
"@backstage/backend-plugin-api": "1.9.0",
"@backstage/plugin-catalog-node": "2.1.0"
"@backstage/backend-plugin-api": "1.9.2",
"@backstage/plugin-catalog-node": "2.2.2"
},
"prettier": "@backstage/cli/config/prettier",
"lint-staged": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ export class CatalogPage {
}

async loginAndSetLocale(locale: string) {
this.page.on('dialog', dialog => dialog.accept());

await this.page.goto('/');
const enterButton = this.page.getByRole('button', { name: 'Enter' });
await expect(enterButton).toBeVisible({ timeout: 30000 });
await enterButton.click();
// Guest flow copy varies by Backstage / branding; wait for shell instead of "Welcome back!".
await expect(
this.page.getByRole('link', { name: 'Home' }).first(),
).toBeVisible({
Expand All @@ -51,8 +52,10 @@ export class CatalogPage {
}

async openCatalog() {
await this.page.goto('/catalog'); // Resolves the issue when "My Groups" sidebar covers the catalog toolbar
await this.page.getByTestId('user-picker-all').getByText('All').click();
await this.page.goto('/catalog');
const allFilter = this.page.getByTestId('user-picker-all').getByText('All');
await allFilter.waitFor({ state: 'visible', timeout: 10000 });
await allFilter.click({ force: true });
}

async openComponent(componentName: string) {
Expand All @@ -69,9 +72,13 @@ export class CatalogPage {
if (baseLocale === 'en') return;

const displayName = getLocaleDisplayName(locale);
await this.page.getByRole('link', { name: 'Settings' }).click();
const settingsLink = this.page.getByRole('link', { name: 'Settings' });
await settingsLink.waitFor({ state: 'visible', timeout: 10000 });
await settingsLink.click();
await expect(
this.page.getByRole('button', { name: 'English' }),
).toBeVisible({ timeout: 10000 });
await this.page.getByRole('button', { name: 'English' }).click();
await this.page.getByRole('option', { name: displayName }).click();
await this.page.locator('a').filter({ hasText: 'Home' }).click();
}
}
54 changes: 27 additions & 27 deletions workspaces/scorecard/packages/app-legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,32 @@
},
"dependencies": {
"@backstage-community/plugin-github-issues": "^0.13.0",
"@backstage-community/plugin-rbac": "^1.50.0",
"@backstage/app-defaults": "^1.7.6",
"@backstage/catalog-model": "^1.7.7",
"@backstage/cli": "^0.36.0",
"@backstage/core-app-api": "^1.19.6",
"@backstage/core-components": "^0.18.8",
"@backstage/core-plugin-api": "^1.12.4",
"@backstage/integration-react": "^1.2.16",
"@backstage/plugin-api-docs": "^0.13.5",
"@backstage/plugin-catalog": "^2.0.1",
"@backstage/plugin-catalog-common": "^1.1.8",
"@backstage/plugin-catalog-graph": "^0.6.0",
"@backstage/plugin-catalog-import": "^0.13.11",
"@backstage/plugin-catalog-react": "^2.1.1",
"@backstage/plugin-kubernetes": "^0.12.17",
"@backstage/plugin-org": "^0.7.0",
"@backstage/plugin-permission-react": "^0.4.41",
"@backstage/plugin-scaffolder": "^1.36.1",
"@backstage/plugin-search": "^1.7.0",
"@backstage/plugin-search-react": "^1.11.0",
"@backstage/plugin-techdocs": "^1.17.2",
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.34",
"@backstage/plugin-techdocs-react": "^1.3.9",
"@backstage/plugin-user-settings": "^0.9.1",
"@backstage/theme": "^0.7.2",
"@backstage/ui": "^0.13.2",
"@backstage-community/plugin-rbac": "^1.52.1",
"@backstage/app-defaults": "^1.7.8",
"@backstage/catalog-model": "^1.9.0",
"@backstage/cli": "^0.36.2",
"@backstage/core-app-api": "^1.20.1",
"@backstage/core-components": "^0.18.10",
"@backstage/core-plugin-api": "^1.12.6",
"@backstage/integration-react": "^1.2.18",
"@backstage/plugin-api-docs": "^0.14.1",
"@backstage/plugin-catalog": "^2.0.5",
"@backstage/plugin-catalog-common": "^1.1.10",
"@backstage/plugin-catalog-graph": "^0.6.4",
"@backstage/plugin-catalog-import": "^0.13.13",
"@backstage/plugin-catalog-react": "^3.0.0",
"@backstage/plugin-kubernetes": "^0.12.19",
"@backstage/plugin-org": "^0.7.4",
"@backstage/plugin-permission-react": "^0.5.1",
"@backstage/plugin-scaffolder": "^1.37.0",
"@backstage/plugin-search": "^1.7.4",
"@backstage/plugin-search-react": "^1.11.4",
"@backstage/plugin-techdocs": "^1.17.6",
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.36",
"@backstage/plugin-techdocs-react": "^1.3.11",
"@backstage/plugin-user-settings": "^0.9.3",
"@backstage/theme": "^0.7.3",
"@backstage/ui": "^0.15.0",
"@mui/icons-material": "5.18.0",
"@mui/material": "5.18.0",
"@mui/styles": "5.18.0",
Expand All @@ -63,7 +63,7 @@
},
"devDependencies": {
"@axe-core/playwright": "^4.10.0",
"@backstage/test-utils": "^1.7.16",
"@backstage/test-utils": "^1.7.18",
"@playwright/test": "1.60.0",
"@red-hat-developer-hub/backstage-plugin-scorecard-common": "workspace:^",
"@testing-library/dom": "^9.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const Root = ({ children }: PropsWithChildren<{}>) => (
<SidebarDivider />
<SidebarGroup label="Menu" icon={<MenuIcon />}>
{/* Global nav, not org-specific */}
<SidebarItem icon={HomeIcon} to="" text="Home" />
<SidebarItem icon={HomeIcon} to="/" text="Home" />
<SidebarItem icon={CategoryIcon} to="catalog" text="Catalog" />
<MyGroupsSidebarItem
singularTitle="My Group"
Expand Down
34 changes: 17 additions & 17 deletions workspaces/scorecard/packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@
"clean": "backstage-cli package clean"
},
"dependencies": {
"@backstage-community/plugin-rbac": "^1.50.0",
"@backstage/cli": "^0.36.0",
"@backstage/core-compat-api": "^0.5.9",
"@backstage/core-components": "^0.18.8",
"@backstage/core-plugin-api": "^1.12.4",
"@backstage/frontend-defaults": "^0.5.0",
"@backstage/frontend-plugin-api": "^0.15.1",
"@backstage/plugin-api-docs": "^0.13.5",
"@backstage/plugin-app-react": "^0.2.1",
"@backstage/plugin-catalog": "^2.0.1",
"@backstage/plugin-home": "^0.9.3",
"@backstage/plugin-org": "^0.7.0",
"@backstage/plugin-scaffolder": "^1.36.1",
"@backstage/plugin-search": "^1.7.0",
"@backstage/plugin-techdocs": "^1.17.2",
"@backstage/plugin-user-settings": "^0.9.1",
"@backstage/ui": "^0.13.2",
"@backstage-community/plugin-rbac": "^1.52.1",
"@backstage/cli": "^0.36.2",
"@backstage/core-compat-api": "^0.5.11",
"@backstage/core-components": "^0.18.10",
"@backstage/core-plugin-api": "^1.12.6",
"@backstage/frontend-defaults": "^0.5.2",
"@backstage/frontend-plugin-api": "^0.17.1",
"@backstage/plugin-api-docs": "^0.14.1",
"@backstage/plugin-app-react": "^0.2.3",
"@backstage/plugin-catalog": "^2.0.5",
"@backstage/plugin-home": "^0.9.6",
"@backstage/plugin-org": "^0.7.4",
"@backstage/plugin-scaffolder": "^1.37.0",
"@backstage/plugin-search": "^1.7.4",
"@backstage/plugin-techdocs": "^1.17.6",
"@backstage/plugin-user-settings": "^0.9.3",
"@backstage/ui": "^0.15.0",
"@mui/icons-material": "^5.18.0",
"@mui/material": "^5.18.0",
"@red-hat-developer-hub/backstage-plugin-dynamic-home-page": "1.11.0",
Expand Down
4 changes: 4 additions & 0 deletions workspaces/scorecard/packages/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/

import { createApp } from '@backstage/frontend-defaults';
import catalogPlugin from '@backstage/plugin-catalog/alpha';
import userSettingsPlugin from '@backstage/plugin-user-settings/alpha';

import { rhdhThemeModule } from '@red-hat-developer-hub/backstage-plugin-theme/alpha';
import {
Expand All @@ -35,6 +37,8 @@ import { iconsModule } from './modules/icons';
*/
const app = createApp({
features: [
catalogPlugin,
userSettingsPlugin,
rhdhThemeModule,
homePageModule,
homepageTranslationsModule,
Expand Down
75 changes: 33 additions & 42 deletions workspaces/scorecard/packages/app/src/modules/nav/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

import { Fragment } from 'react';
import {
Sidebar,
SidebarDivider,
Expand All @@ -26,6 +25,7 @@
import { NavContentBlueprint } from '@backstage/plugin-app-react';
import { SidebarLogo } from './SidebarLogo';
import CategoryIcon from '@mui/icons-material/Category';
import HomeIcon from '@mui/icons-material/Home';
import MenuIcon from '@mui/icons-material/Menu';
import GroupIcon from '@mui/icons-material/People';
import SearchIcon from '@mui/icons-material/Search';
Expand Down Expand Up @@ -80,9 +80,7 @@
export const SidebarContent = NavContentBlueprint.make({
params: {
component: ({ items }) => {
const { headerItems, mainItems, footerItems } = splitNavItems(
items as NavItem[],
);
const { headerItems, mainItems } = splitNavItems(items as NavItem[]);
const mainWithoutMyGroups = mainItems.filter(
item =>
!item.to.includes('my-groups') &&
Expand All @@ -101,48 +99,41 @@
</>
)}
<SidebarGroup label="Menu" icon={<MenuIcon />}>
<SidebarItem icon={HomeIcon} to="/" text="Home" />
<SidebarItem icon={CategoryIcon} to="/catalog" text="Catalog" />
<MyGroupsSidebarItem
singularTitle="My Group"
pluralTitle="My Groups"
icon={GroupIcon}
/>
<SidebarScrollWrapper>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] edge-case

The filter .filter(item => !item.to.includes('/catalog') && item.to !== '/' && item.to !== '/home') uses includes('/catalog') which would match paths containing '/catalog' as a substring (e.g., '/catalog-import'), hiding them from the sidebar. This is a pre-existing pattern already used in the same file at MAIN_NAV_ORDER and the icon selection logic, so it is not a regression introduced by this PR, but the new filter raises the consequence from icon-swap to complete omission.

{mainWithoutMyGroups.length === 0 ? (
<MyGroupsSidebarItem
singularTitle="My Group"
pluralTitle="My Groups"
icon={GroupIcon}
/>
) : (
mainWithoutMyGroups.map((item, index) => (
<Fragment key={`main-${index}`}>
<SidebarItem
to={item.to}
text={item.text}
title={item.title}
icon={
item.to.includes('/catalog') ? CategoryIcon : item.icon
}
/>
{index === 0 && (
<MyGroupsSidebarItem
singularTitle="My Group"
pluralTitle="My Groups"
icon={GroupIcon}
/>
)}
</Fragment>
))
)}
{mainWithoutMyGroups
.filter(
item =>
!item.to.includes('/catalog') &&
item.to !== '/' &&
item.to !== '/home',
)
.map((item, index) => (
<SidebarItem
key={`main-${index}`}

Check warning on line 119 in workspaces/scorecard/packages/app/src/modules/nav/Sidebar.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Do not use Array index in keys

See more on https://sonarcloud.io/project/issues?id=redhat-developer_rhdh-plugins&issues=AZ7-A9TwWYpOdl3gPyGC&open=AZ7-A9TwWYpOdl3gPyGC&pullRequest=3284
to={item.to}
text={item.text}
title={item.title}
icon={item.icon}
/>
))}
</SidebarScrollWrapper>
</SidebarGroup>
<SidebarSpace />
{footerItems.length > 0 && (
<>
<SidebarDivider />
<SidebarGroup
label="Settings"
icon={<UserSettingsSignInAvatar />}
>
<SidebarSettings />
</SidebarGroup>
</>
)}
<SidebarDivider />
<SidebarGroup
label="Settings"
icon={<UserSettingsSignInAvatar />}
to="/settings"
>
<SidebarSettings />
</SidebarGroup>
</Sidebar>
);
},
Expand Down
Loading
Loading