Skip to content

Commit 6cc56bc

Browse files
committed
feat: New baseline on Backstage 1.30.0
1 parent 82bb455 commit 6cc56bc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+26687
-257
lines changed

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ packages/*/src
66
packages/*/node_modules
77
plugins
88
*.local.yaml
9+
.github
10+
compose.yml
11+
*.md
12+
demo-catalog

.github/workflows/commit-stage.yml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env:
1010
jobs:
1111
build:
1212
name: Build
13-
runs-on: ubuntu-22.04
13+
runs-on: ubuntu-24.04
1414
permissions:
1515
contents: read
1616
steps:
@@ -20,25 +20,41 @@ jobs:
2020
- name: Set up Node
2121
uses: actions/setup-node@v4
2222
with:
23-
node-version-file: '.nvmrc'
23+
node-version: 20
2424
cache: 'yarn'
2525

2626
- name: Install dependencies
2727
run: |
2828
yarn install --frozen-lockfile
29+
30+
- name: Validate configuration
31+
run: |
32+
yarn backstage-cli config:check --lax
33+
34+
- name: Validate types and definitions
35+
run: |
36+
yarn tsc:full
2937
3038
- name: Prettier
3139
run: |
32-
yarn run prettier:check
40+
yarn prettier:check
3341
34-
- name: Compile and test
42+
- name: Build
43+
run: |
44+
yarn build:all
45+
46+
- name: Lint
47+
run: |
48+
yarn lint:all
49+
50+
- name: Test
3551
run: |
36-
yarn run ci
52+
yarn test:all
3753
3854
package:
3955
if: ${{ github.ref == 'refs/heads/main' }}
4056
needs: [ build ]
41-
runs-on: ubuntu-22.04
57+
runs-on: ubuntu-24.04
4258
permissions:
4359
contents: read
4460
packages: write
@@ -55,7 +71,7 @@ jobs:
5571
- name: Set up Node
5672
uses: actions/setup-node@v4
5773
with:
58-
node-version-file: '.nvmrc'
74+
node-version: 20
5975
cache: 'yarn'
6076

6177
- name: Install dependencies
@@ -127,7 +143,7 @@ jobs:
127143
merge:
128144
if: ${{ github.ref == 'refs/heads/main' }}
129145
needs: [package]
130-
runs-on: ubuntu-22.04
146+
runs-on: ubuntu-24.04
131147
permissions:
132148
contents: read
133149
packages: write
@@ -144,7 +160,7 @@ jobs:
144160
uses: docker/setup-buildx-action@v3
145161

146162
- name: Install Cosign
147-
uses: sigstore/cosign-installer@v3.4.0
163+
uses: sigstore/cosign-installer@v3.5.0
148164

149165
- name: Generate Docker meta information
150166
id: meta

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ coverage
55
.github
66
compose.yml
77
CODE_OF_CONDUCT.md
8-
MAINTAINERS.md
8+
MAINTAINERS.md
9+
demo-catalog

app-config.production.yaml

Lines changed: 18 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,35 @@
11
app:
22
# Should be the same as backend.baseUrl when using the `app-backend` plugin.
3-
baseUrl: http://localhost:7007
3+
baseUrl: ${BACKSTAGE_BASE_URL}
44

55
backend:
66
# Note that the baseUrl should be the URL that the browser and other clients
77
# should use when communicating with the backend, i.e. it needs to be
88
# reachable not just from within the backend host, but from all of your
99
# callers. When its value is "http://localhost:7007", it's strictly private
1010
# and can't be reached by others.
11-
baseUrl: http://localhost:7007
11+
baseUrl: ${BACKSTAGE_BASE_URL}
12+
cors:
13+
origin: ${BACKSTAGE_BASE_URL}
1214
# The listener can also be expressed as a single <host>:<port> string. In this case we bind to
1315
# all interfaces, the most permissive setting. The right value depends on your specific deployment.
1416
listen: ':7007'
15-
16-
# config options: https://node-postgres.com/apis/client
17-
database:
18-
client: pg
19-
connection:
20-
host: ${POSTGRES_HOST}
21-
port: ${POSTGRES_PORT}
22-
user: ${POSTGRES_USER}
23-
password: ${POSTGRES_PASSWORD}
24-
# https://node-postgres.com/features/ssl
25-
# you can set the sslmode configuration option via the `PGSSLMODE` environment variable
26-
# see https://www.postgresql.org/docs/current/libpq-ssl.html Table 33.1. SSL Mode Descriptions (e.g. require)
27-
# ssl:
28-
# ca: # if you have a CA file and want to verify it you can uncomment this section
29-
# $file: <file-path>/ca/server.crt
17+
# listen:
18+
# port: 7007
3019

