Skip to content

Commit

Permalink
Merge pull request #169 from backstage/topic/v1.19.0-next.1
Browse files Browse the repository at this point in the history
v1.19.0-next.1 version bump
  • Loading branch information
awanlin authored Oct 5, 2023
2 parents 60429fe + 62bcbf9 commit 461e9cd
Show file tree
Hide file tree
Showing 16 changed files with 1,545 additions and 1,969 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
playwright.config.ts
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,7 @@ site
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
!.yarn/versions

# E2E test reports
e2e-test-report/
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Stage 1 - Create yarn install skeleton layer
FROM node:18-bullseye-slim AS packages
FROM node:18-bookworm-slim AS packages

WORKDIR /app
COPY package.json yarn.lock ./
Expand All @@ -12,7 +12,7 @@ COPY packages packages
RUN find packages \! -name "package.json" -mindepth 2 -maxdepth 2 -print | xargs rm -rf

# Stage 2 - Install dependencies and build packages
FROM node:18-bullseye-slim AS build
FROM node:18-bookworm-slim AS build

# Set Python interpreter for `node-gyp` to use
ENV PYTHON /usr/bin/python3
Expand Down Expand Up @@ -46,7 +46,7 @@ RUN mkdir packages/backend/dist/skeleton packages/backend/dist/bundle \
&& tar xzf packages/backend/dist/bundle.tar.gz -C packages/backend/dist/bundle

# Stage 3 - Build the actual backend image and install production dependencies
FROM node:18-bullseye-slim
FROM node:18-bookworm-slim

