Skip to content

Commit

Permalink
Merge pull request #36 from openedx/feanil/backstage_version_bump
Browse files Browse the repository at this point in the history
feanil/backstage version bump
  • Loading branch information
Feanil Patel authored Aug 21, 2024
2 parents a439f20 + 85f3023 commit ee21867
Show file tree
Hide file tree
Showing 25 changed files with 8,047 additions and 3,976 deletions.
2 changes: 1 addition & 1 deletion app-config.production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ backend:
# hostname.
# host: 0.0.0.0

# config options: https://node-postgres.com/api/client
# config options: https://node-postgres.com/apis/client
database:
client: pg
connection:
Expand Down
32 changes: 30 additions & 2 deletions app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ auth:
development:
clientId: ${AUTH_GITHUB_CLIENT_ID}
clientSecret: ${AUTH_GITHUB_CLIENT_SECRET}
signIn:
resolvers:
- resolver: usernameMatchingUserEntityName
# See https://backstage.io/docs/auth/guest/provider
# guest: {}
guest: null

scaffolder:
# see https://backstage.io/docs/features/software-templates/configuration for software template options
Expand All @@ -92,15 +98,37 @@ catalog:
organization: 'openedx'
filters:
branch: 'main'
schedule: # same options as in TaskScheduleDefinition
# supports cron, ISO duration, "human duration" as used in code
frequency: { minutes: 120 }
# supports ISO duration, "human duration" as used in code
timeout: { minutes: 3 }
masterBranches:
organization: 'openedx'
filters:
branch: 'master'
schedule: # same options as in TaskScheduleDefinition
# supports cron, ISO duration, "human duration" as used in code
frequency: { minutes: 120 }
# supports ISO duration, "human duration" as used in code
timeout: { minutes: 3 }
extraCatalogs:
organization: 'openedx'
catalogPath: 'catalog-extra/**/catalog-info.yaml'
filters:
branch: 'main'
repository: 'openedx-backstage'


schedule: # same options as in TaskScheduleDefinition
# supports cron, ISO duration, "human duration" as used in code
frequency: { minutes: 120 }
# supports ISO duration, "human duration" as used in code
timeout: { minutes: 3 }
githubOrg:
id: ghUsers
githubUrl: https://github.com
orgs:
- openedx
schedule:
initialDelay: { seconds: 30 }
frequency: { hours: 1 }
timeout: { minutes: 50 }
2 changes: 1 addition & 1 deletion backstage.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "1.19.3"
"version": "1.29.2"
}
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@
]
},
"devDependencies": {
"@backstage/cli": "^0.23.0",
"@backstage/e2e-test-utils": "^0.1.0",
"@backstage/cli": "^0.26.11",
"@backstage/e2e-test-utils": "^0.1.1",
"@playwright/test": "^1.32.3",
"@spotify/prettier-config": "^12.0.0",
"concurrently": "^8.0.0",
"lerna": "^7.3.0",
"node-gyp": "^9.0.0",
"node-gyp": "^10.0.0",
"prettier": "^2.3.2",
"typescript": "~5.2.0"
"typescript": "~5.4.0"
},
"resolutions": {
"@types/react": "^17",
"@types/react-dom": "^17"
"@types/react": "^18",
"@types/react-dom": "^18"
},
"prettier": "@spotify/prettier-config",
"lint-staged": {
Expand All @@ -55,5 +55,6 @@
"*.{json,md}": [
"prettier --write"
]
}
},
"dependencies": {}
}
28 changes: 28 additions & 0 deletions packages/app/e2e-tests/app.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright 2020 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('/');

const enterButton = page.getByRole('button', { name: 'Enter' });
await expect(enterButton).toBeVisible();
await enterButton.click();

await expect(page.getByText('My Company Catalog')).toBeVisible();
});