3120
auth:
21+
environment: production
3222
providers:
33-
guest: {}
23+
# See https://backstage.io/docs/auth/github/provider
24+
github:
25+
production:
26+
clientId: ${AUTH_GITHUB_CLIENT_ID}
27+
clientSecret: ${AUTH_GITHUB_CLIENT_SECRET}
28+
## uncomment if using GitHub Enterprise
29+
# enterpriseInstanceUrl: ${AUTH_GITHUB_ENTERPRISE_INSTANCE_URL}
30+
signIn:
31+
resolvers:
32+
- resolver: usernameMatchingUserEntityName
3433

3534
catalog:
36-
# Overrides the default list locations from app-config.yaml as these contain example data.
37-
# See https://backstage.io/docs/features/software-catalog/#adding-components-to-the-catalog for more details
38-
# on how to get entities into the catalog.
39-
locations:
40-
# Local example data, replace this with your production config, these are intended for demo use only.
41-
# File locations are relative to the backend process, typically in a deployed context, such as in a Docker container, this will be the root
42-
- type: file
43-
target: ./examples/entities.yaml
44-
45-
# Local example template
46-
- type: file
47-
target: ./examples/template/template.yaml
48-
rules:
49-
- allow: [Template]
50-
51-
# Local example organizational data
52-
- type: file
53-
target: ./examples/org.yaml
54-
rules:
55-
- allow: [User, Group]
35+
locations: []

app-config.yaml

Lines changed: 61 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
app:
2-
title: Scaffolded Backstage App
2+
title: Kadras Developer Portal
33
baseUrl: http://localhost:3000
44

55
organization:
6-
name: My Company
6+
name: Kadras
77

88
backend:
9-
# Used for enabling authentication, secret is shared by all backend plugins
10-
# See https://backstage.io/docs/auth/service-to-service-auth for
11-
# information on the format
12-
# auth:
13-
# keys:
14-
# - secret: ${BACKEND_SECRET}
159
baseUrl: http://localhost:7007
1610
listen:
1711
port: 7007
@@ -25,12 +19,24 @@ backend:
2519
origin: http://localhost:3000
2620
methods: [GET, HEAD, PATCH, POST, PUT, DELETE]
2721
credentials: true
28-
# This is for local development only, it is not recommended to use this in production
29-
# The production database configuration is stored in app-config.production.yaml
22+
# Config options: https://node-postgres.com/apis/client
3023
database:
31-
client: better-sqlite3
32-
connection: ':memory:'
24+
client: pg
25+
connection:
26+
host: ${POSTGRES_HOST}
27+
port: ${POSTGRES_PORT}
28+
user: ${POSTGRES_USER}
29+
password: ${POSTGRES_PASSWORD}
30+
# https://node-postgres.com/features/ssl
31+
# you can set the sslmode configuration option via the `PGSSLMODE` environment variable
32+
# see https://www.postgresql.org/docs/current/libpq-ssl.html Table 33.1. SSL Mode Descriptions (e.g. require)
33+
# ssl:
34+
# ca: # if you have a CA file and want to verify it you can uncomment this section
35+
# $file: <file-path>/ca/server.crt
3336
# workingDirectory: /tmp # Use this to configure a working directory for the scaffolder, defaults to the OS temp-dir
37+
# reading:
38+
# allow:
39+
# - host: "*.swagger.io"
3440

3541
integrations:
3642
github:
@@ -63,49 +69,68 @@ techdocs:
6369
type: 'local' # Alternatives - 'googleGcs' or 'awsS3'. Read documentation for using alternatives.
6470