# Set Python interpreter for `node-gyp` to use
ENV PYTHON /usr/bin/python3
Expand Down
2 changes: 1 addition & 1 deletion backstage.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "1.18.0-next.3"
"version": "1.19.0-next.1"
}
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"private": true,
"engines": {
"node": "16 || 18"
"node": "18 || 20"
},
"scripts": {
"dev": "concurrently \"yarn start\" \"yarn start-backend\"",
Expand All @@ -15,6 +15,7 @@
"clean": "backstage-cli repo clean",
"test": "backstage-cli repo test",
"test:all": "backstage-cli repo test --coverage",
"test:e2e": "playwright test",
"lint": "backstage-cli repo lint --since origin/master",
"lint:all": "backstage-cli repo lint",
"create-plugin": "backstage-cli create-plugin --scope internal --no-private",
Expand All @@ -34,7 +35,9 @@
"@types/unist": "^2.0.6"
},
"devDependencies": {
"@backstage/cli": "^0.22.13-next.3",
"@backstage/cli": "^0.23.0-next.1",
"@backstage/e2e-test-utils": "^0.1.0-next.0",
"@playwright/test": "^1.32.3",
"@spotify/prettier-config": "^7.0.0",
"concurrently": "^6.0.0",
"eslint-plugin-jest": "*",
Expand Down
5 changes: 0 additions & 5 deletions packages/app/cypress.json

This file was deleted.

21 changes: 0 additions & 21 deletions packages/app/cypress/.eslintrc.json

This file was deleted.

6 changes: 0 additions & 6 deletions packages/app/cypress/integration/app.js

This file was deleted.

22 changes: 22 additions & 0 deletions packages/app/e2e-tests/app.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright 2023 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { test, expect } from '@playwright/test';

test('App should render the welcome page', async ({ page }) => {
await page.goto('/');
await expect(page.getByText('My Company Catalog')).toBeVisible();
});
61 changes: 28 additions & 33 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@
},
"bundled": true,
"dependencies": {
"@backstage/app-defaults": "^1.4.3-next.3",
"@backstage/catalog-model": "^1.4.2-next.2",
"@backstage/cli": "^0.22.13-next.3",
"@backstage/core-app-api": "^1.10.0-next.3",
"@backstage/core-components": "^0.13.5-next.3",
"@backstage/core-plugin-api": "^1.6.0-next.3",
"@backstage/integration-react": "^1.1.19-next.3",
"@backstage/plugin-api-docs": "^0.9.11-next.3",
"@backstage/plugin-badges": "^0.2.48-next.3",
"@backstage/plugin-catalog": "^1.13.0-next.3",
"@backstage/plugin-catalog-graph": "^0.2.36-next.3",
"@backstage/plugin-catalog-react": "^1.8.4-next.3",
"@backstage/plugin-cost-insights": "^0.12.13-next.3",
"@backstage/plugin-explore": "^0.4.10-next.3",
"@backstage/plugin-github-actions": "^0.6.5-next.3",
"@backstage/plugin-graphiql": "^0.2.54-next.3",
"@backstage/plugin-org": "^0.6.14-next.3",
"@backstage/plugin-search": "^1.4.0-next.3",
"@backstage/plugin-search-react": "^1.7.0-next.3",
"@backstage/plugin-tech-radar": "^0.6.8-next.3",
"@backstage/plugin-techdocs": "^1.7.0-next.3",
"@backstage/plugin-todo": "^0.2.26-next.3",
"@backstage/plugin-user-settings": "^0.7.9-next.3",
"@backstage/test-utils": "^1.4.3-next.3",
"@backstage/theme": "^0.4.2-next.0",
"@backstage/app-defaults": "^1.4.4-next.1",
"@backstage/catalog-model": "^1.4.2",
"@backstage/cli": "^0.23.0-next.1",
"@backstage/core-app-api": "^1.10.1-next.1",
"@backstage/core-components": "^0.13.6-next.1",
"@backstage/core-plugin-api": "^1.7.0-next.0",
"@backstage/integration-react": "^1.1.20-next.1",
"@backstage/plugin-api-docs": "^0.9.12-next.1",
"@backstage/plugin-badges": "^0.2.49-next.1",
"@backstage/plugin-catalog": "^1.14.0-next.1",
"@backstage/plugin-catalog-graph": "^0.2.37-next.1",
"@backstage/plugin-catalog-react": "^1.8.5-next.1",
"@backstage/plugin-cost-insights": "^0.12.14-next.1",
"@backstage/plugin-explore": "^0.4.11-next.1",
"@backstage/plugin-github-actions": "^0.6.6-next.1",
"@backstage/plugin-graphiql": "^0.2.55-next.1",
"@backstage/plugin-org": "^0.6.15-next.1",
"@backstage/plugin-search": "^1.4.1-next.1",
"@backstage/plugin-search-react": "^1.7.1-next.1",
"@backstage/plugin-tech-radar": "^0.6.9-next.1",
"@backstage/plugin-techdocs": "^1.7.1-next.1",
"@backstage/plugin-todo": "^0.2.28-next.1",
"@backstage/plugin-user-settings": "^0.7.11-next.1",
"@backstage/test-utils": "^1.4.4-next.1",
"@backstage/theme": "^0.4.2",
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.57",
Expand All @@ -43,24 +43,19 @@
"react-use": "^15.3.3"
},
"devDependencies": {
"@playwright/test": "^1.32.3",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@types/jest": "^26.0.7",
"@types/node": "^12.0.0",
"@types/react-dom": "*",
"cross-env": "^7.0.0",
"cypress": "^4.2.0",
"eslint-plugin-cypress": "^2.10.3",
"start-server-and-test": "^1.10.11"
"cross-env": "^7.0.0"
},
"scripts": {
"start": "backstage-cli package start",
"build": "backstage-cli package build",
"test": "backstage-cli package test",
"lint": "backstage-cli package lint",
"test:e2e": "cross-env PORT=3001 start-server-and-test start http://localhost:3001 cy:dev",
"test:e2e:ci": "cross-env PORT=3001 start-server-and-test start http://localhost:3001 cy:run",
"cy:dev": "cypress open",
"cy:run": "cypress run",
"clean": "backstage-cli package clean"
},
"browserslist": {
Expand Down
1 change: 0 additions & 1 deletion packages/app/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
name="description"
content="Backstage is an open platform for building developer portals"
/>
<link rel="apple-touch-icon" href="<%= publicPath %>/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
Expand Down
48 changes: 24 additions & 24 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,29 @@
"migrate:create": "knex migrate:make -x ts"
},
"dependencies": {
"@backstage/backend-common": "^0.19.5-next.3",
"@backstage/backend-tasks": "^0.5.8-next.3",
"@backstage/catalog-client": "^1.4.4-next.2",
"@backstage/catalog-model": "^1.4.2-next.2",
"@backstage/config": "^1.1.0-next.2",
"@backstage/errors": "^1.2.2-next.0",
"@backstage/plugin-app-backend": "^0.3.51-next.3",
"@backstage/plugin-auth-backend": "^0.19.0-next.3",
"@backstage/plugin-auth-node": "^0.3.0-next.3",
"@backstage/plugin-badges-backend": "^0.3.0-next.3",
"@backstage/plugin-catalog-backend": "^1.13.0-next.3",
"@backstage/plugin-explore-backend": "^0.0.13-next.3",
"@backstage/plugin-explore-common": "^0.0.2-next.0",
"@backstage/plugin-permission-common": "^0.7.8-next.2",
"@backstage/plugin-permission-node": "^0.7.14-next.3",
"@backstage/plugin-proxy-backend": "^0.4.0-next.3",
"@backstage/plugin-search-backend": "^1.4.3-next.3",
"@backstage/plugin-search-backend-module-catalog": "^0.1.7-next.3",
"@backstage/plugin-search-backend-module-explore": "^0.1.7-next.3",
"@backstage/plugin-search-backend-module-techdocs": "^0.1.7-next.3",
"@backstage/plugin-search-backend-node": "^1.2.7-next.3",
"@backstage/plugin-techdocs-backend": "^1.7.0-next.3",
"@backstage/plugin-todo-backend": "^0.3.0-next.3",
"@backstage/backend-common": "^0.19.7-next.1",
"@backstage/backend-tasks": "^0.5.10-next.1",
"@backstage/catalog-client": "^1.4.4",
"@backstage/catalog-model": "^1.4.2",
"@backstage/config": "^1.1.0",
"@backstage/errors": "^1.2.2",
"@backstage/plugin-app-backend": "^0.3.53-next.1",
"@backstage/plugin-auth-backend": "^0.19.2-next.1",
"@backstage/plugin-auth-node": "^0.3.2-next.1",
"@backstage/plugin-badges-backend": "^0.3.2-next.1",
"@backstage/plugin-catalog-backend": "^1.14.0-next.1",
"@backstage/plugin-explore-backend": "^0.0.15-next.1",
"@backstage/plugin-explore-common": "^0.0.2",
"@backstage/plugin-permission-common": "^0.7.8",
"@backstage/plugin-permission-node": "^0.7.16-next.1",
"@backstage/plugin-proxy-backend": "^0.4.2-next.1",
"@backstage/plugin-search-backend": "^1.4.5-next.1",
"@backstage/plugin-search-backend-module-catalog": "^0.1.9-next.1",
"@backstage/plugin-search-backend-module-explore": "^0.1.9-next.1",
"@backstage/plugin-search-backend-module-techdocs": "^0.1.9-next.1",
"@backstage/plugin-search-backend-node": "^1.2.9-next.1",
"@backstage/plugin-techdocs-backend": "^1.7.2-next.1",
"@backstage/plugin-todo-backend": "^0.3.3-next.1",
"app": "^0.0.0",
"better-sqlite3": "^7.5.0",
"dockerode": "^3.2.1",
Expand All @@ -48,7 +48,7 @@
"winston": "^3.2.1"
},
"devDependencies": {
"@backstage/cli": "^0.22.13-next.3",
"@backstage/cli": "^0.23.0-next.1",
"@types/dockerode": "^3.2.1",
"@types/express": "^4.17.6",
"@types/express-serve-static-core": "^4.17.5",
Expand Down
21 changes: 10 additions & 11 deletions packages/backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
getRootLogger,
loadBackendConfig,
notFoundHandler,
useHotMemoize,
} from '@backstage/backend-common';

