docs/releases/v1.7.0-changelog.md
f368ad7279: BREAKING: Bumped jest, jest-runtime, and jest-environment-jsdom to v29. This is up from v27, so check out both the v28 and v29 (later here) migration guides.
Particular changes that where encountered in the main Backstage repo are:
jest.useFakeTimers('legacy') is now jest.useFakeTimers({ legacyFakeTimers: true }).withLogCollector from @backstage/test-utils are now objects with a detail property rather than a string.78d5eb299e: Tweak the Jest Caching loader to only operate when in watch mode
9c595302cb: Normalize on winston version ^3.2.1
24b40140c4: Treat files in __testUtils__ and __mocks__ directories as test files for linting
purposes.
Updates the parts of the eslint configuration generator that specify which files should be treated as test code to include any files under two additional directories:
__mocks__: this is the directory used by Jest0 for mock code.__testUtils__: a suggested location for utility code executed only when
running tests.3e309107ca: Updated fallback versions of dependencies in all templates.
292a088807: Added a new repo test command.
ba63cae41c: Updated lockfile parsing to have better support for Yarn 3.
2d3a5f09ab: Use response.json rather than response.send where appropriate, as outlined in SECURITY.md
2dddb32fea: Switched the Jest transform for YAML files to use a custom one available at @backstage/cli/config/jestYamlTransform.js.
a541a3a78a: Switch to upfront resolution of swc-loader in Webpack config.
cfb3598410: Removed tsx and jsx as supported extensions in backend packages. For most
repos, this will not have any effect. But if you inadvertently had added some
tsx/jsx files to your backend package, you may now start to see code: 'MODULE_NOT_FOUND' errors when launching the backend locally. The reason for
this is that the offending files get ignored during transpilation. Hence, the
importing file can no longer find anything to import.
The fix is to rename any .tsx files in your backend packages to .ts instead,
or .jsx to .js.
Updated dependencies
e2dc42e9f0: Google OAuth refresh tokens will now be revoked on logout by calling Google's API
5fa831ce55: CookieConfigurer can optionally return the SameSite cookie attribute.
CookieConfigurer now requires an additional argument appOrigin - the origin URL of the app - which is used to calculate the SameSite attribute.
defaultCookieConfigurer returns the SameSite attribute which defaults to Lax. In cases where an auth-backend is running on a different domain than the App, SameSite=None is used - but only for secure contexts. This is so that cookies can be included in third-party requests.
OAuthAdapterOptions has been modified to require additional arguments, baseUrl, and cookieConfigurer.
OAuthAdapter now resolves cookie configuration using its supplied CookieConfigurer for each request to make sure that the proper attributes always are set.
connection and connectionScope parameters to configure social identity providers.8554533546: BREAKING The bazaar-backend createRouter now requires that the identityApi is passed to the router.
These changes are required to packages/backend/src/plugins/bazaar.ts
The user entity ref is now added to the members table and is taken from the requesting user using the identityApi.
import { PluginEnvironment } from '../types';
import { createRouter } from '@backstage/plugin-bazaar-backend';
import { Router } from 'express';
export default async function createPlugin(
env: PluginEnvironment,
): Promise<Router> {
return await createRouter({
logger: env.logger,
config: env.config,
database: env.database,
+ identity: env.identity,
});
}
getLatestProjects that takes a limit of projects as prop.ad74723fbf: Update Bitbucket Cloud models to latest OAS version.
The latest specification contained some BREAKING CHANGES due to removed fields.
All of these fields are not used at other plugins, though. Therefore, this change has no impact on other modules here.
d558f41d3a: Added new column Label to CatalogTable.columns, this new column allows you make use of labels from metadata.
For example: category and visibility are type of labels associated with API entity illustrated below.
YAML code snippet for API entity
apiVersion: backstage.io/v1alpha1
kind: API
metadata:
name: sample-api
description: API for sample
links:
- url: http://localhost:8080/swagger-ui.html
title: Swagger UI
tags:
- http
labels:
category: legacy
visibility: protected
Consumers can customise columns to include label column and show in api-docs list
const columns = [
CatalogTable.columns.createNameColumn({ defaultKind: 'API' }),
CatalogTable.columns.createLabelColumn('category', { title: 'Category' }),
CatalogTable.columns.createLabelColumn('visibility', {
title: 'Visibility',
defaultValue: 'public',
}),
];
EntityKindPicker so that it can be shown alongside the other filters on the left side of your catalog pages.emptyContent property to CatalogTable and DefaultCatalogPage to support customization of the Catalog Table.b2e6cb6acf: Added a new method addLocationAnalyzers to the CatalogBuilder. With this you can add location analyzers to your catalog. These analyzers will be used by the /analyze-location endpoint to decide if the provided URL contains any catalog-info.yaml files already or not.
Moved the following types from this package to @backstage/plugin-catalog-backend.
eb25f7e12d: The exported permission rules and the API of createCatalogConditionalDecision have changed to reflect the breaking changes made to the PermissionRule type. Note that all involved types are exported from @backstage/plugin-catalog-backend/alpha
response.json rather than response.send where appropriate, as outlined in SECURITY.mdb2e6cb6acf: Breaking Moved the code search for the existing catalog-info.yaml files to the backend from the frontend. It means it will use the configured GitHub integration's credentials.
Add the following to your CatalogBuilder to have the repo URL ingestion working again.
// catalog.ts
import { GithubLocationAnalyzer } from '@backstage/plugin-catalog-backend-module-github';
...
builder.addLocationAnalyzers(
new GithubLocationAnalyzer({
discovery: env.discovery,
config: env.config,
}),
);
...
LocationSpec type. It got moved from this package to the @backstage/plugin-catalog-common so make sure imports are updated.EntityKindPicker so that it can be shown alongside the other filters on the left side of your catalog pages.EntityRefLinks props, the first being getTitle that allows for customization of the title used for each link. The second one is fetchEntities, which triggers a fetching of all entities so that the full entity definition is available in the getTitle callback.46b4a72cee: BREAKING: When defining permission rules, it's now necessary to provide a ZodSchema that specifies the parameters the rule expects. This has been added to help better describe the parameters in the response of the metadata endpoint and to validate the parameters before a rule is executed.
To help with this, we have also made a change to the API of permission rules. Before, the permission rules toQuery and apply signature expected parameters to be separate arguments, like so...
createPermissionRule({
apply: (resource, foo, bar) => true,
toQuery: (foo, bar) => {},
});
The API has now changed to expect the parameters as a single object
createPermissionRule({
paramSchema: z.object({
foo: z.string().describe('Foo value to match'),
bar: z.string().describe('Bar value to match'),
}),
apply: (resource, { foo, bar }) => true,
toQuery: ({ foo, bar }) => {},
});
One final change made is to limit the possible values for a parameter to primitives and arrays of primitives.
46b4a72cee: BREAKING: When defining permission rules, it's now necessary to provide a ZodSchema that specifies the parameters the rule expects. This has been added to help better describe the parameters in the response of the metadata endpoint and to validate the parameters before a rule is executed.
To help with this, we have also made a change to the API of permission rules. Before, the permission rules toQuery and apply signature expected parameters to be separate arguments, like so...
createPermissionRule({
apply: (resource, foo, bar) => true,
toQuery: (foo, bar) => {},
});
The API has now changed to expect the parameters as a single object
createPermissionRule({
paramSchema: z.object({
foo: z.string().describe('Foo value to match'),
bar: z.string().describe('Bar value to match'),
}),
apply: (resource, { foo, bar }) => true,
toQuery: ({ foo, bar }) => {},
});
One final change made is to limit the possible values for a parameter to primitives and arrays of primitives.
eb25f7e12d: BREAKING The exported permission rules have changed to reflect the breaking changes made to the PermissionRule type.
For example, the playlistConditions.isOwner API has changed from:
playlistConditions.isOwner(['user:default/me', 'group:default/owner']);
to:
playlistConditions.isOwner({
owners: ['user:default/me', 'group:default/owner'],
});
/next scaffolder work end to end with the old TaskPage viewreact-jsonschema-form@v5-beta for the NextRouter under @alpha exportsallowed* values for the RepoUrlPicker would be reset on render.allowedOrganizations and allowedOwners to the AzureRepoPicker.additionalTemplateGlobals which allows you to add global functions to the scaffolder nunjucks templates.github:publish action to allow passing whether pull
requests must be up to date with the default branch before merging.allowAutoMerge option for publish:github actionsourcePath parameter to publish:gitlab:merge-request action, targetPath is now optional and falls back to current workspace path.moduleId of the experimental module export.16c853a6ed: Be less restrictive with unknown keys on query endpoint
a799972bb1: The query received by search engines now contains a property called pageLimit, it specifies how many results to return per page when sending a query request to the search backend.
Example: Returns up to 30 results per page
GET /query?pageLimit=30
The search backend validates the page limit and this value must not exceed 100, but it doesn't set a default value for the page limit parameter, it leaves it up to each search engine to set this, so Lunr, Postgres and Elastic Search set 25 results per page as a default value.
response.json rather than response.send where appropriate, as outlined in SECURITY.mdpageLimit on the SearchQuery interface that specifies how many results should be returned per page.4ed1fa2480: The search query state now has an optional pageLimit property that determines how many results will be requested per page, it defaults to 25.
Examples: Basic
<SearchResults query={{ pageLimit: 30 }}>
{results => {
// Item rendering logic is omitted
}}
</SearchResults>
With context
<SearchContextProvider initialState={{ pageLimit: 30 }}>
<SearchResults>
{results => {
// Item rendering logic is omitted
}}
</SearchResults>
</SearchContextProvider>
bed5a1dc6e: The <SearchResultList /> component now accepts an optional property disableRenderingWithNoResults to disable rendering when no results are returned.
Possibility to provide a custom no results component if needed through the noResultsComponent property.
Examples:
Rendering a custom no results component
<SearchResultList
query={query}
noResultsComponent={<ListItemText primary="No results were found" />}
/>
Disable rendering when there are no results
<SearchResultList query={query} disableRenderingWithNoResults />
3de4bd4f19: A <SearchPagination /> component was created for limiting the number of results shown per search page. Use this new component to give users options to select how many search results they want to display per page. The default options are 10, 25, 50, 100.
See examples below:
Basic
import React, { useState } from 'react';
import { Grid } from '@material-ui/core';
import { Page, Header, Content, Lifecycle } from '@backstage/core-components';
import {
SearchBarBase,
SearchPaginationBase,
SearchResultList,
} from '@backstage/plugin-search-react';
const SearchPage = () => {
const [term, setTerm] = useState('');
const [pageLimit, setPageLimit] = useState(25);
const [pageCursor, setPageCursor] = useState<string>();
return (
<Page themeId="home">
<Header title="Search" subtitle={<Lifecycle alpha />} />
<Content>
<Grid container direction="row">
<Grid item xs={12}>
<SearchBarBase value={term} onChange={setTerm} />
</Grid>
<Grid item xs={12}>
<SearchPaginationBase
limit={pageLimit}
onLimitChange={setPageLimit}
cursor={pageCursor}
onCursorChange={setPageCursor}
/>
</Grid>
<Grid item xs={12}>
<SearchResultList query={{ term, pageLimit }} />
</Grid>
</Grid>
</Content>
</Page>
);
};
With context
import React from 'react';
import { Grid } from '@material-ui/core';
import { Page, Header, Content, Lifecycle } from '@backstage/core-components';
import {
SearchBar,
SearchResult,
SearchPagination,
SearchResultListLayout,
SearchContextProvider,
DefaultResultListItem,
} from '@backstage/plugin-search-react';
const SearchPage = () => (
<SearchContextProvider>
<Page themeId="home">
<Header title="Search" subtitle={<Lifecycle alpha />} />
<Content>
<Grid container direction="row">
<Grid item xs={12}>
<SearchBar />
</Grid>
<Grid item xs={12}>
<SearchPagination />
</Grid>
<Grid item xs={12}>
<SearchResult>
{({ results }) => (
<SearchResultListLayout
resultItems={results}
renderResultItem={({ document }) => (
<DefaultResultListItem
key={document.location}
result={document}
/>
)}
/>
)}
</SearchResult>
</Grid>
</Grid>
</Content>
</Page>
</SearchContextProvider>
);
6faaa05626: The <SearchResultGroup /> component now accepts an optional property disableRenderingWithNoResults to disable rendering when no results are returned.
Possibility to provide a custom no results component if needed through the noResultsComponent property.
Examples:
Rendering a custom no results component
<SearchResultGroup
query={query}
icon={<DocsIcon />}
title="Documentation"
noResultsComponent={<ListItemText primary="No results were found" />}
/>
Disable rendering when there are no results
<SearchResultGroup
query={query}
icon={<DocsIcon />}
title="Documentation"
disableRenderingWithNoResults
/>
catalogClient argument to createRoute parametersdocumentType whose value corresponds to the type being indexed.5543e86660: BREAKING: The apiRef passed to ProviderSettingsItem now needs to
implement ProfileInfoApi & SessionApi, rather than just the latter. This is
unlikely to have an effect on most users though, since the builtin auth
providers generally implement both.
Fixed settings page showing providers as logged out when the user is using more than one provider, and displayed some additional login information.
.set() to execute a request to the StorageClient if the user is guestrootLoggerFactory.UrlReadergetClient() for a pluginId would return different clients and not share themresponse.json rather than response.send where appropriate, as outlined in SECURITY.mdcreateBackendModule, with guidelines for choosing a module ID.readTaskScheduleDefinitionFromConfig to read TaskScheduleDefinition (aka. schedule) from the Config.startTestBackend.validateEntity from location to locationRefajv compilation of schema validators to improve module-import performancecurve prop to the DependencyGraph component to select the type of layout58c2264325: Newly created Backstage repositories now use the stable version 6 of
react-router, just like the main repo does. Please let us know if you find any
issues with this.
Migrating to the stable version of react-router is optional for the time
being. But if you want to do the same for your existing repository, please
follow this guide.
e05e0f021b: Update versions of packages used in the create-app template, to match those in the main repo
01dff06be4: Leverage cache mounts in Dockerfile during yarn install ... and apt-get ... commands to speed up repeated builds.
90616bcaa6: Add the new search pagination component to the search page template.
7c6306fc8a: Initializes a git repository when creating an app using @packages/create-app
52f25858a8: Added *.session.sql Visual Studio Code database functionality files to .gitignore in the default template. This is optional but potentially helpful if your developers use Visual Studio Code; you can add a line with that exact value to your own root .gitignore if you want the same.
6d00e80146: Updated the root test scripts to use backstage-cli repo test.
To apply this change to an existing app, make the following change to the root package.json:
- "test": "backstage-cli test",
- "test:all": "lerna run test -- --coverage",
+ "test": "backstage-cli repo test",
+ "test:all": "backstage-cli repo test --coverage",
Updated dependencies
0b2a30dead: fixing techdocs-cli Docker client creation
Docker client does not need to be created when --no-docker option is provided.
If you had DOCKER_CERT_PATH environment variable defined the Docker client was looking for certificates and breaking techdocs-cli generate command even with --no-docker option.
Updated dependencies
@material-ui/icons used, to ^4.9.1 like other packages in the main repodocumentType whose value corresponds to the type being indexed.response.json rather than response.send where appropriate, as outlined in SECURITY.md@asyncapi/react-component to 1.0.0-next.43.@asyncapi/react-component to 1.0.0-next.42.@backstage/plugin-app-backend/alpha.getIdentity throws an AuthenticationError instead of a NotAllowed error when authentication failsresponse.json rather than response.send where appropriate, as outlined in SECURITY.mdOverview Card for either latest or random projects. Changed ProjectPreview.tsx so it take gridSize and useTablePagination as props.23f9199a0f: Deprecate @backstage/plugin-catalog-backend-module-bitbucket.
Please migrate to @backstage/plugin-catalog-backend-module-bitbucket-cloud
or @backstage/plugin-catalog-backend-module-bitbucket-server instead.
Updated dependencies
f66e696e7b: Bitbucket Cloud provider: Add option to configure schedule via app-config.yaml instead of in code.
Please find how to configure the schedule at the config at https://backstage.io/docs/integrations/bitbucketCloud/discovery
a9b91d39bb: Add bitbucketCloudCatalogModule (new backend-plugin-api, alpha).
Updated dependencies
8749df3d02: GitHubEntityProvider: Add option to configure schedule via app-config.yaml instead of in code.
Please find how to configure the schedule at the config at https://backstage.io/docs/integrations/github/discovery
7022aebf35: Added GithubLocationAnalyzer. This can be used to add to the CatalogBuilder. When added this will be used by RepoLocationAnalyzer to figure out if the given URL that you are trying to import from the /catalog-import page already contains catalog-info.yaml files.
51046b58b0: Use schedule from config at backend module.
Also, it removes GithubEntityProviderCatalogModuleOptions
in favor of config-only for the backend module setup
like at other similar modules.
7edb5909e8: Add missing config schema for the GitHubEntityProvider.
be9474b103: Replaces in-code uses of GitHub by Github and deprecates old versions.
Deprecates
GitHubEntityProvider replaced by GithubEntityProviderGitHubLocationAnalyzer replaced by GithubLocationAnalyzerGitHubLocationAnalyzerOptions replaced by GithubLocationAnalyzerOptionsGitHubOrgEntityProvider replaced by GithubOrgEntityProviderGitHubOrgEntityProviderOptions replaced by GithubOrgEntityProviderOptionsRenames
GitHubLocationAnalyzer to GithubLocationAnalyzerGitHubLocationAnalyzerOptions to GithubLocationAnalyzerOptionsa35a27df70: Updated the moduleId of the experimental module export.
Updated dependencies
823acaa88b: Moved the following types from @backstage/plugin-catalog-backend to this package.
Updated dependencies
curve prop to the DependencyGraph component to select the type of layout@material-ui/icons used, to ^4.9.1 like other packages in the main repoCostOverviewBreakdownChart component where some datasets caused the cost overview breakdown chart to tear.luxon dependency to 3.xresponse.json rather than response.send where appropriate, as outlined in SECURITY.mdextraRequestHeaders configuration was ignored.useCustomResources hookresponse.json rather than response.send where appropriate, as outlined in SECURITY.mdresponse.json rather than response.send where appropriate, as outlined in SECURITY.mdresponse.json rather than response.send where appropriate, as outlined in SECURITY.mdpageLimit property on search queries. If none is provided, the search engine will continue to use its default value of 25 results per page.documentType whose value corresponds to the type being indexed.pageLimit property on search queries. If none is provided, the search engine will continue to use its default value of 25 results per page.pageLimit property on search queries. If none is provided, the search engine will continue to use its default value of 25 results per page.documentType whose value corresponds to the type being indexed.documentType whose value corresponds to the type being indexed.response.json rather than response.send where appropriate, as outlined in SECURITY.mdnode-library.0b2a30dead: fixing techdocs-cli Docker client creation
Docker client does not need to be created when --no-docker option is provided.
If you had DOCKER_CERT_PATH environment variable defined the Docker client was looking for certificates and breaking techdocs-cli generate command even with --no-docker option.
Updated dependencies
Response.status instead of .send(number)response.json rather than response.send where appropriate, as outlined in SECURITY.mdREADME.md.