Skip to content

Commit

Permalink
chore: update Backstage to 1.31.2 (#35)
Browse files Browse the repository at this point in the history
* chore: update Backstage to 1.31.2
  • Loading branch information
dirien authored Oct 2, 2024
1 parent 1f79435 commit 99b9e8f
Show file tree
Hide file tree
Showing 21 changed files with 36,357 additions and 105 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- uses: actions/setup-node@v3
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: '18.x'
- run: yarn install
node-version: '20.x'
- name: yarn install
uses: backstage/actions/yarn-install@25145dd4117d50e1da9330e9ed2893bc6b75373e # v0.6.15
with:
cache-prefix: ${{ runner.os }}-v20.x
- run: yarn lint
- run: yarn tsc
#- run: yarn test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: '18.x'
node-version: '20.x'
- run: yarn install
- run: |
cd backstage-plugin-pulumi
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
**/node_modules
**/dist
**/dist-types
**/yarn.lock
#**/yarn.lock
**/package-lock.json
**/pulumi-backstage-*.tgz
# macOS
Expand All @@ -21,7 +21,7 @@ coverage
# Dependencies
node_modules/

# Yarn 3 files
# Yarn files
.pnp.*
.yarn/*
!.yarn/patches
Expand Down
925 changes: 925 additions & 0 deletions .yarn/releases/yarn-4.4.1.cjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.4.1.cjs
26 changes: 18 additions & 8 deletions app-config.production.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
app:
# Should be the same as backend.baseUrl when using the `app-backend` plugin.
app: # Should be the same as backend.baseUrl when using the `app-backend` plugin.
baseUrl: http://localhost:7007

backend:
# Note that the baseUrl should be the URL that the browser and other clients
backend: # Note that the baseUrl should be the URL that the browser and other clients
# should use when communicating with the backend, i.e. it needs to be
# reachable not just from within the backend host, but from all of your
# callers. When its value is "http://localhost:7007", it's strictly private
Expand All @@ -30,10 +28,22 @@ backend:

auth:
providers:
guest: null
guest: {}

catalog:
# Overrides the default list locations from app-config.yaml as these contain example data.
catalog: # Overrides the default list locations from app-config.yaml as these contain example data.
# See https://backstage.io/docs/features/software-catalog/#adding-components-to-the-catalog for more details
# on how to get entities into the catalog.
locations: []
locations: # Local example data, replace this with your production config, these are intended for demo use only.
# File locations are relative to the backend process, typically in a deployed context, such as in a Docker container, this will be the root
- type: file
target: ./examples/entities.yaml
# Local example template
- type: file
target: ./examples/template/template.yaml
rules:
- allow: [Template]
# Local example organizational data
- type: file
target: ./examples/org.yaml
rules:
- allow: [User, Group]
7 changes: 7 additions & 0 deletions app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,10 @@ catalog:
# target: https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/acme-corp.yaml
# rules:
# - allow: [User, Group]

kubernetes:
# see https://backstage.io/docs/features/kubernetes/configuration for kubernetes configuration options
# see https://backstage.io/docs/permissions/getting-started for more on the permission framework
permission:
# setting this to `false` will disable permissions
enabled: true
2 changes: 1 addition & 1 deletion backstage.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "1.28.4"
"version": "1.31.2"
}
6 changes: 0 additions & 6 deletions lerna.json

This file was deleted.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"node": "18 || 20"
},
"scripts": {
"dev": "concurrently \"yarn start\" \"yarn start-backend\"",
"dev": "yarn workspaces foreach -A --include backend --include app --parallel -v -i run start",
"start": "yarn workspace app start",
"start-backend": "yarn workspace backend start",
"build:backend": "yarn workspace backend build",
Expand All @@ -30,7 +30,7 @@
]
},
"devDependencies": {
"@backstage/cli": "^0.26.10",
"@backstage/cli": "^0.27.1",
"@backstage/e2e-test-utils": "^0.1.1",
"@playwright/test": "^1.32.3",
"@spotify/prettier-config": "^12.0.0",
Expand All @@ -53,5 +53,6 @@
"*.{json,md}": [
"prettier --write"
]
}
},
"packageManager": "yarn@4.4.1"
}
53 changes: 27 additions & 26 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,33 @@
"lint": "backstage-cli package lint"
},
"dependencies": {
"@backstage/app-defaults": "^1.5.7",
"@backstage/catalog-model": "^1.5.0",
"@backstage/cli": "^0.26.10",
"@backstage/core-app-api": "^1.13.0",
"@backstage/core-components": "^0.14.8",
"@backstage/core-plugin-api": "^1.9.3",
"@backstage/integration-react": "^1.1.28",
"@backstage/plugin-api-docs": "^0.11.6",
"@backstage/plugin-catalog": "^1.21.0",
"@backstage/plugin-catalog-common": "^1.0.24",
"@backstage/plugin-catalog-graph": "^0.4.6",
"@backstage/plugin-catalog-import": "^0.12.0",
"@backstage/plugin-catalog-react": "^1.12.1",
"@backstage/plugin-org": "^0.6.26",
"@backstage/plugin-permission-react": "^0.4.23",
"@backstage/plugin-scaffolder": "^1.22.0",
"@backstage/plugin-scaffolder-react": "^1.9.0",
"@backstage/plugin-search": "^1.4.13",
"@backstage/plugin-search-react": "^1.7.12",
"@backstage/plugin-techdocs": "^1.10.6",
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.11",
"@backstage/plugin-techdocs-react": "^1.2.5",
"@backstage/plugin-user-settings": "^0.8.8",
"@backstage/theme": "^0.5.6",
"@backstage-community/plugin-github-actions": "^0.6.16",
"@backstage-community/plugin-tech-radar": "^0.7.4",
"@backstage/app-defaults": "^1.5.11",
"@backstage/catalog-model": "^1.7.0",
"@backstage/cli": "^0.27.1",
"@backstage/core-app-api": "^1.15.0",
"@backstage/core-components": "^0.15.0",
"@backstage/core-plugin-api": "^1.9.4",
"@backstage/integration-react": "^1.1.32",
"@backstage/plugin-api-docs": "^0.11.10",
"@backstage/plugin-catalog": "^1.23.1",
"@backstage/plugin-catalog-common": "^1.1.0",
"@backstage/plugin-catalog-graph": "^0.4.10",
"@backstage/plugin-catalog-import": "^0.12.4",
"@backstage/plugin-catalog-react": "^1.13.1",
"@backstage/plugin-kubernetes": "^0.11.14",
"@backstage/plugin-org": "^0.6.30",
"@backstage/plugin-permission-react": "^0.4.26",
"@backstage/plugin-scaffolder": "^1.25.1",
"@backstage/plugin-scaffolder-react": "^1.12.1",
"@backstage/plugin-search": "^1.4.17",
"@backstage/plugin-search-react": "^1.8.0",
"@backstage/plugin-techdocs": "^1.10.10",
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.15",
"@backstage/plugin-techdocs-react": "^1.2.8",
"@backstage/plugin-user-settings": "^0.8.13",
"@backstage/theme": "^0.5.7",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@pulumi/backstage-plugin-pulumi": "^0.1.0",
Expand All @@ -51,12 +52,12 @@
"react-use": "^17.2.4"
},
"devDependencies": {
"@backstage/test-utils": "^1.5.7",
"@backstage/test-utils": "^1.6.0",
"@playwright/test": "^1.32.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": "^9.0.0",
"@types/react-dom": "*",
"cross-env": "^7.0.0"
},
Expand Down
7 changes: 7 additions & 0 deletions packages/app/src/components/Root/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,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 @@ -65,6 +67,11 @@ 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={LibraryBooks} to="docs" text="Docs" />
<SidebarItem icon={CreateComponentIcon} to="create" text="Create..." />
Expand Down
21 changes: 21 additions & 0 deletions packages/app/src/components/catalog/EntityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ import {
PulumiComponent
} from '@pulumi/backstage-plugin-pulumi';

import {
EntityKubernetesContent,
isKubernetesAvailable,
} from '@backstage/plugin-kubernetes';

import {TechDocsAddons} from '@backstage/plugin-techdocs-react';
import {ReportIssue} from '@backstage/plugin-techdocs-module-addons-contrib';

Expand Down Expand Up @@ -183,6 +188,14 @@ const serviceEntityPage = (
{cicdContent}
</EntityLayout.Route>

<EntityLayout.Route
path="/kubernetes"
title="Kubernetes"
if={isKubernetesAvailable}
>
<EntityKubernetesContent />
</EntityLayout.Route>

<EntityLayout.Route path="/api" title="API">
<Grid container spacing={3} alignItems="stretch">
<Grid item md={6}>
Expand All @@ -194,6 +207,14 @@ const serviceEntityPage = (
</Grid>
</EntityLayout.Route>

<EntityLayout.Route
path="/kubernetes"
title="Kubernetes"
if={isKubernetesAvailable}
>
<EntityKubernetesContent />
</EntityLayout.Route>

<EntityLayout.Route path="/dependencies" title="Dependencies">
<Grid container spacing={3} alignItems="stretch">
<Grid item md={6}>
Expand Down
27 changes: 20 additions & 7 deletions packages/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
#
# Before building this image, be sure to have run the following commands in the repo root:
#
# yarn install
# yarn install --immutable
# yarn tsc
# yarn build:backend
#
# Once the commands have been run, you can build the image using `yarn build-image`

FROM --platform=linux/amd64 node:18-bookworm-slim
FROM --platform=linux/amd64 node:20-bookworm-slim

# Set Python interpreter for `node-gyp` to use
ENV PYTHON=/usr/bin/python3
RUN <<EOF
## Install pulumi and set to PATH
curl -fsSL https://get.pulumi.com | sh
Expand All @@ -22,14 +24,16 @@ EOF
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && \
apt-get install -y --no-install-recommends python3 g++ build-essential
apt-get install -y --no-install-recommends python3 g++ build-essential && \
rm -rf /var/lib/apt/lists/*

# Install sqlite3 dependencies. You can skip this if you don't use sqlite3 in the image,
# in which case you should also move better-sqlite3 to "devDependencies" in package.json.
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && \
apt-get install -y --no-install-recommends libsqlite3-dev
apt-get install -y --no-install-recommends libsqlite3-dev && \
rm -rf /var/lib/apt/lists/*

# From here on we use the least-privileged `node` user to run the backend.
USER node
Expand All @@ -39,9 +43,15 @@ USER node
# If this occurs, then ensure BuildKit is enabled (`DOCKER_BUILDKIT=1`) so the app dir is correctly created as `node`.
WORKDIR /app

# Copy files needed by Yarn
COPY --chown=node:node .yarn ./.yarn
COPY --chown=node:node .yarnrc.yml ./

# This switches many Node.js dependencies to production mode.
ENV NODE_ENV production
ENV PYTHON /usr/bin/python3
ENV NODE_ENV=production

# This disables node snapshot for Node 20 to work with the Scaffolder
ENV NODE_OPTIONS "--no-node-snapshot"

# Copy repo skeleton first, to avoid unnecessary docker cache invalidation.
# The skeleton contains the package.json of each package in the monorepo,
Expand All @@ -50,7 +60,10 @@ COPY --chown=node:node yarn.lock package.json packages/backend/dist/skeleton.tar
RUN tar xzf skeleton.tar.gz && rm skeleton.tar.gz

RUN --mount=type=cache,target=/home/node/.cache/yarn,sharing=locked,uid=1000,gid=1000 \
yarn install --frozen-lockfile --production --network-timeout 300000
yarn workspaces focus --all --production && rm -rf "$(yarn cache clean)"

# This will include the examples, if you don't need these simply remove this line
COPY --chown=node:node examples ./examples

# Then copy the rest of the backend bundle, along with any other files we might want.
COPY --chown=node:node packages/backend/dist/bundle.tar.gz app-config*.yaml ./
Expand Down
Loading

0 comments on commit 99b9e8f

Please sign in to comment.