Skip to content
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

chore: Update all minor dependency updates #129

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
]
},
"devDependencies": {
"@backstage/cli": "^0.26.6",
"@backstage/cli": "^0.28.0",
"@commitlint/cli": "^19.0.0",
"@commitlint/config-conventional": "^19.0.0",
"@commitlint/config-lerna-scopes": "^19.0.0",
Expand All @@ -57,7 +57,7 @@
"lint-staged": "^15.0.1",
"node-gyp": "^10.0.0",
"prettier": "^2.0.0",
"typescript": "~5.5.0",
"typescript": "~5.6.0",
"@typescript-eslint/parser": "^7.0.0"
},
"resolutions": {
Expand Down
6 changes: 3 additions & 3 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"dependencies": {
"@backstage/app-defaults": "^1.5.5",
"@backstage/catalog-model": "^1.5.0",
"@backstage/cli": "^0.26.6",
"@backstage/cli": "^0.28.0",
"@backstage/core-app-api": "^1.12.5",
"@backstage/core-components": "^0.14.7",
"@backstage/core-components": "^0.15.0",
"@backstage/core-plugin-api": "^1.9.2",
"@backstage/integration-react": "^1.1.27",
"@backstage/plugin-api-docs": "^0.11.5",
Expand All @@ -41,7 +41,7 @@
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.10",
"@backstage/plugin-techdocs-react": "^1.2.4",
"@backstage/plugin-user-settings": "^0.8.6",
"@backstage/theme": "^0.5.5",
"@backstage/theme": "^0.6.0",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@dynatrace/backstage-plugin-dql": "^0.1.0",
Expand Down
16 changes: 8 additions & 8 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@
"build-image": "docker build ../.. -f Dockerfile --tag backstage"
},
"dependencies": {
"@backstage/backend-defaults": "^0.4.0",
"@backstage/backend-plugin-api": "^0.7.0",
"@backstage/backend-tasks": "^0.5.23",
"@backstage/backend-defaults": "^0.5.0",
"@backstage/backend-plugin-api": "^0.8.0",
"@backstage/backend-tasks": "^0.6.0",
"@backstage/catalog-client": "^1.6.5",
"@backstage/catalog-model": "^1.5.0",
"@backstage/config": "^1.2.0",
"@backstage/plugin-app-backend": "^0.3.67",
"@backstage/plugin-auth-backend": "^0.22.5",
"@backstage/plugin-auth-backend-module-guest-provider": "^0.1.4",
"@backstage/plugin-auth-node": "^0.4.13",
"@backstage/plugin-auth-backend": "^0.23.0",
"@backstage/plugin-auth-backend-module-guest-provider": "^0.2.0",
"@backstage/plugin-auth-node": "^0.5.0",
"@backstage/plugin-catalog-backend": "^1.22.0",
"@backstage/plugin-permission-backend": "^0.5.42",
"@backstage/plugin-permission-backend-module-allow-all-policy": "^0.1.15",
"@backstage/plugin-permission-backend-module-allow-all-policy": "^0.2.0",
"@backstage/plugin-permission-common": "^0.8.0",
"@backstage/plugin-permission-node": "^0.8.0",
"@backstage/plugin-proxy-backend": "^0.5.0",
Expand All @@ -52,7 +52,7 @@
"winston": "^3.2.1"
},
"devDependencies": {
"@backstage/cli": "^0.26.6",
"@backstage/cli": "^0.28.0",
"@types/dockerode": "^3.3.0",
"@types/express": "^4.17.6",
"@types/express-serve-static-core": "^4.17.5",
Expand Down
2 changes: 1 addition & 1 deletion plugins/dql-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@backstage/cli": "^0.26.6",
"@backstage/cli": "^0.28.0",
"@backstage/test-utils": "^1.5.5",
"@types/supertest": "^6.0.0",
"msw": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion plugins/dql-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"postpack": "backstage-cli package postpack"
},
"devDependencies": {
"@backstage/cli": "^0.26.6",
"@backstage/cli": "^0.28.0",
"@types/lodash": "^4.17.0"
},
"files": [
Expand Down
9 changes: 4 additions & 5 deletions plugins/dql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
},
"dependencies": {
"@backstage/catalog-model": "^1.5.0",
"@backstage/core-components": "^0.14.7",
"@backstage/core-components": "^0.15.0",
"@backstage/core-plugin-api": "^1.9.2",
"@backstage/errors": "^1.2.4",
"@backstage/plugin-catalog-react": "^1.12.0",
"@backstage/theme": "^0.5.5",
"@backstage/theme": "^0.6.0",
"@dynatrace/backstage-plugin-dql-common": "^0.1.0",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
Expand All @@ -52,16 +52,15 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.26.6",
"@backstage/cli": "^0.28.0",
"@backstage/core-app-api": "^1.12.5",
"@backstage/dev-utils": "^1.0.32",
"@backstage/test-utils": "^1.5.5",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.0.0",
"@types/lodash": "^4.17.0",
"msw": "^2.0.0"
"@types/lodash": "^4.17.0"
},
"files": [
"dist"
Expand Down
73 changes: 30 additions & 43 deletions plugins/dql/src/api/DqlQueryApiClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,31 @@
*/
import { DqlQueryApiClient } from './DqlQueryApiClient';
import { DiscoveryApi } from '@backstage/core-plugin-api';
import { http } from 'msw';
import { setupServer } from 'msw/node';

const server = setupServer();

const fetchMock = jest.spyOn(global, 'fetch');
const mockFetchResponse = (
response: any,
url: string = '*',
queryParams: string | null = null,
data: any,
properties?: Partial<Awaited<ReturnType<typeof fetch>>>,
) => {
server.use(
http.get(url, ({ request }) => {
if (
queryParams === null ||
new URL(request.url).searchParams.toString() === queryParams
) {
return new Response(JSON.stringify(response), {
headers: {
'Content-Type': 'application/json',
},
});
fetchMock.mockResolvedValue({
headers: new Headers(),
status: 200,
async json() {
if (typeof data === 'string') {
throw new Error('Unexpected token');
}
return new Response(undefined, { status: 404 });
}),
);
return data;
},
// @ts-ignore
async blob() {
return {
async text() {
return typeof data === 'string' ? data : JSON.stringify(data);
},
};
},
...properties,
});
};

const mockDiscoveryApiUrl = (url: string): DiscoveryApi => {
Expand All @@ -52,10 +52,7 @@ const mockedEntityRef = 'component:default/example';
const mockedIdentityToken = 'mock-token';

describe('DQLQueryApiClient', () => {
beforeAll(() => server.listen());
beforeEach(() => jest.resetAllMocks());
afterEach(() => server.resetHandlers());
afterAll(() => server.close());

it('should ask the discovery API for the DQL query API URL', async () => {
mockFetchResponse([]);
Expand Down Expand Up @@ -84,9 +81,7 @@ describe('DQLQueryApiClient', () => {
const discoveryApiUrl = 'https://discovery-api.com';
const queryNamespace = 'namespace';
const queryName = 'query';
const url = `${discoveryApiUrl}/${queryNamespace}/${queryName}`;
const queryParams = `entityRef=component%3Adefault%2Fexample`;
mockFetchResponse([], url, queryParams);
mockFetchResponse([]);
const discoveryApi = mockDiscoveryApiUrl(discoveryApiUrl);
const client = new DqlQueryApiClient({ discoveryApi });

Expand All @@ -97,6 +92,10 @@ describe('DQLQueryApiClient', () => {
mockedIdentityToken,
);

expect(fetchMock).toHaveBeenCalledWith(
`${discoveryApiUrl}/${queryNamespace}/${queryName}?entityRef=component%3Adefault%2Fexample`,
expect.anything(),
);
expect(result).toEqual([]);
});

Expand Down Expand Up @@ -131,12 +130,7 @@ describe('DQLQueryApiClient', () => {
});

it('should reject for non-json data', async () => {
server.use(
http.get('*', () => {
return new Response('not json');
}),
);

mockFetchResponse('not json');
const discoveryApi = mockDiscoveryApiUrl('https://discovery-api.com');
const client = new DqlQueryApiClient({ discoveryApi });

Expand Down Expand Up @@ -184,11 +178,8 @@ describe('DQLQueryApiClient', () => {
it('should report when a query is not found', async () => {
const statusCode = 404;
const statusText = 'Not Found';
server.use(
http.get('*', () => {
return new Response(undefined, { status: statusCode, statusText });
}),
);

mockFetchResponse(undefined, { status: statusCode, statusText });

const discoveryApi = mockDiscoveryApiUrl('https://discovery-api.com');
const client = new DqlQueryApiClient({ discoveryApi });
Expand All @@ -214,11 +205,7 @@ describe('DQLQueryApiClient', () => {
it('should report any generic error to the frontend', async () => {
const statusCode = 500;
const statusText = "It's broken";
server.use(
http.get('*', () => {
return new Response(undefined, { status: statusCode, statusText });
}),
);
mockFetchResponse(undefined, { status: statusCode, statusText });

const discoveryApi = mockDiscoveryApiUrl('https://discovery-api.com');
const client = new DqlQueryApiClient({ discoveryApi });
Expand Down
Loading