62 changes: 31 additions & 31 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,47 +14,47 @@
"lint": "backstage-cli package lint"
},
"dependencies": {
"@backstage/app-defaults": "^1.4.4",
"@backstage/catalog-model": "^1.4.3",
"@backstage/cli": "^0.23.0",
"@backstage/core-app-api": "^1.11.0",
"@backstage/core-components": "^0.13.6",
"@backstage/core-plugin-api": "^1.7.0",
"@backstage/integration-react": "^1.1.20",
"@backstage/plugin-api-docs": "^0.9.12",
"@backstage/plugin-catalog": "^1.14.0",
"@backstage/plugin-catalog-common": "^1.0.17",
"@backstage/plugin-catalog-graph": "^0.2.37",
"@backstage/plugin-catalog-import": "^0.10.1",
"@backstage/plugin-catalog-react": "^1.8.5",
"@backstage/plugin-github-actions": "^0.6.6",
"@backstage/plugin-org": "^0.6.15",
"@backstage/plugin-permission-react": "^0.4.16",
"@backstage/plugin-scaffolder": "^1.15.1",
"@backstage/plugin-search": "^1.4.1",
"@backstage/plugin-search-react": "^1.7.1",
"@backstage/plugin-tech-radar": "^0.6.9",
"@backstage/plugin-techdocs": "^1.8.0",
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.1",
"@backstage/plugin-techdocs-react": "^1.1.12",
"@backstage/plugin-user-settings": "^0.7.11",
"@backstage/theme": "^0.4.3",
"@backstage-community/plugin-github-actions": "^0.6.19",
"@backstage-community/plugin-tech-radar": "^0.7.6",
"@backstage/app-defaults": "^1.5.9",
"@backstage/catalog-model": "^1.5.0",
"@backstage/cli": "^0.26.11",
"@backstage/core-app-api": "^1.14.1",
"@backstage/core-components": "^0.14.9",
"@backstage/core-plugin-api": "^1.9.3",
"@backstage/integration-react": "^1.1.29",
"@backstage/plugin-api-docs": "^0.11.7",
"@backstage/plugin-catalog": "^1.21.1",
"@backstage/plugin-catalog-common": "^1.0.25",
"@backstage/plugin-catalog-graph": "^0.4.7",
"@backstage/plugin-catalog-import": "^0.12.1",
"@backstage/plugin-catalog-react": "^1.12.2",
"@backstage/plugin-org": "^0.6.27",
"@backstage/plugin-permission-react": "^0.4.24",
"@backstage/plugin-scaffolder": "^1.23.0",
"@backstage/plugin-search": "^1.4.14",
"@backstage/plugin-search-react": "^1.7.13",
"@backstage/plugin-techdocs": "^1.10.7",
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.12",
"@backstage/plugin-techdocs-react": "^1.2.6",
"@backstage/plugin-user-settings": "^0.8.10",
"@backstage/theme": "^0.5.6",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"history": "^5.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.0.2",
"react-dom": "^18.0.2",
"react-router": "^6.3.0",
"react-router-dom": "^6.3.0",
"react-use": "^17.2.4"
},
"devDependencies": {
"@backstage/test-utils": "^1.4.4",
"@backstage/test-utils": "^1.5.9",
"@playwright/test": "^1.32.3",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.0.0",
"@testing-library/dom": "^8.0.0",
"@types/node": "^16.11.26",
"@types/react-dom": "*",
"cross-env": "^7.0.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/app/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Backstage is an open platform for building developer portals"
content="Backstage is an open source framework for building developer portals"
/>
<!--
manifest.json provides metadata used when your web app is installed on a
Expand Down Expand Up @@ -41,7 +41,7 @@
href="<%= publicPath %>/safari-pinned-tab.svg"
color="#5bbad5"
/>
<title><%= config.getString('app.title') %></title>
<title><%= config.getOptionalString('app.title') ?? 'Backstage' %></title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
9 changes: 6 additions & 3 deletions packages/app/src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { renderWithEffects } from '@backstage/test-utils';
import { render, waitFor } from '@testing-library/react';
import App from './App';

describe('App', () => {
Expand All @@ -20,7 +20,10 @@ describe('App', () => {
] as any,
};

const rendered = await renderWithEffects(<App />);
expect(rendered.baseElement).toBeInTheDocument();
const rendered = render(<App />);

await waitFor(() => {
expect(rendered.baseElement).toBeInTheDocument();
});
});
});
14 changes: 9 additions & 5 deletions packages/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ import {
import { ScaffolderPage, scaffolderPlugin } from '@backstage/plugin-scaffolder';
import { orgPlugin } from '@backstage/plugin-org';
import { SearchPage } from '@backstage/plugin-search';
import { TechRadarPage } from '@backstage/plugin-tech-radar';
import { TechRadarPage } from '@backstage-community/plugin-tech-radar';
import { UserSettingsPage } from '@backstage/plugin-user-settings';
import { apis } from './apis';
import { entityPage } from './components/catalog/EntityPage';
import { searchPage } from './components/search/SearchPage';
import { Root } from './components/Root';

import { AlertDisplay, OAuthRequestDialog } from '@backstage/core-components';
import {
AlertDisplay,
OAuthRequestDialog,
SignInPage,
} from '@backstage/core-components';
import { createApp } from '@backstage/app-defaults';
import { AppRouter, FlatRoutes } from '@backstage/core-app-api';
import { CatalogGraphPage } from '@backstage/plugin-catalog-graph';
Expand All @@ -29,20 +33,20 @@ import { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common/

// Start Changes for GitHub Auth
import { githubAuthApiRef } from '@backstage/core-plugin-api';
import { SignInProviderConfig, SignInPage } from '@backstage/core-components';
import { SignInProviderConfig } from '@backstage/core-components';

const githubProvider: SignInProviderConfig = {
id: 'github-auth-provider',
title: 'GitHub',
message: 'Sign in using GitHub',
message: 'You must be a member of the "openedx" github org.',
apiRef: githubAuthApiRef,
};
// End changes for GitHub Auth
const app = createApp({
apis,
components: {
SignInPage: props => (
<SignInPage {...props} auto provider={githubProvider} />
<SignInPage {...props} auto providers={[githubProvider]} />
),
},
bindRoutes({ bind }) {
Expand Down
8 changes: 8 additions & 0 deletions packages/app/src/components/Root/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import {
} from '@backstage/core-components';
import MenuIcon from '@material-ui/icons/Menu';
import SearchIcon from '@material-ui/icons/Search';
import { MyGroupsSidebarItem } from '@backstage/plugin-org';
import GroupIcon from '@material-ui/icons/People';

const useSidebarLogoStyles = makeStyles({
root: {
Expand Down Expand Up @@ -66,11 +68,17 @@ export const Root = ({ children }: PropsWithChildren<{}>) => (
<SidebarGroup label="Menu" icon={<MenuIcon />}>
{/* Global nav, not org-specific */}
<SidebarItem icon={HomeIcon} to="catalog" text="Home" />
<MyGroupsSidebarItem
singularTitle="My Group"
pluralTitle="My Groups"
icon={GroupIcon}
/>
<SidebarItem icon={ExtensionIcon} to="api-docs" text="APIs" />
<SidebarItem icon={CreateComponentIcon} to="create" text="Create..." />
{/* End global nav */}
<SidebarDivider />
<SidebarScrollWrapper>
{/* Items in this group will be scrollable if they run out of space */}
<SidebarItem icon={MapIcon} to="tech-radar" text="Tech Radar" />
</SidebarScrollWrapper>
</SidebarGroup>
Expand Down
7 changes: 5 additions & 2 deletions packages/app/src/components/catalog/EntityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
import {
isGithubActionsAvailable,
EntityGithubActionsContent,
} from '@backstage/plugin-github-actions';
} from '@backstage-community/plugin-github-actions';
import {
EntityUserProfileCard,
EntityGroupProfileCard,
Expand Down Expand Up @@ -276,9 +276,12 @@ const groupPage = (
<Grid item xs={12} md={6}>
<EntityOwnershipCard variant="gridItem" />
</Grid>
<Grid item xs={12}>
<Grid item xs={12} md={6}>
<EntityMembersListCard />
</Grid>
<Grid item xs={12} md={6}>
<EntityLinksCard />
</Grid>
</Grid>
</EntityLayout.Route>
</EntityLayout>
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import '@backstage/cli/asset-types';
import React from 'react';
import ReactDOM from 'react-dom';
import ReactDOM from 'react-dom/client';
import App from './App';

ReactDOM.render(<App />, document.getElementById('root'));
ReactDOM.createRoot(document.getElementById('root')!).render(<App />);
Loading

0 comments on commit ee21867

Please sign in to comment.