docs/releases/v1.6.0-next.0-changelog.md
6c1c59b96e: Added README card EntityAzureReadmeCard for Azure Devops.
To get the README component working you'll need to do the following two steps:
First we need to add the @backstage/plugin-azure-devops package to your frontend app:
yarn add --cwd packages/app @backstage/plugin-azure-devops
Second we need to add the EntityAzureReadmeCard extension to the entity page in your app:
// In packages/app/src/components/catalog/EntityPage.tsx
import {
EntityAzureReadmeCard,
isAzureDevOpsAvailable,
} from '@backstage/plugin-azure-devops';
// As it is a card, you can customize it the way you prefer
// For example in the Service section
const overviewContent = (
<Grid container spacing={3} alignItems="stretch">
<EntitySwitch>
<EntitySwitch.Case if={isAzureDevOpsAvailable}>
<Grid item md={6}>
...
</Grid>
<Grid item md={6}>
<EntityAzureReadmeCard maxHeight={350} />
</Grid>
</EntitySwitch.Case>
</EntitySwitch>
</Grid>
);
Notes:
EntitySwitch.Case above from step 2 to all the entity sections you want to see Readme in. For example if you wanted to see Readme when looking at Website entities then you would need to add this to the websiteEntityPage section.if prop is optional on the EntitySwitch.Case, you can remove it if you always want to see the tab even if the entity being viewed does not have the needed annotationmaxHeight property on the EntityAzureReadmeCard will set the maximum screen size you would like to see, if not set it will default to 100%msw to ^0.45.0.6c1c59b96e: Added README card EntityAzureReadmeCard for Azure Devops.
To get the README component working you'll need to do the following two steps:
First we need to add the @backstage/plugin-azure-devops package to your frontend app:
yarn add --cwd packages/app @backstage/plugin-azure-devops
Second we need to add the EntityAzureReadmeCard extension to the entity page in your app:
// In packages/app/src/components/catalog/EntityPage.tsx
import {
EntityAzureReadmeCard,
isAzureDevOpsAvailable,
} from '@backstage/plugin-azure-devops';
// As it is a card, you can customize it the way you prefer
// For example in the Service section
const overviewContent = (
<Grid container spacing={3} alignItems="stretch">
<EntitySwitch>
<EntitySwitch.Case if={isAzureDevOpsAvailable}>
<Grid item md={6}>
...
</Grid>
<Grid item md={6}>
<EntityAzureReadmeCard maxHeight={350} />
</Grid>
</EntitySwitch.Case>
</EntitySwitch>
</Grid>
);
Notes:
EntitySwitch.Case above from step 2 to all the entity sections you want to see Readme in. For example if you wanted to see Readme when looking at Website entities then you would need to add this to the websiteEntityPage section.if prop is optional on the EntitySwitch.Case, you can remove it if you always want to see the tab even if the entity being viewed does not have the needed annotationmaxHeight property on the EntityAzureReadmeCard will set the maximum screen size you would like to see, if not set it will default to 100%e44c0b3811: New features:
msw to ^0.45.0.async validation for the next version of the plugincreate/nextEntityPickerjson-schema-library to ^7.0.0.msw to ^0.45.0.ea2eee9e6a: Add the option for a homepage when using the github:publish action
8872cc735d: Fixed a bug in plugin-scaffolder-backend where it ignores the skip migration database options.
To use this new implementation you need to create the instance of DatabaseTaskStore using the PluginDatabaseManager instead of Knex;
import { DatabaseManager, getRootLogger, loadBackendConfig } from '@backstage/backend-common';
import { DatabaseTaskStore } from '@backstage/plugin-scaffolder-backend';
const config = await loadBackendConfig({ argv: process.argv, logger: getRootLogger() });
const databaseManager = DatabaseManager.fromConfig(config, { migrations: { skip: true } });
const databaseTaskStore = await DatabaseTaskStore.create(databaseManager);
1ff817b3f0: add entity metadata to the template info type
msw to ^0.45.0.publish:file action, use the template editor to test templates instead.8872cc735d: Fixed a bug in search-backend-module-pg where it ignores the skip migration database options when using the database.
To use this new implementation you need to create the instance of DatabaseDocumentStore using the PluginDatabaseManager instead of Knex;
import { DatabaseManager, getRootLogger, loadBackendConfig } from '@backstage/backend-common';
import { DatabaseDocumentStore } from '@backstage/plugin-search-backend-module-pg';
const config = await loadBackendConfig({ argv: process.argv, logger: getRootLogger() });
const databaseManager = DatabaseManager.fromConfig(config, { migrations: { skip: true } });
const databaseDocumentStore = await DatabaseDocumentStore.create(databaseManager);
ServiceFactory.swc instead of sucrasemsw to ^0.45.0.ServiceFactory.ServiceFactory type and removed AnyServiceFactory.ServiceRef you can now also include a defaultFactory, which will be used to construct instances of the service in case there is no explicit factory defined.msw to ^0.45.0.ServiceFactory.msw to ^0.45.0.6ae0f6a719: Switch out sucrase for swc for transpilation.
sucrase is a little more relaxed when it comes to supporting the ways of mocking in jest. You might have to make some changes to your tests to meet the jest standard and spec if your tests seems to start failing.
Mocks that look like this are invalid, and they will throw a reference error in line with the jest documentation here on example 3
const mockCommandExists = jest.fn();
jest.mock('command-exists', () => mockCommandExists);
You might need to update these mocks to look a little like the following to defer the call to the jest.fn() spy until the mock is called.
const mockCommandExists = jest.fn();
jest.mock(
'command-exists',
() =>
(...args: any[]) =>
commandExists(...args),
);
Also, imports are immutable. So it means that you might get some errors when trying to use jest.spyOn with starred imports. You might see an error like this:
TypeError: Cannot redefine property: executeFrameHandlerStrategy
at Function.defineProperty (<anonymous>)
20 | import { AuthResolverContext } from '../types';
21 |
> 22 | const mockFrameHandler = jest.spyOn(
| ^
23 | helpers,
24 | 'executeFrameHandlerStrategy',
25 | ) as unknown as jest.MockedFunction<
This happens when you try to do import * as something from './something' and then jest.spyOn(something, 'test). You will need to add a jest.mock call to mock out the required starred import to return jest.fn() functions from the start. Something like this fixes the above test:
jest.mock('../../helpers', () => ({
executeFrameHandlerStrategy: jest.fn(),
}));
You can also remove any occurrence of hot(App) and any import of react-hot-loader if you're using the that package locally, as all this has now been replaced with React Refresh which you will get out of the box with the new CLI.
Note If you're experiencing difficulties with running tests after the migration, please reach out to us on Discord to see if we can help, or raise an issue. But in the meantime you can switch back to the existing behaviour by using the following config in your root package.json.
"jest": {
"transform": {
"\\.(js|jsx|ts|tsx|mjs|cjs)$": "@backstage/cli/config/jestSucraseTransform.js",
"\\.(bmp|gif|jpg|jpeg|png|frag|xml|svg|eot|woff|woff2|ttf)$": "@backstage/cli/config/jestFileTransform.js",
"\\.(yaml)$": "jest-transform-yaml"
}
}
bf5e9030eb: Updated dependency msw to ^0.45.0.
Updated dependencies
msw to ^0.45.0.getSystemIcons() function to the AppContext available through useApp that will pull a list of all the icons that have been registered in the App.msw to ^0.45.0.msw to ^0.45.0.getSystemIcons() function to the AppContext available through useApp that will pull a list of all the icons that have been registered in the App.msw to ^0.45.0.e83de28e36: Fix typo in the documentation
208d6780c9: The packages/backend/Dockerfile received a couple of updates, it now looks as follows:
FROM node:16-bullseye-slim
# Install sqlite3 dependencies. You can skip this if you don't use sqlite3 in the image,
# in which case you should also move better-sqlite3 to "devDependencies" in package.json.
RUN apt-get update && \
apt-get install -y --no-install-recommends libsqlite3-dev python3 build-essential && \
rm -rf /var/lib/apt/lists/* && \
yarn config set python /usr/bin/python3
# From here on we use the least-privileged `node` user to run the backend.
USER node
WORKDIR /app
# This switches many Node.js dependencies to production mode.
ENV NODE_ENV production
# Copy repo skeleton first, to avoid unnecessary docker cache invalidation.
# The skeleton contains the package.json of each package in the monorepo,
# and along with yarn.lock and the root package.json, that's enough to run yarn install.
COPY --chown=node:node yarn.lock package.json packages/backend/dist/skeleton.tar.gz ./
RUN tar xzf skeleton.tar.gz && rm skeleton.tar.gz
RUN yarn install --frozen-lockfile --production --network-timeout 300000 && rm -rf "$(yarn cache dir)"
# Then copy the rest of the backend bundle, along with any other files we might want.
COPY --chown=node:node packages/backend/dist/bundle.tar.gz app-config*.yaml ./
RUN tar xzf bundle.tar.gz && rm bundle.tar.gz
CMD ["node", "packages/backend", "--config", "app-config.yaml", "--config", "app-config.production.yaml"]
The two notable changes are that a USER node instruction has been added and the ordering of instructions has been changed accordingly. This means that the app will now be running using the least-privileged node user. In order for this to work we now need to make sure that all app files are owned by the node user, which we do by adding the --chown=node:node option to the COPY instructions.
The second change is the addition of ENV NODE_ENV production, which ensured that all Node.js modules run in production mode. If you apply this change to an existing app, note that one of the more significant changes is that this switches the log formatting to use the default production format, JSON. Rather than your log lines looking like this:
2022-08-10T11:36:05.478Z catalog info Performing database migration type=plugin
They will now look like this:
{"level":"info","message":"Performing database migration","plugin":"catalog","service":"backstage","type":"plugin"}
If you wish to keep the existing format, you can override this change by applying the following change to packages/backend/src/index.ts:
getRootLogger,
+ setRootLogger,
+ createRootLogger,
+ coloredFormat,
useHotMemoize,
...
ServerTokenManager,
} from '@backstage/backend-common';
...
async function main() {
+ setRootLogger(createRootLogger({ format: coloredFormat }));
+
const config = await loadBackendConfig({
c0a08fd08c: Added EntityLinksCard to the system EntityPage.
For an existing installation where you want to display the links card for entity pages of kind system you should make the following adjustment to packages/app/src/components/catalog/EntityPage.tsx
const systemPage = (
...
<Grid item md={6} xs={12}>
<EntityCatalogGraphCard variant="gridItem" height={400} />
</Grid>
+ <Grid item md={4} xs={12}>
+ <EntityLinksCard />
+ </Grid>
- <Grid item md={6}>
+ <Grid item md={8}>
<EntityHasComponentsCard variant="gridItem" />
</Grid>
...
);
react-hot-loader, since the @backstage/cli now uses swc with React Refresh instead.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.3f739be9d9: Minor API signatures cleanup
bf5e9030eb: Updated dependency msw to ^0.45.0.
cb1cfc018b: createRouter now requires an additional reader: UrlReader argument
export default async function createPlugin(
env: PluginEnvironment,
): Promise<Router> {
return createRouter({
logger: env.logger,
config: env.config,
+ reader: env.reader,
});
}
Remember to check if you have already provided these settings previously.
# app-config.yaml
azureDevOps:
host: dev.azure.com
token: my-token
organization: my-company
# app-config.yaml
integrations:
azure:
- host: dev.azure.com
token: ${AZURE_TOKEN}
ef9ab322de: Minor API signatures cleanup
Updated dependencies
msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.CatalogProcessingExtensionPoint now accepts multiple providers and processors at once.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.searchStream method in LDAP client awaits the callbacksmsw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.CatalogProcessingExtensionPoint now accepts multiple providers and processors at once.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.CostInsightsHeadercomponent now uses group names if availablemsw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.UserProfileCard that is enabled when the backstage.io/edit-url is present, this matches how the GroupProfileCard worksmsw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.TechDocs reader page.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.msw to ^0.45.0.