Merge branch 'backstage:master' into feature/support-aoss

This commit is contained in:
Andrew Ochsner
2023-10-25 17:41:56 -05:00
committed by GitHub
668 changed files with 16849 additions and 2654 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-techdocs-node': patch
---
Switch to `@smithy/node-http-handler` instead of the `@aws-sdk/node-http-handler`
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/plugin-vault-node': minor
---
Initial version of the `plugin-vault-node`` package. It contains the extension point definitions
for the vault backend, as well as some types that will be deprecated in the backend plugin.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend-module-backstage-openapi': minor
---
Adds a new catalog module for ingesting Backstage plugin OpenAPI specs into the catalog for display as an API entity.
+33
View File
@@ -0,0 +1,33 @@
---
'@backstage/plugin-vault-backend': minor
---
Added support for the [new backend system](https://backstage.io/docs/backend-system/).
In your `packages/backend/src/index.ts` make the following changes:
```diff
import { createBackend } from '@backstage/backend-defaults';
const backend = createBackend();
// ... other feature additions
+ backend.add(import('@backstage/plugin-vault-backend');
backend.start();
```
If you use the new backend system, the token renewal task can be defined via configuration file:
```diff
vault:
baseUrl: <BASE_URL>
token: <TOKEN>
schedule:
+ frequency: ...
+ timeout: ...
+ # Other schedule options, such as scope or initialDelay
```
If the `schedule` is omitted or set to `false` no token renewal task will be scheduled.
If the value of `schedule` is set to `true` the renew will be scheduled hourly (the default).
In other cases (like in the diff above), the defined schedule will be used.
**DEPRECATIONS**: The interface `VaultApi` and the type `VaultSecret` are now deprecated. Import them from `@backstage/plugin-vault-node`.
+17
View File
@@ -0,0 +1,17 @@
---
'@backstage/plugin-catalog-react': minor
---
Added an `EntityPresentationApi` and associated `entityPresentationApiRef`. This
API lets you control how references to entities (e.g. in links, headings,
iconography etc) are represented in the user interface.
Usage of this API is initially added to the `EntityRefLink` and `EntityRefLinks`
components, so that they can render richer, more correct representation of
entity refs. There's also a new `EntityDisplayName` component, which works just like
the `EntityRefLink` but without the link.
Along with that change, the `fetchEntities` and `getTitle` props of
`EntityRefLinksProps` are deprecated and no longer used, since the same need
instead is fulfilled (and by default always enabled) by the
`entityPresentationApiRef`.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-bazaar': patch
---
Adding descending sort in a bazaar plugin
+16
View File
@@ -0,0 +1,16 @@
---
'@backstage/plugin-catalog-backend': minor
---
Introduce a new optional config parameter `catalog.stitchingStrategy.mode`,
which can have the values `'immediate'` (default) and `'deferred'`. The default
is for stitching to work as it did before this change, which means that it
happens "in-band" (blocking) immediately when each processing task finishes.
When set to `'deferred'`, stitching is instead deferred to happen on a separate
asynchronous worker queue just like processing.
Deferred stitching should make performance smoother when ingesting large amounts
of entities, and reduce p99 processing times and repeated over-stitching of
hot spot entities when fan-out/fan-in in terms of relations is very large. It
does however also come with some performance cost due to the queuing with how
much wall-clock time some types of task take.
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/plugin-catalog-backend': patch
'@backstage/plugin-search-backend': patch
---
Update the OpenAPI spec with more complete error responses and request bodies using Optic. Also, updates the test cases to use the new `supertest` pass through from `@backstage/backend-openapi-utils`.
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/repo-tools': minor
---
Adds a new command `schema openapi test` that performs runtime validation of your OpenAPI specs using your test data. Under the hood, we're using Optic to perform this check, really cool work by them!
To use this new command, you will have to run `yarn add @useoptic/optic` in the root of your repo.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-bazaar': patch
---
Added alert popup in the bazaar plugin
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-bazaar': patch
---
Removed unnecessary dependency on `@backstage/cli`.
+91 -2
View File
@@ -250,7 +250,96 @@
"@backstage/plugin-user-settings-backend": "0.2.4",
"@backstage/plugin-vault": "0.1.20",
"@backstage/plugin-vault-backend": "0.3.11",
"@backstage/plugin-xcmetrics": "0.2.44"
"@backstage/plugin-xcmetrics": "0.2.44",
"@backstage/core-compat-api": "0.0.0",
"@backstage/plugin-catalog-backend-module-backstage-openapi": "0.0.0",
"@backstage/plugin-search-backend-module-stack-overflow-collator": "0.0.0",
"@backstage/plugin-vault-node": "0.0.0"
},
"changesets": []
"changesets": [
"chatty-cobras-cheer",
"chilled-knives-rule",
"chilly-books-sneeze",
"chilly-terms-behave",
"dirty-ducks-behave",
"dry-days-invite",
"eighty-chairs-camp",
"fair-parrots-lick",
"fast-bears-lick",
"fifty-taxis-allow",
"flat-ducks-buy",
"fluffy-years-shake",
"four-files-behave",
"four-pears-swim",
"fresh-crews-promise",
"fresh-schools-thank",
"gentle-pears-camp",
"giant-cars-walk",
"giant-cycles-end",
"good-plums-confess",
"great-baboons-allow",
"healthy-shirts-fold",
"heavy-experts-accept",
"hip-mugs-camp",
"hungry-paws-dress",
"hungry-radios-play",
"large-forks-arrive",
"lazy-hotels-wait",
"long-turkeys-argue",
"loud-ghosts-deny",
"many-masks-smoke",
"mighty-crews-attack",
"modern-ducks-battle",
"nasty-colts-tickle",
"new-beers-drive",
"nice-apes-kneel",
"nice-pillows-poke",
"ninety-numbers-study",
"old-apricots-taste",
"old-chairs-switch",
"olive-paws-divide",
"plenty-tigers-argue",
"poor-seahorses-rush",
"popular-bikes-do",
"pretty-swans-worry",
"quick-pumpkins-shave",
"quick-roses-move",
"real-carrots-brake",
"real-jars-yawn",
"red-beers-roll",
"red-yaks-press",
"rich-pugs-chew",
"rude-tomatoes-itch",
"shaggy-beers-collect",
"shaggy-buses-beg",
"sharp-falcons-clean",
"shiny-geese-watch",
"sixty-tips-argue",
"small-buckets-roll",
"smart-dancers-watch",
"sour-toes-joke",
"stale-rice-count",
"strange-queens-deliver",
"strong-taxis-wait",
"sweet-buckets-fry",
"sweet-countries-share",
"swift-mice-care",
"tall-colts-roll",
"tender-lies-wonder",
"tender-maps-type",
"thick-dolphins-boil",
"thirty-stingrays-grin",
"three-moles-mix",
"tidy-camels-boil",
"tricky-cups-hammer",
"tricky-vans-behave",
"violet-lamps-appear",
"wet-cows-brake",
"wicked-ties-knock",
"wild-cows-watch",
"wild-geese-occur",
"wise-waves-approve",
"wise-weeks-design",
"young-days-talk"
]
}
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-auth-backend-module-microsoft-provider': patch
---
Correctly mark the client secret in configuration as secret
+1 -1
View File
@@ -2,4 +2,4 @@
'@backstage/plugin-search-backend-module-techdocs': patch
---
The process of adding or modifying fields in the techdocs search index has been simplified. For more details, see [How to customize fields in the Software Catalog or TechDocs index](../docs/features/search/how-to-guides.md#how-to-customize-fields-in-the-software-catalog-or-techdocs-index).
The process of adding or modifying fields in the techdocs search index has been simplified. For more details, see [How to customize fields in the Software Catalog or TechDocs index](https://backstage.io/docs/features/search/how-to-guides.md#how-to-customize-fields-in-the-software-catalog-or-techdocs-index).
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-app-api': patch
---
Add current and default scopes when refreshing session
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-test-utils': patch
---
Ensure recursive deletion of temporary directories in tests
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-plugin-api': minor
---
`IconComponent` can now have a `fontSize` of `inherit`, which is useful for in-line icons.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-auth-backend': minor
---
Adds the StaticTokenIssuer and StaticKeyStore, an alternative token issuer that can be used to sign the Authorization header using a predefined public/private key pair.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-openapi-utils': minor
---
Adds a new route, `/openapi.json` to validated routers for displaying their full OpenAPI spec in a standard endpoint.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-openapi-utils': patch
---
Adds a new function `wrapInOpenApiTestServer` that allows for proxied requests at runtime. This will support the new `yarn backstage-repo-tools schema openapi test` command.
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/plugin-techdocs-backend': minor
'@backstage/plugin-techdocs-node': minor
---
Expose an extension point to set a custom build strategy. Also move `DocsBuildStrategy` type to `@backstage/plugin-techdocs-node` and deprecate `ShouldBuildParameters` type.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-search-react': patch
---
Minor refactor of search bar analytics capture
+10
View File
@@ -0,0 +1,10 @@
---
'@backstage/plugin-catalog': minor
---
Added the `DefaultEntityPresentationApi`, which is an implementation of the
`EntityPresentationApi` that `@backstage/plugin-catalog-react` exposes through
its `entityPresentationApiRef`. This implementation is also by default made
available automatically by the catalog plugin, unless you replace it with a
custom one. It batch fetches and caches data from the catalog as needed for
display, and is customizable by adopters to add their own rendering functions.
+1
View File
@@ -29,6 +29,7 @@ yarn.lock @backstage/maintainers @backst
/plugins/catalog-* @backstage/maintainers @backstage/reviewers @backstage/catalog-maintainers
/plugins/catalog-backend-module-aws @backstage/maintainers @backstage/reviewers @backstage/catalog-maintainers @pjungermann
/plugins/catalog-backend-module-bitbucket-cloud @backstage/maintainers @backstage/reviewers @backstage/catalog-maintainers @pjungermann
/plugins/catalog-backend-module-backstage-openapi @backstage/maintainers @backstage/reviewers @backstage/openapi-tooling-maintainers
/plugins/catalog-backend-module-msgraph @backstage/maintainers @backstage/reviewers @backstage/catalog-maintainers @pjungermann
/plugins/catalog-backend-module-puppetdb @backstage/maintainers @backstage/reviewers @backstage/catalog-maintainers
/plugins/catalog-graph @backstage/maintainers @backstage/reviewers @backstage/catalog-maintainers @backstage/sda-se-reviewers
+2
View File
@@ -258,6 +258,7 @@ onboarding
Onboarding
OpenSearch
OpenShift
openssl
orgs
padding
paddings
@@ -291,6 +292,7 @@ Preprarer
productional
Protobuf
proxying
proxied
Proxying
pseudonymized
pubsub
@@ -27,7 +27,7 @@ jobs:
with:
egress-policy: audit
- uses: actions/checkout@v3.6.0
- uses: actions/checkout@v4.1.1
with:
# Fetch the commit that's merged into the base rather than the target ref
# This will let us diff only the contents of the PR, without fetching more history
+1 -1
View File
@@ -28,7 +28,7 @@ jobs:
with:
egress-policy: audit
- uses: actions/checkout@v3.6.0
- uses: actions/checkout@v4.1.1
with:
ref: '${{ github.event.pull_request.merge_commit_sha }}'
+1 -1
View File
@@ -19,7 +19,7 @@ jobs:
with:
egress-policy: audit
- uses: actions/stale@v7.0.0
- uses: actions/stale@v8.0.0
id: stale
with:
stale-issue-message: >
+10 -6
View File
@@ -31,10 +31,10 @@ jobs:
with:
egress-policy: audit
- uses: actions/checkout@v3.6.0
- uses: actions/checkout@v4.1.1
- name: use node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v3.8.2
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/ # Needed for auth
@@ -67,10 +67,10 @@ jobs:
with:
egress-policy: audit
- uses: actions/checkout@v3.6.0
- uses: actions/checkout@v4.1.1
- name: use node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v3.8.2
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/ # Needed for auth
@@ -196,12 +196,12 @@ jobs:
INTEGRATION_TEST_AZURE_TOKEN: ${{ secrets.INTEGRATION_TEST_AZURE_TOKEN }}
steps:
- uses: actions/checkout@v3.6.0
- uses: actions/checkout@v4.1.1
- name: fetch branch master
run: git fetch origin master
- name: use node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v3.8.2
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/ # Needed for auth
@@ -222,6 +222,10 @@ jobs:
BACKSTAGE_TEST_DATABASE_POSTGRES9_CONNECTION_STRING: postgresql://postgres:postgres@localhost:${{ job.services.postgres9.ports[5432] }}
BACKSTAGE_TEST_DATABASE_MYSQL8_CONNECTION_STRING: mysql://root:root@localhost:${{ job.services.mysql8.ports[3306] }}/ignored
# We run the test cases before verifying the specs to prevent any failing tests from causing errors.
- name: verify openapi specs against test cases
run: yarn backstage-repo-tools schema openapi test
- name: ensure clean working directory
run: |
if files=$(git ls-files --exclude-standard --others --modified) && [[ -z "$files" ]]; then
+2 -2
View File
@@ -19,13 +19,13 @@ jobs:
egress-policy: audit
- name: checkout
uses: actions/checkout@v3.6.0
uses: actions/checkout@v4.1.1
with:
path: backstage
ref: v${{ github.event.client_payload.version }}
- name: use node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v3.8.2
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/ # Needed for auth
+2 -2
View File
@@ -28,10 +28,10 @@ jobs:
with:
egress-policy: audit
- uses: actions/checkout@v3.6.0
- uses: actions/checkout@v4.1.1
- name: use node.js 18.x
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v3.8.2
with:
node-version: 18.x
registry-url: https://registry.npmjs.org/ # Needed for auth
+2 -2
View File
@@ -19,10 +19,10 @@ jobs:
with:
egress-policy: audit
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: use node.js 18.x
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version: 18.x
registry-url: https://registry.npmjs.org/ # Needed for auth
+4 -4
View File
@@ -60,10 +60,10 @@ jobs:
INTEGRATION_TEST_AZURE_TOKEN: ${{ secrets.INTEGRATION_TEST_AZURE_TOKEN }}
steps:
- uses: actions/checkout@v3.6.0
- uses: actions/checkout@v4.1.1
- name: use node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v3.8.2
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/ # Needed for auth
@@ -142,10 +142,10 @@ jobs:
with:
egress-policy: audit
- uses: actions/checkout@v3.6.0
- uses: actions/checkout@v4.1.1
- name: use node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v3.8.2
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/ # Needed for auth
+1 -1
View File
@@ -34,7 +34,7 @@ jobs:
egress-policy: audit
- name: 'Checkout code'
uses: actions/checkout@v3.6.0
uses: actions/checkout@v4.1.1
with:
persist-credentials: false
+2 -2
View File
@@ -14,13 +14,13 @@ jobs:
with:
egress-policy: audit
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
# Fetch changes to previous commit - required for 'only_changed' in Prettier action
fetch-depth: 0
- name: use node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v3.8.2
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/ # Needed for auth
@@ -16,7 +16,7 @@ jobs:
egress-policy: audit
- name: Checkout
uses: actions/checkout@v3.6.0
uses: actions/checkout@v4.1.1
with:
fetch-depth: 2
ref: ${{ github.head_ref }}
+3 -3
View File
@@ -13,7 +13,7 @@ jobs:
egress-policy: audit
# Setup node & install deps before checkout, keeping install quick
- uses: actions/setup-node@v3.8.1
- uses: actions/setup-node@v3.8.2
with:
node-version: 18.x
- name: Install dependencies
@@ -21,7 +21,7 @@ jobs:
run: npm install semver@7.3.5 fs-extra@10.0.0 @manypkg/get-packages@1.1.1
- name: Checkout
uses: actions/checkout@v3.6.0
uses: actions/checkout@v4.1.1
with:
path: backstage
# 'v' prefix is added here for the tag, we keep it out of the manifest logic
@@ -29,7 +29,7 @@ jobs:
# Checkout backstage/versions into /backstage/versions, which is where store the output
- name: Checkout versions
uses: actions/checkout@v3.6.0
uses: actions/checkout@v4.1.1
with:
repository: backstage/versions
path: backstage/versions
@@ -16,7 +16,7 @@ jobs:
egress-policy: audit
- name: Checkout
uses: actions/checkout@v3.6.0
uses: actions/checkout@v4.1.1
with:
fetch-depth: 2
ref: ${{ github.head_ref }}
@@ -16,10 +16,10 @@ jobs:
with:
egress-policy: audit
- uses: actions/checkout@v3.6.0
- uses: actions/checkout@v4.1.1
- name: use node.js 18.x
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v3.8.2
with:
node-version: 18.x
registry-url: https://registry.npmjs.org/ # Needed for auth
@@ -29,7 +29,7 @@ jobs:
cache-prefix: ${{ runner.os }}-v18.x
- name: Create Snyk report
uses: snyk/actions/node@299cde98a08ff8b1c2bfde1e5a067bce67a6d2b8 # master
uses: snyk/actions/node@39091e69b560da335383b404e50d65b408f4f812 # master
continue-on-error: true # Snyk CLI exits with error when vulnerabilities are found
with:
args: >
+3 -3
View File
@@ -29,9 +29,9 @@ jobs:
with:
egress-policy: audit
- uses: actions/checkout@v3.6.0
- uses: actions/checkout@v4.1.1
- name: Monitor and Synchronize Snyk Policies
uses: snyk/actions/node@299cde98a08ff8b1c2bfde1e5a067bce67a6d2b8 # master
uses: snyk/actions/node@39091e69b560da335383b404e50d65b408f4f812 # master
with:
command: monitor
args: >
@@ -46,7 +46,7 @@ jobs:
# Above we run the `monitor` command, this runs the `test` command which is
# the one that generates the SARIF report that we can upload to GitHub.
- name: Create Snyk report
uses: snyk/actions/node@299cde98a08ff8b1c2bfde1e5a067bce67a6d2b8 # master
uses: snyk/actions/node@39091e69b560da335383b404e50d65b408f4f812 # master
continue-on-error: true # To make sure that SARIF upload gets called
with:
args: >
+1 -1
View File
@@ -18,7 +18,7 @@ jobs:
with:
egress-policy: audit
- uses: actions/checkout@v3.6.0
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 20000
fetch-tags: true
+3 -3
View File
@@ -25,10 +25,10 @@ jobs:
egress-policy: audit
- name: checkout
uses: actions/checkout@v3.6.0
uses: actions/checkout@v4.1.1
- name: setup-node
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v3.8.2
with:
node-version: 18.x
registry-url: https://registry.npmjs.org/
@@ -87,7 +87,7 @@ jobs:
egress-policy: audit
- name: Checkout git repo
uses: actions/checkout@v3.6.0
uses: actions/checkout@v4.1.1
- name: Render Compose File
run: |
BACKSTAGE_IMAGE=$(echo ${{ needs.build-backstage.outputs.tags }})
+2 -2
View File
@@ -24,9 +24,9 @@ jobs:
with:
egress-policy: audit
- uses: actions/checkout@v3.6.0
- uses: actions/checkout@v4.1.1
- name: Use Node.js 18.x
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v3.8.2
with:
node-version: 18.x
- name: yarn install
+1 -1
View File
@@ -47,7 +47,7 @@ jobs:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@v3.6.0
uses: actions/checkout@v4.1.1
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
+1 -1
View File
@@ -16,7 +16,7 @@ jobs:
with:
egress-policy: audit
- uses: actions/checkout@v3.6.0
- uses: actions/checkout@v4.1.1
# Vale does not support file excludes, so we use the script to generate a list of files instead
# The action also does not allow args or a local config file to be passed in, so the files array
+2 -2
View File
@@ -26,10 +26,10 @@ jobs:
with:
egress-policy: audit
- uses: actions/checkout@v3.6.0
- uses: actions/checkout@v4.1.1
- name: use node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v3.8.2
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/ # Needed for auth
+2 -2
View File
@@ -44,7 +44,7 @@ jobs:
with:
egress-policy: audit
- uses: actions/checkout@v3.6.0
- uses: actions/checkout@v4.1.1
- name: Configure Git
run: |
@@ -52,7 +52,7 @@ jobs:
git config --global user.name 'GitHub e2e user'
- name: use node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v3.8.2
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/ # Needed for auth
+2 -2
View File
@@ -34,8 +34,8 @@ jobs:
with:
egress-policy: audit
- uses: actions/checkout@v3.6.0
- uses: actions/setup-python@v4.7.0
- uses: actions/checkout@v4.1.1
- uses: actions/setup-python@v4.7.1
with:
python-version: '3.9'
+3 -3
View File
@@ -42,7 +42,7 @@ jobs:
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v3.6.0
- uses: actions/checkout@v4.1.1
- name: Configure Git
run: |
@@ -50,13 +50,13 @@ jobs:
git config --global user.name 'GitHub e2e user'
- name: use node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v3.8.2
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/ # Needed for auth
- name: setup python
uses: actions/setup-python@v4.7.0
uses: actions/setup-python@v4.7.1
with:
python-version: '3.10'
+1 -1
View File
@@ -19,7 +19,7 @@ jobs:
egress-policy: audit
- name: Checkout
uses: actions/checkout@v3.6.0
uses: actions/checkout@v4.1.1
- name: Install Fossa
run: "curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | bash"
+2 -2
View File
@@ -28,10 +28,10 @@ jobs:
with:
egress-policy: audit
- uses: actions/checkout@v3.6.0
- uses: actions/checkout@v4.1.1
- name: use node.js 18.x
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v3.8.2
with:
node-version: 18.x
+3 -3
View File
@@ -32,12 +32,12 @@ jobs:
with:
egress-policy: audit
- uses: actions/checkout@v3.6.0
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 0 # Required to retrieve git history
- name: use node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v3.8.2
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/ # Needed for auth
@@ -51,7 +51,7 @@ jobs:
- run: yarn build-storybook
- uses: chromaui/action@807600692d28833b717c155e15ed20905cdc865c # v1
- uses: chromaui/action@723135c179d14b28039985d79da5c3d6ee1ac32e # v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
# projectToken intentionally shared to allow collaborators to run Chromatic on forks
+2 -2
View File
@@ -33,10 +33,10 @@ jobs:
with:
egress-policy: audit
- uses: actions/checkout@v3.6.0
- uses: actions/checkout@v4.1.1
- name: use node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v3.8.2
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/ # Needed for auth
-1
View File
@@ -4,7 +4,6 @@
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![CNCF Status](https://img.shields.io/badge/cncf%20status-incubation-blue.svg)](https://www.cncf.io/projects)
[![Main CI Build](https://github.com/backstage/backstage/workflows/Main%20Master%20Build/badge.svg)](https://github.com/backstage/backstage/actions?query=workflow%3A%22Main+Master+Build%22)
[![Discord](https://img.shields.io/discord/687207715902193673)](https://discord.gg/backstage-687207715902193673)
![Code style](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)
[![Codecov](https://img.shields.io/codecov/c/github/backstage/backstage)](https://codecov.io/gh/backstage/backstage)
+6
View File
@@ -235,6 +235,12 @@ catalog:
- System
- Domain
- Location
providers:
openapi:
plugins:
- catalog
- search
- todo
processors:
ldapOrg:
+47
View File
@@ -406,3 +406,50 @@ providerFactories: {
ghe: providers.github.create(),
},
```
## Configuring token issuers
By default, the Backstage authentication backend generates and manages its own signing keys automatically for any issued
Backstage tokens. However, these keys have a short lifetime and do not persist after instance restarts.
Alternatively, users can provide their own public and private key files to sign issued tokens. This is beneficial in
scenarios where the token verification implementation aggressively caches the list of keys, and doesn't attempt to fetch
new ones even if they encounter an unknown key id. To enable this feature add the following configuration to your config
file:
```yaml
auth:
keyStore:
provider: 'static'
static:
keys:
# Must be declared at least once and the first one will be used for signing
- keyId: 'primary'
publicKeyFile: /path/to/public.key
privateKeyFile: /path/to/private.key
algorithm: # Optional, algorithm used to generate the keys, defaults to ES256
# More keys can be added so with future key rotations caches already know about it
- keyId: ...
```
The private key should be stored in the PKCS#8 format. The public key should be stored in the SPKI format.
You can generate the public/private key pair, using openssl and the ES256 algorithm by performing the following
steps:
Generate a private key using the ES256 algorithm
```sh
openssl ecparam -name prime256v1 -genkey -out private.ec.key
```
Convert it to PKCS#8 format
```sh
openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in private.ec.key -out private.key
```
Extract the public key
```sh
openssl ec -inform PEM -outform PEM -pubout -in private.key -out public.key
```
+1 -1
View File
@@ -10,6 +10,6 @@ description: The Backend System
## Status
The new backend system is in alpha, and only a small number of plugins have been migrated so far. It is possible to try it out, but it is not recommended to use this new system in production yet.
The new backend system is in alpha, but many plugins have already been migrated. We recommend all plugins to migrate to the new system, and you can also try it out in your own production deployments.
You can find an example backend setup in [the `backend-next` package](https://github.com/backstage/backstage/tree/master/packages/backend-next).
+5 -3
View File
@@ -107,7 +107,9 @@ $ export AWS_SECRET_ACCESS_KEY=.... (second secret value)
## Configuring the Pulumi CLI
Second, install the [Pulumi CLI](https://www.pulumi.com/docs/get-started/install/).
Second, install the [Pulumi CLI](https://www.pulumi.com/docs/get-started/install/) - `backstage-deploy` uses it to
simplify the management of cloud resources (Pulumi allows us to simply specify the desired "target cloud state", and
Pulumi will intelligently create/modify/delete resources to reach that state. Nice!).
Then we need to execute the following commands, to set Pulumi up:
@@ -126,9 +128,9 @@ By using `pulumi login --local` we are making sure that Pulumi stores our state
## Deploying your instance on Lightsail
:::warning
:::tip
Make sure that [Docker](https://docs.docker.com/) is running before you start this section.
Make sure that [Docker](https://docs.docker.com/) is running on your machine before you start this section.
:::
+41
View File
@@ -0,0 +1,41 @@
## OpenAPI Validation using Test Cases
This is primarily performed by `backstage-repo-tools schema openapi test`. Any errors found in the generated specs can be either
1. Fixed manually, this is usually relevant for request body or response body changes.
2. Fixed automatically with `backstage-repo-tools schema openapi test --update`.
3. Fixing the test case. This can happen where a response is mocked as
```ts
it('should return the right value', () => {
// We will assume that this is the actual response and update the spec accordingly.
// Ideally, this should be a fully populated return value.
const entity: Entity = {} as any;
app.get('/test', () => {
return entity;
});
const response = await request(app).get('/test');
expect(response.body).toEqual(entity);
});
```
will cause an invalid spec validation. The return value doesn't have all properties as defined in the type. Try to avoid this if possible. Something better would be,
```ts
it('should return the right value', () => {
// We will assume that this is the actual response and update the spec accordingly.
// Ideally, this should be a fully populated return value.
const entity: Entity = {
apiVersion: 'a1',
kind: 'k1',
metadata: { name: 'n1' },
};
app.get('/test', () => {
return entity;
});
const response = await request(app).get('/test');
expect(response.body).toEqual(entity);
});
```
Additionally, for more advanced use cases, you can run `yarn optic capture {PATH_TO_OPENAPI_FILE} --update interactive` and go through the prompts on the screen. Under the hood, the test validation + updating is done by [Optic](https://github.com/opticdev/optic), a great project around supporting OpenAPI specs and development. You can find additional options [here](https://www.useoptic.com/docs/verify-openapi).
File diff suppressed because it is too large Load Diff
+12
View File
@@ -0,0 +1,12 @@
---
title: Changelog viewer
author: RSC Labs
authorUrl: https://rsoftcon.com/
category: Discovery
description: View changelogs for your components in Backstage. Built-in support of "Keep the changelog" format.
documentation: https://github.com/RSC-Labs/backstage-changelog-plugin/blob/main/README.md
iconUrl: https://raw.githubusercontent.com/RSC-Labs/backstage-changelog-plugin/main/docs/plugin_icon.png
npmPackageName: '@rsc-labs/backstage-changelog-plugin'
tags:
- changelog
addedDate: '2023-10-22'
+1 -1
View File
@@ -19,7 +19,7 @@
"devDependencies": {
"@docusaurus/module-type-aliases": "0.0.0-5703",
"@spotify/prettier-config": "^14.0.0",
"@tsconfig/docusaurus": "^1.0.6",
"@tsconfig/docusaurus": "^2.0.0",
"@types/luxon": "^3.0.0",
"@types/webpack-env": "^1.18.0",
"js-yaml": "^4.1.0",
+5 -5
View File
@@ -2854,10 +2854,10 @@ __metadata:
languageName: node
linkType: hard
"@tsconfig/docusaurus@npm:^1.0.6":
version: 1.0.7
resolution: "@tsconfig/docusaurus@npm:1.0.7"
checksum: 8f5b14005d90b2008f10daf03a5edec86d2a7603e5641c579ea936a5c2d165a8c3007a72254fc4c2adb0554d73062f52bb97b30ff818f01c9215957822f3c4db
"@tsconfig/docusaurus@npm:^2.0.0":
version: 2.0.1
resolution: "@tsconfig/docusaurus@npm:2.0.1"
checksum: 63bebda70d83c56f95a90176d2e188e1ea9c08c23b499e5e7b292ebfae0ce7117f712809828ed21ae3b8440daf22191d6bf71bf2575f9bd474a51b1770ca30cc
languageName: node
linkType: hard
@@ -3894,7 +3894,7 @@ __metadata:
"@docusaurus/preset-classic": 0.0.0-5703
"@spotify/prettier-config": ^14.0.0
"@swc/core": ^1.3.46
"@tsconfig/docusaurus": ^1.0.6
"@tsconfig/docusaurus": ^2.0.0
"@types/luxon": ^3.0.0
"@types/webpack-env": ^1.18.0
clsx: ^1.1.1
+3 -2
View File
@@ -54,10 +54,11 @@
"@material-ui/pickers@^3.3.10": "patch:@material-ui/pickers@npm%3A3.3.11#./.yarn/patches/@material-ui-pickers-npm-3.3.11-1c8f68ea20.patch",
"@material-ui/pickers@^3.2.10": "patch:@material-ui/pickers@npm%3A3.3.11#./.yarn/patches/@material-ui-pickers-npm-3.3.11-1c8f68ea20.patch"
},
"version": "1.19.0",
"version": "1.20.0-next.0",
"dependencies": {
"@backstage/errors": "workspace:^",
"@manypkg/get-packages": "^1.1.3"
"@manypkg/get-packages": "^1.1.3",
"@useoptic/optic": "^0.50.10"
},
"devDependencies": {
"@backstage/cli": "workspace:*",
+12
View File
@@ -1,5 +1,17 @@
# @backstage/app-defaults
## 1.4.5-next.0
### Patch Changes
- 6c2b872153: Add official support for React 18.
- Updated dependencies
- @backstage/core-components@0.13.7-next.0
- @backstage/core-plugin-api@1.8.0-next.0
- @backstage/plugin-permission-react@0.4.17-next.0
- @backstage/core-app-api@1.11.1-next.0
- @backstage/theme@0.4.4-next.0
## 1.4.4
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/app-defaults",
"description": "Provides the default wiring of a Backstage App",
"version": "1.4.4",
"version": "1.4.5-next.0",
"publishConfig": {
"access": "public",
"main": "dist/index.esm.js",
@@ -1,5 +1,13 @@
# app-next-example-plugin
## 0.0.3-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.13.7-next.0
- @backstage/frontend-plugin-api@0.3.0-next.0
## 0.0.2
### Patch Changes
@@ -1,7 +1,7 @@
{
"name": "app-next-example-plugin",
"description": "Backstage internal example plugin",
"version": "0.0.2",
"version": "0.0.3-next.0",
"publishConfig": {
"access": "public",
"main": "dist/index.esm.js",
+77
View File
@@ -1,5 +1,82 @@
# example-app-next
## 0.0.3-next.0
### Patch Changes
- Updated dependencies
- @backstage/plugin-catalog-import@0.10.2-next.0
- @backstage/cli@0.24.0-next.0
- @backstage/core-components@0.13.7-next.0
- @backstage/frontend-plugin-api@0.3.0-next.0
- @backstage/plugin-home@0.5.10-next.0
- @backstage/plugin-catalog@1.15.0-next.0
- @backstage/plugin-graphiql@0.3.0-next.0
- @backstage/plugin-techdocs-module-addons-contrib@1.1.2-next.0
- @backstage/plugin-techdocs@1.8.1-next.0
- @backstage/frontend-app-api@0.3.0-next.0
- @backstage/plugin-catalog-react@1.9.0-next.0
- @backstage/plugin-user-settings@0.7.12-next.0
- @backstage/plugin-tech-radar@0.6.10-next.0
- @backstage/plugin-search@1.4.2-next.0
- @backstage/plugin-catalog-unprocessed-entities@0.1.5-next.0
- @backstage/integration-react@1.1.21-next.0
- @backstage/plugin-microsoft-calendar@0.1.9-next.0
- @backstage/plugin-newrelic-dashboard@0.3.1-next.0
- @backstage/core-plugin-api@1.8.0-next.0
- @backstage/plugin-permission-react@0.4.17-next.0
- @backstage/plugin-scaffolder-react@1.6.0-next.0
- @backstage/plugin-entity-feedback@0.2.9-next.0
- @backstage/plugin-apache-airflow@0.2.17-next.0
- @backstage/plugin-github-actions@0.6.7-next.0
- @backstage/plugin-octopus-deploy@0.2.8-next.0
- @backstage/plugin-techdocs-react@1.1.13-next.0
- @backstage/app-defaults@1.4.5-next.0
- @backstage/core-app-api@1.11.1-next.0
- @backstage/plugin-catalog-graph@0.2.38-next.0
- @backstage/plugin-code-coverage@0.2.19-next.0
- @backstage/plugin-cost-insights@0.12.15-next.0
- @backstage/plugin-tech-insights@0.3.18-next.0
- @backstage/plugin-azure-devops@0.3.8-next.0
- @backstage/plugin-gcp-projects@0.3.43-next.0
- @backstage/plugin-search-react@1.7.2-next.0
- @backstage/plugin-azure-sites@0.1.15-next.0
- @backstage/plugin-cloudbuild@0.3.26-next.0
- @backstage/plugin-kubernetes@0.11.1-next.0
- @backstage/plugin-lighthouse@0.4.11-next.0
- @backstage/plugin-scaffolder@1.16.0-next.0
- @backstage/plugin-stackstorm@0.1.8-next.0
- @backstage/plugin-dynatrace@8.0.0-next.0
- @backstage/plugin-gcalendar@0.3.20-next.0
- @backstage/plugin-pagerduty@0.6.7-next.0
- @backstage/plugin-shortcuts@0.3.16-next.0
- @backstage/plugin-airbrake@0.3.26-next.0
- @backstage/plugin-api-docs@0.9.13-next.0
- @backstage/plugin-circleci@0.3.26-next.0
- @backstage/plugin-devtools@0.1.6-next.0
- @backstage/plugin-linguist@0.1.11-next.0
- @backstage/plugin-newrelic@0.3.42-next.0
- @backstage/plugin-playlist@0.1.18-next.0
- @backstage/plugin-puppetdb@0.1.9-next.0
- @backstage/plugin-explore@0.4.12-next.0
- @backstage/plugin-jenkins@0.9.1-next.0
- @backstage/plugin-rollbar@0.4.26-next.0
- @backstage/theme@0.4.4-next.0
- @backstage/plugin-badges@0.2.50-next.0
- @backstage/plugin-sentry@0.5.11-next.0
- @backstage/plugin-kafka@0.3.26-next.0
- @backstage/plugin-gocd@0.1.32-next.0
- @backstage/plugin-todo@0.2.30-next.0
- @backstage/plugin-adr@0.6.9-next.0
- @backstage/plugin-org@0.6.16-next.0
- app-next-example-plugin@0.0.3-next.0
- @backstage/catalog-model@1.4.3
- @backstage/config@1.1.1
- @backstage/core-compat-api@0.0.1-next.0
- @backstage/plugin-catalog-common@1.0.17
- @backstage/plugin-linguist-common@0.1.2
- @backstage/plugin-search-common@1.2.7
## 0.0.2
### Patch Changes
+7 -2
View File
@@ -10,10 +10,15 @@ app:
- apis.plugin.graphiql.browse.gitlab: true
# Entity page cards
- 'entity.cards.about'
- entity.cards.about
- entity.cards.labels
- entity.cards.links:
config:
filter:
- isKind: component
# Entity page content
- 'entity.content.techdocs'
- entity.content.techdocs
# scmAuthExtension: >-
# createScmAuthExtension({
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "example-app-next",
"version": "0.0.2",
"version": "0.0.3-next.0",
"private": true,
"backstage": {
"role": "frontend"
+4
View File
@@ -21,6 +21,10 @@ jest.mock('@backstage/plugin-graphiql', () => ({
GraphiQLIcon: () => null,
}));
// Rarely, and only in windows CI, do these tests take slightly more than the
// default five seconds
jest.setTimeout(15_000);
describe('App', () => {
it('should render', async () => {
process.env = {
+77
View File
@@ -1,5 +1,82 @@
# example-app
## 0.2.89-next.0
### Patch Changes
- Updated dependencies
- @backstage/plugin-catalog-import@0.10.2-next.0
- @backstage/cli@0.24.0-next.0
- @backstage/core-components@0.13.7-next.0
- @backstage/plugin-home@0.5.10-next.0
- @backstage/plugin-catalog@1.15.0-next.0
- @backstage/plugin-graphiql@0.3.0-next.0
- @backstage/plugin-techdocs-module-addons-contrib@1.1.2-next.0
- @backstage/plugin-techdocs@1.8.1-next.0
- @backstage/frontend-app-api@0.3.0-next.0
- @backstage/plugin-catalog-react@1.9.0-next.0
- @backstage/plugin-user-settings@0.7.12-next.0
- @backstage/plugin-tech-radar@0.6.10-next.0
- @backstage/plugin-search@1.4.2-next.0
- @backstage/plugin-catalog-unprocessed-entities@0.1.5-next.0
- @backstage/integration-react@1.1.21-next.0
- @backstage/plugin-kubernetes-cluster@0.0.2-next.0
- @backstage/plugin-microsoft-calendar@0.1.9-next.0
- @backstage/plugin-newrelic-dashboard@0.3.1-next.0
- @backstage/core-plugin-api@1.8.0-next.0
- @backstage/plugin-permission-react@0.4.17-next.0
- @backstage/plugin-scaffolder-react@1.6.0-next.0
- @backstage/plugin-entity-feedback@0.2.9-next.0
- @backstage/plugin-apache-airflow@0.2.17-next.0
- @backstage/plugin-github-actions@0.6.7-next.0
- @backstage/plugin-octopus-deploy@0.2.8-next.0
- @backstage/plugin-stack-overflow@0.1.22-next.0
- @backstage/plugin-techdocs-react@1.1.13-next.0
- @backstage/app-defaults@1.4.5-next.0
- @backstage/core-app-api@1.11.1-next.0
- @backstage/plugin-catalog-graph@0.2.38-next.0
- @backstage/plugin-code-coverage@0.2.19-next.0
- @backstage/plugin-cost-insights@0.12.15-next.0
- @backstage/plugin-tech-insights@0.3.18-next.0
- @backstage/plugin-azure-devops@0.3.8-next.0
- @backstage/plugin-gcp-projects@0.3.43-next.0
- @backstage/plugin-search-react@1.7.2-next.0
- @backstage/plugin-azure-sites@0.1.15-next.0
- @backstage/plugin-cloudbuild@0.3.26-next.0
- @backstage/plugin-kubernetes@0.11.1-next.0
- @backstage/plugin-lighthouse@0.4.11-next.0
- @backstage/plugin-scaffolder@1.16.0-next.0
- @backstage/plugin-stackstorm@0.1.8-next.0
- @backstage/plugin-dynatrace@8.0.0-next.0
- @backstage/plugin-gcalendar@0.3.20-next.0
- @backstage/plugin-pagerduty@0.6.7-next.0
- @backstage/plugin-shortcuts@0.3.16-next.0
- @backstage/plugin-airbrake@0.3.26-next.0
- @backstage/plugin-api-docs@0.9.13-next.0
- @backstage/plugin-circleci@0.3.26-next.0
- @backstage/plugin-devtools@0.1.6-next.0
- @backstage/plugin-linguist@0.1.11-next.0
- @backstage/plugin-newrelic@0.3.42-next.0
- @backstage/plugin-playlist@0.1.18-next.0
- @backstage/plugin-puppetdb@0.1.9-next.0
- @backstage/plugin-explore@0.4.12-next.0
- @backstage/plugin-jenkins@0.9.1-next.0
- @backstage/plugin-rollbar@0.4.26-next.0
- @backstage/theme@0.4.4-next.0
- @backstage/plugin-badges@0.2.50-next.0
- @backstage/plugin-sentry@0.5.11-next.0
- @backstage/plugin-kafka@0.3.26-next.0
- @backstage/plugin-nomad@0.1.7-next.0
- @backstage/plugin-gocd@0.1.32-next.0
- @backstage/plugin-todo@0.2.30-next.0
- @backstage/plugin-adr@0.6.9-next.0
- @backstage/plugin-org@0.6.16-next.0
- @backstage/catalog-model@1.4.3
- @backstage/config@1.1.1
- @backstage/plugin-catalog-common@1.0.17
- @backstage/plugin-linguist-common@0.1.2
- @backstage/plugin-search-common@1.2.7
## 0.2.88
### Patch Changes
+74
View File
@@ -0,0 +1,74 @@
/*
* Copyright 2021 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('Should not throw `ResizeObserver loop completed with undelivered notifications`', async ({
page,
}) => {
await page.goto('/');
const enterButton = page.getByRole('button', { name: 'Enter' });
await expect(enterButton).toBeVisible();
await enterButton.click();
await page.goto('/home');
await expect(
page
.frameLocator('#webpack-dev-server-client-overlay')
.getByText(
/ResizeObserver loop completed with undelivered notifications/,
),
).not.toBeVisible();
});
test('Should resize widgets vertically and horizontally', async ({ page }) => {
await page.goto('/');
const enterButton = page.getByRole('button', { name: 'Enter' });
await expect(enterButton).toBeVisible();
await enterButton.click();
await page.goto('/home');
await expect(page.getByText('Backstage Example App')).toBeVisible();
// Start editing mode
await page.getByRole('button', { name: /Edit/ }).click();
await expect(page.getByRole('button', { name: /Save/ })).toBeVisible();
// Resize the last installed widget
const widgetElement = await page.locator('.react-grid-item:nth-child(3)');
const defaultWidgetBox = { x: 1, y: 1, width: 1, height: 1 };
const widgetBoxBefore =
(await widgetElement.boundingBox()) ?? defaultWidgetBox;
const widgetResizeHandle = await widgetElement.locator(
'.react-resizable-handle',
);
await widgetResizeHandle.hover();
await page.mouse.down();
await page.mouse.move(widgetBoxBefore.width / 2, widgetBoxBefore.height / 2);
await page.mouse.up();
const widgetBoxAfter =
(await widgetElement.boundingBox()) ?? defaultWidgetBox;
// Ensure that both height and width was reduced
expect(widgetBoxAfter.width).toBeLessThan(widgetBoxBefore.width);
expect(widgetBoxAfter.height).toBeLessThan(widgetBoxBefore.height);
// Exit editing mode
await page.getByRole('button', { name: 'Save' }).click();
await expect(page.getByRole('button', { name: /Edit/ })).toBeVisible();
});
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "example-app",
"version": "0.2.88",
"version": "0.2.89-next.0",
"private": true,
"backstage": {
"role": "frontend"
+18
View File
@@ -1,5 +1,23 @@
# @backstage/backend-app-api
## 0.5.8-next.0
### Patch Changes
- bc9a18d5ec: Added a workaround for double `default` wrapping when dynamically importing CommonJS modules with default exports.
- Updated dependencies
- @backstage/config-loader@1.5.2-next.0
- @backstage/cli-node@0.2.0-next.0
- @backstage/backend-common@0.19.9-next.0
- @backstage/backend-plugin-api@0.6.7-next.0
- @backstage/backend-tasks@0.5.12-next.0
- @backstage/cli-common@0.1.13
- @backstage/config@1.1.1
- @backstage/errors@1.2.3
- @backstage/types@1.1.1
- @backstage/plugin-auth-node@0.4.1-next.0
- @backstage/plugin-permission-node@0.7.18-next.0
## 0.5.6
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/backend-app-api",
"description": "Core API used by Backstage backend apps",
"version": "0.5.6",
"version": "0.5.8-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"publishConfig": {
+16
View File
@@ -1,5 +1,21 @@
# @backstage/backend-common
## 0.19.9-next.0
### Patch Changes
- Updated dependencies
- @backstage/config-loader@1.5.2-next.0
- @backstage/backend-app-api@0.5.8-next.0
- @backstage/integration@1.7.1
- @backstage/integration-aws-node@0.1.7
- @backstage/backend-dev-utils@0.1.2
- @backstage/backend-plugin-api@0.6.7-next.0
- @backstage/cli-common@0.1.13
- @backstage/config@1.1.1
- @backstage/errors@1.2.3
- @backstage/types@1.1.1
## 0.19.8
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/backend-common",
"description": "Common functionality library for Backstage backends",
"version": "0.19.8",
"version": "0.19.9-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"publishConfig": {
+9
View File
@@ -1,5 +1,14 @@
# @backstage/backend-defaults
## 0.2.7-next.0
### Patch Changes
- Updated dependencies
- @backstage/backend-app-api@0.5.8-next.0
- @backstage/backend-common@0.19.9-next.0
- @backstage/backend-plugin-api@0.6.7-next.0
## 0.2.6
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/backend-defaults",
"description": "Backend defaults used by Backstage backend apps",
"version": "0.2.6",
"version": "0.2.7-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"publishConfig": {
+41
View File
@@ -1,5 +1,46 @@
# example-backend-next
## 0.0.17-next.0
### Patch Changes
- Updated dependencies
- @backstage/plugin-search-backend-node@1.2.11-next.0
- @backstage/plugin-catalog-backend-module-backstage-openapi@0.1.0-next.0
- @backstage/plugin-techdocs-backend@1.8.1-next.0
- @backstage/plugin-scaffolder-backend@1.19.0-next.0
- @backstage/plugin-catalog-backend@1.15.0-next.0
- @backstage/plugin-search-backend@1.4.7-next.0
- @backstage/plugin-search-backend-module-techdocs@0.1.11-next.0
- @backstage/plugin-proxy-backend@0.4.5-next.0
- @backstage/plugin-app-backend@0.3.55-next.0
- @backstage/plugin-devtools-backend@0.2.4-next.0
- @backstage/backend-defaults@0.2.7-next.0
- @backstage/backend-plugin-api@0.6.7-next.0
- @backstage/backend-tasks@0.5.12-next.0
- @backstage/plugin-adr-backend@0.4.4-next.0
- @backstage/plugin-auth-node@0.4.1-next.0
- @backstage/plugin-azure-devops-backend@0.4.4-next.0
- @backstage/plugin-badges-backend@0.3.4-next.0
- @backstage/plugin-catalog-backend-module-openapi@0.1.24-next.0
- @backstage/plugin-catalog-backend-module-scaffolder-entity-model@0.1.4-next.0
- @backstage/plugin-catalog-backend-module-unprocessed@0.3.4-next.0
- @backstage/plugin-entity-feedback-backend@0.2.4-next.0
- @backstage/plugin-jenkins-backend@0.3.1-next.0
- @backstage/plugin-kubernetes-backend@0.13.1-next.0
- @backstage/plugin-lighthouse-backend@0.3.4-next.0
- @backstage/plugin-linguist-backend@0.5.4-next.0
- @backstage/plugin-nomad-backend@0.1.9-next.0
- @backstage/plugin-permission-backend@0.5.30-next.0
- @backstage/plugin-permission-backend-module-allow-all-policy@0.1.4-next.0
- @backstage/plugin-permission-common@0.7.9
- @backstage/plugin-permission-node@0.7.18-next.0
- @backstage/plugin-playlist-backend@0.3.11-next.0
- @backstage/plugin-search-backend-module-catalog@0.1.11-next.0
- @backstage/plugin-search-backend-module-explore@0.1.11-next.0
- @backstage/plugin-sonarqube-backend@0.2.9-next.0
- @backstage/plugin-todo-backend@0.3.5-next.0
## 0.0.16
### Patch Changes
+3 -1
View File
@@ -1,6 +1,6 @@
{
"name": "example-backend-next",
"version": "0.0.16",
"version": "0.0.17-next.0",
"main": "dist/index.cjs.js",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -34,6 +34,8 @@
"@backstage/plugin-azure-devops-backend": "workspace:^",
"@backstage/plugin-badges-backend": "workspace:^",
"@backstage/plugin-catalog-backend": "workspace:^",
"@backstage/plugin-catalog-backend-module-backstage-openapi": "workspace:^",
"@backstage/plugin-catalog-backend-module-openapi": "workspace:^",
"@backstage/plugin-catalog-backend-module-scaffolder-entity-model": "workspace:^",
"@backstage/plugin-catalog-backend-module-unprocessed": "workspace:^",
"@backstage/plugin-devtools-backend": "workspace:^",
+3
View File
@@ -44,6 +44,9 @@ backend.add(import('@backstage/plugin-scaffolder-backend/alpha'));
backend.add(import('@backstage/plugin-search-backend-module-catalog/alpha'));
backend.add(import('@backstage/plugin-search-backend-module-explore/alpha'));
backend.add(import('@backstage/plugin-search-backend-module-techdocs/alpha'));
backend.add(
import('@backstage/plugin-catalog-backend-module-backstage-openapi'),
);
backend.add(import('@backstage/plugin-search-backend/alpha'));
backend.add(import('@backstage/plugin-techdocs-backend/alpha'));
backend.add(import('@backstage/plugin-todo-backend'));
@@ -1,5 +1,19 @@
# @backstage/backend-openapi-utils
## 0.1.0-next.0
### Minor Changes
- 785fb1ea75: Adds a new route, `/openapi.json` to validated routers for displaying their full OpenAPI spec in a standard endpoint.
### Patch Changes
- 6694b369a3: Adds a new function `wrapInOpenApiTestServer` that allows for proxied requests at runtime. This will support the new `yarn backstage-repo-tools schema openapi test` command.
- Updated dependencies
- @backstage/backend-plugin-api@0.6.7-next.0
- @backstage/config@1.1.1
- @backstage/errors@1.2.3
## 0.0.5
### Patch Changes
+1 -1
View File
@@ -65,7 +65,7 @@ export function createRouter() {
### Why am I getting `unknown` as the type for a response?
This can happen when you have a `charset` defined in your `response.content` section. Something like `response.content[ 'application/json; charset=utf-8:']` will cause this issue.
This can happen when you have a `charset` defined in your `response.content` section. Something like `response.content['application/json; charset=utf-8:']` will cause this issue.
## INTERNAL
@@ -5,6 +5,7 @@
```ts
import type { ContentObject } from 'openapi3-ts';
import type core from 'express-serve-static-core';
import { Express as Express_2 } from 'express';
import { FromSchema } from 'json-schema-to-ts';
import { JSONSchema7 } from 'json-schema-to-ts';
import { middleware } from 'express-openapi-validator';
@@ -16,6 +17,7 @@ import { RequestHandler } from 'express';
import type { ResponseObject } from 'openapi3-ts';
import { Router } from 'express';
import type { SchemaObject } from 'openapi3-ts';
import { Server } from 'http';
// @public
export interface ApiRouter<Doc extends RequiredDoc> extends Router {
@@ -248,6 +250,9 @@ type FullMap<
},
> = RequiredMap<T> & OptionalMap<T>;
// @public
export function getOpenApiSpecRoute(baseUrl: string): string;
// @public (undocumented)
interface HeaderObject extends ParameterObject {
// (undocumented)
@@ -708,4 +713,7 @@ type UnknownIfNever<P> = [P] extends [never] ? unknown : P;
// @public
type ValueOf<T> = T[keyof T];
// @public
export const wrapInOpenApiTestServer: (app: Express_2) => Server | Express_2;
```
+4 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/backend-openapi-utils",
"description": "OpenAPI typescript support.",
"version": "0.0.5",
"version": "0.1.0-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -37,6 +37,8 @@
"dist"
],
"dependencies": {
"@backstage/backend-plugin-api": "workspace:^",
"@backstage/config": "workspace:^",
"@backstage/errors": "workspace:^",
"@types/express": "^4.17.6",
"@types/express-serve-static-core": "^4.17.5",
@@ -45,6 +47,7 @@
"express-promise-router": "^4.1.0",
"json-schema-to-ts": "^2.6.2",
"lodash": "^4.17.21",
"openapi-merge": "^1.3.2",
"openapi3-ts": "^3.1.2"
}
}
@@ -0,0 +1,21 @@
/*
* 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.
*/
/**
* The route that all OpenAPI specs should be served from.
* @public
*/
export const OPENAPI_SPEC_ROUTE = '/openapi.json';
+2 -1
View File
@@ -31,4 +31,5 @@ export type {
PathParameters,
} from './utility';
export type { ApiRouter } from './router';
export { createValidatedOpenApiRouter } from './stub';
export { createValidatedOpenApiRouter, getOpenApiSpecRoute } from './stub';
export { wrapInOpenApiTestServer } from './testUtils';
+62 -13
View File
@@ -14,11 +14,12 @@
* limitations under the License.
*/
import { createValidatedOpenApiRouter } from './stub';
import { createValidatedOpenApiRouter, getOpenApiSpecRoute } from './stub';
import express from 'express';
import request from 'supertest';
import singlePathSpec from './___fixtures__/single-path';
import { Response } from './utility';
import { OPENAPI_SPEC_ROUTE } from './constants';
describe('createRouter', () => {
const pet: Response<typeof singlePathSpec, '/pet/:petId', 'get'> = {
@@ -28,6 +29,33 @@ describe('createRouter', () => {
photoUrls: [],
};
const specs = [singlePathSpec];
const ONCE_NESTED_ROUTER_PREFIX = '/pet-store';
const TWICE_NESTED_ROUTER_PREFIX = `/api`;
const routers = specs.flatMap(spec => {
const router = createValidatedOpenApiRouter(spec);
const unnestedApp = express();
unnestedApp.use('/', router);
const onceNestedRouter = express.Router();
onceNestedRouter.use(`${ONCE_NESTED_ROUTER_PREFIX}`, router);
const onceNestedApp = express();
onceNestedApp.use(`/`, onceNestedRouter);
const twiceNestedApp = express();
twiceNestedApp.use(`${TWICE_NESTED_ROUTER_PREFIX}`, onceNestedRouter);
return [
['', unnestedApp, router],
[ONCE_NESTED_ROUTER_PREFIX, onceNestedApp, router],
[
`${TWICE_NESTED_ROUTER_PREFIX}${ONCE_NESTED_ROUTER_PREFIX}`,
twiceNestedApp,
router,
],
] as const;
});
it('does NOT override originalUrl and basePath after execution', async () => {
expect.assertions(2);
const router = createValidatedOpenApiRouter(singlePathSpec);
@@ -61,19 +89,40 @@ describe('createRouter', () => {
expect(routerGetFn).toHaveBeenCalledTimes(1);
});
it('handles coercing parameters correctly', async () => {
expect.assertions(1);
const router = createValidatedOpenApiRouter(singlePathSpec);
router.get('/pet/:petId', (req, res) => {
expect(typeof req.params.petId).toBe('integer');
res.json(pet);
});
it.each(routers)(
'%s handles coercing parameters correctly',
async (prefix, app, router) => {
expect.assertions(1);
router.get('/pet/:petId', (req, res) => {
expect(typeof req.params.petId).toBe('integer');
res.send(pet);
});
const apiRouter = express.Router();
apiRouter.use('/pet-store', router);
const appRouter = express();
appRouter.use('/api', apiRouter);
await request(app).get(`${prefix}/pet/1`);
},
);
await request(appRouter).get('/api/pet-store/pet/1');
it.each(routers)(
'%s adds the openapi spec to the router',
async (prefix, app) => {
const response = await request(app)
.get(`${prefix}${OPENAPI_SPEC_ROUTE}`)
.expect(200);
expect(response.body).toHaveProperty('paths');
Object.keys(response.body.paths).forEach(key => {
const specKey = key.replace(prefix, '');
expect(singlePathSpec.paths).toHaveProperty(specKey);
expect(response.body.paths[key]).toEqual(
(singlePathSpec.paths as any)[specKey],
);
});
},
);
});
describe('getOpenApiSpecRoute', () => {
it('handles expected values', () => {
expect(getOpenApiSpecRoute('/api/test')).toEqual('/api/test/openapi.json');
expect(getOpenApiSpecRoute('api/test')).toEqual('api/test/openapi.json');
});
});
+39 -2
View File
@@ -27,6 +27,8 @@ import {
} from 'express';
import { InputError } from '@backstage/errors';
import { middleware as OpenApiValidator } from 'express-openapi-validator';
import { OPENAPI_SPEC_ROUTE } from './constants';
import { isErrorResult, merge } from 'openapi-merge';
type PropertyOverrideRequest = Request & {
[key: symbol]: string;
@@ -45,6 +47,16 @@ export function getDefaultRouterMiddleware() {
return [json()];
}
/**
* Given a base url for a plugin, find the given OpenAPI spec for that plugin.
* @param baseUrl - Plugin base url.
* @returns OpenAPI spec route for the base url.
* @public
*/
export function getOpenApiSpecRoute(baseUrl: string) {
return `${baseUrl}${OPENAPI_SPEC_ROUTE}`;
}
/**
* Create a new OpenAPI router with some default middleware.
* @param spec - Your OpenAPI spec imported as a JSON object.
@@ -59,7 +71,7 @@ export function createValidatedOpenApiRouter<T extends RequiredDoc>(
middleware?: RequestHandler[];
},
) {
const router = PromiseRouter() as ApiRouter<typeof spec>;
const router = PromiseRouter();
router.use(options?.middleware || getDefaultRouterMiddleware());
/**
@@ -116,5 +128,30 @@ export function createValidatedOpenApiRouter<T extends RequiredDoc>(
// Any errors from the middleware get through here.
router.use(validatorErrorTransformer());
return router;
router.get(OPENAPI_SPEC_ROUTE, async (req, res) => {
const mergeOutput = merge([
{
oas: spec as any,
pathModification: {
/**
* Get the route that this OpenAPI spec is hosted on. The other
* approach of using the discovery API increases the router constructor
* significantly and since we're just looking for path and not full URL,
* this works.
*
* If we wanted to add a list of servers, there may be a case for adding
* discovery API to get an exhaustive list of upstream servers, but that's
* also not currently supported.
*/
prepend: req.originalUrl.replace(OPENAPI_SPEC_ROUTE, ''),
},
},
]);
if (isErrorResult(mergeOutput)) {
throw new InputError('Invalid spec defined');
}
res.json(mergeOutput.output);
});
return router as ApiRouter<typeof spec>;
}
@@ -0,0 +1,36 @@
/*
* 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 { Express } from 'express';
import { Server } from 'http';
/**
* !!! THIS CURRENTLY ONLY SUPPORTS SUPERTEST !!!
* Running against supertest, we need some way to hit the optic proxy. This ensures that
* that happens at runtime when in the context of a `yarn optic capture` command.
* @param app - Express router that would be passed to supertest's `request`.
* @returns A wrapper around the express router (or the router untouched) that still works with supertest.
* @public
*/
export const wrapInOpenApiTestServer = (app: Express): Server | Express => {
if (process.env.OPTIC_PROXY) {
const server = app.listen(+process.env.PORT!);
return {
...server,
address: () => new URL(process.env.OPTIC_PROXY!),
} as any;
}
return app;
};
+11
View File
@@ -1,5 +1,16 @@
# @backstage/backend-plugin-api
## 0.6.7-next.0
### Patch Changes
- Updated dependencies
- @backstage/backend-tasks@0.5.12-next.0
- @backstage/config@1.1.1
- @backstage/types@1.1.1
- @backstage/plugin-auth-node@0.4.1-next.0
- @backstage/plugin-permission-common@0.7.9
## 0.6.6
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/backend-plugin-api",
"description": "Core API used by Backstage backend plugins",
"version": "0.6.6",
"version": "0.6.7-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"publishConfig": {
@@ -1,5 +1,28 @@
# @backstage/backend-plugin-manager
## 0.0.3-next.0
### Patch Changes
- Updated dependencies
- @backstage/cli-node@0.2.0-next.0
- @backstage/plugin-search-backend-node@1.2.11-next.0
- @backstage/plugin-catalog-backend@1.15.0-next.0
- @backstage/plugin-scaffolder-node@0.2.8-next.0
- @backstage/backend-common@0.19.9-next.0
- @backstage/backend-plugin-api@0.6.7-next.0
- @backstage/backend-tasks@0.5.12-next.0
- @backstage/cli-common@0.1.13
- @backstage/config@1.1.1
- @backstage/errors@1.2.3
- @backstage/types@1.1.1
- @backstage/plugin-auth-node@0.4.1-next.0
- @backstage/plugin-events-backend@0.2.16-next.0
- @backstage/plugin-events-node@0.2.16-next.0
- @backstage/plugin-permission-common@0.7.9
- @backstage/plugin-permission-node@0.7.18-next.0
- @backstage/plugin-search-common@1.2.7
## 0.0.2
### Patch Changes
@@ -174,7 +174,7 @@ export class PluginManager implements BackendPluginProvider {
config: Config,
logger: LoggerService,
preferAlpha?: boolean,
mooduleLoader?: ModuleLoader,
moduleLoader?: ModuleLoader,
): Promise<PluginManager>;
// (undocumented)
readonly plugins: DynamicPlugin[];
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/backend-plugin-manager",
"description": "Backstage plugin management backend",
"version": "0.0.2",
"version": "0.0.3-next.0",
"private": true,
"main": "src/index.ts",
"types": "src/index.ts",
@@ -49,7 +49,7 @@ export class PluginManager implements BackendPluginProvider {
config: Config,
logger: LoggerService,
preferAlpha: boolean = false,
mooduleLoader: ModuleLoader = new CommonJSModuleLoader(logger),
moduleLoader: ModuleLoader = new CommonJSModuleLoader(logger),
): Promise<PluginManager> {
/* eslint-disable-next-line no-restricted-syntax */
const backstageRoot = findPaths(__dirname).targetRoot;
@@ -61,7 +61,7 @@ export class PluginManager implements BackendPluginProvider {
);
const scannedPlugins = await scanner.scanRoot();
scanner.trackChanges();
const manager = new PluginManager(logger, scannedPlugins, mooduleLoader);
const manager = new PluginManager(logger, scannedPlugins, moduleLoader);
const dynamicPluginsPaths = scannedPlugins.map(p =>
fs.realpathSync(
@@ -73,7 +73,7 @@ export class PluginManager implements BackendPluginProvider {
),
);
mooduleLoader.bootstrap(backstageRoot, dynamicPluginsPaths);
moduleLoader.bootstrap(backstageRoot, dynamicPluginsPaths);
scanner.subscribeToRootDirectoryChange(async () => {
manager._availablePackages = await scanner.scanRoot();
@@ -217,6 +217,8 @@ export class PluginScanner {
.watch(this._rootDirectory, {
ignoreInitial: true,
followSymlinks: true,
depth: 1,
disableGlobbing: true,
})
.on(
'all',

Some files were not shown because too many files have changed in this diff Show More