Merge branch 'master' of github.com:backstage/backstage into blam/move-scaffolder-to-integrations

* 'master' of github.com:backstage/backstage: (75 commits)
  backend-common: Move definition of etag property inside constructor
  docs: Fix url links in well known annotations
  bitbucket casing
  integration: take over the config
  More review comments
  Address some final review coments about cross-fetch and type-casting
  chore(deps): bump sucrase from 3.16.0 to 3.17.0
  chore(deps-dev): bump @types/webpack from 4.41.22 to 4.41.26
  core-api: remove deprecated registerRoute and deprecate addRoute
  Update README
  Support GHE
  app,create-app: switch to using FlatRoutes
  Make breaking 'minor' change'
  Add codefences to changeset
  Add changeset
  Remove InfoCard :height100" variant
  scripts/check-if-release: fix diff and tweak to handle new and removed packages
  Update with review comments
  docs: Run prettier on techdocs ci/cd tutorial
  remove adr status header
  ...
This commit is contained in:
blam
2021-01-20 16:22:58 +01:00
122 changed files with 2857 additions and 1030 deletions
+29
View File
@@ -0,0 +1,29 @@
---
'@backstage/catalog-model': patch
'@backstage/plugin-catalog-backend': patch
---
Adds a `backstage.io/managed-by-origin-location` annotation to all entities. It links to the
location that was registered to the catalog and which emitted this entity. It has a different
semantic than the existing `backstage.io/managed-by-location` annotation, which tells the direct
parent location that created this entity.
Consider this example: The Backstage operator adds a location of type `github-org` in the
`app-config.yaml`. This setting will be added to a `bootstrap:boostrap` location. The processor
discovers the entities in the following branch
`Location bootstrap:bootstrap -> Location github-org:… -> User xyz`. The user `xyz` will be:
```yaml
apiVersion: backstage.io/v1alpha1
kind: User
metadata:
name: xyz
annotations:
# This entity was added by the 'github-org:…' location
backstage.io/managed-by-location: github-org:…
# The entity was added because the 'bootstrap:boostrap' was added to the catalog
backstage.io/managed-by-origin-location: bootstrap:bootstrap
# ...
spec:
# ...
```
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-github-actions': minor
---
Support GHE
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/core': minor
---
Removed `InfoCard` variant `height100`, originally deprecated in [#2826](https://github.com/backstage/backstage/pull/2826).
If your component still relies on this variant, simply replace it with `gridItem`.
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/plugin-catalog': patch
---
Derive the list of to-delete entities in the `UnregisterEntityDialog` from the `backstage.io/managed-by-origin-location` annotation.
The dialog also rejects deleting entities that are created by the `bootstrap:bootstrap` location.
+40
View File
@@ -0,0 +1,40 @@
---
'@backstage/create-app': patch
---
Migrate to using `FlatRoutes` from `@backstage/core` for the root app routes.
This is the first step in migrating applications as mentioned here: https://backstage.io/docs/plugins/composability#porting-existing-apps.
To apply this change to an existing app, switch out the `Routes` component from `react-router` to `FlatRoutes` from `@backstage/core`.
This also allows you to remove any `/*` suffixes on the route paths. For example:
```diff
import {
OAuthRequestDialog,
SidebarPage,
createRouteRef,
+ FlatRoutes,
} from '@backstage/core';
import { AppSidebar } from './sidebar';
-import { Route, Routes, Navigate } from 'react-router';
+import { Route, Navigate } from 'react-router';
import { Router as CatalogRouter } from '@backstage/plugin-catalog';
...
<AppSidebar />
- <Routes>
+ <FlatRoutes>
...
<Route
- path="/catalog/*"
+ path="/catalog"
element={<CatalogRouter EntityPage={EntityPage} />}
/>
- <Route path="/docs/*" element={<DocsRouter />} />
+ <Route path="/docs" element={<DocsRouter />} />
...
<Route path="/settings" element={<SettingsRouter />} />
- </Routes>
+ </FlatRoutes>
</SidebarPage>
```
+26
View File
@@ -0,0 +1,26 @@
---
'@backstage/backend-common': patch
---
1. URL Reader's `readTree` method now returns an `etag` in the response along with the blob. The etag is an identifier of the blob and will only change if the blob is modified on the target. Usually it is set to the latest commit SHA on the target.
`readTree` also takes an optional `etag` in its options and throws a `NotModifiedError` if the etag matches with the etag of the resource.
So, the `etag` can be used in building a cache when working with URL Reader.
An example -
```ts
const response = await reader.readTree(
'https://github.com/backstage/backstage',
);
const etag = response.etag;
// Will throw a new NotModifiedError (exported from @backstage/backstage-common)
await reader.readTree('https://github.com/backstage/backstage', {
etag,
});
```
2. URL Reader's readTree method can now detect the default branch. So, `url:https://github.com/org/repo/tree/master` can be replaced with `url:https://github.com/org/repo` in places like `backstage.io/techdocs-ref`.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/integration': patch
---
Fix GitLab API base URL and add it by default to the gitlab.com host
+55
View File
@@ -0,0 +1,55 @@
---
'@backstage/core': minor
---
Removed deprecated `router.registerRoute` method in `createPlugin`.
Deprecated `router.addRoute` method in `createPlugin`.
Replace usage of the above two components with a routable extension.
For example, given the following:
```ts
import { createPlugin } from '@backstage/core';
import { MyPage } from './components/MyPage';
import { rootRoute } from './routes';
export const plugin = createPlugin({
id: 'my-plugin',
register({ router }) {
router.addRoute(rootRoute, MyPage);
},
});
```
Migrate to
```ts
import { createPlugin, createRoutableExtension } from '@backstage/core';
import { rootRoute } from './routes';
export const plugin = createPlugin({
id: 'my-plugin',
routes: {
root: rootRoute,
},
});
export const MyPage = plugin.provide(
createRoutableExtension({
component: () => import('./components/MyPage').then(m => m.MyPage),
mountPoint: rootRoute,
}),
);
```
And then use `MyPage` like this in the app:
```tsx
<FlatRoutes>
...
<Route path='/my-path' element={<MyPage />}>
...
</FlatRoutes>
```
+19
View File
@@ -0,0 +1,19 @@
---
'@backstage/backend-common': minor
---
Remove fallback option from `UrlReaders.create` and `UrlReaders.default`, as well as the default fallback reader.
To be able to read data from endpoints outside of the configured integrations, you now need to explicitly allow it by
adding an entry in the `backend.reading.allow` list. For example:
```yml
backend:
baseUrl: ...
reading:
allow:
- host: example.com
- host: '*.examples.org'
```
Apart from adding the above configuration, most projects should not need to take any action to migrate existing code. If you do happen to have your own fallback reader configured, this needs to be replaced with a reader factory that selects a specific set of URLs to work with. If you where wrapping the existing fallback reader, the new one that handles the allow list is created using `FetchUrlReader.factory`.
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/plugin-catalog': patch
---
Display systems in catalog table and make both owner and system link to the entity pages.
The owner field is now taken from the relations of the entity instead of its spec.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/techdocs-common': patch
---
TechDocs backend now streams files through from Google Cloud Storage to the browser, improving memory usage.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-auth-backend': patch
---
Add AWS ALB OIDC reverse proxy authentication provider
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-lighthouse': patch
---
Fix display of floating point precision errors in card category scores
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-common': minor
---
Remove support for HTTPS certificate generation parameters. Use `backend.https = true` instead.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/catalog-model': minor
---
The catalog no longer attempts to merge old and new annotations, when updating an entity from a remote location. This was a behavior that was copied from kubernetes, and catered to use cases where you wanted to use HTTP POST to update an entity in-place, outside of what the refresh loop does. This has proved to be a mistake, because as a side effect, the refresh loop effectively is unable to ever delete annotations when they are removed from source YAML. This is obviously a breaking change, but we believe that this is not a behavior that is relied upon in the wild, and it has never been an actually supported use flow of the catalog. We therefore choose to break the behavior outright, and instead just store updated annotations verbatim - just like we already do for example for labels