import { Config } from '@backstage/config';
Expand Down Expand Up @@ -47,7 +46,7 @@ function makeCreateEnv(config: Config) {
tokenManager,
});
const cacheManager = CacheManager.fromConfig(config);
const taskScheduler = TaskScheduler.fromConfig(config);
const taskScheduler = TaskScheduler.fromConfig(config, { databaseManager });
const identity = DefaultIdentityClient.create({
discovery,
});
Expand Down Expand Up @@ -80,15 +79,15 @@ async function main() {
});
const createEnv = makeCreateEnv(config);

const catalogEnv = useHotMemoize(module, () => createEnv('catalog'));
const authEnv = useHotMemoize(module, () => createEnv('auth'));
const proxyEnv = useHotMemoize(module, () => createEnv('proxy'));
const searchEnv = useHotMemoize(module, () => createEnv('search'));
const techdocsEnv = useHotMemoize(module, () => createEnv('techdocs'));
const todoEnv = useHotMemoize(module, () => createEnv('todo'));
const appEnv = useHotMemoize(module, () => createEnv('app'));
const badgesEnv = useHotMemoize(module, () => createEnv('badges'));
const exploreEnv = useHotMemoize(module, () => createEnv('explore'));
const catalogEnv = createEnv('catalog');
const authEnv = createEnv('auth');
const proxyEnv = createEnv('proxy');
const searchEnv = createEnv('search');
const techdocsEnv = createEnv('techdocs');
const todoEnv = createEnv('todo');
const appEnv = createEnv('app');
const badgesEnv = createEnv('badges');
const exploreEnv = createEnv('explore');

const apiRouter = Router();
apiRouter.use('/catalog', await catalog(catalogEnv));
Expand Down
2 changes: 0 additions & 2 deletions packages/backend/src/plugins/search.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useHotCleanup } from '@backstage/backend-common';
import { createRouter } from '@backstage/plugin-search-backend';
import {
IndexBuilder,
Expand Down Expand Up @@ -51,7 +50,6 @@ export default async function createPlugin({

const { scheduler: indexScheduler } = await indexBuilder.build();
indexScheduler.start();
useHotCleanup(module, () => indexScheduler.stop());

return await createRouter({
engine: indexBuilder.getSearchEngine(),
Expand Down
50 changes: 50 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright 2023 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { defineConfig } from '@playwright/test';
import { generateProjects } from '@backstage/e2e-test-utils/playwright';
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
timeout: 60_000,
expect: {
timeout: 5_000,
},
// Run your local dev server before starting the tests
webServer: process.env.CI
? []
: [
{
command: 'yarn start',
port: 3000,
reuseExistingServer: true,
timeout: 60_000,
},
],
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
reporter: [['html', { open: 'never', outputFolder: 'e2e-test-report' }]],
use: {
actionTimeout: 0,
baseURL:
process.env.PLAYWRIGHT_URL ??
(process.env.CI ? 'http://localhost:7007' : 'http://localhost:3000'),
screenshot: 'only-on-failure',
trace: 'on-first-retry',
},
outputDir: 'node_modules/.cache/e2e-test-results',
projects: generateProjects(), // Find all packages with e2e-test folders
});
Loading

0 comments on commit 461e9cd

Please sign in to comment.