6571
auth:
66-
# see https://backstage.io/docs/auth/ to learn about auth providers
72+
# See https://backstage.io/docs/auth/autologout
73+
autologout:
74+
enabled: false
75+
idleTimeoutMinutes: 60
76+
promptBeforeIdleSeconds: 10
77+
useWorkerTimers: true
78+
logoutIfDisconnected: true
79+
environment: development
80+
# See https://backstage.io/docs/auth
6781
providers:
68-
# See https://backstage.io/docs/auth/guest/provider
69-
guest: {}
82+
# See https://backstage.io/docs/auth/github/provider
83+
github:
84+
development:
85+
clientId: ${AUTH_GITHUB_CLIENT_ID}
86+
clientSecret: ${AUTH_GITHUB_CLIENT_SECRET}
87+
## uncomment if using GitHub Enterprise
88+
# enterpriseInstanceUrl: ${AUTH_GITHUB_ENTERPRISE_INSTANCE_URL}
89+
signIn:
90+
resolvers:
91+
- resolver: usernameMatchingUserEntityName
92+
# - resolver: emailMatchingUserEntityProfileEmail
93+
# - resolver: emailLocalPartMatchingUserEntityName
94+
95+
enableExperimentalRedirectFlow: false
7096

7197
scaffolder:
7298
# see https://backstage.io/docs/features/software-templates/configuration for software template options
99+
defaultAuthor:
100+
name: Kadras Developer Portal
101+
102+
defaultCommitMessage: 'Initial commit'
73103

74104
catalog:
75105
import:
76106
entityFilename: catalog-info.yaml
77107
pullRequestBranchName: backstage-integration
78108
rules:
79-
- allow: [Component, System, API, Resource, Location]
109+
- allow: [API, Component, Location, Resource, System]
80110
locations:
81-
# Local example data, file locations are relative to the backend process, typically `packages/backend`
111+
# Users and Groups
82112
- type: file
83-
target: ../../examples/entities.yaml
84-
85-
# Local example template
113+
target: ../../demo-catalog/organizations/organization-kadras.yml
114+
rules:
115+
- allow: [Group, Location, User]
86116
- type: file
87-
target: ../../examples/template/template.yaml
117+
target: ../../demo-catalog/organizations/organization-guest.yml
88118
rules:
89-
- allow: [Template]
119+
- allow: [Group, User]
90120

91-
# Local example organizational data
121+
# Templates
92122
- type: file
93-
target: ../../examples/org.yaml
123+
target: ../../demo-catalog/templates/templates.yml
94124
rules:
95-
- allow: [User, Group]
96-
97-
## Uncomment these lines to add more example data
98-
# - type: url
99-
# target: https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/all.yaml
100-
101-
## Uncomment these lines to add an example org
102-
# - type: url
103-
# target: https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/acme-corp.yaml
104-
# rules:
105-
# - allow: [User, Group]
125+
- allow: [Location, Template]
106126

127+
# see https://backstage.io/docs/features/kubernetes/configuration for kubernetes configuration options
107128
kubernetes:
108-
# see https://backstage.io/docs/features/kubernetes/configuration for kubernetes configuration options
129+
serviceLocatorMethod:
130+
type: 'multiTenant'
131+
clusterLocatorMethods:
132+
- type: 'config'
133+
clusters: []
109134

110135
# see https://backstage.io/docs/permissions/getting-started for more on the permission framework
111136
permission:

compose.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
services:
2+
3+
postgres:
4+
image: docker.io/library/postgres:16.4-alpine
5+
container_name: "postgres"
6+
ports:
7+
- 5432:5432
8+
environment:
9+
POSTGRES_USER: user
10+
POSTGRES_PASSWORD: password
11+
12+
backstage:
13+
image: backstage
14+
container_name: "backstage"
15+
depends_on:
16+
- postgres
17+
ports:
18+
- 7007:7007
19+
environment:
20+
- BACKSTAGE_BASE_URL=http://localhost:7007
21+
- POSTGRES_HOST=postgres
22+
- POSTGRES_PORT=5432
23+
- POSTGRES_USER=user
24+
- POSTGRES_PASSWORD=password
25+
- GITHUB_TOKEN
26+
- AUTH_GITHUB_CLIENT_ID
27+
- AUTH_GITHUB_CLIENT_SECRET
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
---
2-
# https://backstage.io/docs/features/software-catalog/descriptor-format#kind-user
3-
apiVersion: backstage.io/v1alpha1
4-
kind: User
5-
metadata:
6-
name: guest
7-
spec:
8-
memberOf: [guests]
9-
---
10-
# https://backstage.io/docs/features/software-catalog/descriptor-format#kind-group
112
apiVersion: backstage.io/v1alpha1
123
kind: Group
134
metadata:
145
name: guests
156
spec:
167
type: team
178
children: []
9+
10+
---
11+
apiVersion: backstage.io/v1alpha1
12+
kind: User
13+
metadata:
14+
name: guest
15+
spec:
16+
memberOf: [guests]

0 commit comments

Comments
 (0)