Skip to content

chore(nexus): Backstage 1.39.1 upgrade #4222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 12, 2025
Merged
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
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@backstage-community/plugin-nexus-repository-manager': minor
---

Bump to backstage version 1.39.1
2 changes: 1 addition & 1 deletion workspaces/nexus-repository-manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ To start the app, run:

```sh
yarn install
yarn dev
yarn start
```

To generate knip reports for this app, run:
Expand Down
2 changes: 1 addition & 1 deletion workspaces/nexus-repository-manager/backstage.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "1.36.1"
"version": "1.39.1"
}
7 changes: 4 additions & 3 deletions workspaces/nexus-repository-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"node": "18 || 20 || 22"
},
"scripts": {
"start": "backstage-cli repo start",
"tsc": "tsc",
"tsc:full": "tsc --skipLibCheck true --incremental false",
"build:all": "backstage-cli repo build --all",
Expand All @@ -16,7 +17,7 @@
"test": "backstage-cli repo test",
"test:all": "backstage-cli repo test --coverage",
"fix": "backstage-cli repo fix",
"lint": "backstage-cli repo lint --since origin/main",
"lint": "backstage-cli repo lint --since upstream/main",
"lint:all": "backstage-cli repo lint",
"prettier:check": "prettier --check .",
"new": "backstage-cli new --scope @backstage-community",
Expand All @@ -34,9 +35,9 @@
"directory": "workspaces/nexus-repository-manager"
},
"devDependencies": {
"@backstage/cli": "^0.30.0",
"@backstage/cli": "^0.32.1",
"@backstage/e2e-test-utils": "^0.1.1",
"@backstage/repo-tools": "^0.13.0",
"@backstage/repo-tools": "^0.13.4",
"@changesets/cli": "^2.27.1",
"knip": "^5.27.4",
"node-gyp": "^9.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

import { createDevApp } from '@backstage/dev-utils';
import { EntityProvider } from '@backstage/plugin-catalog-react';
import { TestApiProvider } from '@backstage/test-utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
"tsc": "tsc"
},
"dependencies": {
"@backstage/catalog-model": "^1.7.3",
"@backstage/core-components": "^0.16.3",
"@backstage/core-plugin-api": "^1.10.3",
"@backstage/plugin-catalog-react": "^1.15.1",
"@backstage/theme": "^0.6.3",
"@backstage/catalog-model": "^1.7.4",
"@backstage/core-components": "^0.17.2",
"@backstage/core-plugin-api": "^1.10.7",
"@backstage/plugin-catalog-react": "^1.18.0",
"@backstage/theme": "^0.6.6",
"@janus-idp/shared-react": "^2.16.0",
"@material-ui/core": "^4.9.13",
"@material-ui/icons": "^4.11.3",
Expand All @@ -47,17 +47,19 @@
"react-router-dom": "^6.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.30.0",
"@backstage/core-app-api": "^1.15.5",
"@backstage/dev-utils": "^1.1.7",
"@backstage/test-utils": "^1.7.5",
"@backstage/cli": "^0.32.1",
"@backstage/core-app-api": "^1.17.0",
"@backstage/dev-utils": "^1.1.10",
"@backstage/test-utils": "^1.7.8",
"@hey-api/openapi-ts": "0.67.3",
"@redhat-developer/red-hat-developer-hub-theme": "0.4.0",
"@testing-library/jest-dom": "6.6.3",
"@testing-library/react": "14.3.1",
"@testing-library/react-hooks": "8.0.1",
"@testing-library/user-event": "14.6.1",
"@types/node": "22.15.29",
"@types/react": "^19.1.6",
"@types/react-dom": "^19.1.6",
"cross-fetch": "4.0.0",
"msw": "1.3.5",
"react": "^18.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts
/// <reference types="react" />

import { BackstagePlugin } from '@backstage/core-plugin-api';
import { Entity } from '@backstage/catalog-model';
import { JSX as JSX_2 } from 'react';
import { JSX as JSX_2 } from 'react/jsx-runtime';
import { RouteRef } from '@backstage/core-plugin-api';

// @public (undocumented)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';

import { render, screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';

import { TestApiProvider, MockErrorApi, mockApis } from '@backstage/test-utils';
import { errorApiRef } from '@backstage/core-plugin-api';
import { translationApiRef } from '@backstage/core-plugin-api/alpha';
import { ArtifactRowData, ArtifactTable } from './ArtifactTable';

// Get the text at row[columnName]
Expand Down Expand Up @@ -55,8 +55,15 @@ describe('ArtifactTable', () => {
];

it('renders rows', async () => {
await render(
<ArtifactTable title="Nexus Artifacts" artifacts={sampleRows} />,
render(
<TestApiProvider
apis={[
[errorApiRef, new MockErrorApi()],
[translationApiRef, mockApis.translation()],
]}
>
<ArtifactTable title="Nexus Artifacts" artifacts={sampleRows} />
</TestApiProvider>,
);

const table = screen.getAllByRole('table')[0];
Expand All @@ -76,8 +83,15 @@ describe('ArtifactTable', () => {
});

it('renders empty state', async () => {
const { queryByTestId } = await render(
<ArtifactTable title="Nexus Artifacts" artifacts={[]} />,
const { queryByTestId } = render(
<TestApiProvider
apis={[
[errorApiRef, new MockErrorApi()],
[translationApiRef, mockApis.translation()],
]}
>
<ArtifactTable title="Nexus Artifacts" artifacts={[]} />
</TestApiProvider>,
);

expect(
Expand All @@ -94,7 +108,16 @@ describe('ArtifactTable', () => {
},
];

await render(<ArtifactTable title="Nexus Artifacts" artifacts={rowData} />);
await render(
<TestApiProvider
apis={[
[errorApiRef, new MockErrorApi()],
[translationApiRef, mockApis.translation()],
]}
>
<ArtifactTable title="Nexus Artifacts" artifacts={rowData} />
</TestApiProvider>,
);

const table = screen.getAllByRole('table')[0];
expect(getCellText(table, 0, 'Artifact')).toContain(
Expand All @@ -108,8 +131,15 @@ describe('ArtifactTable', () => {
hash: undefined,
};

await render(
<ArtifactTable title="Nexus Artifacts" artifacts={[noHash]} />,
render(
<TestApiProvider
apis={[
[errorApiRef, new MockErrorApi()],
[translationApiRef, mockApis.translation()],
]}
>
<ArtifactTable title="Nexus Artifacts" artifacts={[noHash]} />
</TestApiProvider>,
);

const table = screen.getAllByRole('table')[0];
Expand All @@ -129,7 +159,16 @@ describe('ArtifactTable', () => {
sizeBytes: 200,
},
];
await render(<ArtifactTable title="Nexus Artifacts" artifacts={rowData} />);
render(
<TestApiProvider
apis={[
[errorApiRef, new MockErrorApi()],
[translationApiRef, mockApis.translation()],
]}
>
<ArtifactTable title="Nexus Artifacts" artifacts={rowData} />
</TestApiProvider>,
);

const user = userEvent.setup();
const table = screen.getAllByRole('table')[0];
Expand Down Expand Up @@ -174,7 +213,16 @@ describe('ArtifactTable', () => {
hash: undefined,
},
];
await render(<ArtifactTable title="Nexus Artifacts" artifacts={rowData} />);
render(
<TestApiProvider
apis={[
[errorApiRef, new MockErrorApi()],
[translationApiRef, mockApis.translation()],
]}
>
<ArtifactTable title="Nexus Artifacts" artifacts={rowData} />
</TestApiProvider>,
);

const user = userEvent.setup();
const table = screen.getAllByRole('table')[0];
Expand Down Expand Up @@ -221,12 +269,21 @@ describe('ArtifactTable', () => {
hash: undefined,
},
];
await render(<ArtifactTable title="Nexus Artifacts" artifacts={rowData} />);
render(
<TestApiProvider
apis={[
[errorApiRef, new MockErrorApi()],
[translationApiRef, mockApis.translation()],
]}
>
<ArtifactTable title="Nexus Artifacts" artifacts={rowData} />
</TestApiProvider>,
);

const user = userEvent.setup();
const table = screen.getAllByRole('table')[0];

const filterInput = screen.getByPlaceholderText('Search');
const filterInput = screen.getByPlaceholderText('Filter');
await user.type(filterInput, '-hash');
await waitFor(() => {
expect(getCellText(table, 0, 'Checksum')).toContain('-hash');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

import { Link, Table, type TableColumn } from '@backstage/core-components';

import { Box, Chip, makeStyles } from '@material-ui/core';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { BrowserRouter } from 'react-router-dom';
import { useAsync } from 'react-use';

Expand All @@ -8,6 +7,9 @@ import {
getAssetVariants,
NexusRepositoryManager,
} from './NexusRepositoryManager';
import { TestApiProvider, MockErrorApi, mockApis } from '@backstage/test-utils';
import { errorApiRef } from '@backstage/core-plugin-api';
import { translationApiRef } from '@backstage/core-plugin-api/alpha';

jest.mock('react-use', () => ({
...jest.requireActual('react-use'),
Expand Down Expand Up @@ -54,9 +56,16 @@ describe('NexusRepositoryManager', () => {
it('should show empty table if loaded and value is not present', () => {
(useAsync as jest.Mock).mockReturnValue({ loading: false, value: [] });
const { getByTestId } = render(
<BrowserRouter>
<NexusRepositoryManager />
</BrowserRouter>,
<TestApiProvider
apis={[
[errorApiRef, new MockErrorApi()],
[translationApiRef, mockApis.translation()],
]}
>
<BrowserRouter>
<NexusRepositoryManager />
</BrowserRouter>
</TestApiProvider>,
);
expect(getByTestId('nexus-repository-manager-table')).not.toBeNull();
expect(getByTestId('nexus-repository-manager-empty-table')).not.toBeNull();
Expand Down Expand Up @@ -157,9 +166,16 @@ describe('NexusRepositoryManager', () => {
],
});
const { queryByTestId } = render(
<BrowserRouter>
<NexusRepositoryManager />
</BrowserRouter>,
<TestApiProvider
apis={[
[errorApiRef, new MockErrorApi()],
[translationApiRef, mockApis.translation()],
]}
>
<BrowserRouter>
<NexusRepositoryManager />
</BrowserRouter>
</TestApiProvider>,
);
expect(queryByTestId('nexus-repository-manager-table')).not.toBeNull();
expect(queryByTestId('nexus-repository-manager-empty-table')).toBeNull();
Expand Down Expand Up @@ -234,9 +250,16 @@ describe('NexusRepositoryManager', () => {
],
});
const { queryByTestId } = render(
<BrowserRouter>
<NexusRepositoryManager />
</BrowserRouter>,
<TestApiProvider
apis={[
[errorApiRef, new MockErrorApi()],
[translationApiRef, mockApis.translation()],
]}
>
<BrowserRouter>
<NexusRepositoryManager />
</BrowserRouter>
</TestApiProvider>,
);
expect(
queryByTestId('nexus-repository-manager-table')?.querySelectorAll(
Expand Down Expand Up @@ -312,9 +335,16 @@ describe('NexusRepositoryManager', () => {
});

const { queryByTestId } = render(
<BrowserRouter>
<NexusRepositoryManager />
</BrowserRouter>,
<TestApiProvider
apis={[
[errorApiRef, new MockErrorApi()],
[translationApiRef, mockApis.translation()],
]}
>
<BrowserRouter>
<NexusRepositoryManager />
</BrowserRouter>
</TestApiProvider>,
);

// hash of the jar, which is second
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { useAsync } from 'react-use';

import { Progress } from '@backstage/core-components';
Expand Down
1 change: 1 addition & 0 deletions workspaces/nexus-repository-manager/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"files": ["node_modules/@backstage/cli/asset-types/asset-types.d.ts"],
"exclude": ["node_modules"],
"compilerOptions": {
"jsx": "react-jsx",
"outDir": "dist-types",
"rootDir": ".",
"lib": ["DOM", "DOM.Iterable", "ScriptHost", "ES2022"],
Expand Down
Loading