From 3daad614529df66948d936640a28ab027a2134c5 Mon Sep 17 00:00:00 2001 From: Andrei Ivanovici Date: Wed, 20 Mar 2024 10:29:05 +0200 Subject: [PATCH 001/387] feat: support imports from azure devops Signed-off-by: Andrei Ivanovici --- .changeset/rude-buckets-invite.md | 7 + plugins/catalog-import/src/api/AzureDevops.ts | 81 ++++ .../src/api/AzureRepoApiClient.test.ts | 356 ++++++++++++++++++ .../src/api/AzureRepoApiClient.ts | 269 +++++++++++++ .../src/api/CatalogImportClient.test.ts | 68 +++- .../src/api/CatalogImportClient.ts | 194 +++------- plugins/catalog-import/src/api/GitHub.ts | 135 ++++++- .../ImportInfoCard/ImportInfoCard.tsx | 18 +- 8 files changed, 976 insertions(+), 152 deletions(-) create mode 100644 .changeset/rude-buckets-invite.md create mode 100644 plugins/catalog-import/src/api/AzureDevops.ts create mode 100644 plugins/catalog-import/src/api/AzureRepoApiClient.test.ts create mode 100644 plugins/catalog-import/src/api/AzureRepoApiClient.ts diff --git a/.changeset/rude-buckets-invite.md b/.changeset/rude-buckets-invite.md new file mode 100644 index 0000000000..51dca15a82 --- /dev/null +++ b/.changeset/rude-buckets-invite.md @@ -0,0 +1,7 @@ +--- +'@backstage/plugin-catalog-import': patch +--- + +Integrated Azure Devops as a catalog import source. This enables Backstage to create Pull Requests to Azure Devops repositories as it does with GitHub repositories + +NO BREAKING CHANGES diff --git a/plugins/catalog-import/src/api/AzureDevops.ts b/plugins/catalog-import/src/api/AzureDevops.ts new file mode 100644 index 0000000000..d2cf9eacd7 --- /dev/null +++ b/plugins/catalog-import/src/api/AzureDevops.ts @@ -0,0 +1,81 @@ +/* + * Copyright 2024 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 { AzureIntegration } from '@backstage/integration'; +import { ScmAuthApi } from '@backstage/integration-react'; +import { ConfigApi } from '@backstage/core-plugin-api'; +import { getBranchName, getCatalogFilename } from '../components/helpers'; +import { createAzurePullRequest } from './AzureRepoApiClient'; +import parseGitUrl from 'git-url-parse'; + +export interface AzureRepoParts { + tenantUrl: string; + repoName: string; + project: string; +} + +export function parseAzureUrl( + repoUrl: string, + integration: AzureIntegration, +): AzureRepoParts { + const { organization, owner, name } = parseGitUrl(repoUrl); + const tenantUrl = `https://${integration.config.host}/${organization}`; + return { tenantUrl, repoName: name, project: owner }; +} + +export async function submitAzurePrToRepo( + integration: AzureIntegration, + options: { + title: string; + body: string; + fileContent: string; + repositoryUrl: string; + }, + scmAuthApi: ScmAuthApi, + configApi: ConfigApi, +) { + const { repositoryUrl, fileContent, title, body } = options; + + const branchName = getBranchName(configApi); + const fileName = getCatalogFilename(configApi); + + const { token } = await scmAuthApi.getCredentials({ + url: repositoryUrl, + additionalScope: { + repoWrite: true, + }, + }); + const { tenantUrl, repoName, project } = parseAzureUrl( + repositoryUrl, + integration, + ); + const result = await createAzurePullRequest({ + token, + fileContent, + title, + description: body, + project, + repository: repoName, + branchName, + tenantUrl, + fileName, + }); + const catalogLocation = `${result.repository.webUrl}?path=/${fileName}`; + const prLocation = `${result.repository.webUrl}/pullrequest/${result.pullRequestId}`; + return { + link: prLocation!, + location: catalogLocation, + }; +} diff --git a/plugins/catalog-import/src/api/AzureRepoApiClient.test.ts b/plugins/catalog-import/src/api/AzureRepoApiClient.test.ts new file mode 100644 index 0000000000..6579bba5a9 --- /dev/null +++ b/plugins/catalog-import/src/api/AzureRepoApiClient.test.ts @@ -0,0 +1,356 @@ +/* + * Copyright 2024 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 { rest } from 'msw'; +import { + AzurePrOptions, + AzurePrResult, + AzureRef, + AzureRefUpdate, + AzureRepo, + createAzurePullRequest, + CreatePrOptions, + NewBranchOptions, + RepoApiClient, +} from './AzureRepoApiClient'; +import { setupServer } from 'msw/node'; +import { setupRequestMockHandlers } from '@backstage/test-utils'; + +function mockRepoEndpoint() { + return rest.get( + 'https://dev.azure.com/acme/project/_apis/git/repositories/:path', + (req, res, ctx) => { + const { path } = req.params; + if (path === 'success') { + return res( + ctx.json({ + id: '01', + name: 'success', + defaultBranch: 'refs/heads/master', + }), + ); + } + if (path === 'not-found') { + return res( + ctx.status(404), + ctx.json({ + message: 'repository not found', + }), + ); + } + return res(ctx.status(200)); + }, + ); +} + +function mockRefsEndpoint() { + return rest.get( + 'https://dev.azure.com/acme/project/_apis/git/repositories/:repo/refs', + (req, res, ctx) => { + const filter = req.url.searchParams.get('filter'); + const { repo } = req.params; + if (repo !== 'success') { + return res( + ctx.status(404), + ctx.json({ + message: 'repository not found', + }), + ); + } + if (filter === 'heads/main') { + const result = { + value: [ + { + name: 'refs/heads/main', + objectId: '0000000000000000000000000000000000000000', + }, + ], + }; + return res(ctx.json(result)); + } + return res(ctx.json({ value: [] })); + }, + ); +} + +function mockPushEndpoint() { + return rest.post( + 'https://dev.azure.com/acme/project/_apis/git/repositories/:repo/pushes', + (req, res, ctx) => { + const { repo } = req.params; + if (repo === 'success') { + return res( + ctx.json({ + refUpdates: [ + { + repositoryId: '01', + name: 'refs/heads/backstage-integration', + oldObjectId: '0000000000000000000000000000000000000000', + newObjectId: '0000000000000000000000000000000000000001', + }, + ], + } satisfies { refUpdates: AzureRefUpdate[] }), + ); + } + + if (repo === 'error') { + return res( + ctx.status(500), + ctx.json({ + message: 'internal error', + }), + ); + } + + return res( + ctx.status(500), + ctx.json({ + message: 'Unexpected call', + }), + ); + }, + ); +} + +function mockPrEndpoint() { + return rest.post( + 'https://dev.azure.com/acme/project/_apis/git/repositories/:repo/pullrequests', + (req, res, ctx) => { + const { repo } = req.params; + if (repo === 'success') { + return res( + ctx.json({ + pullRequestId: 'PR01', + repository: { + name: 'success', + webUrl: 'https://example.com', + }, + } satisfies AzurePrResult), + ); + } + + return res( + ctx.status(500), + ctx.json({ + message: 'internal error', + }), + ); + }, + ); +} + +describe('RepoApiClient', () => { + const server = setupServer(); + setupRequestMockHandlers(server); + const sut = new RepoApiClient({ + token: 'token', + project: 'project', + tenantUrl: 'https://dev.azure.com/acme', + }); + beforeEach(() => { + server.use( + mockPrEndpoint(), + mockRefsEndpoint(), + mockPushEndpoint(), + mockRepoEndpoint(), + ); + }); + describe('getRepository', () => { + it('should get an existing repository', async () => { + await expect(sut.getRepository('success')).resolves.toEqual({ + id: '01', + name: 'success', + defaultBranch: 'refs/heads/master', + }); + }); + it('should throw when the repository repository does not exist', async () => { + await expect(sut.getRepository('not-found')).rejects.toThrow( + new Error('repository not found'), + ); + }); + }); + describe('getDefaultBranch', () => { + it('should return when correct branch', async () => { + const foundRef = await sut.getDefaultBranch({ + name: 'success', + defaultBranch: 'refs/heads/main', + id: '01', + }); + expect(foundRef).toEqual({ + name: 'refs/heads/main', + objectId: '0000000000000000000000000000000000000000', + }); + }); + + it('should throw when the repository does not exist', async () => { + const promise = sut.getDefaultBranch({ + name: 'fail', + defaultBranch: 'refs/heads/main', + id: '01', + }); + await expect(promise).rejects.toThrow(new Error('repository not found')); + }); + + it('should throw when the default branch does not exist', async () => { + const promise = sut.getDefaultBranch({ + name: 'success', + defaultBranch: 'refs/heads/missing_branch', + id: '01', + }); + await expect(promise).rejects.toThrow( + new Error(`The requested ref 'heads/missing_branch' was not found`), + ); + }); + }); + describe('pushNewBranch', () => { + let sourceBranch: AzureRef; + let options: NewBranchOptions; + let expectedResult: AzureRefUpdate; + + beforeEach(() => { + sourceBranch = { + name: 'refs/heads/main', + objectId: '0000000000000000000000000000000000000000', + }; + options = { + title: 'title', + branchName: 'backstage-integration', + fileName: 'catalog-info.yaml', + fileContent: 'This is a test', + }; + expectedResult = { + repositoryId: '01', + name: 'refs/heads/backstage-integration', + oldObjectId: '0000000000000000000000000000000000000000', + newObjectId: '0000000000000000000000000000000000000001', + }; + }); + it('should create a new branch', async () => { + await expect( + sut.pushNewBranch('success', sourceBranch, options), + ).resolves.toEqual(expectedResult); + }); + it('should throw when api call fails', async () => { + await expect( + sut.pushNewBranch('error', sourceBranch, options), + ).rejects.toThrow(new Error('internal error')); + }); + }); + describe('createPullRequest', () => { + const sourceBranchName = 'refs/heads/main'; + const targetBranchName = 'refs/heads/backstage-integration'; + const options: CreatePrOptions = { + title: 'Title', + description: 'Description', + }; + it('should create a new Pull request', async () => { + await expect( + sut.createPullRequest( + 'success', + sourceBranchName, + targetBranchName, + options, + ), + ).resolves.toEqual({ + pullRequestId: 'PR01', + repository: { + name: 'success', + webUrl: 'https://example.com', + }, + } satisfies AzurePrResult); + }); + it('should throw when api call fails', async () => { + await expect( + sut.createPullRequest( + 'error', + sourceBranchName, + targetBranchName, + options, + ), + ).rejects.toThrow(new Error('internal error')); + }); + }); +}); +describe('createAzurePullRequest', () => { + let client: RepoApiClient; + let clientMock: Record; + + beforeEach(() => { + clientMock = { + createPullRequest: jest.fn(), + pushNewBranch: jest.fn(), + getRepository: jest.fn(), + getDefaultBranch: jest.fn(), + }; + client = clientMock as any as RepoApiClient; + }); + + it('should create a new Pull request', async () => { + const options: AzurePrOptions = { + tenantUrl: 'https://dev.azure.com/acme', + repository: 'test', + project: 'project', + fileName: 'catalog-info.yaml', + title: 'Test Title', + fileContent: 'content', + branchName: 'backstage-integration', + description: 'Test Description', + token: 'token', + }; + const repo: AzureRepo = { + name: options.repository, + defaultBranch: 'ref/heads/main', + id: '01', + }; + const defaultBranch: AzureRef = { + name: 'ref/heads/main', + objectId: '000000000000000000000000000000000000000', + }; + const expectedResult: AzurePrResult = { + pullRequestId: 'PR01', + repository: { + name: options.repository, + webUrl: 'https://dev.azure.com/acme/project', + }, + }; + + clientMock.getRepository.mockResolvedValue(repo); + clientMock.getDefaultBranch.mockResolvedValue(defaultBranch); + clientMock.pushNewBranch.mockResolvedValue({ + name: options.branchName, + oldObjectId: '000000000000000000000000000000000000000', + newObjectId: '000000000000000000000000000000000000001', + repositoryId: '01', + } satisfies AzureRefUpdate); + clientMock.createPullRequest.mockResolvedValue(expectedResult); + + await expect(createAzurePullRequest(options, client)).resolves.toEqual( + expectedResult, + ); + expect(clientMock.getRepository).toHaveBeenCalledWith(options.repository); + expect(clientMock.getDefaultBranch).toHaveBeenCalledWith(repo); + expect(clientMock.pushNewBranch).toHaveBeenCalledWith( + repo.name, + defaultBranch, + options, + ); + expect(clientMock.createPullRequest).toHaveBeenCalledWith( + repo.name, + options.branchName, + defaultBranch.name, + options, + ); + }); +}); diff --git a/plugins/catalog-import/src/api/AzureRepoApiClient.ts b/plugins/catalog-import/src/api/AzureRepoApiClient.ts new file mode 100644 index 0000000000..ea152b2947 --- /dev/null +++ b/plugins/catalog-import/src/api/AzureRepoApiClient.ts @@ -0,0 +1,269 @@ +/* + * Copyright 2024 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. + */ + +export interface AzurePrOptions { + tenantUrl: string; + title: string; + project: string; + branchName: string; + repository: string; + token: string; + fileContent: string; + fileName: string; + description: string; +} + +export interface CreateAzurePr { + sourceRefName: string; + targetRefName: string; + title: string; + description: string; +} + +export interface AzureRepo { + id: string; + name: string; + defaultBranch: string; +} + +export interface AzureRef { + name: string; + objectId: string; +} + +interface RefQueryResult { + value: AzureRef[]; +} + +export interface AzureCommit { + comment: string; + + changes: { + changeType: string; + item: { + path: string; + }; + newContent: { + content: string; + contentType: 'rawtext'; + }; + }[]; +} + +export interface AzureRefUpdate { + repositoryId: string; + name: string; + oldObjectId: string; + newObjectId: string; +} + +export interface AzurePushResult { + refUpdates: AzureRefUpdate[]; +} + +export interface AzurePush { + refUpdates: { + name: string; + oldObjectId: string; + }[]; + commits: AzureCommit[]; +} + +export interface AzurePrResult { + pullRequestId: string; + repository: { + name: string; + webUrl: string; + }; +} + +const apiVersions = { + V7_2p_1: '7.2-preview.1', + V7_2p_2: '7.2-preview.2', +}; + +export interface RepoApiClientOptions { + project: string; + tenantUrl: string; + token: string; +} + +export interface NewBranchOptions { + fileContent: string; + fileName: string; + title: string; + branchName: string; +} + +export interface CreatePrOptions { + description: string; + title: string; +} + +export class RepoApiClient { + private createEndpoint = ( + path: string, + version: string, + queryParams: Record | undefined = undefined, + ) => { + const url = new URL( + `${this._options.tenantUrl}/${this._options.project}/_apis/git/repositories`, + ); + url.pathname += path; + + url.searchParams.set('api-version', version); + Object.entries(queryParams ?? {}).forEach(([key, value]) => + url.searchParams.set(key, value), + ); + return url.toString(); + }; + + constructor(private _options: RepoApiClientOptions) {} + + private async get( + path: string, + version: string, + queryParams: Record | undefined = undefined, + ): Promise { + const endpoint = this.createEndpoint(path, version, queryParams); + const result = await fetch(endpoint, { + headers: { + Authorization: `Bearer ${this._options.token}`, + }, + }); + if (!result.ok) { + return result.json().then(it => Promise.reject(new Error(it.message))); + } + return await result.json(); + } + + private async post( + path: string, + version: string, + payload: unknown, + ): Promise { + const endpoint = this.createEndpoint(path, version); + const result = await fetch(endpoint, { + method: 'POST', + headers: { + Authorization: `Bearer ${this._options.token}`, + 'Content-Type': 'application/json', + }, + body: JSON.stringify(payload), + }); + if (!result.ok) { + return result.json().then(it => Promise.reject(new Error(it.message))); + } + return await result.json(); + } + + async getRepository(repositoryName: string): Promise { + return this.get(`/${repositoryName}`, apiVersions.V7_2p_1); + } + + async getDefaultBranch(repo: AzureRepo): Promise { + const filter = repo.defaultBranch.replace('refs/', ''); + const result: RefQueryResult = await this.get( + `/${repo.name}/refs`, + apiVersions.V7_2p_2, + { filter }, + ); + if (!result.value?.length) { + return Promise.reject( + new Error(`The requested ref '${filter}' was not found`), + ); + } + return result.value[0]; + } + + async pushNewBranch( + repoName: string, + sourceBranch: AzureRef, + options: NewBranchOptions, + ): Promise { + const push: AzurePush = { + refUpdates: [ + { + name: `refs/heads/${options.branchName}`, + oldObjectId: sourceBranch.objectId, + }, + ], + commits: [ + { + comment: options.title, + changes: [ + { + changeType: 'add', + item: { + path: `/${options.fileName}`, + }, + newContent: { + content: options.fileContent, + contentType: 'rawtext', + }, + }, + ], + }, + ], + }; + const result = await this.post( + `/${repoName}/pushes`, + apiVersions.V7_2p_2, + push, + ); + return result.refUpdates[0]; + } + + async createPullRequest( + repoName: string, + sourceName: string, + targetName: string, + options: CreatePrOptions, + ): Promise { + const payload: CreateAzurePr = { + title: options.title, + description: options.description, + sourceRefName: sourceName, + targetRefName: targetName, + }; + + return await this.post( + `/${repoName}/pullrequests`, + apiVersions.V7_2p_2, + payload, + ); + } +} + +export async function createAzurePullRequest( + options: AzurePrOptions, + client: RepoApiClient | undefined = undefined, +): Promise { + const actualClient = client ?? new RepoApiClient(options); + const repo = await actualClient.getRepository(options.repository); + const defaultBranch = await actualClient.getDefaultBranch(repo); + const refUpdate = await actualClient.pushNewBranch( + repo.name, + defaultBranch, + options, + ); + return actualClient.createPullRequest( + repo.name, + refUpdate.name, + defaultBranch.name, + options, + ); +} diff --git a/plugins/catalog-import/src/api/CatalogImportClient.test.ts b/plugins/catalog-import/src/api/CatalogImportClient.test.ts index df44ec94c4..d4e4eeed54 100644 --- a/plugins/catalog-import/src/api/CatalogImportClient.test.ts +++ b/plugins/catalog-import/src/api/CatalogImportClient.test.ts @@ -46,6 +46,12 @@ jest.mock('@octokit/rest', () => { return { Octokit }; }); +jest.mock('./AzureRepoApiClient', () => { + return { + createAzurePullRequest: jest.fn(), + }; +}); + import { ConfigReader, UrlPatternDiscovery } from '@backstage/core-app-api'; import { ScmIntegrations } from '@backstage/integration'; import { ScmAuthApi } from '@backstage/integration-react'; @@ -55,6 +61,11 @@ import { Octokit } from '@octokit/rest'; import { rest } from 'msw'; import { setupServer } from 'msw/node'; import { CatalogImportClient } from './CatalogImportClient'; +import { + AzurePrOptions, + AzurePrResult, + createAzurePullRequest, +} from './AzureRepoApiClient'; describe('CatalogImportClient', () => { const server = setupServer(); @@ -269,7 +280,7 @@ describe('CatalogImportClient', () => { }); }); - it('should reject for integrations that are not github ones', async () => { + it('should reject for integrations that are not github or azure', async () => { await expect( catalogImportClient.analyzeUrl( 'https://registered-but-not-github.com/backstage/backstage', @@ -619,6 +630,61 @@ describe('CatalogImportClient', () => { base: 'main', }); }); + it('should create AzureDevops pull request', async () => { + catalogApi.validateEntity.mockResolvedValueOnce({ + valid: true, + }); + const azureMock = createAzurePullRequest as jest.Mock; + azureMock.mockResolvedValueOnce({ + repository: { + name: 'backstage', + webUrl: 'https://dev.azure.com/spotify/backstage/_git/backstage', + }, + pullRequestId: '01', + } satisfies AzurePrResult); + const expectedPrOptions: AzurePrOptions = { + title: 'A title/message', + description: 'A body', + repository: 'backstage', + fileName: 'catalog-info.yaml', + project: 'backstage', + tenantUrl: 'https://dev.azure.com/spotify', + branchName: 'backstage-integration', + token: 'token', + fileContent: ` + { + "apiVersion": "backstage.io/v1alpha1", + "kind": "Component", + "metadata": { + "name": "valid-name", + "annotations": { + "github.com/project-slug": "backstage/example-repo" + } + }, + "spec": { + "type": "other", + "lifecycle": "unknown", + "owner": "backstage" + } + } + `, + }; + await expect( + catalogImportClient.submitPullRequest({ + repositoryUrl: + 'https://dev.azure.com/spotify/backstage/_git/backstage', + fileContent: expectedPrOptions.fileContent, + title: expectedPrOptions.title, + body: expectedPrOptions.description, + }), + ).resolves.toEqual({ + link: 'https://dev.azure.com/spotify/backstage/_git/backstage/pullrequest/01', + location: + 'https://dev.azure.com/spotify/backstage/_git/backstage?path=/catalog-info.yaml', + }); + + expect(azureMock).toHaveBeenCalledWith(expectedPrOptions); + }); it('Submit Pull Request with invalid component name', async () => { const ErrorMessage = 'Policy check failed for component:default/invalid name; caused by Error: "metadata.name" is not valid; expected a string that is sequences of [a-zA-Z0-9] separated by any of [-_.], at most 63 characters in total but found "invalid name". To learn more about catalog file format, visit: https://github.com/backstage/backstage/blob/master/docs/architecture-decisions/adr002-default-catalog-file-format.md'; diff --git a/plugins/catalog-import/src/api/CatalogImportClient.ts b/plugins/catalog-import/src/api/CatalogImportClient.ts index cecb85f9a3..e05e3882c4 100644 --- a/plugins/catalog-import/src/api/CatalogImportClient.ts +++ b/plugins/catalog-import/src/api/CatalogImportClient.ts @@ -21,18 +21,19 @@ import { IdentityApi, } from '@backstage/core-plugin-api'; import { - GithubIntegrationConfig, + AzureIntegration, + GithubIntegration, ScmIntegrationRegistry, } from '@backstage/integration'; import { ScmAuthApi } from '@backstage/integration-react'; -import { Octokit } from '@octokit/rest'; -import { Base64 } from 'js-base64'; import { AnalyzeResult, CatalogImportApi } from './CatalogImportApi'; import YAML from 'yaml'; -import { getGithubIntegrationConfig } from './GitHub'; -import { getBranchName, getCatalogFilename } from '../components/helpers'; +import { GitHubOptions, submitGitHubPrToRepo } from './GitHub'; +import { getCatalogFilename } from '../components/helpers'; import { AnalyzeLocationResponse } from '@backstage/plugin-catalog-common'; import { CompoundEntityRef } from '@backstage/catalog-model'; +import parseGitUrl from 'git-url-parse'; +import { submitAzurePrToRepo } from './AzureDevops'; /** * The default implementation of the {@link CatalogImportApi}. @@ -89,15 +90,17 @@ export class CatalogImportClient implements CatalogImportApi { ], }; } - - const ghConfig = getGithubIntegrationConfig(this.scmIntegrationsApi, url); - if (!ghConfig) { - const other = this.scmIntegrationsApi.byUrl(url); + const supportedIntegrations = ['github', 'azure']; + const foundIntegration = this.scmIntegrationsApi.byUrl(url); + const iSupported = supportedIntegrations.find( + it => it === foundIntegration?.type, + ); + if (!iSupported) { const catalogFilename = getCatalogFilename(this.configApi); - if (other) { + if (foundIntegration) { throw new Error( - `The ${other.title} integration only supports full URLs to ${catalogFilename} files. Did you try to pass in the URL of a directory instead?`, + `The ${foundIntegration.title} integration only supports full URLs to ${catalogFilename} files. Did you try to pass in the URL of a directory instead?`, ); } throw new Error( @@ -144,7 +147,7 @@ export class CatalogImportClient implements CatalogImportApi { return { type: 'repository', - integrationType: 'github', + integrationType: foundIntegration!.type, url: url, generatedEntities: analyzation.generateEntities.map(x => x.entity), }; @@ -185,21 +188,41 @@ the component will become available.\n\nFor more information, read an \ if (!validationResponse.valid) { throw new Error(validationResponse.errors[0].message); } - const ghConfig = getGithubIntegrationConfig( - this.scmIntegrationsApi, - repositoryUrl, - ); - if (ghConfig) { - return await this.submitGitHubPrToRepo({ - ...ghConfig, - repositoryUrl, - fileContent, - title, - body, - }); + const provider = this.scmIntegrationsApi.byUrl(repositoryUrl); + + switch (provider?.type) { + case 'github': { + const { config } = provider as GithubIntegration; + const { name, owner } = parseGitUrl(repositoryUrl); + const options2: GitHubOptions = { + githubIntegrationConfig: config, + repo: name, + owner: owner, + repositoryUrl, + fileContent, + title, + body, + }; + return submitGitHubPrToRepo(options2, this.scmAuthApi, this.configApi); + } + case 'azure': { + return submitAzurePrToRepo( + provider as AzureIntegration, + { + repositoryUrl, + fileContent, + title, + body, + }, + this.scmAuthApi, + this.configApi, + ); + } + default: { + throw new Error('unimplemented!'); + } } - throw new Error('unimplemented!'); } // TODO: this could be part of the catalog api @@ -238,125 +261,4 @@ the component will become available.\n\nFor more information, read an \ const payload = await response.json(); return payload; } - - // TODO: extract this function and implement for non-github - private async submitGitHubPrToRepo(options: { - owner: string; - repo: string; - title: string; - body: string; - fileContent: string; - repositoryUrl: string; - githubIntegrationConfig: GithubIntegrationConfig; - }): Promise<{ link: string; location: string }> { - const { - owner, - repo, - title, - body, - fileContent, - repositoryUrl, - githubIntegrationConfig, - } = options; - - const { token } = await this.scmAuthApi.getCredentials({ - url: repositoryUrl, - additionalScope: { - repoWrite: true, - }, - }); - - const octo = new Octokit({ - auth: token, - baseUrl: githubIntegrationConfig.apiBaseUrl, - }); - - const branchName = getBranchName(this.configApi); - const fileName = getCatalogFilename(this.configApi); - - const repoData = await octo.repos - .get({ - owner, - repo, - }) - .catch(e => { - throw new Error(formatHttpErrorMessage("Couldn't fetch repo data", e)); - }); - - const parentRef = await octo.git - .getRef({ - owner, - repo, - ref: `heads/${repoData.data.default_branch}`, - }) - .catch(e => { - throw new Error( - formatHttpErrorMessage("Couldn't fetch default branch data", e), - ); - }); - - await octo.git - .createRef({ - owner, - repo, - ref: `refs/heads/${branchName}`, - sha: parentRef.data.object.sha, - }) - .catch(e => { - throw new Error( - formatHttpErrorMessage( - `Couldn't create a new branch with name '${branchName}'`, - e, - ), - ); - }); - - await octo.repos - .createOrUpdateFileContents({ - owner, - repo, - path: fileName, - message: title, - content: Base64.encode(fileContent), - branch: branchName, - }) - .catch(e => { - throw new Error( - formatHttpErrorMessage( - `Couldn't create a commit with ${fileName} file added`, - e, - ), - ); - }); - - const pullRequestResponse = await octo.pulls - .create({ - owner, - repo, - title, - head: branchName, - body, - base: repoData.data.default_branch, - }) - .catch(e => { - throw new Error( - formatHttpErrorMessage( - `Couldn't create a pull request for ${branchName} branch`, - e, - ), - ); - }); - - return { - link: pullRequestResponse.data.html_url, - location: `https://${githubIntegrationConfig.host}/${owner}/${repo}/blob/${repoData.data.default_branch}/${fileName}`, - }; - } -} - -function formatHttpErrorMessage( - message: string, - error: { status: number; message: string }, -) { - return `${message}, received http response status code ${error.status}: ${error.message}`; } diff --git a/plugins/catalog-import/src/api/GitHub.ts b/plugins/catalog-import/src/api/GitHub.ts index b659832c10..4eb56b3a97 100644 --- a/plugins/catalog-import/src/api/GitHub.ts +++ b/plugins/catalog-import/src/api/GitHub.ts @@ -14,9 +14,26 @@ * limitations under the License. */ -import { ScmIntegrationRegistry } from '@backstage/integration'; +import { + GithubIntegrationConfig, + ScmIntegrationRegistry, +} from '@backstage/integration'; import parseGitUrl from 'git-url-parse'; +import { ScmAuthApi } from '@backstage/integration-react'; +import { Octokit } from '@octokit/rest'; +import { getBranchName, getCatalogFilename } from '../components/helpers'; +import { ConfigApi } from '@backstage/core-plugin-api'; +import { Base64 } from 'js-base64'; +export interface GitHubOptions { + owner: string; + repo: string; + title: string; + body: string; + fileContent: string; + repositoryUrl: string; + githubIntegrationConfig: GithubIntegrationConfig; +} export const getGithubIntegrationConfig = ( scmIntegrationsApi: ScmIntegrationRegistry, location: string, @@ -33,3 +50,119 @@ export const getGithubIntegrationConfig = ( githubIntegrationConfig: integration.config, }; }; + +export async function submitGitHubPrToRepo( + options: GitHubOptions, + scmAuthApi: ScmAuthApi, + configApi: ConfigApi, +): Promise<{ link: string; location: string }> { + const { + owner, + repo, + title, + body, + fileContent, + repositoryUrl, + githubIntegrationConfig, + } = options; + + const { token } = await scmAuthApi.getCredentials({ + url: repositoryUrl, + additionalScope: { + repoWrite: true, + }, + }); + + const octo = new Octokit({ + auth: token, + baseUrl: githubIntegrationConfig.apiBaseUrl, + }); + + const branchName = getBranchName(configApi); + const fileName = getCatalogFilename(configApi); + + const repoData = await octo.repos + .get({ + owner, + repo, + }) + .catch(e => { + throw new Error(formatHttpErrorMessage("Couldn't fetch repo data", e)); + }); + + const parentRef = await octo.git + .getRef({ + owner, + repo, + ref: `heads/${repoData.data.default_branch}`, + }) + .catch(e => { + throw new Error( + formatHttpErrorMessage("Couldn't fetch default branch data", e), + ); + }); + + await octo.git + .createRef({ + owner, + repo, + ref: `refs/heads/${branchName}`, + sha: parentRef.data.object.sha, + }) + .catch(e => { + throw new Error( + formatHttpErrorMessage( + `Couldn't create a new branch with name '${branchName}'`, + e, + ), + ); + }); + + await octo.repos + .createOrUpdateFileContents({ + owner, + repo, + path: fileName, + message: title, + content: Base64.encode(fileContent), + branch: branchName, + }) + .catch(e => { + throw new Error( + formatHttpErrorMessage( + `Couldn't create a commit with ${fileName} file added`, + e, + ), + ); + }); + + const pullRequestResponse = await octo.pulls + .create({ + owner, + repo, + title, + head: branchName, + body, + base: repoData.data.default_branch, + }) + .catch(e => { + throw new Error( + formatHttpErrorMessage( + `Couldn't create a pull request for ${branchName} branch`, + e, + ), + ); + }); + + return { + link: pullRequestResponse.data.html_url, + location: `https://${githubIntegrationConfig.host}/${owner}/${repo}/blob/${repoData.data.default_branch}/${fileName}`, + }; +} + +function formatHttpErrorMessage( + message: string, + error: { status: number; message: string }, +) { + return `${message}, received http response status code ${error.status}: ${error.message}`; +} diff --git a/plugins/catalog-import/src/components/ImportInfoCard/ImportInfoCard.tsx b/plugins/catalog-import/src/components/ImportInfoCard/ImportInfoCard.tsx index be8a457572..a55c9825d5 100644 --- a/plugins/catalog-import/src/components/ImportInfoCard/ImportInfoCard.tsx +++ b/plugins/catalog-import/src/components/ImportInfoCard/ImportInfoCard.tsx @@ -29,7 +29,8 @@ import { useCatalogFilename } from '../../hooks'; */ export interface ImportInfoCardProps { exampleLocationUrl?: string; - exampleRepositoryUrl?: string; + exampleGitRepositoryUrl?: string; + exampleAzureRepositoryUrl?: string; } /** @@ -40,7 +41,8 @@ export interface ImportInfoCardProps { export const ImportInfoCard = (props: ImportInfoCardProps) => { const { exampleLocationUrl = 'https://github.com/backstage/backstage/blob/master/catalog-info.yaml', - exampleRepositoryUrl = 'https://github.com/backstage/backstage', + exampleGitRepositoryUrl = 'https://github.com/backstage/backstage', + exampleAzureRepositoryUrl = 'https://dev.azure.com/spotify/backstage/_git/backstage', } = props; const configApi = useApi(configApiRef); @@ -77,10 +79,18 @@ export const ImportInfoCard = (props: ImportInfoCardProps) => { <> Link to a repository{' '} - + + + + + GitHub Example: {exampleGitRepositoryUrl} - Example: {exampleRepositoryUrl} + Azure Example: {exampleAzureRepositoryUrl} The wizard discovers all {catalogFilename} files in the From 4c7d217da961ec13bd649b2431e9be48eba79755 Mon Sep 17 00:00:00 2001 From: Andrei Ivanovici Date: Mon, 25 Mar 2024 11:57:04 +0200 Subject: [PATCH 002/387] chore: update api reports Signed-off-by: Andrei Ivanovici --- plugins/catalog-import/api-report.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/catalog-import/api-report.md b/plugins/catalog-import/api-report.md index a513cfe87a..9a755f4182 100644 --- a/plugins/catalog-import/api-report.md +++ b/plugins/catalog-import/api-report.md @@ -189,9 +189,11 @@ export const ImportInfoCard: ( // @public export interface ImportInfoCardProps { // (undocumented) - exampleLocationUrl?: string; + exampleAzureRepositoryUrl?: string; // (undocumented) - exampleRepositoryUrl?: string; + exampleGitRepositoryUrl?: string; + // (undocumented) + exampleLocationUrl?: string; } // Warning: (ae-forgotten-export) The symbol "State" needs to be exported by the entry point index.d.ts From 06419882ea7aa0a1df6e091cd69584cde7d53e38 Mon Sep 17 00:00:00 2001 From: Andrei Ivanovici Date: Mon, 25 Mar 2024 12:15:37 +0200 Subject: [PATCH 003/387] fix: remove token from test assertions Signed-off-by: Andrei Ivanovici --- plugins/catalog-import/src/api/AzureRepoApiClient.test.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/catalog-import/src/api/AzureRepoApiClient.test.ts b/plugins/catalog-import/src/api/AzureRepoApiClient.test.ts index 6579bba5a9..5024b8cda4 100644 --- a/plugins/catalog-import/src/api/AzureRepoApiClient.test.ts +++ b/plugins/catalog-import/src/api/AzureRepoApiClient.test.ts @@ -155,10 +155,9 @@ describe('RepoApiClient', () => { const server = setupServer(); setupRequestMockHandlers(server); const sut = new RepoApiClient({ - token: 'token', project: 'project', tenantUrl: 'https://dev.azure.com/acme', - }); + } as any); beforeEach(() => { server.use( mockPrEndpoint(), @@ -307,8 +306,7 @@ describe('createAzurePullRequest', () => { fileContent: 'content', branchName: 'backstage-integration', description: 'Test Description', - token: 'token', - }; + } as any; const repo: AzureRepo = { name: options.repository, defaultBranch: 'ref/heads/main', From 0780898029a6c417c0f35532d9d553664be0c0ab Mon Sep 17 00:00:00 2001 From: Andrei Ivanovici Date: Tue, 26 Mar 2024 18:03:36 +0200 Subject: [PATCH 004/387] fix: fix typos Signed-off-by: Andrei Ivanovici --- .../src/components/ImportInfoCard/ImportInfoCard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/catalog-import/src/components/ImportInfoCard/ImportInfoCard.tsx b/plugins/catalog-import/src/components/ImportInfoCard/ImportInfoCard.tsx index a55c9825d5..cd585a8dc8 100644 --- a/plugins/catalog-import/src/components/ImportInfoCard/ImportInfoCard.tsx +++ b/plugins/catalog-import/src/components/ImportInfoCard/ImportInfoCard.tsx @@ -80,7 +80,7 @@ export const ImportInfoCard = (props: ImportInfoCardProps) => { Link to a repository{' '} From 8a3786b0e55e1beeebee33d3b453d8b4aa208525 Mon Sep 17 00:00:00 2001 From: Andrei Ivanovici Date: Mon, 22 Apr 2024 13:11:35 +0300 Subject: [PATCH 005/387] chore: update docs Signed-off-by: Andrei Ivanovici --- .changeset/rude-buckets-invite.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.changeset/rude-buckets-invite.md b/.changeset/rude-buckets-invite.md index 51dca15a82..03a9c1b8fd 100644 --- a/.changeset/rude-buckets-invite.md +++ b/.changeset/rude-buckets-invite.md @@ -2,6 +2,4 @@ '@backstage/plugin-catalog-import': patch --- -Integrated Azure Devops as a catalog import source. This enables Backstage to create Pull Requests to Azure Devops repositories as it does with GitHub repositories - -NO BREAKING CHANGES +Integrated Azure DevOps as a catalog import source. This enables Backstage to create Pull Requests to Azure DevOps repositories as it does with GitHub repositories From 0a5afe95ec1b714fc1ccee075b8b499d77976443 Mon Sep 17 00:00:00 2001 From: Andrei Ivanovici Date: Mon, 22 Apr 2024 15:43:09 +0300 Subject: [PATCH 006/387] chore: use azure rest api v6 Signed-off-by: Andrei Ivanovici --- .../catalog-import/src/api/AzureRepoApiClient.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/plugins/catalog-import/src/api/AzureRepoApiClient.ts b/plugins/catalog-import/src/api/AzureRepoApiClient.ts index ea152b2947..a743159ea8 100644 --- a/plugins/catalog-import/src/api/AzureRepoApiClient.ts +++ b/plugins/catalog-import/src/api/AzureRepoApiClient.ts @@ -90,10 +90,7 @@ export interface AzurePrResult { }; } -const apiVersions = { - V7_2p_1: '7.2-preview.1', - V7_2p_2: '7.2-preview.2', -}; +const apiVersions = '6.0'; export interface RepoApiClientOptions { project: string; @@ -171,14 +168,14 @@ export class RepoApiClient { } async getRepository(repositoryName: string): Promise { - return this.get(`/${repositoryName}`, apiVersions.V7_2p_1); + return this.get(`/${repositoryName}`, apiVersions); } async getDefaultBranch(repo: AzureRepo): Promise { const filter = repo.defaultBranch.replace('refs/', ''); const result: RefQueryResult = await this.get( `/${repo.name}/refs`, - apiVersions.V7_2p_2, + apiVersions, { filter }, ); if (!result.value?.length) { @@ -221,7 +218,7 @@ export class RepoApiClient { }; const result = await this.post( `/${repoName}/pushes`, - apiVersions.V7_2p_2, + apiVersions, push, ); return result.refUpdates[0]; @@ -242,7 +239,7 @@ export class RepoApiClient { return await this.post( `/${repoName}/pullrequests`, - apiVersions.V7_2p_2, + apiVersions, payload, ); } From a60d73b4a8244d9874b42c510e86532d7e424e69 Mon Sep 17 00:00:00 2001 From: aramissennyeydd Date: Sun, 5 May 2024 10:30:44 -0400 Subject: [PATCH 007/387] fix plugin template for monorepo plugins Signed-off-by: aramissennyeydd --- .changeset/shy-hounds-battle.md | 5 +++++ packages/cli/templates/default-backend-plugin/README.md.hbs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/shy-hounds-battle.md diff --git a/.changeset/shy-hounds-battle.md b/.changeset/shy-hounds-battle.md new file mode 100644 index 0000000000..11d66e0d94 --- /dev/null +++ b/.changeset/shy-hounds-battle.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Fix a bug in the backend plugin template that was creating an incorrect link. diff --git a/packages/cli/templates/default-backend-plugin/README.md.hbs b/packages/cli/templates/default-backend-plugin/README.md.hbs index e95c626167..48a4ddb848 100644 --- a/packages/cli/templates/default-backend-plugin/README.md.hbs +++ b/packages/cli/templates/default-backend-plugin/README.md.hbs @@ -11,4 +11,4 @@ start` in the root directory, and then navigating to [/{{pluginVar}}/health](htt You can also serve the plugin in isolation by running `yarn start` in the plugin directory. This method of serving the plugin provides quicker iteration speed and a faster startup and hot reloads. -It is only meant for local development, and the setup for it can be found inside the [/dev](/dev) directory. +It is only meant for local development, and the setup for it can be found inside the [/dev](./dev) directory. From 4ba352071a29733aa8c88ee58e1292547868b8bc Mon Sep 17 00:00:00 2001 From: aramissennyeydd Date: Sun, 5 May 2024 10:42:01 -0400 Subject: [PATCH 008/387] fix express types as well Signed-off-by: aramissennyeydd --- packages/cli/templates/default-backend-plugin/package.json.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/templates/default-backend-plugin/package.json.hbs b/packages/cli/templates/default-backend-plugin/package.json.hbs index 6b7aa915aa..289bb1ff69 100644 --- a/packages/cli/templates/default-backend-plugin/package.json.hbs +++ b/packages/cli/templates/default-backend-plugin/package.json.hbs @@ -32,7 +32,6 @@ "@backstage/backend-defaults": "{{versionQuery '@backstage/backend-defaults'}}", "@backstage/backend-plugin-api": "{{versionQuery '@backstage/backend-plugin-api'}}", "@backstage/config": "{{versionQuery '@backstage/config'}}", - "@types/express": "{{versionQuery '@types/express' '4.17.6'}}", "express": "{{versionQuery 'express' '4.17.1'}}", "express-promise-router": "{{versionQuery 'express-promise-router' '4.1.0'}}", "winston": "{{versionQuery 'winston' '3.2.1'}}", @@ -43,6 +42,7 @@ "@backstage/cli": "{{versionQuery '@backstage/cli'}}", "@backstage/plugin-auth-backend": "{{versionQuery '@backstage/plugin-auth-backend'}}", "@backstage/plugin-auth-backend-module-guest-provider": "{{versionQuery '@backstage/plugin-auth-backend-module-guest-provider'}}", + "@types/express": "{{versionQuery '@types/express' '4.17.6'}}", "@types/supertest": "{{versionQuery '@types/supertest' '2.0.12'}}", "supertest": "{{versionQuery 'supertest' '6.2.4'}}", "msw": "{{versionQuery 'msw' '1.0.0'}}" From 31c99f53a890aa083834bd9a198979c02373ac1d Mon Sep 17 00:00:00 2001 From: aramissennyeydd Date: Sun, 5 May 2024 15:13:43 -0400 Subject: [PATCH 009/387] adjust release notes Signed-off-by: aramissennyeydd --- .changeset/shy-hounds-battle.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/shy-hounds-battle.md b/.changeset/shy-hounds-battle.md index 11d66e0d94..bfcf46c076 100644 --- a/.changeset/shy-hounds-battle.md +++ b/.changeset/shy-hounds-battle.md @@ -2,4 +2,4 @@ '@backstage/cli': patch --- -Fix a bug in the backend plugin template that was creating an incorrect link. +Fix a few minor issues with the backend template that were causing failing linting checks in the main repo. From 1788cf9d9f94fb33c51b9f95d2176f7ebc46d208 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 08:42:01 +0000 Subject: [PATCH 010/387] chore(deps): update dependency @openapitools/openapi-generator-cli to v2.13.4 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 42 +++++++++++++++--------------------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/yarn.lock b/yarn.lock index a9d18ff80e..d54c29f3aa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10728,15 +10728,14 @@ __metadata: languageName: node linkType: hard -"@nestjs/axios@npm:3.0.1": - version: 3.0.1 - resolution: "@nestjs/axios@npm:3.0.1" +"@nestjs/axios@npm:3.0.2": + version: 3.0.2 + resolution: "@nestjs/axios@npm:3.0.2" peerDependencies: "@nestjs/common": ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 axios: ^1.3.1 - reflect-metadata: ^0.1.12 rxjs: ^6.0.0 || ^7.0.0 - checksum: 01cebc64efa7a1d9df7a9053fbc5124986a95078789a0f280a2a61c31601a70a35745e07fc385497b4f85c7bdb6216a3575728646f1e6e684c038ac31900129c + checksum: 285a735fb5db602b63aa4a37e161f609b2cec05b69f4bffe983617c2136ac29c0a33bb96e6276d22a656907bed5d53460e740310bc05c043dcd39c37db7cda29 languageName: node linkType: hard @@ -11868,14 +11867,14 @@ __metadata: linkType: hard "@openapitools/openapi-generator-cli@npm:^2.4.26, @openapitools/openapi-generator-cli@npm:^2.7.0": - version: 2.13.2 - resolution: "@openapitools/openapi-generator-cli@npm:2.13.2" + version: 2.13.4 + resolution: "@openapitools/openapi-generator-cli@npm:2.13.4" dependencies: - "@nestjs/axios": 3.0.1 + "@nestjs/axios": 3.0.2 "@nestjs/common": 10.3.0 "@nestjs/core": 10.3.0 "@nuxtjs/opencollective": 0.3.2 - axios: 1.6.5 + axios: 1.6.8 chalk: 4.1.2 commander: 8.3.0 compare-versions: 4.1.4 @@ -11891,7 +11890,7 @@ __metadata: tslib: 2.6.2 bin: openapi-generator-cli: main.js - checksum: 553458ffface4090f117ec488352f664bb4656b645ef51faf5be35f27e739ac5c8931adf401309dfa0aad7ceefa39fb267d452b72d7a22f0fdb26d988d73b642 + checksum: 825a49ff86632767d318fa860d9d251984b9b3e8f386cf8298430005f20611d7b535c6e87e370edd19ff824a5c68cf65efc93cbb64d7a2f1649e46a8887cf5d2 languageName: node linkType: hard @@ -18822,14 +18821,14 @@ __metadata: languageName: node linkType: hard -"axios@npm:1.6.5": - version: 1.6.5 - resolution: "axios@npm:1.6.5" +"axios@npm:1.6.8, axios@npm:^1.0.0, axios@npm:^1.4.0, axios@npm:^1.6.0": + version: 1.6.8 + resolution: "axios@npm:1.6.8" dependencies: - follow-redirects: ^1.15.4 + follow-redirects: ^1.15.6 form-data: ^4.0.0 proxy-from-env: ^1.1.0 - checksum: e28d67b2d9134cb4608c44d8068b0678cfdccc652742e619006f27264a30c7aba13b2cd19c6f1f52ae195b5232734925928fb192d5c85feea7edd2f273df206d + checksum: bf007fa4b207d102459300698620b3b0873503c6d47bf5a8f6e43c0c64c90035a4f698b55027ca1958f61ab43723df2781c38a99711848d232cad7accbcdfcdd languageName: node linkType: hard @@ -18843,17 +18842,6 @@ __metadata: languageName: node linkType: hard -"axios@npm:^1.0.0, axios@npm:^1.4.0, axios@npm:^1.6.0": - version: 1.6.8 - resolution: "axios@npm:1.6.8" - dependencies: - follow-redirects: ^1.15.6 - form-data: ^4.0.0 - proxy-from-env: ^1.1.0 - checksum: bf007fa4b207d102459300698620b3b0873503c6d47bf5a8f6e43c0c64c90035a4f698b55027ca1958f61ab43723df2781c38a99711848d232cad7accbcdfcdd - languageName: node - linkType: hard - "axobject-query@npm:^3.2.1": version: 3.2.1 resolution: "axobject-query@npm:3.2.1" @@ -25051,7 +25039,7 @@ __metadata: languageName: node linkType: hard -"follow-redirects@npm:^1.0.0, follow-redirects@npm:^1.14.9, follow-redirects@npm:^1.15.4, follow-redirects@npm:^1.15.6": +"follow-redirects@npm:^1.0.0, follow-redirects@npm:^1.14.9, follow-redirects@npm:^1.15.6": version: 1.15.6 resolution: "follow-redirects@npm:1.15.6" peerDependenciesMeta: From 9a22ffef8adabe2d7ff959fe8a2a8767f4b6ac4f Mon Sep 17 00:00:00 2001 From: Andrei Ivanovici Date: Mon, 6 May 2024 18:59:38 +0300 Subject: [PATCH 011/387] chore: use generic example Co-authored-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com> Signed-off-by: Andrei Ivanovici --- .../src/components/ImportInfoCard/ImportInfoCard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/catalog-import/src/components/ImportInfoCard/ImportInfoCard.tsx b/plugins/catalog-import/src/components/ImportInfoCard/ImportInfoCard.tsx index cd585a8dc8..67979f1a3d 100644 --- a/plugins/catalog-import/src/components/ImportInfoCard/ImportInfoCard.tsx +++ b/plugins/catalog-import/src/components/ImportInfoCard/ImportInfoCard.tsx @@ -42,7 +42,7 @@ export const ImportInfoCard = (props: ImportInfoCardProps) => { const { exampleLocationUrl = 'https://github.com/backstage/backstage/blob/master/catalog-info.yaml', exampleGitRepositoryUrl = 'https://github.com/backstage/backstage', - exampleAzureRepositoryUrl = 'https://dev.azure.com/spotify/backstage/_git/backstage', + exampleAzureRepositoryUrl = 'https://dev.azure.com/org-name/project-name/_git/repo-name, } = props; const configApi = useApi(configApiRef); From 4fefb2a3938f53172096d9df45fa205bb9d21a84 Mon Sep 17 00:00:00 2001 From: Andrei Ivanovici Date: Fri, 10 May 2024 15:38:48 +0300 Subject: [PATCH 012/387] chore: use alt url parser Signed-off-by: Andrei Ivanovici --- plugins/catalog-import/src/api/AzureDevops.ts | 26 +++++----- .../src/api/CatalogImportClient.ts | 2 - plugins/catalog-import/src/api/util.test.ts | 51 +++++++++++++++++++ plugins/catalog-import/src/api/util.ts | 40 +++++++++++++++ .../ImportInfoCard/ImportInfoCard.tsx | 18 ++----- 5 files changed, 107 insertions(+), 30 deletions(-) create mode 100644 plugins/catalog-import/src/api/util.test.ts create mode 100644 plugins/catalog-import/src/api/util.ts diff --git a/plugins/catalog-import/src/api/AzureDevops.ts b/plugins/catalog-import/src/api/AzureDevops.ts index d2cf9eacd7..d028c75129 100644 --- a/plugins/catalog-import/src/api/AzureDevops.ts +++ b/plugins/catalog-import/src/api/AzureDevops.ts @@ -13,12 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { AzureIntegration } from '@backstage/integration'; import { ScmAuthApi } from '@backstage/integration-react'; import { ConfigApi } from '@backstage/core-plugin-api'; import { getBranchName, getCatalogFilename } from '../components/helpers'; import { createAzurePullRequest } from './AzureRepoApiClient'; -import parseGitUrl from 'git-url-parse'; +import { parseRepoUrl } from './util'; export interface AzureRepoParts { tenantUrl: string; @@ -26,17 +25,19 @@ export interface AzureRepoParts { project: string; } -export function parseAzureUrl( - repoUrl: string, - integration: AzureIntegration, -): AzureRepoParts { - const { organization, owner, name } = parseGitUrl(repoUrl); - const tenantUrl = `https://${integration.config.host}/${organization}`; - return { tenantUrl, repoName: name, project: owner }; +export function parseAzureUrl(repoUrl: string): AzureRepoParts { + const { org, repo, project, host } = parseRepoUrl(repoUrl); + if (!org || !repo || !project) { + throw new Error( + 'Invalid AzureDevops Repository. Please use a valid repository url and try again ', + ); + } + const tenantUrl = `https://${host}/${org}`; + + return { tenantUrl, repoName: repo, project: project }; } export async function submitAzurePrToRepo( - integration: AzureIntegration, options: { title: string; body: string; @@ -57,10 +58,7 @@ export async function submitAzurePrToRepo( repoWrite: true, }, }); - const { tenantUrl, repoName, project } = parseAzureUrl( - repositoryUrl, - integration, - ); + const { tenantUrl, repoName, project } = parseAzureUrl(repositoryUrl); const result = await createAzurePullRequest({ token, fileContent, diff --git a/plugins/catalog-import/src/api/CatalogImportClient.ts b/plugins/catalog-import/src/api/CatalogImportClient.ts index e05e3882c4..fe7fc5c59e 100644 --- a/plugins/catalog-import/src/api/CatalogImportClient.ts +++ b/plugins/catalog-import/src/api/CatalogImportClient.ts @@ -21,7 +21,6 @@ import { IdentityApi, } from '@backstage/core-plugin-api'; import { - AzureIntegration, GithubIntegration, ScmIntegrationRegistry, } from '@backstage/integration'; @@ -208,7 +207,6 @@ the component will become available.\n\nFor more information, read an \ } case 'azure': { return submitAzurePrToRepo( - provider as AzureIntegration, { repositoryUrl, fileContent, diff --git a/plugins/catalog-import/src/api/util.test.ts b/plugins/catalog-import/src/api/util.test.ts new file mode 100644 index 0000000000..3a14a2e7ae --- /dev/null +++ b/plugins/catalog-import/src/api/util.test.ts @@ -0,0 +1,51 @@ +/* + * Copyright 2024 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 { parseRepoUrl } from './util'; + +describe('parseRepoUrl', () => { + it('parses Azure DevOps Cloud url', async () => { + const result = parseRepoUrl( + 'https://dev.azure.com/organization/project/_git/repository?path=%2Fcatalog-info.yaml', + ); + + expect(result.host).toEqual('dev.azure.com'); + expect(result.org).toEqual('organization'); + expect(result.project).toEqual('project'); + expect(result.repo).toEqual('repository'); + }); + + it('parses Azure DevOps Server url', async () => { + const result = parseRepoUrl( + 'https://server.com/organization/project/_git/repository?path=%2Fcatalog-info.yaml', + ); + + expect(result.host).toEqual('server.com'); + expect(result.org).toEqual('organization'); + expect(result.project).toEqual('project'); + expect(result.repo).toEqual('repository'); + }); + + it('parses TFS subpath Url', async () => { + const result = parseRepoUrl( + 'https://server.com/tfs/organization/project/_git/repository?path=%2Fcatalog-info.yaml', + ); + + expect(result.host).toEqual('server.com/tfs'); + expect(result.org).toEqual('organization'); + expect(result.project).toEqual('project'); + expect(result.repo).toEqual('repository'); + }); +}); diff --git a/plugins/catalog-import/src/api/util.ts b/plugins/catalog-import/src/api/util.ts new file mode 100644 index 0000000000..dc6b4ae2a6 --- /dev/null +++ b/plugins/catalog-import/src/api/util.ts @@ -0,0 +1,40 @@ +/* + * Copyright 2024 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. + */ +export function parseRepoUrl(sourceUrl: string) { + const url = new URL(sourceUrl); + + let host = url.host; + let org; + let project; + let repo; + + const parts = url.pathname.split('/').map(part => decodeURIComponent(part)); + if (parts[2] === '_git') { + org = parts[1]; + project = repo = parts[3]; + } else if (parts[3] === '_git') { + org = parts[1]; + project = parts[2]; + repo = parts[4]; + } else if (parts[4] === '_git') { + host = `${host}/${parts[1]}`; + org = parts[2]; + project = parts[3]; + repo = parts[5]; + } + + return { host, org, project, repo }; +} diff --git a/plugins/catalog-import/src/components/ImportInfoCard/ImportInfoCard.tsx b/plugins/catalog-import/src/components/ImportInfoCard/ImportInfoCard.tsx index 67979f1a3d..be8a457572 100644 --- a/plugins/catalog-import/src/components/ImportInfoCard/ImportInfoCard.tsx +++ b/plugins/catalog-import/src/components/ImportInfoCard/ImportInfoCard.tsx @@ -29,8 +29,7 @@ import { useCatalogFilename } from '../../hooks'; */ export interface ImportInfoCardProps { exampleLocationUrl?: string; - exampleGitRepositoryUrl?: string; - exampleAzureRepositoryUrl?: string; + exampleRepositoryUrl?: string; } /** @@ -41,8 +40,7 @@ export interface ImportInfoCardProps { export const ImportInfoCard = (props: ImportInfoCardProps) => { const { exampleLocationUrl = 'https://github.com/backstage/backstage/blob/master/catalog-info.yaml', - exampleGitRepositoryUrl = 'https://github.com/backstage/backstage', - exampleAzureRepositoryUrl = 'https://dev.azure.com/org-name/project-name/_git/repo-name, + exampleRepositoryUrl = 'https://github.com/backstage/backstage', } = props; const configApi = useApi(configApiRef); @@ -79,18 +77,10 @@ export const ImportInfoCard = (props: ImportInfoCardProps) => { <> Link to a repository{' '} - - - - - GitHub Example: {exampleGitRepositoryUrl} + - Azure Example: {exampleAzureRepositoryUrl} + Example: {exampleRepositoryUrl} The wizard discovers all {catalogFilename} files in the From b54aee0d4ac30562b4e60bd6bee6c34897e30278 Mon Sep 17 00:00:00 2001 From: Andrei Ivanovici Date: Fri, 10 May 2024 17:46:47 +0300 Subject: [PATCH 013/387] chore: update api report Signed-off-by: Andrei Ivanovici --- plugins/catalog-import/api-report.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/catalog-import/api-report.md b/plugins/catalog-import/api-report.md index 9a755f4182..a513cfe87a 100644 --- a/plugins/catalog-import/api-report.md +++ b/plugins/catalog-import/api-report.md @@ -188,12 +188,10 @@ export const ImportInfoCard: ( // @public export interface ImportInfoCardProps { - // (undocumented) - exampleAzureRepositoryUrl?: string; - // (undocumented) - exampleGitRepositoryUrl?: string; // (undocumented) exampleLocationUrl?: string; + // (undocumented) + exampleRepositoryUrl?: string; } // Warning: (ae-forgotten-export) The symbol "State" needs to be exported by the entry point index.d.ts From 3e823d3e14e26b06e64b3631dfaa23f212e6bbf1 Mon Sep 17 00:00:00 2001 From: Phil Kuang Date: Fri, 10 May 2024 18:21:48 -0400 Subject: [PATCH 014/387] feat(userInfo): implement persisting user info to support limited tokens Signed-off-by: Phil Kuang --- .changeset/cold-comics-rush.md | 6 + .../auth/DefaultAuthService.ts | 15 ++- .../auth/authServiceFactory.test.ts | 35 ++++-- .../auth/user/UserTokenHandler.test.ts | 2 - .../auth/user/UserTokenHandler.ts | 1 - .../userInfo/userInfoServiceFactory.ts | 48 ++++++-- .../migrations/20240510120825_user_info.js | 44 +++++++ .../src/identity/TokenFactory.test.ts | 18 ++- .../auth-backend/src/identity/TokenFactory.ts | 19 +-- .../identity/UserInfoDatabaseHandler.test.ts | 109 ++++++++++++++++++ .../src/identity/UserInfoDatabaseHandler.ts | 60 ++++++++++ plugins/auth-backend/src/identity/index.ts | 1 + .../auth-backend/src/identity/router.test.ts | 65 ++++++++++- plugins/auth-backend/src/identity/router.ts | 29 +++-- plugins/auth-backend/src/migrations.test.ts | 26 +++++ plugins/auth-backend/src/service/router.ts | 13 ++- 16 files changed, 449 insertions(+), 42 deletions(-) create mode 100644 .changeset/cold-comics-rush.md create mode 100644 plugins/auth-backend/migrations/20240510120825_user_info.js create mode 100644 plugins/auth-backend/src/identity/UserInfoDatabaseHandler.test.ts create mode 100644 plugins/auth-backend/src/identity/UserInfoDatabaseHandler.ts diff --git a/.changeset/cold-comics-rush.md b/.changeset/cold-comics-rush.md new file mode 100644 index 0000000000..edb481fd83 --- /dev/null +++ b/.changeset/cold-comics-rush.md @@ -0,0 +1,6 @@ +--- +'@backstage/backend-app-api': patch +'@backstage/plugin-auth-backend': patch +--- + +Limited user tokens will no longer include the `ent` field in its payload. Ownership claims will now be fetched from the user info service. diff --git a/packages/backend-app-api/src/services/implementations/auth/DefaultAuthService.ts b/packages/backend-app-api/src/services/implementations/auth/DefaultAuthService.ts index dc76a8761b..9d9fb58bfb 100644 --- a/packages/backend-app-api/src/services/implementations/auth/DefaultAuthService.ts +++ b/packages/backend-app-api/src/services/implementations/auth/DefaultAuthService.ts @@ -49,8 +49,12 @@ export class DefaultAuthService implements AuthService { private readonly publicKeyStore: KeyStore, ) {} - // allowLimitedAccess is currently ignored, since we currently always use the full user tokens - async authenticate(token: string): Promise { + async authenticate( + token: string, + options?: { + allowLimitedAccess?: boolean; + }, + ): Promise { const pluginResult = await this.pluginTokenHandler.verifyToken(token); if (pluginResult) { if (pluginResult.limitedUserToken) { @@ -73,6 +77,13 @@ export class DefaultAuthService implements AuthService { const userResult = await this.userTokenHandler.verifyToken(token); if (userResult) { + if ( + !options?.allowLimitedAccess && + this.userTokenHandler.isLimitedUserToken(token) + ) { + throw new AuthenticationError('Illegal limited user token'); + } + return createCredentialsWithUserPrincipal( userResult.userEntityRef, token, diff --git a/packages/backend-app-api/src/services/implementations/auth/authServiceFactory.test.ts b/packages/backend-app-api/src/services/implementations/auth/authServiceFactory.test.ts index 96d4ce4dc9..f8628c001b 100644 --- a/packages/backend-app-api/src/services/implementations/auth/authServiceFactory.test.ts +++ b/packages/backend-app-api/src/services/implementations/auth/authServiceFactory.test.ts @@ -199,6 +199,17 @@ describe('authServiceFactory', () => { }); it('should issue limited user tokens', async () => { + /* Corresponding private key in case this test needs to be updated in the future: + { + kty: 'EC', + x: 'c9cPvv_S7zETBKDlAa3oOjr7RvyUueIYIak0TRph7mg', + y: 'bKaxDRAWgmEJ9Ix8e85blH_IsnbQxX31x0oQTVwLZ2c', + crv: 'P-256', + d: '2eJlhCDdGx9fxKDL1D9BnY3CCTEKxL60Bkms0hmubmY', + kid: '8d01c3db-56f9-45f0-86dd-05b3c835b3d3', + alg: 'ES256' + } + */ server.use( rest.get( 'http://localhost:7007/api/auth/.well-known/jwks.json', @@ -208,8 +219,8 @@ describe('authServiceFactory', () => { keys: [ { kty: 'EC', - x: '78-Ei1H3nKM23ZpGMMzte2mVoYCcnfnSiLTm1P7vZM0', - y: 'Z9-PjG_EU598tLLUc2f8sCqxT7bjs8WpoV-lHm9GJHY', + x: 'c9cPvv_S7zETBKDlAa3oOjr7RvyUueIYIak0TRph7mg', + y: 'bKaxDRAWgmEJ9Ix8e85blH_IsnbQxX31x0oQTVwLZ2c', crv: 'P-256', kid: '8d01c3db-56f9-45f0-86dd-05b3c835b3d3', alg: 'ES256', @@ -234,7 +245,7 @@ describe('authServiceFactory', () => { const catalogAuth = await tester.get('catalog'); const fullToken = - 'eyJ0eXAiOiJ2bmQuYmFja3N0YWdlLnVzZXIiLCJhbGciOiJFUzI1NiIsImtpZCI6IjhkMDFjM2RiLTU2ZjktNDVmMC04NmRkLTA1YjNjODM1YjNkMyJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjcwMDcvYXBpL2F1dGgiLCJzdWIiOiJ1c2VyOmRldmVsb3BtZW50L2d1ZXN0IiwiZW50IjpbInVzZXI6ZGV2ZWxvcG1lbnQvZ3Vlc3QiLCJncm91cDpkZWZhdWx0L3RlYW0tYSJdLCJhdWQiOiJiYWNrc3RhZ2UiLCJpYXQiOjE3MTIwNzE3MTQsImV4cCI6MTcxMjA3NTMxNCwidWlwIjoiMDFBUUJfSWpHTXRWc2gyWmgzZEg1NXhOX29pSVlhQ1F3ODJjeDZ5M1BQMXlpTjM4eGMzMVpMS2U0YVNDQlJTTy10cjFzZFUzT29ELUxJYV8tNV9RVUEifQ.mjIrZGqbZ2t68fS4U3crlGw-bYJZnMlhMHf-YL7q_u1HfaLr4NMTcHkxdnNS2wfJxCmUBxRfUS8b3nSAKsxcHA'; + 'eyJ0eXAiOiJ2bmQuYmFja3N0YWdlLnVzZXIiLCJhbGciOiJFUzI1NiIsImtpZCI6IjhkMDFjM2RiLTU2ZjktNDVmMC04NmRkLTA1YjNjODM1YjNkMyJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjcwMDcvYXBpL2F1dGgiLCJzdWIiOiJ1c2VyOmRldmVsb3BtZW50L2d1ZXN0IiwiZW50IjpbInVzZXI6ZGV2ZWxvcG1lbnQvZ3Vlc3QiLCJncm91cDpkZWZhdWx0L3RlYW0tYSJdLCJhdWQiOiJiYWNrc3RhZ2UiLCJpYXQiOjE3MTIwNzE3MTQsImV4cCI6MTcxMjA3NTMxNCwidWlwIjoiSmwxVEpycG9VUjR1NENjUE9nalJMeHpEMi1FMGZPR3ptSm81UWI2eS1aN19meG5oVVBEdWVWRE1CS0l6WF9pc0lvSDhlZm9EUFA5bG9aQnpPblB5Z2cifQ.1gVMq1ofO8PzRctu72D6c4IMqXuIabT79WdGEhW6vIrBRs_qhuWAa94Wvz_KYKpBTb2nxgzXJ5OeddeoYApMyQ'; const credentials = await catalogAuth.authenticate(fullToken); if (!catalogAuth.isPrincipal(credentials, 'user')) { @@ -256,7 +267,6 @@ describe('authServiceFactory', () => { const expectedTokenPayload = base64url.encode( JSON.stringify({ sub: 'user:development/guest', - ent: ['user:development/guest', 'group:default/team-a'], iat: expectedIssuedAt, exp: expectedExpiresAt, }), @@ -293,6 +303,17 @@ describe('authServiceFactory', () => { const catalogAuth = await tester.get('catalog'); const permissionAuth = await tester.get('permission'); + /* Corresponding private key in case this test needs to be updated in the future: + { + kty: 'EC', + x: 'c9cPvv_S7zETBKDlAa3oOjr7RvyUueIYIak0TRph7mg', + y: 'bKaxDRAWgmEJ9Ix8e85blH_IsnbQxX31x0oQTVwLZ2c', + crv: 'P-256', + d: '2eJlhCDdGx9fxKDL1D9BnY3CCTEKxL60Bkms0hmubmY', + kid: '8d01c3db-56f9-45f0-86dd-05b3c835b3d3', + alg: 'ES256' + } + */ server.use( rest.get( 'http://localhost:7007/api/auth/.well-known/jwks.json', @@ -302,8 +323,8 @@ describe('authServiceFactory', () => { keys: [ { kty: 'EC', - x: '78-Ei1H3nKM23ZpGMMzte2mVoYCcnfnSiLTm1P7vZM0', - y: 'Z9-PjG_EU598tLLUc2f8sCqxT7bjs8WpoV-lHm9GJHY', + x: 'c9cPvv_S7zETBKDlAa3oOjr7RvyUueIYIak0TRph7mg', + y: 'bKaxDRAWgmEJ9Ix8e85blH_IsnbQxX31x0oQTVwLZ2c', crv: 'P-256', kid: '8d01c3db-56f9-45f0-86dd-05b3c835b3d3', alg: 'ES256', @@ -341,7 +362,7 @@ describe('authServiceFactory', () => { }); const fullToken = - 'eyJ0eXAiOiJ2bmQuYmFja3N0YWdlLnVzZXIiLCJhbGciOiJFUzI1NiIsImtpZCI6IjhkMDFjM2RiLTU2ZjktNDVmMC04NmRkLTA1YjNjODM1YjNkMyJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjcwMDcvYXBpL2F1dGgiLCJzdWIiOiJ1c2VyOmRldmVsb3BtZW50L2d1ZXN0IiwiZW50IjpbInVzZXI6ZGV2ZWxvcG1lbnQvZ3Vlc3QiLCJncm91cDpkZWZhdWx0L3RlYW0tYSJdLCJhdWQiOiJiYWNrc3RhZ2UiLCJpYXQiOjE3MTIwNzE3MTQsImV4cCI6MTcxMjA3NTMxNCwidWlwIjoiMDFBUUJfSWpHTXRWc2gyWmgzZEg1NXhOX29pSVlhQ1F3ODJjeDZ5M1BQMXlpTjM4eGMzMVpMS2U0YVNDQlJTTy10cjFzZFUzT29ELUxJYV8tNV9RVUEifQ.mjIrZGqbZ2t68fS4U3crlGw-bYJZnMlhMHf-YL7q_u1HfaLr4NMTcHkxdnNS2wfJxCmUBxRfUS8b3nSAKsxcHA'; + 'eyJ0eXAiOiJ2bmQuYmFja3N0YWdlLnVzZXIiLCJhbGciOiJFUzI1NiIsImtpZCI6IjhkMDFjM2RiLTU2ZjktNDVmMC04NmRkLTA1YjNjODM1YjNkMyJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjcwMDcvYXBpL2F1dGgiLCJzdWIiOiJ1c2VyOmRldmVsb3BtZW50L2d1ZXN0IiwiZW50IjpbInVzZXI6ZGV2ZWxvcG1lbnQvZ3Vlc3QiLCJncm91cDpkZWZhdWx0L3RlYW0tYSJdLCJhdWQiOiJiYWNrc3RhZ2UiLCJpYXQiOjE3MTIwNzE3MTQsImV4cCI6MTcxMjA3NTMxNCwidWlwIjoiSmwxVEpycG9VUjR1NENjUE9nalJMeHpEMi1FMGZPR3ptSm81UWI2eS1aN19meG5oVVBEdWVWRE1CS0l6WF9pc0lvSDhlZm9EUFA5bG9aQnpPblB5Z2cifQ.1gVMq1ofO8PzRctu72D6c4IMqXuIabT79WdGEhW6vIrBRs_qhuWAa94Wvz_KYKpBTb2nxgzXJ5OeddeoYApMyQ'; const credentials = await searchAuth.authenticate(fullToken); if (!searchAuth.isPrincipal(credentials, 'user')) { diff --git a/packages/backend-app-api/src/services/implementations/auth/user/UserTokenHandler.test.ts b/packages/backend-app-api/src/services/implementations/auth/user/UserTokenHandler.test.ts index b0e8418655..76bafb2a8f 100644 --- a/packages/backend-app-api/src/services/implementations/auth/user/UserTokenHandler.test.ts +++ b/packages/backend-app-api/src/services/implementations/auth/user/UserTokenHandler.test.ts @@ -346,7 +346,6 @@ describe('UserTokenHandler', () => { header: { typ: 'vnd.backstage.limited-user', alg: 'ES256' }, payload: { sub: 'mock', - ent: ['mock'], iat: 1, exp: 2, }, @@ -384,7 +383,6 @@ describe('UserTokenHandler', () => { new TextEncoder().encode( JSON.stringify({ sub: parts.payload.sub, - ent: parts.payload.ent, iat: parts.payload.iat, exp: parts.payload.exp, }), diff --git a/packages/backend-app-api/src/services/implementations/auth/user/UserTokenHandler.ts b/packages/backend-app-api/src/services/implementations/auth/user/UserTokenHandler.ts index bd73d8701f..4dd1874843 100644 --- a/packages/backend-app-api/src/services/implementations/auth/user/UserTokenHandler.ts +++ b/packages/backend-app-api/src/services/implementations/auth/user/UserTokenHandler.ts @@ -137,7 +137,6 @@ export class UserTokenHandler { base64url.encode( JSON.stringify({ sub: payload.sub, - ent: payload.ent, iat: payload.iat, exp: payload.exp, }), diff --git a/packages/backend-app-api/src/services/implementations/userInfo/userInfoServiceFactory.ts b/packages/backend-app-api/src/services/implementations/userInfo/userInfoServiceFactory.ts index e88acaf4c2..a745285843 100644 --- a/packages/backend-app-api/src/services/implementations/userInfo/userInfoServiceFactory.ts +++ b/packages/backend-app-api/src/services/implementations/userInfo/userInfoServiceFactory.ts @@ -19,13 +19,24 @@ import { BackstageUserInfo, coreServices, createServiceFactory, + DiscoveryService, BackstageCredentials, } from '@backstage/backend-plugin-api'; +import { ResponseError } from '@backstage/errors'; import { decodeJwt } from 'jose'; import { toInternalBackstageCredentials } from '../auth/helpers'; -// TODO: The intention is for this to eventually be replaced by a call to the auth-backend +type Options = { + discovery: DiscoveryService; +}; + export class DefaultUserInfoService implements UserInfoService { + private readonly discovery: DiscoveryService; + + constructor(options: Options) { + this.discovery = options.discovery; + } + async getUserInfo( credentials: BackstageCredentials, ): Promise { @@ -36,29 +47,48 @@ export class DefaultUserInfoService implements UserInfoService { if (!internalCredentials.token) { throw new Error('User credentials is unexpectedly missing token'); } - const { sub: userEntityRef, ent: ownershipEntityRefs = [] } = decodeJwt( + const { sub: userEntityRef, ent: ownershipEntityRefs } = decodeJwt( internalCredentials.token, ); if (typeof userEntityRef !== 'string') { throw new Error('User entity ref must be a string'); } + + // Return user info if it's already available in the token (ie. it is a full token) if ( - !Array.isArray(ownershipEntityRefs) || - ownershipEntityRefs.some(ref => typeof ref !== 'string') + Array.isArray(ownershipEntityRefs) && + ownershipEntityRefs.every(ref => typeof ref === 'string') ) { - throw new Error('Ownership entity refs must be an array of strings'); + return { userEntityRef, ownershipEntityRefs }; } - return { userEntityRef, ownershipEntityRefs }; + const userInfoResp = await fetch( + `${await this.discovery.getBaseUrl('auth')}/v1/userinfo`, + { + headers: { + Authorization: `Bearer ${internalCredentials.token}`, + }, + }, + ); + + if (!userInfoResp.ok) { + throw await ResponseError.fromResponse(userInfoResp); + } + + const { sub, ent } = await userInfoResp.json(); + + return { userEntityRef: sub, ownershipEntityRefs: ent }; } } /** @public */ export const userInfoServiceFactory = createServiceFactory({ service: coreServices.userInfo, - deps: {}, - async factory() { - return new DefaultUserInfoService(); + deps: { + discovery: coreServices.discovery, + }, + async factory({ discovery }) { + return new DefaultUserInfoService({ discovery }); }, }); diff --git a/plugins/auth-backend/migrations/20240510120825_user_info.js b/plugins/auth-backend/migrations/20240510120825_user_info.js new file mode 100644 index 0000000000..ed667a2b7a --- /dev/null +++ b/plugins/auth-backend/migrations/20240510120825_user_info.js @@ -0,0 +1,44 @@ +/* + * Copyright 2024 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. + */ + +// @ts-check + +/** + * @param {import('knex').Knex} knex + */ +exports.up = async function up(knex) { + await knex.schema.createTable('user_info', table => { + table.comment('User information'); + + table + .string('user_entity_ref') + .primary() + .notNullable() + .comment('User entity reference'); + + table + .text('user_info', 'longtext') + .notNullable() + .comment('User info blob, JSON serialized'); + }); +}; + +/** + * @param {import('knex').Knex} knex + */ +exports.down = async function down(knex) { + await knex.schema.dropTable('user_info'); +}; diff --git a/plugins/auth-backend/src/identity/TokenFactory.test.ts b/plugins/auth-backend/src/identity/TokenFactory.test.ts index 0994e44f68..becf821db7 100644 --- a/plugins/auth-backend/src/identity/TokenFactory.test.ts +++ b/plugins/auth-backend/src/identity/TokenFactory.test.ts @@ -24,6 +24,7 @@ import { } from 'jose'; import { MemoryKeyStore } from './MemoryKeyStore'; import { TokenFactory } from './TokenFactory'; +import { UserInfoDatabaseHandler } from './UserInfoDatabaseHandler'; import { tokenTypes } from '@backstage/plugin-auth-node'; const logger = getVoidLogger(); @@ -43,6 +44,10 @@ const entityRef = stringifyEntityRef({ }); describe('TokenFactory', () => { + const mockUserInfoDatabaseHandler = { + addUserInfo: jest.fn().mockResolvedValue(undefined), + } as unknown as UserInfoDatabaseHandler; + it('should issue valid tokens signed by a listed key', async () => { const keyDurationSeconds = 5; const factory = new TokenFactory({ @@ -50,6 +55,7 @@ describe('TokenFactory', () => { keyStore: new MemoryKeyStore(), keyDurationSeconds, logger, + userInfoDatabaseHandler: mockUserInfoDatabaseHandler, }); await expect(factory.listPublicKeys()).resolves.toEqual({ keys: [] }); @@ -81,6 +87,11 @@ describe('TokenFactory', () => { verifyResult.payload.iat! + keyDurationSeconds, ); + expect(mockUserInfoDatabaseHandler.addUserInfo).toHaveBeenCalledWith({ + userEntityRef: entityRef, + ownershipEntityRefs: [entityRef], + }); + // Emulate the reconstruction of a limited user token const limitedUserToken = [ base64url.encode( @@ -93,7 +104,6 @@ describe('TokenFactory', () => { base64url.encode( JSON.stringify({ sub: verifyResult.payload.sub, - ent: verifyResult.payload.ent, iat: verifyResult.payload.iat, exp: verifyResult.payload.exp, }), @@ -107,7 +117,6 @@ describe('TokenFactory', () => { ); expect(verifyProofResult.payload).toEqual({ sub: entityRef, - ent: [entityRef], iat: expect.any(Number), exp: expect.any(Number), }); @@ -125,6 +134,7 @@ describe('TokenFactory', () => { keyStore: new MemoryKeyStore(), keyDurationSeconds: 5, logger, + userInfoDatabaseHandler: mockUserInfoDatabaseHandler, }); const token1 = await factory.issueToken({ @@ -170,6 +180,7 @@ describe('TokenFactory', () => { keyStore: new MemoryKeyStore(), keyDurationSeconds, logger, + userInfoDatabaseHandler: mockUserInfoDatabaseHandler, }); await expect(() => { @@ -187,6 +198,7 @@ describe('TokenFactory', () => { keyDurationSeconds, logger, algorithm: '', + userInfoDatabaseHandler: mockUserInfoDatabaseHandler, }); await expect(() => { @@ -202,6 +214,7 @@ describe('TokenFactory', () => { keyStore: new MemoryKeyStore(), keyDurationSeconds: 5, logger, + userInfoDatabaseHandler: mockUserInfoDatabaseHandler, }); await expect(() => { @@ -220,6 +233,7 @@ describe('TokenFactory', () => { keyStore: new MemoryKeyStore(), keyDurationSeconds, logger, + userInfoDatabaseHandler: mockUserInfoDatabaseHandler, }); const token = await factory.issueToken({ diff --git a/plugins/auth-backend/src/identity/TokenFactory.ts b/plugins/auth-backend/src/identity/TokenFactory.ts index 9277361679..4c7753d998 100644 --- a/plugins/auth-backend/src/identity/TokenFactory.ts +++ b/plugins/auth-backend/src/identity/TokenFactory.ts @@ -31,6 +31,7 @@ import { LoggerService } from '@backstage/backend-plugin-api'; import { TokenParams, tokenTypes } from '@backstage/plugin-auth-node'; import { AnyJWK, KeyStore, TokenIssuer } from './types'; import { JsonValue } from '@backstage/types'; +import { UserInfoDatabaseHandler } from './UserInfoDatabaseHandler'; const MS_IN_S = 1000; const MAX_TOKEN_LENGTH = 32768; // At 64 bytes per entity ref this still leaves room for about 500 entities @@ -93,11 +94,6 @@ interface BackstageUserIdentityProofPayload { */ sub: string; - /** - * The ownership entity refs of the user - */ - ent?: string[]; - /** * Standard expiry in epoch seconds */ @@ -124,6 +120,7 @@ type Options = { * If not, add a knex migration file in the migrations folder. * More info on supported algorithms: https://github.com/panva/jose */ algorithm?: string; + userInfoDatabaseHandler: UserInfoDatabaseHandler; }; /** @@ -146,6 +143,7 @@ export class TokenFactory implements TokenIssuer { private readonly keyStore: KeyStore; private readonly keyDurationSeconds: number; private readonly algorithm: string; + private readonly userInfoDatabaseHandler: UserInfoDatabaseHandler; private keyExpiry?: Date; private privateKeyPromise?: Promise; @@ -156,6 +154,7 @@ export class TokenFactory implements TokenIssuer { this.keyStore = options.keyStore; this.keyDurationSeconds = options.keyDurationSeconds; this.algorithm = options.algorithm ?? 'ES256'; + this.userInfoDatabaseHandler = options.userInfoDatabaseHandler; } async issueToken(params: TokenParams): Promise { @@ -190,7 +189,7 @@ export class TokenFactory implements TokenIssuer { alg: key.alg, kid: key.kid, }, - payload: { sub, ent, iat, exp }, + payload: { sub, iat, exp }, key: signingKey, }); @@ -221,6 +220,13 @@ export class TokenFactory implements TokenIssuer { ); } + // Store the user info in the database upon successful token + // issuance so that it can be retrieved later by limited user tokens + await this.userInfoDatabaseHandler.addUserInfo({ + userEntityRef: sub, + ownershipEntityRefs: ent, + }); + return token; } @@ -342,7 +348,6 @@ export class TokenFactory implements TokenIssuer { const payload = { sub: options.payload.sub, - ent: options.payload.ent, iat: options.payload.iat, exp: options.payload.exp, }; diff --git a/plugins/auth-backend/src/identity/UserInfoDatabaseHandler.test.ts b/plugins/auth-backend/src/identity/UserInfoDatabaseHandler.test.ts new file mode 100644 index 0000000000..4c18e1ff2a --- /dev/null +++ b/plugins/auth-backend/src/identity/UserInfoDatabaseHandler.test.ts @@ -0,0 +1,109 @@ +/* + * Copyright 2024 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 { resolvePackagePath } from '@backstage/backend-common'; +import { TestDatabaseId, TestDatabases } from '@backstage/backend-test-utils'; +import { Knex } from 'knex'; +import { UserInfoDatabaseHandler } from './UserInfoDatabaseHandler'; + +const migrationsDir = resolvePackagePath( + '@backstage/plugin-auth-backend', + 'migrations', +); + +describe('UserInfoDatabaseHandler', () => { + const databases = TestDatabases.create(); + + async function createDatabaseHandler(databaseId: TestDatabaseId) { + const knex = await databases.init(databaseId); + + await knex.migrate.latest({ + directory: migrationsDir, + }); + + return { + knex, + dbHandler: new UserInfoDatabaseHandler(knex), + }; + } + + describe.each(databases.eachSupportedId())( + '%p', + databaseId => { + let knex: Knex; + let dbHandler: UserInfoDatabaseHandler; + + beforeEach(async () => { + ({ knex, dbHandler } = await createDatabaseHandler(databaseId)); + }, 30000); + + it('addUserInfo', async () => { + const userInfo = { + userEntityRef: 'user:default/foo', + ownershipEntityRefs: ['group:default/foo-group', 'group:default/bar'], + }; + + await dbHandler.addUserInfo(userInfo); + + const savedUserInfo = await knex('user_info') + .where('user_entity_ref', 'user:default/foo') + .first(); + expect(savedUserInfo).toEqual({ + user_entity_ref: userInfo.userEntityRef, + user_info: JSON.stringify({ + ownershipEntityRefs: userInfo.ownershipEntityRefs, + }), + }); + + userInfo.ownershipEntityRefs = [ + 'group:default/group1', + 'group:default/group2', + ]; + await dbHandler.addUserInfo(userInfo); + + const updatedUserInfo = await knex('user_info') + .where('user_entity_ref', 'user:default/foo') + .first(); + expect(updatedUserInfo).toEqual({ + user_entity_ref: userInfo.userEntityRef, + user_info: JSON.stringify({ + ownershipEntityRefs: userInfo.ownershipEntityRefs, + }), + }); + }); + + it('getUserInfo', async () => { + const userInfo = { + userEntityRef: 'user:default/backstage-user', + ownershipEntityRefs: ['group:default/group1', 'group:default/group2'], + }; + + await knex('user_info').insert({ + user_entity_ref: userInfo.userEntityRef, + user_info: JSON.stringify({ + ownershipEntityRefs: userInfo.ownershipEntityRefs, + }), + }); + + const savedUserInfo = await dbHandler.getUserInfo( + userInfo.userEntityRef, + ); + expect(savedUserInfo).toEqual(userInfo); + }); + }, + 60000, + ); +}); diff --git a/plugins/auth-backend/src/identity/UserInfoDatabaseHandler.ts b/plugins/auth-backend/src/identity/UserInfoDatabaseHandler.ts new file mode 100644 index 0000000000..f7dea52236 --- /dev/null +++ b/plugins/auth-backend/src/identity/UserInfoDatabaseHandler.ts @@ -0,0 +1,60 @@ +/* + * Copyright 2024 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 { BackstageUserInfo } from '@backstage/backend-plugin-api'; +import { Knex } from 'knex'; + +const TABLE = 'user_info'; + +type Row = { + user_entity_ref: string; + user_info: string; +}; + +// TODO: How do we prune stale users? +export class UserInfoDatabaseHandler { + constructor(private readonly client: Knex) {} + + async addUserInfo(userInfo: BackstageUserInfo): Promise { + await this.client(TABLE) + .insert({ + user_entity_ref: userInfo.userEntityRef, + user_info: JSON.stringify({ + ownershipEntityRefs: userInfo.ownershipEntityRefs, + }), + }) + .onConflict('user_entity_ref') + .merge(); + } + + async getUserInfo( + userEntityRef: string, + ): Promise { + const info = await this.client(TABLE) + .where({ user_entity_ref: userEntityRef }) + .first(); + + if (!info) { + return undefined; + } + + const { ownershipEntityRefs } = JSON.parse(info.user_info); + return { + userEntityRef: info.user_entity_ref, + ownershipEntityRefs, + }; + } +} diff --git a/plugins/auth-backend/src/identity/index.ts b/plugins/auth-backend/src/identity/index.ts index 0492836723..6ea025aae9 100644 --- a/plugins/auth-backend/src/identity/index.ts +++ b/plugins/auth-backend/src/identity/index.ts @@ -21,3 +21,4 @@ export { MemoryKeyStore } from './MemoryKeyStore'; export { FirestoreKeyStore } from './FirestoreKeyStore'; export { KeyStores } from './KeyStores'; export type { KeyStore, TokenParams } from './types'; +export { UserInfoDatabaseHandler } from './UserInfoDatabaseHandler'; diff --git a/plugins/auth-backend/src/identity/router.test.ts b/plugins/auth-backend/src/identity/router.test.ts index 9880d2931c..1ed9071578 100644 --- a/plugins/auth-backend/src/identity/router.test.ts +++ b/plugins/auth-backend/src/identity/router.test.ts @@ -22,10 +22,15 @@ import { mockServices, startTestBackend } from '@backstage/backend-test-utils'; import Router from 'express-promise-router'; import request from 'supertest'; import { bindOidcRouter } from './router'; +import { UserInfoDatabaseHandler } from './UserInfoDatabaseHandler'; describe('bindOidcRouter', () => { - it('should return user info', async () => { + it('should return user info for full tokens', async () => { const auth = mockServices.auth.mock(); + const mockUserInfoDatabaseHandler = { + getUserInfo: jest.fn().mockResolvedValue(undefined), + } as unknown as UserInfoDatabaseHandler; + const { server } = await startTestBackend({ features: [ createBackendPlugin({ @@ -39,6 +44,7 @@ describe('bindOidcRouter', () => { baseUrl: 'http://localhost:7000', auth, tokenIssuer: {} as any, + userInfoDatabaseHandler: mockUserInfoDatabaseHandler, }); httpRouter.use(router); httpRouter.addAuthPolicy({ @@ -68,6 +74,61 @@ describe('bindOidcRouter', () => { ent: ['k/ns:a', 'k/ns:b'], }); - expect('test').toBe('test'); + expect(mockUserInfoDatabaseHandler.getUserInfo).not.toHaveBeenCalled(); + }); + + it('should return user info for limited tokens', async () => { + const auth = mockServices.auth.mock(); + const mockUserInfoDatabaseHandler = { + getUserInfo: jest.fn().mockResolvedValue({ + userEntityRef: 'k/ns:n', + ownershipEntityRefs: ['k/ns:a', 'k/ns:b'], + }), + } as unknown as UserInfoDatabaseHandler; + + const { server } = await startTestBackend({ + features: [ + createBackendPlugin({ + pluginId: 'auth', + register(reg) { + reg.registerInit({ + deps: { httpRouter: coreServices.httpRouter }, + async init({ httpRouter }) { + const router = Router(); + bindOidcRouter(router, { + baseUrl: 'http://localhost:7000', + auth, + tokenIssuer: {} as any, + userInfoDatabaseHandler: mockUserInfoDatabaseHandler, + }); + httpRouter.use(router); + httpRouter.addAuthPolicy({ + path: '/', + allow: 'unauthenticated', + }); + }, + }); + }, + }), + ], + }); + + auth.authenticate.mockResolvedValueOnce({} as any); + auth.isPrincipal.mockReturnValueOnce(true); + + await request(server) + .get('/api/auth/v1/userinfo') + .set( + 'Authorization', + `Bearer h.${btoa(JSON.stringify({ sub: 'k/ns:n' }))}.s`, + ) + .expect(200, { + sub: 'k/ns:n', + ent: ['k/ns:a', 'k/ns:b'], + }); + + expect(mockUserInfoDatabaseHandler.getUserInfo).toHaveBeenCalledWith( + 'k/ns:n', + ); }); }); diff --git a/plugins/auth-backend/src/identity/router.ts b/plugins/auth-backend/src/identity/router.ts index 3936298c72..be9345338f 100644 --- a/plugins/auth-backend/src/identity/router.ts +++ b/plugins/auth-backend/src/identity/router.ts @@ -20,6 +20,7 @@ import { TokenIssuer } from './types'; import { AuthService } from '@backstage/backend-plugin-api'; import { decodeJwt } from 'jose'; import { AuthenticationError, InputError } from '@backstage/errors'; +import { UserInfoDatabaseHandler } from './UserInfoDatabaseHandler'; export function bindOidcRouter( targetRouter: express.Router, @@ -27,9 +28,10 @@ export function bindOidcRouter( baseUrl: string; auth: AuthService; tokenIssuer: TokenIssuer; + userInfoDatabaseHandler: UserInfoDatabaseHandler; }, ) { - const { baseUrl, auth, tokenIssuer } = options; + const { baseUrl, auth, tokenIssuer, userInfoDatabaseHandler } = options; const router = Router(); targetRouter.use(router); @@ -91,21 +93,30 @@ export function bindOidcRouter( ); } - const { sub: userEntityRef, ent: ownershipEntityRefs = [] } = - decodeJwt(token); + const { sub: userEntityRef, ent: ownershipEntityRefs } = decodeJwt(token); if (typeof userEntityRef !== 'string') { throw new Error('Invalid user token, user entity ref must be a string'); } + + // Return user info if it's already available in the token (ie. it is a full token) if ( - !Array.isArray(ownershipEntityRefs) || - ownershipEntityRefs.some(ref => typeof ref !== 'string') + Array.isArray(ownershipEntityRefs) && + ownershipEntityRefs.every(ref => typeof ref === 'string') ) { - throw new Error( - 'Invalid user token, ownership entity refs must be an array of strings', - ); + res.json({ sub: userEntityRef, ent: ownershipEntityRefs }); + return; } - res.json({ sub: userEntityRef, ent: ownershipEntityRefs }); + const userInfo = await userInfoDatabaseHandler.getUserInfo(userEntityRef); + if (!userInfo) { + res.status(404).send('User info not found'); + return; + } + + res.json({ + sub: userInfo.userEntityRef, + ent: userInfo.ownershipEntityRefs, + }); }); } diff --git a/plugins/auth-backend/src/migrations.test.ts b/plugins/auth-backend/src/migrations.test.ts index f80b729975..eeb56785c8 100644 --- a/plugins/auth-backend/src/migrations.test.ts +++ b/plugins/auth-backend/src/migrations.test.ts @@ -71,4 +71,30 @@ describe('migrations', () => { await knex.destroy(); }, ); + + it.each(databases.eachSupportedId())( + '20240510120825_user_info.js, %p', + async databaseId => { + const knex = await databases.init(databaseId); + + await migrateUntilBefore(knex, '20240510120825_user_info.js'); + await migrateUpOnce(knex); + + const user_info = JSON.stringify({ + ownershipEntityRefs: ['group:default/group1', 'group:default/group2'], + }); + + await knex + .insert({ user_entity_ref: 'user:default/backstage-user', user_info }) + .into('user_info'); + + await expect(knex('user_info')).resolves.toEqual([ + { user_entity_ref: 'user:default/backstage-user', user_info }, + ]); + + await migrateDownOnce(knex); + + await knex.destroy(); + }, + ); }); diff --git a/plugins/auth-backend/src/service/router.ts b/plugins/auth-backend/src/service/router.ts index 11c150aa33..4bb42c3abd 100644 --- a/plugins/auth-backend/src/service/router.ts +++ b/plugins/auth-backend/src/service/router.ts @@ -32,7 +32,12 @@ import { } from '@backstage/backend-common'; import { NotFoundError } from '@backstage/errors'; import { CatalogApi } from '@backstage/catalog-client'; -import { bindOidcRouter, KeyStores, TokenFactory } from '../identity'; +import { + bindOidcRouter, + KeyStores, + TokenFactory, + UserInfoDatabaseHandler, +} from '../identity'; import session from 'express-session'; import connectSessionKnex from 'connect-session-knex'; import passport from 'passport'; @@ -87,6 +92,10 @@ export async function createRouter( database: authDb, }); + const userInfoDatabaseHandler = new UserInfoDatabaseHandler( + await authDb.get(), + ); + let tokenIssuer: TokenIssuer; if (keyStore instanceof StaticKeyStore) { tokenIssuer = new StaticTokenIssuer( @@ -106,6 +115,7 @@ export async function createRouter( algorithm: tokenFactoryAlgorithm ?? config.getOptionalString('auth.identityTokenAlgorithm'), + userInfoDatabaseHandler, }); } @@ -156,6 +166,7 @@ export async function createRouter( auth, tokenIssuer, baseUrl: authUrl, + userInfoDatabaseHandler, }); // Gives a more helpful error message than a plain 404 From b9b3d647f767a8ddb397e9af11f10cfeb0a12c19 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 19:34:27 +0000 Subject: [PATCH 015/387] fix(deps): update dependency dompurify to v3.1.3 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index cf61ceace7..df9188b89a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -24187,7 +24187,7 @@ __metadata: languageName: node linkType: hard -"dompurify@npm:=3.1.0, dompurify@npm:^3.0.0": +"dompurify@npm:=3.1.0": version: 3.1.0 resolution: "dompurify@npm:3.1.0" checksum: 06fc76607cd076e394b2ea5479ab6f0407b8fedb6877ae95e94207b878365e5e1cd914055dacce152a5f419818afb8d4cd284b780246cf35363f0747c179a0ba @@ -24195,9 +24195,16 @@ __metadata: linkType: hard "dompurify@npm:^2.2.7": - version: 2.5.0 - resolution: "dompurify@npm:2.5.0" - checksum: 9eab7be868ddb5a43fa634898605681e7b6b18dc5b89f5d143afc9ec63bb4d2c113a15900d5ee363859aa8722e8534da346486997eafbb29e3178cbb89077e15 + version: 2.5.3 + resolution: "dompurify@npm:2.5.3" + checksum: 816726f99d6b6e52dcda4656c5db20767844eb7d5f57e8c6d5d5e3e6d5b291874ad6cd28fd82b2e0fcd42c45a6cafe5e0047493272944f000bda06a98c74a72d + languageName: node + linkType: hard + +"dompurify@npm:^3.0.0": + version: 3.1.3 + resolution: "dompurify@npm:3.1.3" + checksum: ad8bbf8f73e44bb2b0fa1f676a248515332ac9fadc57e5f7ffc8e1f597c7cb7ecd9ecb80075f0934fa4362bef33779107ed165e3d5fa84e80eb603defdf7aed2 languageName: node linkType: hard From 987ba2f62338880a95e9ae03e558e38aeea3a90c Mon Sep 17 00:00:00 2001 From: Aditya Kumar Date: Tue, 14 May 2024 09:26:58 +0530 Subject: [PATCH 016/387] Updated the auth/github document Signed-off-by: Aditya Kumar --- docs/auth/github/provider.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/auth/github/provider.md b/docs/auth/github/provider.md index 2c3aaeaf7d..366764c7e8 100644 --- a/docs/auth/github/provider.md +++ b/docs/auth/github/provider.md @@ -69,7 +69,11 @@ This provider includes several resolvers out of the box that you can use: - `emailLocalPartMatchingUserEntityName`: Matches the [local part](https://en.wikipedia.org/wiki/Email_address#Local-part) of the email address from the auth provider with the User entity that has a matching `name`. If no match is found it will throw a `NotFoundError`. - `usernameMatchingUserEntityName`: Matches the username from the auth provider with the User entity that has a matching `name`. If no match is found it will throw a `NotFoundError`. -> Note: The resolvers will be tried in order, but will only be skipped if they throw a `NotFoundError`. +:::note Note + +The resolvers will be tried in order, but will only be skipped if they throw a `NotFoundError`. + +::: If these resolvers do not fit your needs you can build a custom resolver, this is covered in the [Building Custom Resolvers](../identity-resolver.md#building-custom-resolvers) section of the Sign-in Identities and Resolvers documentation. From 9189c23b65cb44ceb9a32d452d05a8c67bd56922 Mon Sep 17 00:00:00 2001 From: Alan Serhan Date: Fri, 17 May 2024 16:52:39 +0100 Subject: [PATCH 017/387] From: Alan Serhan Date: Fri, 17 May 2024 16:56:00 IST Subject: [Feature] Update Backstage docs to include information how to leverage backstage-cli Signed-off-by: Alan Serhan --- .../writing-custom-actions.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/features/software-templates/writing-custom-actions.md b/docs/features/software-templates/writing-custom-actions.md index 92ff092948..8dbca8b1c9 100644 --- a/docs/features/software-templates/writing-custom-actions.md +++ b/docs/features/software-templates/writing-custom-actions.md @@ -13,6 +13,25 @@ by writing custom actions which can be used alongside our > If you want to continue using the builtin actions, include them in the actions > array when registering your custom actions, as seen below. +## Streamlining Custom Action Creation with Backstage CLI + +The creation of custom actions in Backstage has never been easier thanks to the Backstage CLI. This tool streamlines the setup process, allowing you to focus on your actions' unique functionality. + +Start by using the `yarn backstage-cli new` command to generate a scaffolder module. This command sets up the necessary boilerplate code, providing a smooth start: + +``` +$ yarn backstage-cli new +? What do you want to create? + plugin-common - A new isomorphic common plugin package + plugin-node - A new Node.js library plugin package + plugin-react - A new web library plugin package +> scaffolder-module - An module exporting custom actions for @backstage/plugin-scaffolder-backend +``` + +You can find a [list](https://backstage.io/docs/local-dev/cli-commands/) of all commands provided by the Backstage CLI. + +When prompted, select the option to generate a scaffolder module. This creates a solid foundation for your custom action. Enter the name of the module you wish to create, and the CLI will generate the required files and directory structure. + ## Writing your Custom Action Your custom action can live where you choose, but simplest is to include it From 43b45c0ce03209f766fd91b958c9048e1a87db6e Mon Sep 17 00:00:00 2001 From: Nelson Paulraj Date: Mon, 20 May 2024 19:39:15 +0530 Subject: [PATCH 018/387] Added digital.ai release yaml for marketplace Signed-off-by: Nelson Paulraj --- microsite/data/plugins/digital.ai-release.yaml | 18 ++++++++++++++++++ microsite/static/img/digital.ai-release.svg | 14 ++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 microsite/data/plugins/digital.ai-release.yaml create mode 100644 microsite/static/img/digital.ai-release.svg diff --git a/microsite/data/plugins/digital.ai-release.yaml b/microsite/data/plugins/digital.ai-release.yaml new file mode 100644 index 0000000000..56674640ce --- /dev/null +++ b/microsite/data/plugins/digital.ai-release.yaml @@ -0,0 +1,18 @@ +--- +title: Digital.ai Release +author: digital.ai +authorUrl: https://digital.ai/ +category: Release +description: The plugin offers integration with Digital.ai Release and backstage. It provide access to active releases, templates and manage workflow executions. +documentation: https://docs.digital.ai/bundle/devops-deploy-version-v.24.1/page/deploy/concept/xl-deploy-backstage-overview.html +iconUrl: /img/digital.ai-release.svg +npmPackageName: '@digital.ai/plugin-dai-release' +tags: + - ci + - cd + - release + - orchestration + - devops + - pipeline + - automation +addedDate: '2024-05-22' diff --git a/microsite/static/img/digital.ai-release.svg b/microsite/static/img/digital.ai-release.svg new file mode 100644 index 0000000000..ba510e2a79 --- /dev/null +++ b/microsite/static/img/digital.ai-release.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + From 43f6b71faae85196a31b2c22718576be7efe2ea0 Mon Sep 17 00:00:00 2001 From: Nelson Paulraj Date: Thu, 23 May 2024 11:31:24 +0530 Subject: [PATCH 019/387] Updated plugin category to CI/CD Signed-off-by: Nelson Paulraj --- microsite/data/plugins/digital.ai-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microsite/data/plugins/digital.ai-release.yaml b/microsite/data/plugins/digital.ai-release.yaml index 56674640ce..e74c84999b 100644 --- a/microsite/data/plugins/digital.ai-release.yaml +++ b/microsite/data/plugins/digital.ai-release.yaml @@ -2,7 +2,7 @@ title: Digital.ai Release author: digital.ai authorUrl: https://digital.ai/ -category: Release +category: CI/CD description: The plugin offers integration with Digital.ai Release and backstage. It provide access to active releases, templates and manage workflow executions. documentation: https://docs.digital.ai/bundle/devops-deploy-version-v.24.1/page/deploy/concept/xl-deploy-backstage-overview.html iconUrl: /img/digital.ai-release.svg From b18670184f2bd06240eec0afcbdf8b5ab6416a9a Mon Sep 17 00:00:00 2001 From: Thomas Cardonne Date: Wed, 8 May 2024 00:43:22 +0200 Subject: [PATCH 020/387] feat(search-backend-module-elasticsearch): ensure all stale indices are deleted Signed-off-by: Thomas Cardonne --- .changeset/wild-eyes-grab.md | 10 ++++ .../ElasticSearchClientWrapper.test.ts | 60 +++++++------------ .../src/engines/ElasticSearchClientWrapper.ts | 32 ++++------ .../ElasticSearchSearchEngineIndexer.test.ts | 53 ++++++---------- .../ElasticSearchSearchEngineIndexer.ts | 20 ++----- 5 files changed, 68 insertions(+), 107 deletions(-) create mode 100644 .changeset/wild-eyes-grab.md diff --git a/.changeset/wild-eyes-grab.md b/.changeset/wild-eyes-grab.md new file mode 100644 index 0000000000..d97c92d99e --- /dev/null +++ b/.changeset/wild-eyes-grab.md @@ -0,0 +1,10 @@ +--- +'@backstage/plugin-search-backend-module-elasticsearch': minor +--- + +**BREAKING** The ElasticSearch indexer will now delete stale indices matching the indexer's pattern. + +An indexer using the `some-type-index__*` pattern will remove indices matching this pattern after indexation +to prevent stale indices leading to shards exhaustion. + +Note: The ElasticSearch indexer already uses wildcards patterns to remove aliases on these indices. diff --git a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchClientWrapper.test.ts b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchClientWrapper.test.ts index 75f2e36b2b..e888aa4506 100644 --- a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchClientWrapper.test.ts +++ b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchClientWrapper.test.ts @@ -28,17 +28,13 @@ jest.mock('@elastic/elasticsearch', () => ({ search: jest .fn() .mockImplementation(async args => ({ client: 'es', args })), - cat: { - aliases: jest - .fn() - .mockImplementation(async args => ({ client: 'es', args })), - }, helpers: { bulk: jest .fn() .mockImplementation(async args => ({ client: 'es', args })), }, indices: { + get: jest.fn().mockImplementation(async args => ({ client: 'es', args })), create: jest .fn() .mockImplementation(async args => ({ client: 'es', args })), @@ -64,17 +60,13 @@ jest.mock('@opensearch-project/opensearch', () => ({ search: jest .fn() .mockImplementation(async args => ({ client: 'os', args })), - cat: { - aliases: jest - .fn() - .mockImplementation(async args => ({ client: 'os', args })), - }, helpers: { bulk: jest .fn() .mockImplementation(async args => ({ client: 'os', args })), }, indices: { + get: jest.fn().mockImplementation(async args => ({ client: 'os', args })), create: jest .fn() .mockImplementation(async args => ({ client: 'os', args })), @@ -154,6 +146,16 @@ describe('ElasticSearchClientWrapper', () => { expect(result.args).toStrictEqual(indexTemplate); }); + it('indexList', async () => { + const wrapper = ElasticSearchClientWrapper.fromClientOptions(esOptions); + + const input = { index: 'xyz-*' }; + const result = (await wrapper.listIndices(input)) as any; + + expect(result.client).toBe('es'); + expect(result.args).toStrictEqual(input); + }); + it('indexExists', async () => { const wrapper = ElasticSearchClientWrapper.fromClientOptions(esOptions); @@ -187,20 +189,6 @@ describe('ElasticSearchClientWrapper', () => { expect(result.args).toStrictEqual(input); }); - it('getAliases', async () => { - const wrapper = ElasticSearchClientWrapper.fromClientOptions(esOptions); - - const input = { aliases: ['xyz'] }; - const result = (await wrapper.getAliases(input)) as any; - - // Should call the OpenSearch client with expected input. - expect(result.client).toBe('es'); - expect(result.args).toStrictEqual({ - format: 'json', - name: input.aliases, - }); - }); - it('updateAliases', async () => { const wrapper = ElasticSearchClientWrapper.fromClientOptions(esOptions); @@ -282,6 +270,16 @@ describe('ElasticSearchClientWrapper', () => { expect(result.args).toStrictEqual(indexTemplate); }); + it('indexList', async () => { + const wrapper = ElasticSearchClientWrapper.fromClientOptions(osOptions); + + const input = { index: 'xyz-*' }; + const result = (await wrapper.listIndices(input)) as any; + + expect(result.client).toBe('os'); + expect(result.args).toStrictEqual(input); + }); + it('indexExists', async () => { const wrapper = ElasticSearchClientWrapper.fromClientOptions(osOptions); @@ -315,20 +313,6 @@ describe('ElasticSearchClientWrapper', () => { expect(result.args).toStrictEqual(input); }); - it('getAliases', async () => { - const wrapper = ElasticSearchClientWrapper.fromClientOptions(osOptions); - - const input = { aliases: ['xyz'] }; - const result = (await wrapper.getAliases(input)) as any; - - // Should call the OpenSearch client with expected input. - expect(result.client).toBe('os'); - expect(result.args).toStrictEqual({ - format: 'json', - name: input.aliases, - }); - }); - it('updateAliases', async () => { const wrapper = ElasticSearchClientWrapper.fromClientOptions(osOptions); diff --git a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchClientWrapper.ts b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchClientWrapper.ts index a7aca3d03f..454e1a6d50 100644 --- a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchClientWrapper.ts +++ b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchClientWrapper.ts @@ -141,6 +141,18 @@ export class ElasticSearchClientWrapper { throw new Error('No client defined'); } + listIndices(options: { index: string }) { + if (this.openSearchClient) { + return this.openSearchClient.indices.get(options); + } + + if (this.elasticSearchClient) { + return this.elasticSearchClient.indices.get(options); + } + + throw new Error('No client defined'); + } + indexExists(options: { index: string | string[] }) { if (this.openSearchClient) { return this.openSearchClient.indices.exists(options); @@ -177,26 +189,6 @@ export class ElasticSearchClientWrapper { throw new Error('No client defined'); } - getAliases(options: { aliases: string[] }) { - const { aliases } = options; - - if (this.openSearchClient) { - return this.openSearchClient.cat.aliases({ - format: 'json', - name: aliases, - }); - } - - if (this.elasticSearchClient) { - return this.elasticSearchClient.cat.aliases({ - format: 'json', - name: aliases, - }); - } - - throw new Error('No client defined'); - } - updateAliases(options: { actions: ElasticSearchAliasAction[] }) { const filteredActions = options.actions.filter(Boolean); diff --git a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngineIndexer.test.ts b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngineIndexer.test.ts index 44d33c27a5..75b86cc868 100644 --- a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngineIndexer.test.ts +++ b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngineIndexer.test.ts @@ -30,7 +30,7 @@ const clientWrapper = ElasticSearchClientWrapper.fromClientOptions({ describe('ElasticSearchSearchEngineIndexer', () => { let indexer: ElasticSearchSearchEngineIndexer; let bulkSpy: jest.Mock; - let catSpy: jest.Mock; + let getSpy: jest.Mock; let createSpy: jest.Mock; let aliasesSpy: jest.Mock; let deleteSpy: jest.Mock; @@ -68,30 +68,24 @@ describe('ElasticSearchSearchEngineIndexer', () => { refreshSpy, ); - catSpy = jest.fn().mockReturnValue([ - { - alias: 'some-type-index__search', - index: 'some-type-index__123tobedeleted', - filter: '-', - 'routing.index': '-', - 'routing.search': '-', - is_write_index: '-', + getSpy = jest.fn().mockReturnValue({ + 'some-type-index__123tobedeleted': { + aliases: {}, + mappings: {}, + settings: {}, }, - { - alias: 'some-type-index__search_removable', - index: 'some-type-index__456tobedeleted', - filter: '-', - 'routing.index': '-', - 'routing.search': '-', - is_write_index: '-', + 'some-type-index__456tobedeleted': { + aliases: {}, + mappings: {}, + settings: {}, }, - ]); + }); mock.add( { method: 'GET', - path: '/_cat/aliases/some-type-index__search%2Csome-type-index__search_removable', + path: '/some-type-index__*', }, - catSpy, + getSpy, ); createSpy = jest.fn().mockReturnValue({ @@ -143,7 +137,7 @@ describe('ElasticSearchSearchEngineIndexer', () => { await TestPipeline.fromIndexer(indexer).withDocuments(documents).execute(); // Older indices should have been queried for. - expect(catSpy).toHaveBeenCalled(); + expect(getSpy).toHaveBeenCalled(); // A new index should have been created. const createdIndex = createSpy.mock.calls[0][0].path.slice(1); @@ -163,15 +157,6 @@ describe('ElasticSearchSearchEngineIndexer', () => { remove: { index: 'some-type-index__*', alias: 'some-type-index__search' }, }); expect(aliasActions[1]).toStrictEqual({ - add: { - indices: [ - 'some-type-index__123tobedeleted', - 'some-type-index__456tobedeleted', - ], - alias: 'some-type-index__search_removable', - }, - }); - expect(aliasActions[2]).toStrictEqual({ add: { index: createdIndex, alias: 'some-type-index__search' }, }); @@ -183,7 +168,7 @@ describe('ElasticSearchSearchEngineIndexer', () => { await TestPipeline.fromIndexer(indexer).withDocuments([]).execute(); // Older indices should have been queried for. - expect(catSpy).toHaveBeenCalled(); + expect(getSpy).toHaveBeenCalled(); // A new index should have been created. expect(createSpy).toHaveBeenNthCalledWith( @@ -236,17 +221,17 @@ describe('ElasticSearchSearchEngineIndexer', () => { ]; // Update initial alias cat to return nothing. - catSpy = jest.fn().mockReturnValue([]); + getSpy = jest.fn().mockReturnValue({}); mock.clear({ method: 'GET', - path: '/_cat/aliases/some-type-index__search%2Csome-type-index__search_removable', + path: '/some-type-index__*', }); mock.add( { method: 'GET', - path: '/_cat/aliases/some-type-index__search%2Csome-type-index__search_removable', + path: '/some-type-index__*', }, - catSpy, + getSpy, ); await TestPipeline.fromIndexer(indexer).withDocuments(documents).execute(); diff --git a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngineIndexer.ts b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngineIndexer.ts index 4b1307114a..58773600a7 100644 --- a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngineIndexer.ts +++ b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngineIndexer.ts @@ -56,7 +56,6 @@ export class ElasticSearchSearchEngineIndexer extends BatchSearchEngineIndexer { private readonly indexPrefix: string; private readonly indexSeparator: string; private readonly alias: string; - private readonly removableAlias: string; private readonly logger: Logger | LoggerService; private readonly sourceStream: Readable; private readonly elasticSearchClientWrapper: ElasticSearchClientWrapper; @@ -74,7 +73,6 @@ export class ElasticSearchSearchEngineIndexer extends BatchSearchEngineIndexer { this.indexSeparator = options.indexSeparator; this.indexName = this.constructIndexName(`${Date.now()}`); this.alias = options.alias; - this.removableAlias = `${this.alias}_removable`; this.elasticSearchClientWrapper = options.elasticSearchClientWrapper; // The ES client bulk helper supports stream-based indexing, but we have to @@ -108,13 +106,13 @@ export class ElasticSearchSearchEngineIndexer extends BatchSearchEngineIndexer { async initialize(): Promise { this.logger.info(`Started indexing documents for index ${this.type}`); - const aliases = await this.elasticSearchClientWrapper.getAliases({ - aliases: [this.alias, this.removableAlias], + const indices = await this.elasticSearchClientWrapper.listIndices({ + index: this.constructIndexName('*'), }); - this.removableIndices = [ - ...new Set(aliases.body.map((r: Record) => r.index)), - ] as string[]; + for (const key of Object.keys(indices.body)) { + this.removableIndices.push(key); + } await this.elasticSearchClientWrapper.createIndex({ index: this.indexName, @@ -171,14 +169,6 @@ export class ElasticSearchSearchEngineIndexer extends BatchSearchEngineIndexer { { remove: { index: this.constructIndexName('*'), alias: this.alias }, }, - this.removableIndices.length - ? { - add: { - indices: this.removableIndices, - alias: this.removableAlias, - }, - } - : undefined, { add: { index: this.indexName, alias: this.alias }, }, From 7019b5328e589b04582968b78ccb45dc536bca3f Mon Sep 17 00:00:00 2001 From: Thomas Cardonne Date: Wed, 8 May 2024 01:05:36 +0200 Subject: [PATCH 021/387] fix: regen api-reports Signed-off-by: Thomas Cardonne --- .../api-report.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/search-backend-module-elasticsearch/api-report.md b/plugins/search-backend-module-elasticsearch/api-report.md index 053c267f29..2c23c82f76 100644 --- a/plugins/search-backend-module-elasticsearch/api-report.md +++ b/plugins/search-backend-module-elasticsearch/api-report.md @@ -154,18 +154,18 @@ export class ElasticSearchClientWrapper { options: ElasticSearchClientOptions, ): ElasticSearchClientWrapper; // (undocumented) - getAliases(options: { - aliases: string[]; - }): - | TransportRequestPromise, unknown>> - | TransportRequestPromise_2, unknown>>; - // (undocumented) indexExists(options: { index: string | string[]; }): | TransportRequestPromise> | TransportRequestPromise_2>; // (undocumented) + listIndices(options: { + index: string; + }): + | TransportRequestPromise, unknown>> + | TransportRequestPromise_2, unknown>>; + // (undocumented) putIndexTemplate( template: ElasticSearchCustomIndexTemplate, ): From 59a4bea757b3b4170f495b549d9b3b728b589602 Mon Sep 17 00:00:00 2001 From: Thomas Cardonne Date: Wed, 8 May 2024 12:30:16 +0200 Subject: [PATCH 022/387] fix: deprecate getAliases instead of removing it Signed-off-by: Thomas Cardonne --- .../api-report.md | 6 +++ .../ElasticSearchClientWrapper.test.ts | 38 +++++++++++++++++++ .../src/engines/ElasticSearchClientWrapper.ts | 23 +++++++++++ 3 files changed, 67 insertions(+) diff --git a/plugins/search-backend-module-elasticsearch/api-report.md b/plugins/search-backend-module-elasticsearch/api-report.md index 2c23c82f76..4c55dad91e 100644 --- a/plugins/search-backend-module-elasticsearch/api-report.md +++ b/plugins/search-backend-module-elasticsearch/api-report.md @@ -153,6 +153,12 @@ export class ElasticSearchClientWrapper { static fromClientOptions( options: ElasticSearchClientOptions, ): ElasticSearchClientWrapper; + // @deprecated (undocumented) + getAliases(options: { + aliases: string[]; + }): + | TransportRequestPromise, unknown>> + | TransportRequestPromise_2, unknown>>; // (undocumented) indexExists(options: { index: string | string[]; diff --git a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchClientWrapper.test.ts b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchClientWrapper.test.ts index e888aa4506..dd5a37e5f0 100644 --- a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchClientWrapper.test.ts +++ b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchClientWrapper.test.ts @@ -28,6 +28,11 @@ jest.mock('@elastic/elasticsearch', () => ({ search: jest .fn() .mockImplementation(async args => ({ client: 'es', args })), + cat: { + aliases: jest + .fn() + .mockImplementation(async args => ({ client: 'es', args })), + }, helpers: { bulk: jest .fn() @@ -60,6 +65,11 @@ jest.mock('@opensearch-project/opensearch', () => ({ search: jest .fn() .mockImplementation(async args => ({ client: 'os', args })), + cat: { + aliases: jest + .fn() + .mockImplementation(async args => ({ client: 'os', args })), + }, helpers: { bulk: jest .fn() @@ -189,6 +199,20 @@ describe('ElasticSearchClientWrapper', () => { expect(result.args).toStrictEqual(input); }); + it('getAliases', async () => { + const wrapper = ElasticSearchClientWrapper.fromClientOptions(esOptions); + + const input = { aliases: ['xyz'] }; + const result = (await wrapper.getAliases(input)) as any; + + // Should call the OpenSearch client with expected input. + expect(result.client).toBe('es'); + expect(result.args).toStrictEqual({ + format: 'json', + name: input.aliases, + }); + }); + it('updateAliases', async () => { const wrapper = ElasticSearchClientWrapper.fromClientOptions(esOptions); @@ -313,6 +337,20 @@ describe('ElasticSearchClientWrapper', () => { expect(result.args).toStrictEqual(input); }); + it('getAliases', async () => { + const wrapper = ElasticSearchClientWrapper.fromClientOptions(osOptions); + + const input = { aliases: ['xyz'] }; + const result = (await wrapper.getAliases(input)) as any; + + // Should call the OpenSearch client with expected input. + expect(result.client).toBe('os'); + expect(result.args).toStrictEqual({ + format: 'json', + name: input.aliases, + }); + }); + it('updateAliases', async () => { const wrapper = ElasticSearchClientWrapper.fromClientOptions(osOptions); diff --git a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchClientWrapper.ts b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchClientWrapper.ts index 454e1a6d50..4bf8a3d998 100644 --- a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchClientWrapper.ts +++ b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchClientWrapper.ts @@ -177,6 +177,29 @@ export class ElasticSearchClientWrapper { throw new Error('No client defined'); } + /** + * @deprecated unused by the ElasticSearch Engine, will be removed in the future + */ + getAliases(options: { aliases: string[] }) { + const { aliases } = options; + + if (this.openSearchClient) { + return this.openSearchClient.cat.aliases({ + format: 'json', + name: aliases, + }); + } + + if (this.elasticSearchClient) { + return this.elasticSearchClient.cat.aliases({ + format: 'json', + name: aliases, + }); + } + + throw new Error('No client defined'); + } + createIndex(options: { index: string }) { if (this.openSearchClient) { return this.openSearchClient.indices.create(options); From 3a5c6e6d8b44a8b6ac0976a13c57228ea56656b9 Mon Sep 17 00:00:00 2001 From: Thomas Cardonne Date: Fri, 17 May 2024 10:48:42 +0200 Subject: [PATCH 023/387] chore(changeset): add deprecation notice and upgrade task Signed-off-by: Thomas Cardonne --- .changeset/wild-eyes-grab.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.changeset/wild-eyes-grab.md b/.changeset/wild-eyes-grab.md index d97c92d99e..f382c406f3 100644 --- a/.changeset/wild-eyes-grab.md +++ b/.changeset/wild-eyes-grab.md @@ -2,9 +2,13 @@ '@backstage/plugin-search-backend-module-elasticsearch': minor --- -**BREAKING** The ElasticSearch indexer will now delete stale indices matching the indexer's pattern. +**BREAKING**: The ElasticSearch indexer will now delete stale indices matching the indexer's pattern. +The method `getAliases` of `ElasticSearchClientWrapper` has been deprecated and might be removed in future releases. An indexer using the `some-type-index__*` pattern will remove indices matching this pattern after indexation to prevent stale indices leading to shards exhaustion. +Before upgrading ensure that the index pattern doesn't match indices that are not managed by Backstage +and thus shouldn't be deleted. + Note: The ElasticSearch indexer already uses wildcards patterns to remove aliases on these indices. From 5eba6fcd79a286b561cb9b7e09c184bd36b903bd Mon Sep 17 00:00:00 2001 From: Thomas Cardonne Date: Thu, 23 May 2024 14:10:04 +0200 Subject: [PATCH 024/387] feat: handle deletion of many indices in chunks Signed-off-by: Thomas Cardonne --- .../ElasticSearchSearchEngineIndexer.test.ts | 55 ++++++++++++++++++- .../ElasticSearchSearchEngineIndexer.ts | 33 +++++++++-- 2 files changed, 79 insertions(+), 9 deletions(-) diff --git a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngineIndexer.test.ts b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngineIndexer.test.ts index 75b86cc868..1590d5fb2a 100644 --- a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngineIndexer.test.ts +++ b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngineIndexer.test.ts @@ -114,7 +114,7 @@ describe('ElasticSearchSearchEngineIndexer', () => { mock.add( { method: 'DELETE', - path: '/some-type-index__123tobedeleted%2Csome-type-index__456tobedeleted', + path: '/*', }, deleteSpy, ); @@ -161,7 +161,11 @@ describe('ElasticSearchSearchEngineIndexer', () => { }); // Old index should be cleaned up. - expect(deleteSpy).toHaveBeenCalled(); + expect(deleteSpy).toHaveBeenCalledWith( + expect.objectContaining({ + path: '/some-type-index__123tobedeleted%2Csome-type-index__456tobedeleted', + }), + ); }); it('handles when no documents are received', async () => { @@ -185,7 +189,11 @@ describe('ElasticSearchSearchEngineIndexer', () => { expect(aliasesSpy).not.toHaveBeenCalled(); // Old index should not be cleaned up. - expect(deleteSpy).not.toHaveBeenCalled(); + expect(deleteSpy).toHaveBeenCalledWith( + expect.objectContaining({ + path: expect.not.stringContaining('tobedeleted'), + }), + ); }); it('handles bulk and batching during indexing', async () => { @@ -240,6 +248,47 @@ describe('ElasticSearchSearchEngineIndexer', () => { expect(deleteSpy).not.toHaveBeenCalled(); }); + it('split index deletion in chunks', async () => { + // Generate 200 existing indices + const currentIndices = Array.from( + new Array(200), + (_, i) => `some-type-index__old${i}`, + ); + + const indicesResponse = currentIndices.reduce((acc, curr) => { + return { + ...acc, + [curr]: { mappings: {}, aliases: {} }, + }; + }, {}); + + getSpy = jest.fn().mockReturnValue(indicesResponse); + mock.clear({ + method: 'GET', + path: '/some-type-index__*', + }); + mock.add( + { + method: 'GET', + path: '/some-type-index__*', + }, + getSpy, + ); + + await TestPipeline.fromIndexer(indexer) + .withDocuments([ + { + title: 'testTerm', + text: 'testText', + location: 'test/location', + }, + ]) + .execute(); + + // Delete endpoint should have been called for 4 chunks of 50 (200 indices) + expect(deleteSpy).toHaveBeenCalledTimes(4); + }); + it('handles bulk client rejection', async () => { // Given an ES client wrapper that rejects an error const expectedError = new Error('HTTP Timeout'); diff --git a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngineIndexer.ts b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngineIndexer.ts index 58773600a7..616c1ca349 100644 --- a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngineIndexer.ts +++ b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngineIndexer.ts @@ -181,12 +181,33 @@ export class ElasticSearchSearchEngineIndexer extends BatchSearchEngineIndexer { this.logger.info('Removing stale search indices', { removableIndices: this.removableIndices, }); - try { - await this.elasticSearchClientWrapper.deleteIndex({ - index: this.removableIndices, - }); - } catch (e) { - this.logger.warn(`Failed to remove stale search indices: ${e}`); + + // Split the array into chunks of up to 50 indices to handle the case + // where we need to delete a lot of stalled indices + const chunks = this.removableIndices.reduce( + (resultArray, item, index) => { + const chunkIndex = Math.floor(index / 50); + + if (!resultArray[chunkIndex]) { + resultArray[chunkIndex] = []; // start a new chunk + } + + resultArray[chunkIndex].push(item); + + return resultArray; + }, + [] as string[][], + ); + + // Call deleteIndex for each chunk + for (const chunk of chunks) { + try { + await this.elasticSearchClientWrapper.deleteIndex({ + index: chunk, + }); + } catch (e) { + this.logger.warn(`Failed to remove stale search indices: ${e}`); + } } } } From 1ea76795a02a7e26bbb77cde8af13f31cb491c13 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Thu, 23 May 2024 15:21:24 +0200 Subject: [PATCH 025/387] fix(scaffolder): remove waiting until all fields are filled in before requesting user credentials Signed-off-by: Benjamin Janssens --- .changeset/hungry-cups-jog.md | 5 +++++ .../src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 .changeset/hungry-cups-jog.md diff --git a/.changeset/hungry-cups-jog.md b/.changeset/hungry-cups-jog.md new file mode 100644 index 0000000000..af600c4f91 --- /dev/null +++ b/.changeset/hungry-cups-jog.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder': patch +--- + +Removed waiting until all fields are filled in before requesting user credentials diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx index 5a40480889..b8fe7b9420 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx @@ -125,10 +125,7 @@ export const RepoUrlPicker = (props: RepoUrlPickerProps) => { const { requestUserCredentials } = uiSchema?.['ui:options'] ?? {}; const workspace = state.owner ? state.owner : state.project; - if ( - !requestUserCredentials || - !(state.host && workspace && state.repoName) - ) { + if (!requestUserCredentials) { return; } From 505584596b5bac537f2a8d3349ab42f2a32f8a5f Mon Sep 17 00:00:00 2001 From: Nelson Paulraj Date: Tue, 28 May 2024 18:02:15 +0530 Subject: [PATCH 026/387] Updated documentation URL Signed-off-by: Nelson Paulraj --- microsite/data/plugins/digital.ai-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microsite/data/plugins/digital.ai-release.yaml b/microsite/data/plugins/digital.ai-release.yaml index e74c84999b..86ec13f5fe 100644 --- a/microsite/data/plugins/digital.ai-release.yaml +++ b/microsite/data/plugins/digital.ai-release.yaml @@ -4,7 +4,7 @@ author: digital.ai authorUrl: https://digital.ai/ category: CI/CD description: The plugin offers integration with Digital.ai Release and backstage. It provide access to active releases, templates and manage workflow executions. -documentation: https://docs.digital.ai/bundle/devops-deploy-version-v.24.1/page/deploy/concept/xl-deploy-backstage-overview.html +documentation: https://docs.digital.ai/bundle/devops-release-version-v.24.1/page/release/concept/release-backstage-overview.html iconUrl: /img/digital.ai-release.svg npmPackageName: '@digital.ai/plugin-dai-release' tags: From 8ad4cb190d3a4d40591869ba7c53e9173d33c662 Mon Sep 17 00:00:00 2001 From: Nelson Paulraj Date: Tue, 28 May 2024 18:06:36 +0530 Subject: [PATCH 027/387] Updated date Signed-off-by: Nelson Paulraj --- microsite/data/plugins/digital.ai-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microsite/data/plugins/digital.ai-release.yaml b/microsite/data/plugins/digital.ai-release.yaml index 86ec13f5fe..36fd29cd13 100644 --- a/microsite/data/plugins/digital.ai-release.yaml +++ b/microsite/data/plugins/digital.ai-release.yaml @@ -15,4 +15,4 @@ tags: - devops - pipeline - automation -addedDate: '2024-05-22' +addedDate: '2024-05-28' From 0e797b37f4a5fa74d00bd0065aad73dfe140e55c Mon Sep 17 00:00:00 2001 From: Brian Phillips <28457+brianphillips@users.noreply.github.com> Date: Wed, 29 May 2024 10:04:09 -0500 Subject: [PATCH 028/387] Add ability to specify a different relationship name for MembersListCard The default relationship remains `memberOf` but could be overridden to specify (for instance) `leaderOf` if you wanted to have multiple MembersListCard components on a `Group` page (one for "Members" and another for "Leaders") Signed-off-by: Brian Phillips <28457+brianphillips@users.noreply.github.com> --- .../MembersList/MembersListCard.test.tsx | 30 +++++++++++++++++++ .../Group/MembersList/MembersListCard.tsx | 4 ++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.test.tsx b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.test.tsx index 793ffe274b..539b0bd892 100644 --- a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.test.tsx +++ b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.test.tsx @@ -99,6 +99,7 @@ describe('MemberTab Test', () => { ] as Entity[], }), }; + const getEntitiesSpy = jest.spyOn(catalogApi, 'getEntities'); it('Display Profile Card', async () => { await renderInTestApp( @@ -115,6 +116,12 @@ describe('MemberTab Test', () => { }, }, ); + expect(getEntitiesSpy).toHaveBeenCalledWith({ + filter: { + kind: 'User', + 'relations.memberOf': ['group:default/team-d'], + }, + }); expect(screen.getByAltText('Tara MacGovern')).toHaveAttribute( 'src', @@ -149,6 +156,29 @@ describe('MemberTab Test', () => { expect(screen.getByText('Testers (1)')).toBeInTheDocument(); }); + it('Can query a different relationship', async () => { + await renderInTestApp( + + + + + , + { + mountedRoutes: { + '/catalog/:namespace/:kind/:name': entityRouteRef, + '/catalog': rootRouteRef, + }, + }, + ); + + expect(getEntitiesSpy).toHaveBeenCalledWith({ + filter: { + kind: 'User', + 'relations.leaderOf': ['group:default/team-d'], + }, + }); + }); + describe('Aggregate members toggle', () => { it('Does not show the aggregate members toggle if the showAggregateMembersToggle prop is undefined', async () => { await renderInTestApp( diff --git a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx index 418a83f5b2..b21ae20c23 100644 --- a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx +++ b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx @@ -138,12 +138,14 @@ export const MembersListCard = (props: { memberDisplayTitle?: string; pageSize?: number; showAggregateMembersToggle?: boolean; + relationship?: string; relationsType?: EntityRelationAggregation; }) => { const { memberDisplayTitle = 'Members', pageSize = 50, showAggregateMembersToggle, + relationship = 'memberOf', relationsType = 'direct', } = props; const classes = useListStyles(); @@ -187,7 +189,7 @@ export const MembersListCard = (props: { const membersList = await catalogApi.getEntities({ filter: { kind: 'User', - 'relations.memberof': [ + [`relations.${relationship}`]: [ stringifyEntityRef({ kind: 'group', namespace: groupNamespace.toLocaleLowerCase('en-US'), From c307ef471a3d9868395213d4b69eb3c444b4039e Mon Sep 17 00:00:00 2001 From: Brian Phillips <28457+brianphillips@users.noreply.github.com> Date: Wed, 29 May 2024 10:29:23 -0500 Subject: [PATCH 029/387] add changeset Signed-off-by: Brian Phillips <28457+brianphillips@users.noreply.github.com> --- .changeset/little-games-fail.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/little-games-fail.md diff --git a/.changeset/little-games-fail.md b/.changeset/little-games-fail.md new file mode 100644 index 0000000000..dc5d2f7795 --- /dev/null +++ b/.changeset/little-games-fail.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-org': patch +--- + +Added relationship option to EntityMembersListCard component From 2644eeccb955fcf0b6e26f9df1c6b6f3e6d88afc Mon Sep 17 00:00:00 2001 From: Brian Phillips <28457+brianphillips@users.noreply.github.com> Date: Wed, 29 May 2024 13:40:23 -0500 Subject: [PATCH 030/387] Add API report Signed-off-by: Brian Phillips <28457+brianphillips@users.noreply.github.com> --- plugins/org/api-report.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/org/api-report.md b/plugins/org/api-report.md index 1960ce839b..fe641e5a8b 100644 --- a/plugins/org/api-report.md +++ b/plugins/org/api-report.md @@ -23,6 +23,7 @@ export const EntityMembersListCard: (props: { memberDisplayTitle?: string | undefined; pageSize?: number | undefined; showAggregateMembersToggle?: boolean | undefined; + relationship?: string | undefined; relationsType?: EntityRelationAggregation | undefined; }) => JSX_2.Element; @@ -55,6 +56,7 @@ export const MembersListCard: (props: { memberDisplayTitle?: string; pageSize?: number; showAggregateMembersToggle?: boolean; + relationship?: string; relationsType?: EntityRelationAggregation; }) => React_2.JSX.Element; From 05ad87ed3aff16d87aa65a62972b0bc529457770 Mon Sep 17 00:00:00 2001 From: Brian Phillips <28457+brianphillips@users.noreply.github.com> Date: Wed, 29 May 2024 14:37:35 -0500 Subject: [PATCH 031/387] fix case mismatch in relationship name Signed-off-by: Brian Phillips <28457+brianphillips@users.noreply.github.com> --- .../Group/MembersList/MembersListCard.test.tsx | 4 ++-- .../Group/MembersList/MembersListCard.tsx | 5 +++-- plugins/org/src/helpers/helpers.ts | 18 +++++++++++------- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.test.tsx b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.test.tsx index 539b0bd892..3a129348c7 100644 --- a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.test.tsx +++ b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.test.tsx @@ -119,7 +119,7 @@ describe('MemberTab Test', () => { expect(getEntitiesSpy).toHaveBeenCalledWith({ filter: { kind: 'User', - 'relations.memberOf': ['group:default/team-d'], + 'relations.memberof': ['group:default/team-d'], }, }); @@ -174,7 +174,7 @@ describe('MemberTab Test', () => { expect(getEntitiesSpy).toHaveBeenCalledWith({ filter: { kind: 'User', - 'relations.leaderOf': ['group:default/team-d'], + 'relations.leaderof': ['group:default/team-d'], }, }); }); diff --git a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx index b21ae20c23..d1e74200fd 100644 --- a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx +++ b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx @@ -145,7 +145,7 @@ export const MembersListCard = (props: { memberDisplayTitle = 'Members', pageSize = 50, showAggregateMembersToggle, - relationship = 'memberOf', + relationship = 'memberof', relationsType = 'direct', } = props; const classes = useListStyles(); @@ -179,6 +179,7 @@ export const MembersListCard = (props: { return await getAllDesendantMembersForGroupEntity( groupEntity, catalogApi, + relationship, ); }, [catalogApi, groupEntity, showAggregateMembers]); const { @@ -189,7 +190,7 @@ export const MembersListCard = (props: { const membersList = await catalogApi.getEntities({ filter: { kind: 'User', - [`relations.${relationship}`]: [ + [`relations.${relationship.toLocaleLowerCase('en-US')}`]: [ stringifyEntityRef({ kind: 'group', namespace: groupNamespace.toLocaleLowerCase('en-US'), diff --git a/plugins/org/src/helpers/helpers.ts b/plugins/org/src/helpers/helpers.ts index 7da4ee32d8..465f89afa1 100644 --- a/plugins/org/src/helpers/helpers.ts +++ b/plugins/org/src/helpers/helpers.ts @@ -31,6 +31,7 @@ import { export const getMembersFromGroups = async ( groups: CompoundEntityRef[], catalogApi: CatalogApi, + relationship = 'memberof', ) => { const membersList = groups.length === 0 @@ -38,13 +39,14 @@ export const getMembersFromGroups = async ( : await catalogApi.getEntities({ filter: { kind: 'User', - 'relations.memberof': groups.map(group => - stringifyEntityRef({ - kind: 'group', - namespace: group.namespace.toLocaleLowerCase('en-US'), - name: group.name.toLocaleLowerCase('en-US'), - }), - ), + [`relations.${relationship.toLocaleLowerCase('en-US')}`]: + groups.map(group => + stringifyEntityRef({ + kind: 'group', + namespace: group.namespace.toLocaleLowerCase('en-US'), + name: group.name.toLocaleLowerCase('en-US'), + }), + ), }, }); @@ -99,10 +101,12 @@ export const getDescendantGroupsFromGroup = async ( export const getAllDesendantMembersForGroupEntity = async ( groupEntity: GroupEntity, catalogApi: CatalogApi, + relationship = 'memberof', ) => getMembersFromGroups( await getDescendantGroupsFromGroup(groupEntity, catalogApi), catalogApi, + relationship, ); export const removeDuplicateEntitiesFrom = (entityArray: Entity[]) => { From 46c61f683bacba24ed7058c5041f3398c0a43ffb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 30 May 2024 12:58:30 +0000 Subject: [PATCH 032/387] chore(deps): update actions/checkout digest to a5ac7e5 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/api-breaking-changes-comment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/api-breaking-changes-comment.yml b/.github/workflows/api-breaking-changes-comment.yml index 9ae32e1d4a..317690f875 100644 --- a/.github/workflows/api-breaking-changes-comment.yml +++ b/.github/workflows/api-breaking-changes-comment.yml @@ -90,7 +90,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 # Identify comment to be updated - name: Find comment for API Changes From 41279aa8998296b820ba237cd17204eaa68be134 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 30 May 2024 12:58:46 +0000 Subject: [PATCH 033/387] chore(deps): update backstage/actions action to v0.6.11 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/api-breaking-changes.yml | 2 +- .github/workflows/automate_changeset_feedback.yml | 2 +- .github/workflows/ci.yml | 6 +++--- .github/workflows/cron.yml | 2 +- .github/workflows/deploy_docker-image.yml | 2 +- .github/workflows/deploy_nightly.yml | 2 +- .github/workflows/deploy_packages.yml | 4 ++-- .github/workflows/pr-review-comment.yaml | 2 +- .github/workflows/pr.yaml | 2 +- .github/workflows/sync_code-formatting.yml | 2 +- .github/workflows/sync_snyk-github-issues.yml | 2 +- .github/workflows/verify_accessibility.yml | 2 +- .github/workflows/verify_e2e-kubernetes.yml | 2 +- .github/workflows/verify_e2e-linux.yml | 2 +- .github/workflows/verify_e2e-windows.yml | 2 +- .github/workflows/verify_storybook.yml | 2 +- 16 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/api-breaking-changes.yml b/.github/workflows/api-breaking-changes.yml index d44e524ccb..d62e606c0e 100644 --- a/.github/workflows/api-breaking-changes.yml +++ b/.github/workflows/api-breaking-changes.yml @@ -33,7 +33,7 @@ jobs: registry-url: https://registry.npmjs.org/ - name: yarn install - uses: backstage/actions/yarn-install@a674369920067381b450d398b27df7039b7ef635 # v0.6.5 + uses: backstage/actions/yarn-install@772cef06641090d0095188e15c85647acdf0c250 # v0.6.11 with: cache-prefix: linux-v18 diff --git a/.github/workflows/automate_changeset_feedback.yml b/.github/workflows/automate_changeset_feedback.yml index 95b0a808a1..08898e5bb5 100644 --- a/.github/workflows/automate_changeset_feedback.yml +++ b/.github/workflows/automate_changeset_feedback.yml @@ -34,7 +34,7 @@ jobs: ref: 'refs/pull/${{ github.event.pull_request.number }}/merge' - name: fetch base run: git fetch --depth 1 origin ${{ github.base_ref }} - - uses: backstage/actions/changeset-feedback@af61233abb88019335b07ab855873d991f43d25a # v0.6.7 + - uses: backstage/actions/changeset-feedback@772cef06641090d0095188e15c85647acdf0c250 # v0.6.11 name: Generate feedback with: diff-ref: 'origin/master' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00181adb5e..a5bc6c2894 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: registry-url: https://registry.npmjs.org/ # Needed for auth - name: yarn install - uses: backstage/actions/yarn-install@af61233abb88019335b07ab855873d991f43d25a # v0.6.7 + uses: backstage/actions/yarn-install@772cef06641090d0095188e15c85647acdf0c250 # v0.6.11 with: cache-prefix: ${{ runner.os }}-v${{ matrix.node-version }} @@ -77,7 +77,7 @@ jobs: registry-url: https://registry.npmjs.org/ # Needed for auth - name: yarn install - uses: backstage/actions/yarn-install@af61233abb88019335b07ab855873d991f43d25a # v0.6.7 + uses: backstage/actions/yarn-install@772cef06641090d0095188e15c85647acdf0c250 # v0.6.11 with: cache-prefix: ${{ runner.os }}-v${{ matrix.node-version }} @@ -222,7 +222,7 @@ jobs: registry-url: https://registry.npmjs.org/ # Needed for auth - name: yarn install - uses: backstage/actions/yarn-install@af61233abb88019335b07ab855873d991f43d25a # v0.6.7 + uses: backstage/actions/yarn-install@772cef06641090d0095188e15c85647acdf0c250 # v0.6.11 with: cache-prefix: ${{ runner.os }}-v${{ matrix.node-version }} diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 7dcb4a9c0f..ede29d2730 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -13,7 +13,7 @@ jobs: with: egress-policy: audit - - uses: backstage/actions/cron@af61233abb88019335b07ab855873d991f43d25a # v0.6.7 + - uses: backstage/actions/cron@772cef06641090d0095188e15c85647acdf0c250 # v0.6.11 with: app-id: ${{ secrets.BACKSTAGE_GOALIE_APPLICATION_ID }} private-key: ${{ secrets.BACKSTAGE_GOALIE_PRIVATE_KEY }} diff --git a/.github/workflows/deploy_docker-image.yml b/.github/workflows/deploy_docker-image.yml index ddf01fa49c..48e74fdf47 100644 --- a/.github/workflows/deploy_docker-image.yml +++ b/.github/workflows/deploy_docker-image.yml @@ -37,7 +37,7 @@ jobs: registry-url: https://registry.npmjs.org/ # Needed for auth - name: yarn install - uses: backstage/actions/yarn-install@af61233abb88019335b07ab855873d991f43d25a # v0.6.7 + uses: backstage/actions/yarn-install@772cef06641090d0095188e15c85647acdf0c250 # v0.6.11 with: cache-prefix: ${{ runner.os }}-v${{ matrix.node-version }} diff --git a/.github/workflows/deploy_nightly.yml b/.github/workflows/deploy_nightly.yml index 02a1c65681..4014da8360 100644 --- a/.github/workflows/deploy_nightly.yml +++ b/.github/workflows/deploy_nightly.yml @@ -27,7 +27,7 @@ jobs: node-version: 18.x registry-url: https://registry.npmjs.org/ # Needed for auth - name: yarn install - uses: backstage/actions/yarn-install@af61233abb88019335b07ab855873d991f43d25a # v0.6.7 + uses: backstage/actions/yarn-install@772cef06641090d0095188e15c85647acdf0c250 # v0.6.11 with: cache-prefix: ${{ runner.os }}-v18.x diff --git a/.github/workflows/deploy_packages.yml b/.github/workflows/deploy_packages.yml index 04badd65b0..76184fcb39 100644 --- a/.github/workflows/deploy_packages.yml +++ b/.github/workflows/deploy_packages.yml @@ -82,7 +82,7 @@ jobs: node-version: ${{ matrix.node-version }} registry-url: https://registry.npmjs.org/ # Needed for auth - name: yarn install - uses: backstage/actions/yarn-install@af61233abb88019335b07ab855873d991f43d25a # v0.6.7 + uses: backstage/actions/yarn-install@772cef06641090d0095188e15c85647acdf0c250 # v0.6.11 with: cache-prefix: ${{ runner.os }}-v${{ matrix.node-version }} @@ -166,7 +166,7 @@ jobs: node-version: ${{ matrix.node-version }} registry-url: https://registry.npmjs.org/ # Needed for auth - name: yarn install - uses: backstage/actions/yarn-install@af61233abb88019335b07ab855873d991f43d25a # v0.6.7 + uses: backstage/actions/yarn-install@772cef06641090d0095188e15c85647acdf0c250 # v0.6.11 with: cache-prefix: ${{ runner.os }}-v${{ matrix.node-version }} diff --git a/.github/workflows/pr-review-comment.yaml b/.github/workflows/pr-review-comment.yaml index 232089e2f3..d722894df7 100644 --- a/.github/workflows/pr-review-comment.yaml +++ b/.github/workflows/pr-review-comment.yaml @@ -40,7 +40,7 @@ jobs: const prNumber = artifact.name.slice('pr_number-'.length) core.setOutput('pr-number', prNumber); - - uses: backstage/actions/re-review@af61233abb88019335b07ab855873d991f43d25a # v0.6.7 + - uses: backstage/actions/re-review@772cef06641090d0095188e15c85647acdf0c250 # v0.6.11 with: app-id: ${{ secrets.BACKSTAGE_GOALIE_APPLICATION_ID }} private-key: ${{ secrets.BACKSTAGE_GOALIE_PRIVATE_KEY }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 779137b52a..8193bfaf79 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -23,7 +23,7 @@ jobs: egress-policy: audit - name: PR sync - uses: backstage/actions/pr-sync@af61233abb88019335b07ab855873d991f43d25a # v0.6.7 + uses: backstage/actions/pr-sync@772cef06641090d0095188e15c85647acdf0c250 # v0.6.11 with: github-token: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }} app-id: ${{ secrets.BACKSTAGE_GOALIE_APPLICATION_ID }} diff --git a/.github/workflows/sync_code-formatting.yml b/.github/workflows/sync_code-formatting.yml index bb2e00ffa6..a854323207 100644 --- a/.github/workflows/sync_code-formatting.yml +++ b/.github/workflows/sync_code-formatting.yml @@ -25,7 +25,7 @@ jobs: node-version: ${{ matrix.node-version }} registry-url: https://registry.npmjs.org/ # Needed for auth - name: yarn install - uses: backstage/actions/yarn-install@af61233abb88019335b07ab855873d991f43d25a # v0.6.7 + uses: backstage/actions/yarn-install@772cef06641090d0095188e15c85647acdf0c250 # v0.6.11 with: cache-prefix: ${{ runner.os }}-v${{ matrix.node-version }} diff --git a/.github/workflows/sync_snyk-github-issues.yml b/.github/workflows/sync_snyk-github-issues.yml index cb5eaa1737..1ef69a240d 100644 --- a/.github/workflows/sync_snyk-github-issues.yml +++ b/.github/workflows/sync_snyk-github-issues.yml @@ -24,7 +24,7 @@ jobs: node-version: 18.x registry-url: https://registry.npmjs.org/ # Needed for auth - name: yarn install - uses: backstage/actions/yarn-install@af61233abb88019335b07ab855873d991f43d25a # v0.6.7 + uses: backstage/actions/yarn-install@772cef06641090d0095188e15c85647acdf0c250 # v0.6.11 with: cache-prefix: ${{ runner.os }}-v18.x diff --git a/.github/workflows/verify_accessibility.yml b/.github/workflows/verify_accessibility.yml index 996153f8d3..8a4ca15ed8 100644 --- a/.github/workflows/verify_accessibility.yml +++ b/.github/workflows/verify_accessibility.yml @@ -30,7 +30,7 @@ jobs: with: node-version: 18.x - name: yarn install - uses: backstage/actions/yarn-install@af61233abb88019335b07ab855873d991f43d25a # v0.6.7 + uses: backstage/actions/yarn-install@772cef06641090d0095188e15c85647acdf0c250 # v0.6.11 with: cache-prefix: ${{ runner.os }}-v18.x - name: run Lighthouse CI diff --git a/.github/workflows/verify_e2e-kubernetes.yml b/.github/workflows/verify_e2e-kubernetes.yml index 77d2c3bdc1..46eef15534 100644 --- a/.github/workflows/verify_e2e-kubernetes.yml +++ b/.github/workflows/verify_e2e-kubernetes.yml @@ -35,7 +35,7 @@ jobs: registry-url: https://registry.npmjs.org/ # Needed for auth - name: yarn install - uses: backstage/actions/yarn-install@af61233abb88019335b07ab855873d991f43d25a # v0.6.7 + uses: backstage/actions/yarn-install@772cef06641090d0095188e15c85647acdf0c250 # v0.6.11 with: cache-prefix: ${{ runner.os }}-v${{ matrix.node-version }} diff --git a/.github/workflows/verify_e2e-linux.yml b/.github/workflows/verify_e2e-linux.yml index f8583ac178..1c6bb1b7b6 100644 --- a/.github/workflows/verify_e2e-linux.yml +++ b/.github/workflows/verify_e2e-linux.yml @@ -58,7 +58,7 @@ jobs: node-version: ${{ matrix.node-version }} registry-url: https://registry.npmjs.org/ # Needed for auth - name: yarn install - uses: backstage/actions/yarn-install@af61233abb88019335b07ab855873d991f43d25a # v0.6.7 + uses: backstage/actions/yarn-install@772cef06641090d0095188e15c85647acdf0c250 # v0.6.11 with: cache-prefix: ${{ runner.os }}-v${{ matrix.node-version }} diff --git a/.github/workflows/verify_e2e-windows.yml b/.github/workflows/verify_e2e-windows.yml index e2a789d666..08d9fc70cb 100644 --- a/.github/workflows/verify_e2e-windows.yml +++ b/.github/workflows/verify_e2e-windows.yml @@ -78,7 +78,7 @@ jobs: uses: browser-actions/setup-chrome@803ef6dfb4fdf22089c9563225d95e4a515820a0 # latest - name: yarn install - uses: backstage/actions/yarn-install@af61233abb88019335b07ab855873d991f43d25a # v0.6.7 + uses: backstage/actions/yarn-install@772cef06641090d0095188e15c85647acdf0c250 # v0.6.11 with: cache-prefix: ${{ runner.os }}-v${{ matrix.node-version }} diff --git a/.github/workflows/verify_storybook.yml b/.github/workflows/verify_storybook.yml index 1859c0b8bc..0363d6e071 100644 --- a/.github/workflows/verify_storybook.yml +++ b/.github/workflows/verify_storybook.yml @@ -42,7 +42,7 @@ jobs: node-version: ${{ matrix.node-version }} registry-url: https://registry.npmjs.org/ # Needed for auth - name: yarn install - uses: backstage/actions/yarn-install@af61233abb88019335b07ab855873d991f43d25a # v0.6.7 + uses: backstage/actions/yarn-install@772cef06641090d0095188e15c85647acdf0c250 # v0.6.11 with: cache-prefix: ${{ runner.os }}-v${{ matrix.node-version }} - name: storybook yarn install From 4b87f23d20f3d630cb5f4a6478fec90ef9ddc6b2 Mon Sep 17 00:00:00 2001 From: David Weber Date: Thu, 30 May 2024 21:04:16 +0200 Subject: [PATCH 034/387] docs: ldap module correct usage of legacy provider Signed-off-by: David Weber --- docs/integrations/ldap/org--old.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/docs/integrations/ldap/org--old.md b/docs/integrations/ldap/org--old.md index 13fbcb9408..63f052371f 100644 --- a/docs/integrations/ldap/org--old.md +++ b/docs/integrations/ldap/org--old.md @@ -52,7 +52,7 @@ export default async function createPlugin( // The target parameter below needs to match the ldap.providers.target // value specified in your app-config. builder.addEntityProvider( - LdapOrgEntityProvider.fromConfig(env.config, { + LdapOrgEntityProvider.fromLegacyConfig(env.config, { id: 'our-ldap-master', target: 'ldaps://ds.example.net', logger: env.logger, @@ -343,12 +343,15 @@ the group transformer. 2. Configure the provider with the transformer: ```ts - const ldapEntityProvider = LdapOrgEntityProvider.fromConfig(env.config, { - id: 'our-ldap-master', - target: 'ldaps://ds.example.net', - logger: env.logger, - groupTransformer: myGroupTransformer, - }); + const ldapEntityProvider = LdapOrgEntityProvider.fromLegacyConfig( + env.config, + { + id: 'our-ldap-master', + target: 'ldaps://ds.example.net', + logger: env.logger, + groupTransformer: myGroupTransformer, + }, + ); ``` ## Using a Processor instead of a Provider @@ -368,7 +371,7 @@ register it in the catalog plugin: ```typescript title="packages/backend/src/plugins/catalog.ts" builder.addProcessor( - LdapOrgReaderProcessor.fromConfig(env.config, { + LdapOrgReaderProcessor.fromLegacyConfig(env.config, { logger: env.logger, }), ); From 07ffaf70c0240dee063413f86f9b4f49e0b2c8e0 Mon Sep 17 00:00:00 2001 From: Ismail Mohammed Date: Fri, 31 May 2024 01:37:37 +0300 Subject: [PATCH 035/387] Updated API documentation for software-catelog Signed-off-by: Ismail Mohammed --- docs/features/software-catalog/api.md | 280 +++++++++++++++++++++++++- 1 file changed, 279 insertions(+), 1 deletion(-) diff --git a/docs/features/software-catalog/api.md b/docs/features/software-catalog/api.md index d002b12015..2f768a7ef4 100644 --- a/docs/features/software-catalog/api.md +++ b/docs/features/software-catalog/api.md @@ -425,6 +425,10 @@ value. These are special in that they form the entity's unique The return type is JSON, as a single [`Entity`](descriptor-format.md), or a 404 error if there was no entity with that reference triplet. +### `GET /entities/by-name/{kind}/{namespace}/{name}/ancestry` + +Get an entity's ancestry by entity ref. + ### `POST /entities/by-refs` Gets a batch of entities by their entity refs. This is useful in contexts where @@ -456,6 +460,35 @@ where the `items` array has _the same length_ and _the same order_ as the input `entityRefs` array. Each element contains the corresponding entity data, or `null` if no entity existed in the catalog with that ref. +### `POST /refresh` + +Refresh the entity related to `entityRef`. + +Request body is JSON, on the form + +```json +{ + "entityRef": "", + "authorizationToken": "" +} +``` + +### `POST /validate-entity` + +Validate that a passed in entity has no errors in schema. + +Request body is JSON, on the form + +```json +{ + "location": "", + "entity": { + "proident_f": {}, + "culpa_ca": {} + } +} +``` + ## Locations ### `GET /locations` @@ -504,6 +537,39 @@ Response type is JSON, on the form } ``` +### `GET /entity-facets?facet=&facet=&filter=&filter=` + +Get all entity facets that match the given filters. + +Response type is JSON, on the form + +```json +{ + "facets": { + "exercitation84": [ + { + "value": "", + "count": "" + }, + { + "value": "", + "count": "" + } + ], + "consectetur_1": [ + { + "value": "", + "count": "" + }, + { + "value": "", + "count": "" + } + ] + } +} +``` + ### `POST /locations` Adds a location to be ingested by the catalog. @@ -542,7 +608,219 @@ If the location already exists the response will be `HTTP/1.1 409 Conflict` and Supports the `?dryRun=true` query parameter, which will perform validation and not write anything to the database. In the event of successfully passing validation, the `entities` field of the response JSON will be populated with entities present in the location. -### `DELETE /locations/` +### `POST /analyze-location` + +Validate a given location. + +Request body is JSON, on the form + +```json +{ + "location": { + "type": "", + "target": "" + }, + "catalogFileName": "" +} +``` + +And Response type is JSON, on the form + +```json +{ + "generateEntities": [ + { + "fields": [ + { + "description": "", + "value": "", + "state": "needsUserInput", + "field": "" + }, + { + "description": "", + "value": "", + "state": "analysisSuggestedNoValue", + "field": "" + } + ], + "entity": { + "apiVersion": "", + "kind": "", + "metadata": {}, + "spec": { + "ullamco_b24": {} + }, + "relations": [ + { + "targetRef": "", + "type": "" + }, + { + "targetRef": "", + "type": "" + } + ] + } + }, + { + "fields": [ + { + "description": "", + "value": "", + "state": "needsUserInput", + "field": "" + }, + { + "description": "", + "value": "", + "state": "analysisSuggestedValue", + "field": "" + } + ], + "entity": { + "apiVersion": "", + "kind": "", + "metadata": {}, + "spec": { + "velita": {}, + "aliquip_d": {}, + "officia__e8": {} + }, + "relations": [ + { + "targetRef": "", + "type": "" + }, + { + "targetRef": "", + "type": "" + } + ] + } + } + ], + "existingEntityFiles": [ + { + "entity": { + "metadata": { + "name": "", + "links": [ + { + "url": "", + "type": "", + "icon": "", + "title": "" + }, + { + "url": "", + "type": "", + "icon": "", + "title": "" + } + ], + "tags": ["", ""], + "annotations": { + "nostrud__": "", + "ipsumd": "", + "amet_bc2": "" + }, + "labels": { + "ea1c": "" + }, + "description": "", + "title": "", + "namespace": "", + "etag": "", + "uid": "" + }, + "kind": "", + "apiVersion": "", + "relations": [ + { + "targetRef": "", + "type": "" + }, + { + "targetRef": "", + "type": "" + } + ], + "spec": { + "culpa982": {}, + "dolorb": {}, + "mollitb7e": {} + } + }, + "isRegistered": "", + "location": { + "target": "", + "type": "" + } + }, + { + "entity": { + "metadata": { + "name": "", + "links": [ + { + "url": "", + "type": "", + "icon": "", + "title": "" + }, + { + "url": "", + "type": "", + "icon": "", + "title": "" + } + ], + "tags": ["", ""], + "annotations": { + "sint_69": "", + "ex5b7": "" + }, + "labels": { + "proidentc1": "", + "ullamco_c": "", + "do_8": "" + }, + "description": "", + "title": "", + "namespace": "", + "etag": "", + "uid": "" + }, + "kind": "", + "apiVersion": "", + "relations": [ + { + "targetRef": "", + "type": "" + }, + { + "targetRef": "", + "type": "" + } + ], + "spec": { + "ine": {}, + "Ute1": {}, + "fugiat80": {} + } + }, + "isRegistered": "", + "location": { + "target": "", + "type": "" + } + } + ] +} +``` + +### `DELETE /locations/{id}` Delete a location by its id. On success response code will be `HTTP/1.1 204 No Content`. From 9b6210308878c3f59fd969e8d9d558298010500c Mon Sep 17 00:00:00 2001 From: Ismail Mohammed Date: Sun, 2 Jun 2024 00:26:12 +0300 Subject: [PATCH 036/387] Cleaned code. Removed reduntant sample data Signed-off-by: Ismail Mohammed --- docs/features/software-catalog/api.md | 192 +------------------------- 1 file changed, 4 insertions(+), 188 deletions(-) diff --git a/docs/features/software-catalog/api.md b/docs/features/software-catalog/api.md index 2f768a7ef4..36b9e96220 100644 --- a/docs/features/software-catalog/api.md +++ b/docs/features/software-catalog/api.md @@ -482,10 +482,7 @@ Request body is JSON, on the form ```json { "location": "", - "entity": { - "proident_f": {}, - "culpa_ca": {} - } + "entity": "" } ``` @@ -545,28 +542,7 @@ Response type is JSON, on the form ```json { - "facets": { - "exercitation84": [ - { - "value": "", - "count": "" - }, - { - "value": "", - "count": "" - } - ], - "consectetur_1": [ - { - "value": "", - "count": "" - }, - { - "value": "", - "count": "" - } - ] - } + "facets": "" } ``` @@ -644,172 +620,12 @@ And Response type is JSON, on the form "field": "" } ], - "entity": { - "apiVersion": "", - "kind": "", - "metadata": {}, - "spec": { - "ullamco_b24": {} - }, - "relations": [ - { - "targetRef": "", - "type": "" - }, - { - "targetRef": "", - "type": "" - } - ] - } - }, - { - "fields": [ - { - "description": "", - "value": "", - "state": "needsUserInput", - "field": "" - }, - { - "description": "", - "value": "", - "state": "analysisSuggestedValue", - "field": "" - } - ], - "entity": { - "apiVersion": "", - "kind": "", - "metadata": {}, - "spec": { - "velita": {}, - "aliquip_d": {}, - "officia__e8": {} - }, - "relations": [ - { - "targetRef": "", - "type": "" - }, - { - "targetRef": "", - "type": "" - } - ] - } + "entity": "" } ], "existingEntityFiles": [ { - "entity": { - "metadata": { - "name": "", - "links": [ - { - "url": "", - "type": "", - "icon": "", - "title": "" - }, - { - "url": "", - "type": "", - "icon": "", - "title": "" - } - ], - "tags": ["", ""], - "annotations": { - "nostrud__": "", - "ipsumd": "", - "amet_bc2": "" - }, - "labels": { - "ea1c": "" - }, - "description": "", - "title": "", - "namespace": "", - "etag": "", - "uid": "" - }, - "kind": "", - "apiVersion": "", - "relations": [ - { - "targetRef": "", - "type": "" - }, - { - "targetRef": "", - "type": "" - } - ], - "spec": { - "culpa982": {}, - "dolorb": {}, - "mollitb7e": {} - } - }, - "isRegistered": "", - "location": { - "target": "", - "type": "" - } - }, - { - "entity": { - "metadata": { - "name": "", - "links": [ - { - "url": "", - "type": "", - "icon": "", - "title": "" - }, - { - "url": "", - "type": "", - "icon": "", - "title": "" - } - ], - "tags": ["", ""], - "annotations": { - "sint_69": "", - "ex5b7": "" - }, - "labels": { - "proidentc1": "", - "ullamco_c": "", - "do_8": "" - }, - "description": "", - "title": "", - "namespace": "", - "etag": "", - "uid": "" - }, - "kind": "", - "apiVersion": "", - "relations": [ - { - "targetRef": "", - "type": "" - }, - { - "targetRef": "", - "type": "" - } - ], - "spec": { - "ine": {}, - "Ute1": {}, - "fugiat80": {} - } - }, + "entity": "", "isRegistered": "", "location": { "target": "", From d7b8ca5aca95ab3902c9296dfbbe289383d760ab Mon Sep 17 00:00:00 2001 From: Vladimir Kobzev Date: Mon, 3 Jun 2024 10:58:42 +0200 Subject: [PATCH 037/387] Add topic field to NotificationGetOptions, add router query topic param, add topic filter to DatabaseNotificationsStore.ts, add unit test Signed-off-by: Vladimir Kobzev --- .changeset/sour-jokes-sneeze.md | 5 +++++ .../database/DatabaseNotificationsStore.test.ts | 14 ++++++++++++++ .../src/database/DatabaseNotificationsStore.ts | 4 ++++ .../src/database/NotificationsStore.ts | 1 + .../notifications-backend/src/service/router.ts | 5 +++++ 5 files changed, 29 insertions(+) create mode 100644 .changeset/sour-jokes-sneeze.md diff --git a/.changeset/sour-jokes-sneeze.md b/.changeset/sour-jokes-sneeze.md new file mode 100644 index 0000000000..5cafaea595 --- /dev/null +++ b/.changeset/sour-jokes-sneeze.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-notifications-backend': patch +--- + +Added an option to filter notifications by topic diff --git a/plugins/notifications-backend/src/database/DatabaseNotificationsStore.test.ts b/plugins/notifications-backend/src/database/DatabaseNotificationsStore.test.ts index 6204629821..c6df60c56e 100644 --- a/plugins/notifications-backend/src/database/DatabaseNotificationsStore.test.ts +++ b/plugins/notifications-backend/src/database/DatabaseNotificationsStore.test.ts @@ -271,6 +271,20 @@ describe.each(databases.eachSupportedId())( expect(notifications.length).toBe(1); expect(notifications.at(0)?.id).toEqual(id2); }); + + it('should filter notifications based on topic', async () => { + await storage.saveNotification(testNotification1); + await storage.saveNotification(testNotification2); + await storage.saveNotification(testNotification3); + + const notifications = await storage.getNotifications({ + user, + topic: 'efgh-topic', + }); + + expect(notifications.length).toBe(1); + expect(notifications.at(0)?.id).toEqual(id1); + }); }); describe('getNotifications filters on severity', () => { diff --git a/plugins/notifications-backend/src/database/DatabaseNotificationsStore.ts b/plugins/notifications-backend/src/database/DatabaseNotificationsStore.ts index f4bd25d1ba..3d027128ec 100644 --- a/plugins/notifications-backend/src/database/DatabaseNotificationsStore.ts +++ b/plugins/notifications-backend/src/database/DatabaseNotificationsStore.ts @@ -204,6 +204,10 @@ export class DatabaseNotificationsStore implements NotificationsStore { query.whereNull('read'); } // or match both if undefined + if (options.topic) { + query.where('topic', '=', options.topic); + } + if (options.saved) { query.whereNotNull('saved'); } else if (options.saved === false) { diff --git a/plugins/notifications-backend/src/database/NotificationsStore.ts b/plugins/notifications-backend/src/database/NotificationsStore.ts index 901ea1695d..3c57d0ac4a 100644 --- a/plugins/notifications-backend/src/database/NotificationsStore.ts +++ b/plugins/notifications-backend/src/database/NotificationsStore.ts @@ -35,6 +35,7 @@ export type NotificationGetOptions = { limit?: number; search?: string; orderField?: EntityOrder[]; + topic?: string; read?: boolean; saved?: boolean; createdAfter?: Date; diff --git a/plugins/notifications-backend/src/service/router.ts b/plugins/notifications-backend/src/service/router.ts index bb5c9e06ac..3ca3ce46bc 100644 --- a/plugins/notifications-backend/src/service/router.ts +++ b/plugins/notifications-backend/src/service/router.ts @@ -302,6 +302,11 @@ export async function createRouter( opts.read = false; // or keep undefined } + + if (req.query.topic) { + opts.topic = req.query.topic.toString(); + } + if (req.query.saved === 'true') { opts.saved = true; } else if (req.query.saved === 'false') { From 65b8256bf88263af000020ac5f5c1cc344542c50 Mon Sep 17 00:00:00 2001 From: Andrei Ivanovici Date: Sat, 1 Jun 2024 00:52:24 +0300 Subject: [PATCH 038/387] chore: code cleanup Signed-off-by: Andrei Ivanovici --- .../api/{util.test.ts => AzureDevops.test.ts} | 3 +- plugins/catalog-import/src/api/AzureDevops.ts | 27 +++- .../src/api/AzureRepoApiClient.test.ts | 131 +++++++++++------- .../src/api/AzureRepoApiClient.ts | 74 ++++++---- .../src/api/CatalogImportClient.test.ts | 3 +- .../src/api/CatalogImportClient.ts | 10 +- plugins/catalog-import/src/api/util.ts | 40 ------ 7 files changed, 169 insertions(+), 119 deletions(-) rename plugins/catalog-import/src/api/{util.test.ts => AzureDevops.test.ts} (97%) delete mode 100644 plugins/catalog-import/src/api/util.ts diff --git a/plugins/catalog-import/src/api/util.test.ts b/plugins/catalog-import/src/api/AzureDevops.test.ts similarity index 97% rename from plugins/catalog-import/src/api/util.test.ts rename to plugins/catalog-import/src/api/AzureDevops.test.ts index 3a14a2e7ae..4a3dfca42d 100644 --- a/plugins/catalog-import/src/api/util.test.ts +++ b/plugins/catalog-import/src/api/AzureDevops.test.ts @@ -13,7 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { parseRepoUrl } from './util'; + +import { parseRepoUrl } from './AzureDevops'; describe('parseRepoUrl', () => { it('parses Azure DevOps Cloud url', async () => { diff --git a/plugins/catalog-import/src/api/AzureDevops.ts b/plugins/catalog-import/src/api/AzureDevops.ts index d028c75129..f7309d01f8 100644 --- a/plugins/catalog-import/src/api/AzureDevops.ts +++ b/plugins/catalog-import/src/api/AzureDevops.ts @@ -17,7 +17,6 @@ import { ScmAuthApi } from '@backstage/integration-react'; import { ConfigApi } from '@backstage/core-plugin-api'; import { getBranchName, getCatalogFilename } from '../components/helpers'; import { createAzurePullRequest } from './AzureRepoApiClient'; -import { parseRepoUrl } from './util'; export interface AzureRepoParts { tenantUrl: string; @@ -77,3 +76,29 @@ export async function submitAzurePrToRepo( location: catalogLocation, }; } + +export function parseRepoUrl(sourceUrl: string) { + const url = new URL(sourceUrl); + + let host = url.host; + let org; + let project; + let repo; + + const parts = url.pathname.split('/').map(part => decodeURIComponent(part)); + if (parts[2] === '_git') { + org = parts[1]; + project = repo = parts[3]; + } else if (parts[3] === '_git') { + org = parts[1]; + project = parts[2]; + repo = parts[4]; + } else if (parts[4] === '_git') { + host = `${host}/${parts[1]}`; + org = parts[2]; + project = parts[3]; + repo = parts[5]; + } + + return { host, org, project, repo }; +} diff --git a/plugins/catalog-import/src/api/AzureRepoApiClient.test.ts b/plugins/catalog-import/src/api/AzureRepoApiClient.test.ts index 5024b8cda4..a8fbe9db76 100644 --- a/plugins/catalog-import/src/api/AzureRepoApiClient.test.ts +++ b/plugins/catalog-import/src/api/AzureRepoApiClient.test.ts @@ -154,6 +154,7 @@ function mockPrEndpoint() { describe('RepoApiClient', () => { const server = setupServer(); setupRequestMockHandlers(server); + const testToken = new Date().toString(); const sut = new RepoApiClient({ project: 'project', tenantUrl: 'https://dev.azure.com/acme', @@ -168,25 +169,28 @@ describe('RepoApiClient', () => { }); describe('getRepository', () => { it('should get an existing repository', async () => { - await expect(sut.getRepository('success')).resolves.toEqual({ + await expect(sut.getRepository('success', testToken)).resolves.toEqual({ id: '01', name: 'success', defaultBranch: 'refs/heads/master', }); }); it('should throw when the repository repository does not exist', async () => { - await expect(sut.getRepository('not-found')).rejects.toThrow( + await expect(sut.getRepository('not-found', testToken)).rejects.toThrow( new Error('repository not found'), ); }); }); describe('getDefaultBranch', () => { it('should return when correct branch', async () => { - const foundRef = await sut.getDefaultBranch({ - name: 'success', - defaultBranch: 'refs/heads/main', - id: '01', - }); + const foundRef = await sut.getDefaultBranch( + { + name: 'success', + defaultBranch: 'refs/heads/main', + id: '01', + }, + testToken, + ); expect(foundRef).toEqual({ name: 'refs/heads/main', objectId: '0000000000000000000000000000000000000000', @@ -194,37 +198,43 @@ describe('RepoApiClient', () => { }); it('should throw when the repository does not exist', async () => { - const promise = sut.getDefaultBranch({ - name: 'fail', - defaultBranch: 'refs/heads/main', - id: '01', - }); + const promise = sut.getDefaultBranch( + { + name: 'fail', + defaultBranch: 'refs/heads/main', + id: '01', + }, + testToken, + ); await expect(promise).rejects.toThrow(new Error('repository not found')); }); it('should throw when the default branch does not exist', async () => { - const promise = sut.getDefaultBranch({ - name: 'success', - defaultBranch: 'refs/heads/missing_branch', - id: '01', - }); + const promise = sut.getDefaultBranch( + { + name: 'success', + defaultBranch: 'refs/heads/missing_branch', + id: '01', + }, + testToken, + ); await expect(promise).rejects.toThrow( new Error(`The requested ref 'heads/missing_branch' was not found`), ); }); }); describe('pushNewBranch', () => { - let sourceBranch: AzureRef; let options: NewBranchOptions; let expectedResult: AzureRefUpdate; beforeEach(() => { - sourceBranch = { - name: 'refs/heads/main', - objectId: '0000000000000000000000000000000000000000', - }; options = { + repoName: 'name', title: 'title', + sourceBranch: { + name: 'refs/heads/main', + objectId: '0000000000000000000000000000000000000000', + }, branchName: 'backstage-integration', fileName: 'catalog-info.yaml', fileContent: 'This is a test', @@ -238,29 +248,43 @@ describe('RepoApiClient', () => { }); it('should create a new branch', async () => { await expect( - sut.pushNewBranch('success', sourceBranch, options), + sut.pushNewBranch( + { + ...options, + repoName: 'success', + }, + testToken, + ), ).resolves.toEqual(expectedResult); }); it('should throw when api call fails', async () => { await expect( - sut.pushNewBranch('error', sourceBranch, options), + sut.pushNewBranch( + { + ...options, + repoName: 'error', + }, + testToken, + ), ).rejects.toThrow(new Error('internal error')); }); }); describe('createPullRequest', () => { - const sourceBranchName = 'refs/heads/main'; - const targetBranchName = 'refs/heads/backstage-integration'; const options: CreatePrOptions = { + repoName: 'repoName', + sourceName: 'refs/heads/main', + targetName: 'refs/heads/backstage-integration', title: 'Title', description: 'Description', }; it('should create a new Pull request', async () => { await expect( sut.createPullRequest( - 'success', - sourceBranchName, - targetBranchName, - options, + { + ...options, + repoName: 'success', + }, + testToken, ), ).resolves.toEqual({ pullRequestId: 'PR01', @@ -272,12 +296,7 @@ describe('RepoApiClient', () => { }); it('should throw when api call fails', async () => { await expect( - sut.createPullRequest( - 'error', - sourceBranchName, - targetBranchName, - options, - ), + sut.createPullRequest({ ...options, repoName: 'error' }, testToken), ).rejects.toThrow(new Error('internal error')); }); }); @@ -297,6 +316,7 @@ describe('createAzurePullRequest', () => { }); it('should create a new Pull request', async () => { + const testToken = new Date().getTime().toString(); const options: AzurePrOptions = { tenantUrl: 'https://dev.azure.com/acme', repository: 'test', @@ -306,7 +326,8 @@ describe('createAzurePullRequest', () => { fileContent: 'content', branchName: 'backstage-integration', description: 'Test Description', - } as any; + token: testToken, + }; const repo: AzureRepo = { name: options.repository, defaultBranch: 'ref/heads/main', @@ -337,18 +358,34 @@ describe('createAzurePullRequest', () => { await expect(createAzurePullRequest(options, client)).resolves.toEqual( expectedResult, ); - expect(clientMock.getRepository).toHaveBeenCalledWith(options.repository); - expect(clientMock.getDefaultBranch).toHaveBeenCalledWith(repo); - expect(clientMock.pushNewBranch).toHaveBeenCalledWith( - repo.name, - defaultBranch, - options, + expect(clientMock.getRepository).toHaveBeenCalledWith( + options.repository, + testToken, ); + expect(clientMock.getDefaultBranch).toHaveBeenCalledWith(repo, testToken); + const expectedBranchOptions: NewBranchOptions = { + repoName: repo.name, + sourceBranch: defaultBranch, + branchName: options.branchName, + fileContent: options.fileContent, + fileName: options.fileName, + title: options.title, + }; + expect(clientMock.pushNewBranch).toHaveBeenCalledWith( + expectedBranchOptions, + testToken, + ); + + const expectedPrOptions: CreatePrOptions = { + repoName: repo.name, + description: options.description, + title: options.title, + sourceName: options.branchName, + targetName: defaultBranch.name, + }; expect(clientMock.createPullRequest).toHaveBeenCalledWith( - repo.name, - options.branchName, - defaultBranch.name, - options, + expectedPrOptions, + testToken, ); }); }); diff --git a/plugins/catalog-import/src/api/AzureRepoApiClient.ts b/plugins/catalog-import/src/api/AzureRepoApiClient.ts index a743159ea8..56be626f5e 100644 --- a/plugins/catalog-import/src/api/AzureRepoApiClient.ts +++ b/plugins/catalog-import/src/api/AzureRepoApiClient.ts @@ -95,7 +95,6 @@ const apiVersions = '6.0'; export interface RepoApiClientOptions { project: string; tenantUrl: string; - token: string; } export interface NewBranchOptions { @@ -103,9 +102,14 @@ export interface NewBranchOptions { fileName: string; title: string; branchName: string; + repoName: string; + sourceBranch: AzureRef; } export interface CreatePrOptions { + repoName: string; + sourceName: string; + targetName: string; description: string; title: string; } @@ -134,11 +138,12 @@ export class RepoApiClient { path: string, version: string, queryParams: Record | undefined = undefined, + token: string, ): Promise { const endpoint = this.createEndpoint(path, version, queryParams); const result = await fetch(endpoint, { headers: { - Authorization: `Bearer ${this._options.token}`, + Authorization: `Bearer ${token}`, }, }); if (!result.ok) { @@ -151,12 +156,13 @@ export class RepoApiClient { path: string, version: string, payload: unknown, + token: string, ): Promise { const endpoint = this.createEndpoint(path, version); const result = await fetch(endpoint, { method: 'POST', headers: { - Authorization: `Bearer ${this._options.token}`, + Authorization: `Bearer ${token}`, 'Content-Type': 'application/json', }, body: JSON.stringify(payload), @@ -167,16 +173,20 @@ export class RepoApiClient { return await result.json(); } - async getRepository(repositoryName: string): Promise { - return this.get(`/${repositoryName}`, apiVersions); + async getRepository( + repositoryName: string, + token: string, + ): Promise { + return this.get(`/${repositoryName}`, apiVersions, undefined, token); } - async getDefaultBranch(repo: AzureRepo): Promise { + async getDefaultBranch(repo: AzureRepo, token: string): Promise { const filter = repo.defaultBranch.replace('refs/', ''); const result: RefQueryResult = await this.get( `/${repo.name}/refs`, apiVersions, { filter }, + token, ); if (!result.value?.length) { return Promise.reject( @@ -187,10 +197,10 @@ export class RepoApiClient { } async pushNewBranch( - repoName: string, - sourceBranch: AzureRef, options: NewBranchOptions, + token: string, ): Promise { + const { sourceBranch, repoName } = options; const push: AzurePush = { refUpdates: [ { @@ -220,16 +230,16 @@ export class RepoApiClient { `/${repoName}/pushes`, apiVersions, push, + token, ); return result.refUpdates[0]; } async createPullRequest( - repoName: string, - sourceName: string, - targetName: string, options: CreatePrOptions, + token: string, ): Promise { + const { repoName, sourceName, targetName } = options; const payload: CreateAzurePr = { title: options.title, description: options.description, @@ -241,6 +251,7 @@ export class RepoApiClient { `/${repoName}/pullrequests`, apiVersions, payload, + token, ); } } @@ -249,18 +260,33 @@ export async function createAzurePullRequest( options: AzurePrOptions, client: RepoApiClient | undefined = undefined, ): Promise { + const { + title, + repository, + token, + fileContent, + fileName, + branchName, + description, + } = options; const actualClient = client ?? new RepoApiClient(options); - const repo = await actualClient.getRepository(options.repository); - const defaultBranch = await actualClient.getDefaultBranch(repo); - const refUpdate = await actualClient.pushNewBranch( - repo.name, - defaultBranch, - options, - ); - return actualClient.createPullRequest( - repo.name, - refUpdate.name, - defaultBranch.name, - options, - ); + const repo = await actualClient.getRepository(repository, token); + const defaultBranch = await actualClient.getDefaultBranch(repo, token); + const branchOptions: NewBranchOptions = { + title: title, + repoName: repo.name, + sourceBranch: defaultBranch, + branchName: branchName, + fileContent: fileContent, + fileName: fileName, + }; + const refUpdate = await actualClient.pushNewBranch(branchOptions, token); + const prOptions: CreatePrOptions = { + title, + description, + repoName: repo.name, + sourceName: refUpdate.name, + targetName: defaultBranch.name, + }; + return actualClient.createPullRequest(prOptions, token); } diff --git a/plugins/catalog-import/src/api/CatalogImportClient.test.ts b/plugins/catalog-import/src/api/CatalogImportClient.test.ts index d4e4eeed54..315b59ea67 100644 --- a/plugins/catalog-import/src/api/CatalogImportClient.test.ts +++ b/plugins/catalog-import/src/api/CatalogImportClient.test.ts @@ -43,6 +43,7 @@ jest.mock('@octokit/rest', () => { return octokit; } } + return { Octokit }; }); @@ -299,7 +300,7 @@ describe('CatalogImportClient', () => { ), ).rejects.toThrow( new Error( - 'This URL was not recognized as a valid GitHub URL because there was no configured integration that matched the given host name. You could try to paste the full URL to a catalog-info.yaml file instead.', + 'This URL was not recognized as a valid git URL because there was no configured integration that matched the given host name. Currently GitHub and Azure DevOps are supported. You could try to paste the full URL to a catalog-info.yaml file instead.', ), ); }); diff --git a/plugins/catalog-import/src/api/CatalogImportClient.ts b/plugins/catalog-import/src/api/CatalogImportClient.ts index fe7fc5c59e..9745bd4a85 100644 --- a/plugins/catalog-import/src/api/CatalogImportClient.ts +++ b/plugins/catalog-import/src/api/CatalogImportClient.ts @@ -91,9 +91,9 @@ export class CatalogImportClient implements CatalogImportApi { } const supportedIntegrations = ['github', 'azure']; const foundIntegration = this.scmIntegrationsApi.byUrl(url); - const iSupported = supportedIntegrations.find( - it => it === foundIntegration?.type, - ); + const iSupported = + !!foundIntegration && + supportedIntegrations.find(it => it === foundIntegration.type); if (!iSupported) { const catalogFilename = getCatalogFilename(this.configApi); @@ -103,7 +103,7 @@ export class CatalogImportClient implements CatalogImportApi { ); } throw new Error( - `This URL was not recognized as a valid GitHub URL because there was no configured integration that matched the given host name. You could try to paste the full URL to a ${catalogFilename} file instead.`, + `This URL was not recognized as a valid git URL because there was no configured integration that matched the given host name. Currently GitHub and Azure DevOps are supported. You could try to paste the full URL to a ${catalogFilename} file instead.`, ); } @@ -146,7 +146,7 @@ export class CatalogImportClient implements CatalogImportApi { return { type: 'repository', - integrationType: foundIntegration!.type, + integrationType: foundIntegration.type, url: url, generatedEntities: analyzation.generateEntities.map(x => x.entity), }; diff --git a/plugins/catalog-import/src/api/util.ts b/plugins/catalog-import/src/api/util.ts deleted file mode 100644 index dc6b4ae2a6..0000000000 --- a/plugins/catalog-import/src/api/util.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2024 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. - */ -export function parseRepoUrl(sourceUrl: string) { - const url = new URL(sourceUrl); - - let host = url.host; - let org; - let project; - let repo; - - const parts = url.pathname.split('/').map(part => decodeURIComponent(part)); - if (parts[2] === '_git') { - org = parts[1]; - project = repo = parts[3]; - } else if (parts[3] === '_git') { - org = parts[1]; - project = parts[2]; - repo = parts[4]; - } else if (parts[4] === '_git') { - host = `${host}/${parts[1]}`; - org = parts[2]; - project = parts[3]; - repo = parts[5]; - } - - return { host, org, project, repo }; -} From 6a4ad4ee45956936ef1185d3c80b116f7a98330d Mon Sep 17 00:00:00 2001 From: Kacper Nowacki Date: Mon, 3 Jun 2024 14:42:55 +0200 Subject: [PATCH 039/387] Fetch default branch for target repository instead of using hardcoded master branch if no targetBranch is provided Signed-off-by: Kacper Nowacki --- .changeset/fair-rockets-leave.md | 6 +++ .../bitbucketServerPullRequest.test.ts | 18 +++++++ .../src/actions/bitbucketServerPullRequest.ts | 47 ++++++++++++++++++- 3 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 .changeset/fair-rockets-leave.md diff --git a/.changeset/fair-rockets-leave.md b/.changeset/fair-rockets-leave.md new file mode 100644 index 0000000000..41cf28fc9e --- /dev/null +++ b/.changeset/fair-rockets-leave.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-scaffolder-backend-module-bitbucket-server': patch +--- + +Instead of using hardcoded targetBranch we are fetching the default branch from Bitbucket repository. +This prevents from errors when no targetBranch is provided and the default repository branch is different from `master`, for example: `main`. diff --git a/plugins/scaffolder-backend-module-bitbucket-server/src/actions/bitbucketServerPullRequest.test.ts b/plugins/scaffolder-backend-module-bitbucket-server/src/actions/bitbucketServerPullRequest.test.ts index 9d2dd915f8..61adf0e3c8 100644 --- a/plugins/scaffolder-backend-module-bitbucket-server/src/actions/bitbucketServerPullRequest.test.ts +++ b/plugins/scaffolder-backend-module-bitbucket-server/src/actions/bitbucketServerPullRequest.test.ts @@ -103,6 +103,14 @@ describe('publish:bitbucketServer:pull-request', () => { ], start: 0, }; + const responseOfDefaultBranch = { + id: 'refs/heads/main', + displayId: 'main', + type: 'BRANCH', + latestCommit: '1245346tsdfgdf', + latestChangeset: 'wsdfgdh234', + isDefault: true, + }; const responseOfPullRequests = { id: 19, version: 0, @@ -190,6 +198,16 @@ describe('publish:bitbucketServer:pull-request', () => { ); }, ), + rest.get( + 'https://hosted.bitbucket.com/rest/api/1.0/projects/project/repos/repo/default-branch', + (_, res, ctx) => { + return res( + ctx.status(200), + ctx.set('Content-Type', 'application/json'), + ctx.json(responseOfDefaultBranch), + ); + }, + ), rest.post( 'https://hosted.bitbucket.com/rest/api/1.0/projects/project/repos/repo/pull-requests', (_, res, ctx) => { diff --git a/plugins/scaffolder-backend-module-bitbucket-server/src/actions/bitbucketServerPullRequest.ts b/plugins/scaffolder-backend-module-bitbucket-server/src/actions/bitbucketServerPullRequest.ts index 8fddffaba4..440e402764 100644 --- a/plugins/scaffolder-backend-module-bitbucket-server/src/actions/bitbucketServerPullRequest.ts +++ b/plugins/scaffolder-backend-module-bitbucket-server/src/actions/bitbucketServerPullRequest.ts @@ -204,6 +204,39 @@ const createBranch = async (opts: { return await response.json(); }; +const getDefaultBranch = async (opts: { + project: string; + repo: string; + authorization: string; + apiBaseUrl: string; +}) => { + const { project, repo, authorization, apiBaseUrl } = opts; + let response: Response; + + const options: RequestInit = { + method: 'GET', + headers: { + Authorization: authorization, + 'Content-Type': 'application/json', + }, + }; + + try { + response = await fetch( + `${apiBaseUrl}/projects/${project}/repos/${repo}/default-branch`, + options, + ); + } catch (error) { + throw error; + } + + const { displayId } = await response.json(); + const defaultBranch = displayId; + if (!defaultBranch) { + throw new Error(`Could not fetch default branch for ${project}/${repo}`); + } + return defaultBranch; +}; /** * Creates a BitbucketServer Pull Request action. * @public @@ -288,7 +321,7 @@ export function createPublishBitbucketServerPullRequestAction(options: { repoUrl, title, description, - targetBranch = 'master', + targetBranch, sourceBranch, gitAuthorName, gitAuthorEmail, @@ -326,10 +359,20 @@ export function createPublishBitbucketServerPullRequestAction(options: { const apiBaseUrl = integrationConfig.config.apiBaseUrl; + let finalTargetBranch = targetBranch; + if (!finalTargetBranch) { + finalTargetBranch = await getDefaultBranch({ + project, + repo, + authorization, + apiBaseUrl, + }); + } + const toRef = await findBranches({ project, repo, - branchName: targetBranch, + branchName: finalTargetBranch!, authorization, apiBaseUrl, }); From 02f90c111776ce40cb3ed33dcd5cf8ecc09f4cff Mon Sep 17 00:00:00 2001 From: Fabian Mack Date: Mon, 3 Jun 2024 16:04:06 +0200 Subject: [PATCH 040/387] Make number of decimal digits in Gauge configurable Signed-off-by: Fabian Mack --- .../components/ProgressBars/Gauge.test.tsx | 21 ++++++++++ .../src/components/ProgressBars/Gauge.tsx | 41 ++++++++++++++++--- 2 files changed, 57 insertions(+), 5 deletions(-) diff --git a/packages/core-components/src/components/ProgressBars/Gauge.test.tsx b/packages/core-components/src/components/ProgressBars/Gauge.test.tsx index 2d9e852e6c..2d92391a30 100644 --- a/packages/core-components/src/components/ProgressBars/Gauge.test.tsx +++ b/packages/core-components/src/components/ProgressBars/Gauge.test.tsx @@ -47,6 +47,27 @@ describe('', () => { getByText('10m'); }); + it('handle relativeToMax prop', async () => { + const { getByText } = await renderInTestApp( + , + ); + getByText('7 pts'); + }); + + it('handle decimalDigits prop', async () => { + const { getByText } = await renderInTestApp( + , + ); + getByText('5.50/10'); + }); + const ok = '#111'; const warning = '#222'; const error = '#333'; diff --git a/packages/core-components/src/components/ProgressBars/Gauge.tsx b/packages/core-components/src/components/ProgressBars/Gauge.tsx index e72172fd59..a1ddbff4ea 100644 --- a/packages/core-components/src/components/ProgressBars/Gauge.tsx +++ b/packages/core-components/src/components/ProgressBars/Gauge.tsx @@ -75,6 +75,8 @@ export type GaugeProps = { size?: 'normal' | 'small'; description?: ReactNode; getColor?: GaugePropsGetColor; + relativeToMax?: boolean; + decimalDigits?: number; }; /** @public */ @@ -93,6 +95,7 @@ const defaultGaugeProps = { inverse: false, unit: '%', max: 100, + relativeToMax: false, }; export const getProgressColor: GaugePropsGetColor = ({ @@ -129,13 +132,36 @@ export function Gauge(props: GaugeProps) { const { getColor = getProgressColor, size = 'normal' } = props; const classes = useStyles(props); const { palette } = useTheme(); - const { value, fractional, inverse, unit, max, description } = { + const { + value, + fractional, + inverse, + unit, + max, + description, + relativeToMax, + decimalDigits, + } = { ...defaultGaugeProps, ...props, }; - const asPercentage = fractional ? Math.round(value * max) : value; - const asActual = max !== 100 ? Math.round(value) : asPercentage; + let asPercentage: number; + if (relativeToMax) { + asPercentage = (value / max) * 100; + } else { + asPercentage = fractional ? Math.round(value * max) : value; + } + let asActual: number; + if (relativeToMax) { + asActual = value; + } else { + asActual = max !== 100 ? Math.round(value) : asPercentage; + } + const asDisplay = + decimalDigits === undefined + ? asActual.toString() + : asActual.toFixed(decimalDigits); const [isHovering, setIsHovering] = useState(false); @@ -164,7 +190,12 @@ export function Gauge(props: GaugeProps) { percent={asPercentage} strokeWidth={12} trailWidth={12} - strokeColor={getColor({ palette, value: asActual, inverse, max })} + strokeColor={getColor({ + palette, + value: asPercentage, + inverse, + max: relativeToMax ? 100 : max, + })} className={classes.circle} /> {description && isHovering ? ( @@ -175,7 +206,7 @@ export function Gauge(props: GaugeProps) { [classes.overlaySmall]: size === 'small', })} > - {isNaN(value) ? 'N/A' : `${asActual}${unit}`} + {isNaN(value) ? 'N/A' : `${asDisplay}${unit}`} )} From 99b641ddb5c212e48c9fa18a92e65dfc683a2db3 Mon Sep 17 00:00:00 2001 From: Fabian Mack Date: Mon, 3 Jun 2024 17:05:41 +0200 Subject: [PATCH 041/387] Generate API report Signed-off-by: Fabian Mack --- packages/core-components/api-report.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/core-components/api-report.md b/packages/core-components/api-report.md index 0f71bcb004..597b1a9abf 100644 --- a/packages/core-components/api-report.md +++ b/packages/core-components/api-report.md @@ -450,6 +450,8 @@ export type GaugeProps = { size?: 'normal' | 'small'; description?: ReactNode; getColor?: GaugePropsGetColor; + relativeToMax?: boolean; + decimalDigits?: number; }; // @public (undocumented) From e4811ecdaf01b82ccfc41c6eed306447121e516c Mon Sep 17 00:00:00 2001 From: Fabian Mack Date: Mon, 3 Jun 2024 17:11:30 +0200 Subject: [PATCH 042/387] Add changeset Signed-off-by: Fabian Mack --- .changeset/sixty-parrots-tan.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/sixty-parrots-tan.md diff --git a/.changeset/sixty-parrots-tan.md b/.changeset/sixty-parrots-tan.md new file mode 100644 index 0000000000..88436391eb --- /dev/null +++ b/.changeset/sixty-parrots-tan.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-components': patch +--- + +Make number of decimal digits in Gauge configurable via the `decimalDigits` property From 4b39c4d27e1f4a6ac032710a0e84276069333b12 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 20:04:12 +0000 Subject: [PATCH 043/387] fix(deps): update dependency @types/express-serve-static-core to v4.19.3 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5bec6d68de..5beb8b42c5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17163,14 +17163,14 @@ __metadata: linkType: hard "@types/express-serve-static-core@npm:*, @types/express-serve-static-core@npm:^4.17.33, @types/express-serve-static-core@npm:^4.17.5": - version: 4.19.0 - resolution: "@types/express-serve-static-core@npm:4.19.0" + version: 4.19.3 + resolution: "@types/express-serve-static-core@npm:4.19.3" dependencies: "@types/node": "*" "@types/qs": "*" "@types/range-parser": "*" "@types/send": "*" - checksum: 39c09fcb3f61de96ed56d97273874cafe50e6675ac254af4d77014e569e4fdc29d1d0d1dd12e11f008cb9a52785b07c2801c6ba91397965392b20c75ee01fb4e + checksum: fff38a7f43baeb6a62380682d39846c9d92047e0dce1737d76ebd944528619abc18addc4f0548bf43dbf4514090a1bd5140ba36695024656f941a87424b8ed7d languageName: node linkType: hard From f262a45b4a728aceb45f06b45aad8c38fdaa6dea Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 4 Jun 2024 15:30:55 +0000 Subject: [PATCH 044/387] chore(deps): update github/codeql-action action to v3.25.8 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/scorecard.yml | 2 +- .github/workflows/sync_snyk-monitor.yml | 2 +- .github/workflows/verify_codeql.yml | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 8d5b2522af..253219d2fc 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: 'Upload to code-scanning' - uses: github/codeql-action/upload-sarif@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3 + uses: github/codeql-action/upload-sarif@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8 with: sarif_file: results.sarif diff --git a/.github/workflows/sync_snyk-monitor.yml b/.github/workflows/sync_snyk-monitor.yml index 4678c36907..780f08422d 100644 --- a/.github/workflows/sync_snyk-monitor.yml +++ b/.github/workflows/sync_snyk-monitor.yml @@ -58,6 +58,6 @@ jobs: SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} NODE_OPTIONS: --max-old-space-size=7168 - name: Upload Snyk report - uses: github/codeql-action/upload-sarif@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3 + uses: github/codeql-action/upload-sarif@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8 with: sarif_file: snyk.sarif diff --git a/.github/workflows/verify_codeql.yml b/.github/workflows/verify_codeql.yml index bcac7e947c..23dbac3130 100644 --- a/.github/workflows/verify_codeql.yml +++ b/.github/workflows/verify_codeql.yml @@ -55,7 +55,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3 + uses: github/codeql-action/init@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -66,7 +66,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3 + uses: github/codeql-action/autobuild@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -80,4 +80,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3 + uses: github/codeql-action/analyze@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8 From 115741c468c40e508b714dff5ef2577248236888 Mon Sep 17 00:00:00 2001 From: Hghtwr Date: Mon, 27 May 2024 23:11:06 +0200 Subject: [PATCH 045/387] Implement group-based user retrieval for Gitlab based on additional configuration key 'restrictUsersToGroup' Signed-off-by: Hghtwr --- .gitignore | 1 + packages/backend/src/index.ts | 2 +- .../src/lib/client.ts | 21 +++++++++++ .../src/lib/types.ts | 8 +++++ .../GitlabOrgDiscoveryEntityProvider.ts | 35 ++++++++++++++----- .../src/providers/config.test.ts | 4 +++ .../src/providers/config.ts | 3 ++ 7 files changed, 64 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 5ba3da3148..6db4bf549c 100644 --- a/.gitignore +++ b/.gitignore @@ -94,6 +94,7 @@ typings/ # dotenv environment variables file .env .env.test +.envrc # parcel-bundler cache (https://parceljs.org/) .cache diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index a4acd19cf2..621d912844 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -21,7 +21,7 @@ const backend = createBackend(); backend.add(import('@backstage/plugin-auth-backend')); backend.add(import('./authModuleGithubProvider')); backend.add(import('@backstage/plugin-auth-backend-module-guest-provider')); - +backend.add(import('@backstage/plugin-catalog-backend-module-gitlab-org')); backend.add(import('@backstage/plugin-app-backend/alpha')); backend.add(import('@backstage/plugin-catalog-backend-module-unprocessed')); backend.add( diff --git a/plugins/catalog-backend-module-gitlab/src/lib/client.ts b/plugins/catalog-backend-module-gitlab/src/lib/client.ts index 8f56657f68..54c19bd3cc 100644 --- a/plugins/catalog-backend-module-gitlab/src/lib/client.ts +++ b/plugins/catalog-backend-module-gitlab/src/lib/client.ts @@ -23,6 +23,7 @@ import { LoggerService } from '@backstage/backend-plugin-api'; import { GitLabDescendantGroupsResponse, GitLabGroup, + GitlabGroupMember, GitLabGroupMembersResponse, GitLabProject, GitLabUser, @@ -114,8 +115,19 @@ export class GitLabClient { return response; } + async listGroupMembers( + groupPath: string, + options?: CommonListOptions, + ): Promise> { + return this.pagedRequest( + `/groups/${encodeURIComponent(groupPath)}/members/all`, + options, + ); + } + async listUsers( options?: UserListOptions, + global?: boolean, ): Promise> { return this.pagedRequest(`/users?`, { ...options, @@ -128,6 +140,14 @@ export class GitLabClient { groupPath: string, options?: CommonListOptions, ): Promise> { + return this.listGroupMembers(groupPath, { + ...options, + show_seat_info: true, + }).then(resp => { + resp.items = resp.items.filter(user => user.is_using_seat); + return resp; + }); + /* return this.pagedRequest( `/groups/${encodeURIComponent(groupPath)}/members/all`, { @@ -138,6 +158,7 @@ export class GitLabClient { resp.items = resp.items.filter(user => user.is_using_seat); return resp; }); +*/ } async listGroups( diff --git a/plugins/catalog-backend-module-gitlab/src/lib/types.ts b/plugins/catalog-backend-module-gitlab/src/lib/types.ts index 2857fea162..89d2ceba1b 100644 --- a/plugins/catalog-backend-module-gitlab/src/lib/types.ts +++ b/plugins/catalog-backend-module-gitlab/src/lib/types.ts @@ -60,6 +60,7 @@ export type GitLabUser = { avatar_url: string; groups?: GitLabGroup[]; group_saml_identity?: GitLabGroupSamlIdentity; + is_using_seat?: boolean; // Only available in responses from the group members endpoint }; /** @@ -149,6 +150,13 @@ export type GitlabProviderConfig = { * Accepts only groups under the provided path (which will be stripped) */ group: string; + + /** + * If true, the provider will only ingest users that are part of the configured group. + * Only valid for self-hosted GitLab instances. + */ + restrictUsersToGroup?: boolean; + /** * ??? */ diff --git a/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts b/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts index e10f9ee313..67a5134f25 100644 --- a/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts +++ b/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts @@ -356,7 +356,24 @@ export class GitlabOrgDiscoveryEntityProvider implements EntityProvider { let groups; let users; - if (this.gitLabClient.isSelfManaged()) { + // Doesn't matter if we are on SaaS or not, we can either get the users from the defined group or from the root group. + if (this.gitLabClient.isSelfManaged() && this.config.restrictUsersToGroup) { + groups = (await this.gitLabClient.listDescendantGroups(this.config.group)) + .items; + users = paginated( + options => + this.gitLabClient.listGroupMembers(this.config.group, options), + { + page: 1, + per_page: 100, + }, + ); + } + + if ( + this.gitLabClient.isSelfManaged() && + !this.config.restrictUsersToGroup + ) { groups = paginated( options => this.gitLabClient.listGroups(options), { @@ -365,19 +382,19 @@ export class GitlabOrgDiscoveryEntityProvider implements EntityProvider { all_available: true, }, ); - users = paginated( options => this.gitLabClient.listUsers(options), - { - page: 1, - per_page: 100, - active: true, - }, + { page: 1, per_page: 100, active: true }, ); - } else { + } + + // For SaaS, the only difference is the root group + if (!this.gitLabClient.isSelfManaged()) { groups = (await this.gitLabClient.listDescendantGroups(this.config.group)) .items; - const rootGroup = this.config.group.split('/')[0]; + const rootGroup = this.config.restrictUsersToGroup + ? this.config.group + : this.config.group.split('/')[0]; users = paginated( options => this.gitLabClient.listSaaSUsers(rootGroup, options), { diff --git a/plugins/catalog-backend-module-gitlab/src/providers/config.test.ts b/plugins/catalog-backend-module-gitlab/src/providers/config.test.ts index 09b42e6475..f53121e064 100644 --- a/plugins/catalog-backend-module-gitlab/src/providers/config.test.ts +++ b/plugins/catalog-backend-module-gitlab/src/providers/config.test.ts @@ -61,6 +61,7 @@ describe('config', () => { allowInherited: false, schedule: undefined, skipForkedRepos: false, + restrictUsersToGroup: false, }), ); }); @@ -99,6 +100,7 @@ describe('config', () => { allowInherited: false, schedule: undefined, skipForkedRepos: false, + restrictUsersToGroup: false, }), ); }); @@ -137,6 +139,7 @@ describe('config', () => { orgEnabled: false, allowInherited: false, schedule: undefined, + restrictUsersToGroup: false, skipForkedRepos: true, }), ); @@ -178,6 +181,7 @@ describe('config', () => { orgEnabled: false, allowInherited: false, skipForkedRepos: false, + restrictUsersToGroup: false, schedule: { frequency: Duration.fromISO('PT30M'), timeout: { diff --git a/plugins/catalog-backend-module-gitlab/src/providers/config.ts b/plugins/catalog-backend-module-gitlab/src/providers/config.ts index 8606a525bd..68eba7165a 100644 --- a/plugins/catalog-backend-module-gitlab/src/providers/config.ts +++ b/plugins/catalog-backend-module-gitlab/src/providers/config.ts @@ -51,6 +51,8 @@ function readGitlabConfig(id: string, config: Config): GitlabProviderConfig { const schedule = config.has('schedule') ? readTaskScheduleDefinitionFromConfig(config.getConfig('schedule')) : undefined; + const restrictUsersToGroup = + config.getOptionalBoolean('restrictUsersToGroup') ?? false; return { id, @@ -66,6 +68,7 @@ function readGitlabConfig(id: string, config: Config): GitlabProviderConfig { orgEnabled, allowInherited, skipForkedRepos, + restrictUsersToGroup, }; } From 8db30ad8525062a2eff58294cc1d99977d3ade8d Mon Sep 17 00:00:00 2001 From: Hghtwr Date: Mon, 27 May 2024 23:20:40 +0200 Subject: [PATCH 046/387] Create changeset for restrictUserToGroup configuration key Signed-off-by: Hghtwr --- .changeset/fifty-pumpkins-smell.md | 5 +++++ packages/backend/package.json | 1 + yarn.lock | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/fifty-pumpkins-smell.md diff --git a/.changeset/fifty-pumpkins-smell.md b/.changeset/fifty-pumpkins-smell.md new file mode 100644 index 0000000000..0dceaf7f37 --- /dev/null +++ b/.changeset/fifty-pumpkins-smell.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend-module-gitlab': patch +--- + +The Gitlab configuration supports an additional optional boolean key `catalog.providers.gitlab..restrictUsersToGroup`. Setting this to `true` will make Backstage only import users from the group defined in in the `group` key, instead of all users in the organisation (self-hosted) or of the root group (SaaS). It will default to false, keeping the original implementation intact, when not explicitly set. diff --git a/packages/backend/package.json b/packages/backend/package.json index ba22ddae1e..edad16fb7e 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -38,6 +38,7 @@ "@backstage/plugin-auth-node": "workspace:^", "@backstage/plugin-catalog-backend": "workspace:^", "@backstage/plugin-catalog-backend-module-backstage-openapi": "workspace:^", + "@backstage/plugin-catalog-backend-module-gitlab-org": "workspace:^", "@backstage/plugin-catalog-backend-module-openapi": "workspace:^", "@backstage/plugin-catalog-backend-module-scaffolder-entity-model": "workspace:^", "@backstage/plugin-catalog-backend-module-unprocessed": "workspace:^", diff --git a/yarn.lock b/yarn.lock index a67630c6a5..094f162fd0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5379,7 +5379,7 @@ __metadata: languageName: unknown linkType: soft -"@backstage/plugin-catalog-backend-module-gitlab-org@workspace:plugins/catalog-backend-module-gitlab-org": +"@backstage/plugin-catalog-backend-module-gitlab-org@workspace:^, @backstage/plugin-catalog-backend-module-gitlab-org@workspace:plugins/catalog-backend-module-gitlab-org": version: 0.0.0-use.local resolution: "@backstage/plugin-catalog-backend-module-gitlab-org@workspace:plugins/catalog-backend-module-gitlab-org" dependencies: @@ -26680,6 +26680,7 @@ __metadata: "@backstage/plugin-auth-node": "workspace:^" "@backstage/plugin-catalog-backend": "workspace:^" "@backstage/plugin-catalog-backend-module-backstage-openapi": "workspace:^" + "@backstage/plugin-catalog-backend-module-gitlab-org": "workspace:^" "@backstage/plugin-catalog-backend-module-openapi": "workspace:^" "@backstage/plugin-catalog-backend-module-scaffolder-entity-model": "workspace:^" "@backstage/plugin-catalog-backend-module-unprocessed": "workspace:^" From 59df0489963568132b733fa55a19dcc02cc01b7b Mon Sep 17 00:00:00 2001 From: Hghtwr Date: Mon, 27 May 2024 23:30:34 +0200 Subject: [PATCH 047/387] Add explaination for Gitlab's restrictUsersToGroup configuration key Signed-off-by: Hghtwr --- docs/integrations/gitlab/org.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/integrations/gitlab/org.md b/docs/integrations/gitlab/org.md index 2cc0dcfb82..61eefd4868 100644 --- a/docs/integrations/gitlab/org.md +++ b/docs/integrations/gitlab/org.md @@ -196,11 +196,24 @@ which contain members will be ingested. ### Users -For self hosted, all `User` entities are ingested from the entire instance. +For self hosted, all `User` entities are ingested from the entire instance by default. For gitlab.com `User` entities for users who have [direct or inherited membership](https://docs.gitlab.com/ee/user/project/members/index.html#membership-types) of the top-level group for the configured group path will be ingested. +In both cases (SaaS & self hosted), you can limit the ingested users to users directly assigned to the group defined in your `app-config.yaml` by setting the configuration key `restrictUsersToGroup: true`. This is especially useful when you have a large userbase that you don't want to import by default. + +```yaml +catalog: + providers: + gitlab: + yourProviderId: + host: gitlab.com ## Could also be self hosted. + orgEnabled: true + group: org/teams # Required for gitlab.com when `orgEnabled: true`. Optional for self managed. Must not end with slash. Accepts only groups under the provided path (which will be stripped) + restrictUsersToGroup: true # Backstage will ingest only users directly assigned to org/teams. +``` + ### Limiting `User` and `Group` entity ingestion in the provider Optionally, you can limit the entity types ingested by the provider when using From 5d4045b09dd7f2f041610d92b4d67bd0af1d95b5 Mon Sep 17 00:00:00 2001 From: Hghtwr Date: Mon, 27 May 2024 23:41:18 +0200 Subject: [PATCH 048/387] Remove gitlab-org used during testing, remove unused types and options Signed-off-by: Hghtwr --- packages/backend/src/index.ts | 1 - plugins/catalog-backend-module-gitlab/src/lib/client.ts | 2 -- plugins/catalog-backend-module-gitlab/src/lib/types.ts | 1 - 3 files changed, 4 deletions(-) diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index 621d912844..1174b7bf6d 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -21,7 +21,6 @@ const backend = createBackend(); backend.add(import('@backstage/plugin-auth-backend')); backend.add(import('./authModuleGithubProvider')); backend.add(import('@backstage/plugin-auth-backend-module-guest-provider')); -backend.add(import('@backstage/plugin-catalog-backend-module-gitlab-org')); backend.add(import('@backstage/plugin-app-backend/alpha')); backend.add(import('@backstage/plugin-catalog-backend-module-unprocessed')); backend.add( diff --git a/plugins/catalog-backend-module-gitlab/src/lib/client.ts b/plugins/catalog-backend-module-gitlab/src/lib/client.ts index 54c19bd3cc..f80f954a8e 100644 --- a/plugins/catalog-backend-module-gitlab/src/lib/client.ts +++ b/plugins/catalog-backend-module-gitlab/src/lib/client.ts @@ -23,7 +23,6 @@ import { LoggerService } from '@backstage/backend-plugin-api'; import { GitLabDescendantGroupsResponse, GitLabGroup, - GitlabGroupMember, GitLabGroupMembersResponse, GitLabProject, GitLabUser, @@ -127,7 +126,6 @@ export class GitLabClient { async listUsers( options?: UserListOptions, - global?: boolean, ): Promise> { return this.pagedRequest(`/users?`, { ...options, diff --git a/plugins/catalog-backend-module-gitlab/src/lib/types.ts b/plugins/catalog-backend-module-gitlab/src/lib/types.ts index 89d2ceba1b..0b9ea6a868 100644 --- a/plugins/catalog-backend-module-gitlab/src/lib/types.ts +++ b/plugins/catalog-backend-module-gitlab/src/lib/types.ts @@ -153,7 +153,6 @@ export type GitlabProviderConfig = { /** * If true, the provider will only ingest users that are part of the configured group. - * Only valid for self-hosted GitLab instances. */ restrictUsersToGroup?: boolean; From 70500dd306a0129e4174363dd92fb7c4b7a44bd9 Mon Sep 17 00:00:00 2001 From: Hghtwr Date: Mon, 27 May 2024 23:43:16 +0200 Subject: [PATCH 049/387] Remove former implementation of listSaaSUsers() Signed-off-by: Hghtwr --- .../catalog-backend-module-gitlab/src/lib/client.ts | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/plugins/catalog-backend-module-gitlab/src/lib/client.ts b/plugins/catalog-backend-module-gitlab/src/lib/client.ts index f80f954a8e..b5a2b69131 100644 --- a/plugins/catalog-backend-module-gitlab/src/lib/client.ts +++ b/plugins/catalog-backend-module-gitlab/src/lib/client.ts @@ -145,18 +145,6 @@ export class GitLabClient { resp.items = resp.items.filter(user => user.is_using_seat); return resp; }); - /* - return this.pagedRequest( - `/groups/${encodeURIComponent(groupPath)}/members/all`, - { - ...options, - show_seat_info: true, - }, - ).then(resp => { - resp.items = resp.items.filter(user => user.is_using_seat); - return resp; - }); -*/ } async listGroups( From 8f34253b902ba9ad4a89046ad148135f1a45cbcf Mon Sep 17 00:00:00 2001 From: Hghtwr Date: Tue, 28 May 2024 09:26:59 +0200 Subject: [PATCH 050/387] Satisfy Typecheck for user/groups by restructuring the if clause Signed-off-by: Hghtwr --- .../src/providers/GitlabOrgDiscoveryEntityProvider.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts b/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts index 67a5134f25..ce545ebe84 100644 --- a/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts +++ b/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts @@ -368,9 +368,7 @@ export class GitlabOrgDiscoveryEntityProvider implements EntityProvider { per_page: 100, }, ); - } - - if ( + } else if ( this.gitLabClient.isSelfManaged() && !this.config.restrictUsersToGroup ) { @@ -387,9 +385,8 @@ export class GitlabOrgDiscoveryEntityProvider implements EntityProvider { { page: 1, per_page: 100, active: true }, ); } - // For SaaS, the only difference is the root group - if (!this.gitLabClient.isSelfManaged()) { + else { groups = (await this.gitLabClient.listDescendantGroups(this.config.group)) .items; const rootGroup = this.config.restrictUsersToGroup From f79798be0410e39b50afcd3bd403e6ef35d85dbe Mon Sep 17 00:00:00 2001 From: Hghtwr Date: Tue, 28 May 2024 09:46:45 +0200 Subject: [PATCH 051/387] Update api report for #24889 Signed-off-by: Hghtwr --- plugins/catalog-backend-module-gitlab/api-report.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/catalog-backend-module-gitlab/api-report.md b/plugins/catalog-backend-module-gitlab/api-report.md index d7fcd1b94d..2b78c67205 100644 --- a/plugins/catalog-backend-module-gitlab/api-report.md +++ b/plugins/catalog-backend-module-gitlab/api-report.md @@ -98,6 +98,7 @@ export class GitlabOrgDiscoveryEntityProvider implements EntityProvider { export type GitlabProviderConfig = { host: string; group: string; + restrictUsersToGroup?: boolean; id: string; branch?: string; fallbackBranch: string; @@ -122,6 +123,7 @@ export type GitLabUser = { avatar_url: string; groups?: GitLabGroup[]; group_saml_identity?: GitLabGroupSamlIdentity; + is_using_seat?: boolean; }; // @public From 20de0f8cb8d97c148e5d1081fcc2a265c6eb72a5 Mon Sep 17 00:00:00 2001 From: Hghtwr Date: Tue, 28 May 2024 10:10:39 +0200 Subject: [PATCH 052/387] Remove unused dependencies after testing Signed-off-by: Hghtwr --- packages/backend/package.json | 1 - yarn.lock | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/backend/package.json b/packages/backend/package.json index edad16fb7e..ba22ddae1e 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -38,7 +38,6 @@ "@backstage/plugin-auth-node": "workspace:^", "@backstage/plugin-catalog-backend": "workspace:^", "@backstage/plugin-catalog-backend-module-backstage-openapi": "workspace:^", - "@backstage/plugin-catalog-backend-module-gitlab-org": "workspace:^", "@backstage/plugin-catalog-backend-module-openapi": "workspace:^", "@backstage/plugin-catalog-backend-module-scaffolder-entity-model": "workspace:^", "@backstage/plugin-catalog-backend-module-unprocessed": "workspace:^", diff --git a/yarn.lock b/yarn.lock index 094f162fd0..a67630c6a5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5379,7 +5379,7 @@ __metadata: languageName: unknown linkType: soft -"@backstage/plugin-catalog-backend-module-gitlab-org@workspace:^, @backstage/plugin-catalog-backend-module-gitlab-org@workspace:plugins/catalog-backend-module-gitlab-org": +"@backstage/plugin-catalog-backend-module-gitlab-org@workspace:plugins/catalog-backend-module-gitlab-org": version: 0.0.0-use.local resolution: "@backstage/plugin-catalog-backend-module-gitlab-org@workspace:plugins/catalog-backend-module-gitlab-org" dependencies: @@ -26680,7 +26680,6 @@ __metadata: "@backstage/plugin-auth-node": "workspace:^" "@backstage/plugin-catalog-backend": "workspace:^" "@backstage/plugin-catalog-backend-module-backstage-openapi": "workspace:^" - "@backstage/plugin-catalog-backend-module-gitlab-org": "workspace:^" "@backstage/plugin-catalog-backend-module-openapi": "workspace:^" "@backstage/plugin-catalog-backend-module-scaffolder-entity-model": "workspace:^" "@backstage/plugin-catalog-backend-module-unprocessed": "workspace:^" From 08b0740812155788f35479be2dda84fdf3c390f8 Mon Sep 17 00:00:00 2001 From: Hghtwr Date: Tue, 28 May 2024 14:07:07 +0200 Subject: [PATCH 053/387] Fix reviewdog documentation issues Signed-off-by: Hghtwr --- .changeset/fifty-pumpkins-smell.md | 2 +- docs/integrations/gitlab/org.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/fifty-pumpkins-smell.md b/.changeset/fifty-pumpkins-smell.md index 0dceaf7f37..95f4fd3fc1 100644 --- a/.changeset/fifty-pumpkins-smell.md +++ b/.changeset/fifty-pumpkins-smell.md @@ -2,4 +2,4 @@ '@backstage/plugin-catalog-backend-module-gitlab': patch --- -The Gitlab configuration supports an additional optional boolean key `catalog.providers.gitlab..restrictUsersToGroup`. Setting this to `true` will make Backstage only import users from the group defined in in the `group` key, instead of all users in the organisation (self-hosted) or of the root group (SaaS). It will default to false, keeping the original implementation intact, when not explicitly set. +The Gitlab configuration supports an additional optional boolean key `catalog.providers.gitlab..restrictUsersToGroup`. Setting this to `true` will make Backstage only import users from the group defined in the `group` key, instead of all users in the organisation (self-hosted) or of the root group (SaaS). It will default to false, keeping the original implementation intact, when not explicitly set. diff --git a/docs/integrations/gitlab/org.md b/docs/integrations/gitlab/org.md index 61eefd4868..fbc89cf8ba 100644 --- a/docs/integrations/gitlab/org.md +++ b/docs/integrations/gitlab/org.md @@ -201,7 +201,7 @@ For self hosted, all `User` entities are ingested from the entire instance by de For gitlab.com `User` entities for users who have [direct or inherited membership](https://docs.gitlab.com/ee/user/project/members/index.html#membership-types) of the top-level group for the configured group path will be ingested. -In both cases (SaaS & self hosted), you can limit the ingested users to users directly assigned to the group defined in your `app-config.yaml` by setting the configuration key `restrictUsersToGroup: true`. This is especially useful when you have a large userbase that you don't want to import by default. +In both cases (SaaS & self hosted), you can limit the ingested users to users directly assigned to the group defined in your `app-config.yaml` by setting the configuration key `restrictUsersToGroup: true`. This is especially useful when you have a large user base that you don't want to import by default. ```yaml catalog: From 22dd53f42b90354218b5dfa9346db0d9a8bb60c7 Mon Sep 17 00:00:00 2001 From: Alan Serhan Date: Wed, 5 Jun 2024 14:41:21 +0100 Subject: [PATCH 054/387] Signed-off-by: Alan Serhan - Replace hardcoded cli-commands link with local one - Add more context in 'Writing your Custom Actions' to follow up on previous docs section --- .../software-templates/writing-custom-actions.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/docs/features/software-templates/writing-custom-actions.md b/docs/features/software-templates/writing-custom-actions.md index 8dbca8b1c9..789b8a8122 100644 --- a/docs/features/software-templates/writing-custom-actions.md +++ b/docs/features/software-templates/writing-custom-actions.md @@ -28,20 +28,15 @@ $ yarn backstage-cli new > scaffolder-module - An module exporting custom actions for @backstage/plugin-scaffolder-backend ``` -You can find a [list](https://backstage.io/docs/local-dev/cli-commands/) of all commands provided by the Backstage CLI. +You can find a [list](../../local-dev/cli-commands.md) of all commands provided by the Backstage CLI. When prompted, select the option to generate a scaffolder module. This creates a solid foundation for your custom action. Enter the name of the module you wish to create, and the CLI will generate the required files and directory structure. ## Writing your Custom Action -Your custom action can live where you choose, but simplest is to include it -alongside your `backend` package in `packages/backend`. +After running the command, the CLI will create a new directory with the name you provided. This directory will be the working directory for creating the custom action. It will contain all the necessary files and boilerplate code to get started. -Let's create a simple action that adds a new file and some contents that are -passed as `input` to the function. - -In `packages/backend/src/plugins/scaffolder/actions/custom.ts` we can create a -new action. +Let's create a simple action that adds a new file and some contents that are passed as `input` to the function. Within the generated directory, locate the file at `src/actions/example/example.ts`. Feel free to rename this file along with its generated unit test. We will replace the existing placeholder code with our custom action code as follows: ```ts title="With Zod" import { createTemplateAction } from '@backstage/plugin-scaffolder-node'; From 90c5268cff5b732147480c24303b82504eee63eb Mon Sep 17 00:00:00 2001 From: Beth Griggs Date: Wed, 5 Jun 2024 12:59:30 +0100 Subject: [PATCH 055/387] cli: add peerDependencies to devDependencies in package.json.hbs templates Fixes: https://github.com/backstage/backstage/issues/24674 Signed-off-by: Beth Griggs --- .changeset/fifty-actors-buy.md | 5 +++++ packages/cli/templates/default-plugin/package.json.hbs | 3 ++- .../templates/default-react-plugin-package/package.json.hbs | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changeset/fifty-actors-buy.md diff --git a/.changeset/fifty-actors-buy.md b/.changeset/fifty-actors-buy.md new file mode 100644 index 0000000000..40e6f44154 --- /dev/null +++ b/.changeset/fifty-actors-buy.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Add `peerDependencies` to `devDependencies` in `package.json.hbs` templates. diff --git a/packages/cli/templates/default-plugin/package.json.hbs b/packages/cli/templates/default-plugin/package.json.hbs index fb86c7e792..c833c125f6 100644 --- a/packages/cli/templates/default-plugin/package.json.hbs +++ b/packages/cli/templates/default-plugin/package.json.hbs @@ -48,7 +48,8 @@ "@testing-library/jest-dom": "{{versionQuery '@testing-library/jest-dom' '6.0.0'}}", "@testing-library/react": "{{versionQuery '@testing-library/react' '14.0.0'}}", "@testing-library/user-event": "{{versionQuery '@testing-library/user-event' '14.0.0'}}", - "msw": "{{versionQuery 'msw' '1.0.0'}}" + "msw": "{{versionQuery 'msw' '1.0.0'}}", + "react": "{{versionQuery 'react' '^16.13.1 || ^17.0.0 || ^18.0.0'}}" }, "files": [ "dist" diff --git a/packages/cli/templates/default-react-plugin-package/package.json.hbs b/packages/cli/templates/default-react-plugin-package/package.json.hbs index c5e92eb7d6..79f3430f46 100644 --- a/packages/cli/templates/default-react-plugin-package/package.json.hbs +++ b/packages/cli/templates/default-react-plugin-package/package.json.hbs @@ -40,7 +40,8 @@ "@backstage/cli": "{{versionQuery '@backstage/cli'}}", "@backstage/test-utils": "{{versionQuery '@backstage/test-utils'}}", "@testing-library/jest-dom": "{{versionQuery '@testing-library/jest-dom' '6.0.0'}}", - "@testing-library/react": "{{versionQuery '@testing-library/react' '14.0.0'}}" + "@testing-library/react": "{{versionQuery '@testing-library/react' '14.0.0'}}", + "react": "{{versionQuery 'react' '^16.13.1 || ^17.0.0 || ^18.0.0'}}" }, "files": [ "dist" From 01813619dca4e27c1b91b0d50bcfa4954fef501b Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 5 Jun 2024 17:09:14 +0200 Subject: [PATCH 056/387] owners: update community plugin maintainers Signed-off-by: Patrik Oldsberg --- OWNERS.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OWNERS.md b/OWNERS.md index bf97c91685..186263b045 100644 --- a/OWNERS.md +++ b/OWNERS.md @@ -114,10 +114,10 @@ Scope: Tooling and Community Repo Maintainers for the Backstage [Community Plugi | Name | Organization | GitHub | Discord | | -------------------- | ------------ | ------------------------------------------- | ------------ | -| Bethany Griggs | Red Hat | [BethGriggs](https://github.com/BethGriggs) | `bethgriggs` | -| Tomas Kral | Red Hat | [kadel](https://github.com/kadel) | `tomkral` | | André Wanlin | Spotify | [awanlin](https://github.com/awanlin) | `ahhhndre` | -| Philipp Hugenroth | Spotify | [tudi2d](https://github.com/tudi2d) | `tudi2d` | +| Bethany Griggs | Red Hat | [BethGriggs](https://github.com/BethGriggs) | `bethgriggs` | +| Nick Boldt | Red Hat | [nickboldt](https://github.com/nickboldt) | `nboldt` | +| Tomas Kral | Red Hat | [kadel](https://github.com/kadel) | `tomkral` | | Vincenzo Scamporlino | Spotify | [vinzscam](https://github.com/vinzscam) | `vinzscam` | ### Events From 67d0530796c4e5faed42f48ee25dbbd9988c5b73 Mon Sep 17 00:00:00 2001 From: sblausten Date: Wed, 5 Jun 2024 19:02:52 +0200 Subject: [PATCH 057/387] Fix bug in root repo import where catalog-info.yaml.hcl file breaks import Signed-off-by: sblausten --- .changeset/orange-beans-float.md | 5 +++++ .../src/analyzers/GithubLocationAnalyzer.ts | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .changeset/orange-beans-float.md diff --git a/.changeset/orange-beans-float.md b/.changeset/orange-beans-float.md new file mode 100644 index 0000000000..7e31277890 --- /dev/null +++ b/.changeset/orange-beans-float.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend-module-github': patch +--- + +Fix bug in root repo import where catalog-info.yaml.hcl file is found by search and breaks the import diff --git a/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.ts b/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.ts index 2648b1bcdc..e3b367eb14 100644 --- a/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.ts +++ b/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.ts @@ -76,8 +76,13 @@ export class GithubLocationAnalyzer implements ScmLocationAnalyzer { const { owner, name: repo } = parseGitUrl(url); const catalogFile = catalogFilename || 'catalog-info.yaml'; + const fileParts = catalogFile.split('.'); + const extension = + fileParts.length > 0 + ? `extension:${fileParts[fileParts.length - 1]}` + : ''; - const query = `filename:${catalogFile} repo:${owner}/${repo}`; + const query = `filename:${catalogFile} ${extension} repo:${owner}/${repo}`; const integration = this.integrations.github.byUrl(url); if (!integration) { From 9ad3ba6011dbd93ff915f20c8a02bbee75e3a5be Mon Sep 17 00:00:00 2001 From: sblausten Date: Wed, 5 Jun 2024 19:11:08 +0200 Subject: [PATCH 058/387] Update test mocks Signed-off-by: sblausten --- .../src/analyzers/GithubLocationAnalyzer.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.test.ts b/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.test.ts index b745dd37ba..8fcffd1a33 100644 --- a/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.test.ts +++ b/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.test.ts @@ -112,7 +112,7 @@ describe('GithubLocationAnalyzer', () => { it('should analyze', async () => { octokit.search.code.mockImplementation((opts: { q: string }) => { - if (opts.q === 'filename:catalog-info.yaml repo:foo/bar') { + if (opts.q === 'filename:catalog-info.yaml extension:yaml repo:foo/bar') { return Promise.resolve({ data: { items: [{ path: 'catalog-info.yaml' }], total_count: 1 }, }); @@ -139,7 +139,7 @@ describe('GithubLocationAnalyzer', () => { it('should use the provided entity filename for search', async () => { octokit.search.code.mockImplementation((opts: { q: string }) => { - if (opts.q === 'filename:anvil.yaml repo:foo/bar') { + if (opts.q === 'filename:anvil.yaml extension:yaml repo:foo/bar') { return Promise.resolve({ data: { items: [{ path: 'anvil.yaml' }], total_count: 1 }, }); From 0391e693babafe46b9d25b86862ac6003b1890f6 Mon Sep 17 00:00:00 2001 From: Brian Phillips <28457+brianphillips@users.noreply.github.com> Date: Thu, 6 Jun 2024 06:37:35 -0500 Subject: [PATCH 059/387] use more sensible property for specifying the relationship type In the process, the `relationsType` prop is deprecated and renamed to `relationAggregation`. Signed-off-by: Brian Phillips <28457+brianphillips@users.noreply.github.com> --- .../Group/MembersList/MembersListCard.test.tsx | 6 +++--- .../Cards/Group/MembersList/MembersListCard.tsx | 15 +++++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.test.tsx b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.test.tsx index 3a129348c7..69d6090687 100644 --- a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.test.tsx +++ b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.test.tsx @@ -160,7 +160,7 @@ describe('MemberTab Test', () => { await renderInTestApp( - + , { @@ -376,7 +376,7 @@ describe('MemberTab Test', () => { @@ -414,7 +414,7 @@ describe('MemberTab Test', () => { - + diff --git a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx index d1e74200fd..f27b071114 100644 --- a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx +++ b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx @@ -138,16 +138,19 @@ export const MembersListCard = (props: { memberDisplayTitle?: string; pageSize?: number; showAggregateMembersToggle?: boolean; - relationship?: string; + relationType?: string; + /** @deprecated Please use `relationAggregation` instead */ relationsType?: EntityRelationAggregation; + relationAggregation?: EntityRelationAggregation; }) => { const { memberDisplayTitle = 'Members', pageSize = 50, showAggregateMembersToggle, - relationship = 'memberof', - relationsType = 'direct', + relationType = 'memberof', } = props; + const relationAggregation = + props.relationAggregation ?? props.relationsType ?? 'direct'; const classes = useListStyles(); const { entity: groupEntity } = useEntity(); @@ -167,7 +170,7 @@ export const MembersListCard = (props: { }; const [showAggregateMembers, setShowAggregateMembers] = useState( - relationsType === 'aggregated', + relationAggregation === 'aggregated', ); const { loading: loadingDescendantMembers, value: descendantMembers } = @@ -179,7 +182,7 @@ export const MembersListCard = (props: { return await getAllDesendantMembersForGroupEntity( groupEntity, catalogApi, - relationship, + relationType, ); }, [catalogApi, groupEntity, showAggregateMembers]); const { @@ -190,7 +193,7 @@ export const MembersListCard = (props: { const membersList = await catalogApi.getEntities({ filter: { kind: 'User', - [`relations.${relationship.toLocaleLowerCase('en-US')}`]: [ + [`relations.${relationType.toLocaleLowerCase('en-US')}`]: [ stringifyEntityRef({ kind: 'group', namespace: groupNamespace.toLocaleLowerCase('en-US'), From 0a3f1bb2e0bcdaf63ec95484b57b452a5ec0250e Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Thu, 6 Jun 2024 13:20:55 +0200 Subject: [PATCH 060/387] refactor: use host instead of url for SCM authentication Signed-off-by: Benjamin Janssens --- packages/integration-react/src/api/ScmAuth.ts | 14 +++++++------- packages/integration-react/src/api/ScmAuthApi.ts | 6 +++--- .../fields/RepoUrlPicker/RepoUrlPicker.tsx | 13 ++----------- 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/packages/integration-react/src/api/ScmAuth.ts b/packages/integration-react/src/api/ScmAuth.ts index a22b15e400..05bb360d90 100644 --- a/packages/integration-react/src/api/ScmAuth.ts +++ b/packages/integration-react/src/api/ScmAuth.ts @@ -49,11 +49,11 @@ class ScmAuthMux implements ScmAuthApi { async getCredentials( options: ScmAuthTokenOptions, ): Promise { - const url = new URL(options.url); - const provider = this.#providers.find(p => p.isUrlSupported(url)); + const { host } = options; + const provider = this.#providers.find(p => p.isHostSupported(host)); if (!provider) { throw new Error( - `No auth provider available for '${options.url}', see https://backstage.io/link?scm-auth`, + `No auth provider available for '${host}', see https://backstage.io/link?scm-auth`, ); } @@ -261,10 +261,10 @@ export class ScmAuth implements ScmAuthApi { } /** - * Checks whether the implementation is able to provide authentication for the given URL. + * Checks whether the implementation is able to provide authentication for the given host. */ - isUrlSupported(url: URL): boolean { - return url.host === this.#host; + isHostSupported(host: string): boolean { + return host === this.#host; } private getAdditionalScopesForProvider( @@ -283,7 +283,7 @@ export class ScmAuth implements ScmAuthApi { async getCredentials( options: ScmAuthTokenOptions, ): Promise { - const { url, additionalScope, ...restOptions } = options; + const { host, additionalScope, ...restOptions } = options; const scopes = this.#scopeMapping.default.slice(); if (additionalScope?.repoWrite) { diff --git a/packages/integration-react/src/api/ScmAuthApi.ts b/packages/integration-react/src/api/ScmAuthApi.ts index be65842bc1..eafc630128 100644 --- a/packages/integration-react/src/api/ScmAuthApi.ts +++ b/packages/integration-react/src/api/ScmAuthApi.ts @@ -27,11 +27,11 @@ import { */ export interface ScmAuthTokenOptions extends AuthRequestOptions { /** - * The URL of the SCM resource to be accessed. + * The host of the SCM resource to be accessed. * - * @example https://github.com/backstage/backstage + * @example github.com */ - url: string; + host: string; /** * Whether to request additional access scope. diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx index b8fe7b9420..ad01ee0fd7 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx @@ -124,8 +124,7 @@ export const RepoUrlPicker = (props: RepoUrlPickerProps) => { async () => { const { requestUserCredentials } = uiSchema?.['ui:options'] ?? {}; - const workspace = state.owner ? state.owner : state.project; - if (!requestUserCredentials) { + if (!requestUserCredentials || !state.host) { return; } @@ -134,19 +133,11 @@ export const RepoUrlPicker = (props: RepoUrlPickerProps) => { return; } - // previously, we were encodeURI for state.host, workspace and state.repoName separately. - // That created an issue where GitLab workspace can be nested like groupA/subgroupB - // when we encodeURi separately and then join, the URL will be malformed and - // resulting in 400 request error from GitLab API - const [encodedHost, encodedRepoName] = [state.host, state.repoName].map( - encodeURIComponent, - ); - // user has requested that we use the users credentials // so lets grab them using the scmAuthApi and pass through // any additional scopes from the ui:options const { token } = await scmAuthApi.getCredentials({ - url: `https://${encodedHost}/${workspace}/${encodedRepoName}`, + host: state.host, additionalScope: { repoWrite: true, customScopes: requestUserCredentials.additionalScopes, From bad9449e3d984f4eb9356ba1ba5b7567d5730ca6 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Thu, 6 Jun 2024 13:31:41 +0200 Subject: [PATCH 061/387] test: update tests Signed-off-by: Benjamin Janssens --- .../integration-react/src/api/ScmAuth.test.ts | 84 ++++++++----------- 1 file changed, 37 insertions(+), 47 deletions(-) diff --git a/packages/integration-react/src/api/ScmAuth.test.ts b/packages/integration-react/src/api/ScmAuth.test.ts index d252b95b85..de5ad516d7 100644 --- a/packages/integration-react/src/api/ScmAuth.test.ts +++ b/packages/integration-react/src/api/ScmAuth.test.ts @@ -37,9 +37,7 @@ describe('ScmAuth', () => { }), ); - await expect( - api.getCredentials({ url: 'https://github.com/backstage/backstage' }), - ).resolves.toEqual({ + await expect(api.getCredentials({ host: 'github.com' })).resolves.toEqual({ token: 'github-access-token', headers: { Authorization: 'Bearer github-access-token', @@ -47,7 +45,7 @@ describe('ScmAuth', () => { }); await expect( api.getCredentials({ - url: 'https://ghe.example.com/backstage/backstage', + host: 'ghe.example.com', additionalScope: { repoWrite: true, }, @@ -80,13 +78,13 @@ describe('ScmAuth', () => { const githubAuth = ScmAuth.forGithub(mockAuthApi); await expect( - githubAuth.getCredentials({ url: 'http://example.com' }), + githubAuth.getCredentials({ host: 'example.com' }), ).resolves.toMatchObject({ token: 'repo read:org read:user', }); await expect( githubAuth.getCredentials({ - url: 'http://example.com', + host: 'example.com', additionalScope: { repoWrite: true }, }), ).resolves.toMatchObject({ @@ -95,13 +93,13 @@ describe('ScmAuth', () => { const gitlabAuth = ScmAuth.forGitlab(mockAuthApi); await expect( - gitlabAuth.getCredentials({ url: 'http://example.com' }), + gitlabAuth.getCredentials({ host: 'example.com' }), ).resolves.toMatchObject({ token: 'read_user read_api read_repository', }); await expect( gitlabAuth.getCredentials({ - url: 'http://example.com', + host: 'example.com', additionalScope: { repoWrite: true }, }), ).resolves.toMatchObject({ @@ -110,14 +108,14 @@ describe('ScmAuth', () => { const azureAuth = ScmAuth.forAzure(mockAuthApi); await expect( - azureAuth.getCredentials({ url: 'http://example.com' }), + azureAuth.getCredentials({ host: 'example.com' }), ).resolves.toMatchObject({ token: '499b84ac-1321-427f-aa17-267ca6975798/vso.build 499b84ac-1321-427f-aa17-267ca6975798/vso.code 499b84ac-1321-427f-aa17-267ca6975798/vso.graph 499b84ac-1321-427f-aa17-267ca6975798/vso.project 499b84ac-1321-427f-aa17-267ca6975798/vso.profile', }); await expect( azureAuth.getCredentials({ - url: 'http://example.com', + host: 'example.com', additionalScope: { repoWrite: true }, }), ).resolves.toMatchObject({ @@ -127,13 +125,13 @@ describe('ScmAuth', () => { const bitbucketAuth = ScmAuth.forBitbucket(mockAuthApi); await expect( - bitbucketAuth.getCredentials({ url: 'http://example.com' }), + bitbucketAuth.getCredentials({ host: 'example.com' }), ).resolves.toMatchObject({ token: 'account team pullrequest snippet issue', }); await expect( bitbucketAuth.getCredentials({ - url: 'http://example.com', + host: 'example.com', additionalScope: { repoWrite: true }, }), ).resolves.toMatchObject({ @@ -152,7 +150,7 @@ describe('ScmAuth', () => { const githubAuth = ScmAuth.forGithub(mockAuthApi); await expect( githubAuth.getCredentials({ - url: 'http://example.com', + host: 'example.com', additionalScope: { customScopes: { github: ['org:read', 'workflow'] }, }, @@ -164,7 +162,7 @@ describe('ScmAuth', () => { const gitlabAuth = ScmAuth.forGitlab(mockAuthApi); await expect( gitlabAuth.getCredentials({ - url: 'http://example.com', + host: 'example.com', additionalScope: { customScopes: { gitlab: ['write_repository'] } }, }), ).resolves.toMatchObject({ @@ -174,7 +172,7 @@ describe('ScmAuth', () => { const azureAuth = ScmAuth.forAzure(mockAuthApi); await expect( azureAuth.getCredentials({ - url: 'http://example.com', + host: 'example.com', additionalScope: { customScopes: { azure: ['499b84ac-1321-427f-aa17-267ca6975798/vso.org'], @@ -189,7 +187,7 @@ describe('ScmAuth', () => { const bitbucketAuth = ScmAuth.forBitbucket(mockAuthApi); await expect( bitbucketAuth.getCredentials({ - url: 'http://example.com', + host: 'example.com', additionalScope: { customScopes: { bitbucket: ['snippet:write', 'issue:write'] }, }, @@ -204,47 +202,39 @@ describe('ScmAuth', () => { getAccessToken: jest.fn(), }; - const expectUrlSupport = (scm: ScmAuth, url: string) => { - expect(scm.isUrlSupported(new URL(url))).toBe(true); - expect(scm.isUrlSupported(new URL('https://not.supported.com'))).toBe( - false, - ); + const expectHostSupport = (scm: ScmAuth, host: string) => { + expect(scm.isHostSupported(host)).toBe(true); + expect(scm.isHostSupported('not.supported.com')).toBe(false); }; - expectUrlSupport(ScmAuth.forGithub(mockAuthApi), 'https://github.com'); - expectUrlSupport(ScmAuth.forGitlab(mockAuthApi), 'https://gitlab.com'); - expectUrlSupport( - ScmAuth.forAzure(mockAuthApi, {}), - 'https://dev.azure.com', - ); - expectUrlSupport( - ScmAuth.forBitbucket(mockAuthApi, {}), - 'https://bitbucket.org', - ); - expectUrlSupport( + expectHostSupport(ScmAuth.forGithub(mockAuthApi), 'github.com'); + expectHostSupport(ScmAuth.forGitlab(mockAuthApi), 'gitlab.com'); + expectHostSupport(ScmAuth.forAzure(mockAuthApi, {}), 'dev.azure.com'); + expectHostSupport(ScmAuth.forBitbucket(mockAuthApi, {}), 'bitbucket.org'); + expectHostSupport( ScmAuth.forGithub(mockAuthApi, { host: 'example.com' }), - 'https://example.com/abc', + 'example.com', ); - expectUrlSupport( + expectHostSupport( ScmAuth.forGitlab(mockAuthApi, { host: 'example.com' }), - 'http://example.com', + 'example.com', ); - expectUrlSupport( + expectHostSupport( ScmAuth.forAzure(mockAuthApi, { host: 'example.com' }), - 'https://example.com', + 'example.com', ); - expectUrlSupport( + expectHostSupport( ScmAuth.forBitbucket(mockAuthApi, { host: 'example.com:8080' }), - 'https://example.com:8080', + 'example.com:8080', ); }); - it('should throw an error for unknown URLs', async () => { + it('should throw an error for unknown hosts', async () => { const emptyMux = ScmAuth.merge(); await expect( - emptyMux.getCredentials({ url: 'http://example.com' }), + emptyMux.getCredentials({ host: 'example.com' }), ).rejects.toThrow( - "No auth provider available for 'http://example.com', see https://backstage.io/link?scm-auth", + "No auth provider available for 'example.com', see https://backstage.io/link?scm-auth", ); const scmAuth = ScmAuth.merge( @@ -257,17 +247,17 @@ describe('ScmAuth', () => { }), ); await expect( - scmAuth.getCredentials({ url: 'http://example.com' }), + scmAuth.getCredentials({ host: 'example.com' }), ).resolves.toMatchObject({ token: 'token' }); await expect( - scmAuth.getCredentials({ url: 'http://not.example.com' }), + scmAuth.getCredentials({ host: 'not.example.com' }), ).rejects.toThrow( - "No auth provider available for 'http://not.example.com', see https://backstage.io/link?scm-auth", + "No auth provider available for 'not.example.com', see https://backstage.io/link?scm-auth", ); await expect( - scmAuth.getCredentials({ url: 'http://example.com:8080' }), + scmAuth.getCredentials({ host: 'example.com:8080' }), ).rejects.toThrow( - "No auth provider available for 'http://example.com:8080', see https://backstage.io/link?scm-auth", + "No auth provider available for 'example.com:8080', see https://backstage.io/link?scm-auth", ); }); }); From 4a99e6463d2c9cb8786bad750b1915b89c2b0c8a Mon Sep 17 00:00:00 2001 From: Brian Phillips <28457+brianphillips@users.noreply.github.com> Date: Thu, 6 Jun 2024 07:05:29 -0500 Subject: [PATCH 062/387] deprecate all instances of the relationsType property in favor of relationAggregation Signed-off-by: Brian Phillips <28457+brianphillips@users.noreply.github.com> --- .changeset/little-games-fail.md | 4 ++- plugins/org/api-report.md | 8 +++-- .../Cards/OwnershipCard/ComponentsGrid.tsx | 12 +++++-- .../OwnershipCard/OwnershipCard.test.tsx | 2 +- .../Cards/OwnershipCard/OwnershipCard.tsx | 31 +++++++++++-------- .../OwnershipCard/useGetEntities.test.ts | 4 +-- .../Cards/OwnershipCard/useGetEntities.ts | 10 +++--- 7 files changed, 45 insertions(+), 26 deletions(-) diff --git a/.changeset/little-games-fail.md b/.changeset/little-games-fail.md index dc5d2f7795..199f983be8 100644 --- a/.changeset/little-games-fail.md +++ b/.changeset/little-games-fail.md @@ -2,4 +2,6 @@ '@backstage/plugin-org': patch --- -Added relationship option to EntityMembersListCard component +Added `relationType` property to EntityMembersListCard component that allows for display users related to a group via some other relationship aside from `memberOf`. + +Also, as a side effect, the `relationsType` property has been deprecated in favor of a more accurately named `relationAggregation` property. diff --git a/plugins/org/api-report.md b/plugins/org/api-report.md index fe641e5a8b..884832c111 100644 --- a/plugins/org/api-report.md +++ b/plugins/org/api-report.md @@ -23,8 +23,9 @@ export const EntityMembersListCard: (props: { memberDisplayTitle?: string | undefined; pageSize?: number | undefined; showAggregateMembersToggle?: boolean | undefined; - relationship?: string | undefined; + relationType?: string | undefined; relationsType?: EntityRelationAggregation | undefined; + relationAggregation?: EntityRelationAggregation | undefined; }) => JSX_2.Element; // @public (undocumented) @@ -33,6 +34,7 @@ export const EntityOwnershipCard: (props: { entityFilterKind?: string[] | undefined; hideRelationsToggle?: boolean | undefined; relationsType?: EntityRelationAggregation | undefined; + relationAggregation?: EntityRelationAggregation | undefined; entityLimit?: number | undefined; }) => JSX_2.Element; @@ -56,8 +58,9 @@ export const MembersListCard: (props: { memberDisplayTitle?: string; pageSize?: number; showAggregateMembersToggle?: boolean; - relationship?: string; + relationType?: string; relationsType?: EntityRelationAggregation; + relationAggregation?: EntityRelationAggregation; }) => React_2.JSX.Element; // @public @@ -84,6 +87,7 @@ export const OwnershipCard: (props: { entityFilterKind?: string[]; hideRelationsToggle?: boolean; relationsType?: EntityRelationAggregation; + relationAggregation?: EntityRelationAggregation; entityLimit?: number; }) => React_2.JSX.Element; diff --git a/plugins/org/src/components/Cards/OwnershipCard/ComponentsGrid.tsx b/plugins/org/src/components/Cards/OwnershipCard/ComponentsGrid.tsx index ff16a4ab2d..586e612e94 100644 --- a/plugins/org/src/components/Cards/OwnershipCard/ComponentsGrid.tsx +++ b/plugins/org/src/components/Cards/OwnershipCard/ComponentsGrid.tsx @@ -107,19 +107,27 @@ export const ComponentsGrid = ({ className, entity, relationsType, + relationAggregation, entityFilterKind, entityLimit = 6, }: { className?: string; entity: Entity; - relationsType: EntityRelationAggregation; + /** @deprecated Please use relationAggregation instead */ + relationsType?: EntityRelationAggregation; + relationAggregation?: EntityRelationAggregation; entityFilterKind?: string[]; entityLimit?: number; }) => { const catalogLink = useRouteRef(catalogIndexRouteRef); + if (!relationsType && !relationAggregation) { + throw new Error( + 'The relationAggregation property must be set as an EntityRelationAggregation type.', + ); + } const { componentsWithCounters, loading, error } = useGetEntities( entity, - relationsType, + (relationAggregation ?? relationsType)!, // we can safely use the non-null assertion here because of the run-time check above entityFilterKind, entityLimit, ); diff --git a/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.test.tsx b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.test.tsx index f2b949f768..004fb8b964 100644 --- a/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.test.tsx +++ b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.test.tsx @@ -288,7 +288,7 @@ describe('OwnershipCard', () => { const { getByText } = await renderInTestApp( - + , { diff --git a/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx index a5b0b7bb19..fce47845bc 100644 --- a/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx +++ b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx @@ -67,31 +67,34 @@ export const OwnershipCard = (props: { variant?: InfoCardVariants; entityFilterKind?: string[]; hideRelationsToggle?: boolean; + /** @deprecated Please use relationAggregation instead */ relationsType?: EntityRelationAggregation; + relationAggregation?: EntityRelationAggregation; entityLimit?: number; }) => { const { variant, entityFilterKind, hideRelationsToggle, - relationsType, entityLimit = 6, } = props; + const relationAggregation = props.relationAggregation ?? props.relationsType; const relationsToggle = hideRelationsToggle === undefined ? false : hideRelationsToggle; const classes = useStyles(); const { entity } = useEntity(); - const defaultRelationsType = entity.kind === 'User' ? 'aggregated' : 'direct'; - const [getRelationsType, setRelationsType] = useState( - relationsType ?? defaultRelationsType, + const defaultRelationAggregation = + entity.kind === 'User' ? 'aggregated' : 'direct'; + const [getRelationAggregation, setRelationAggregation] = useState( + relationAggregation ?? defaultRelationAggregation, ); useEffect(() => { - if (!relationsType) { - setRelationsType(defaultRelationsType); + if (!relationAggregation) { + setRelationAggregation(defaultRelationAggregation); } - }, [setRelationsType, defaultRelationsType, relationsType]); + }, [setRelationAggregation, defaultRelationAggregation, relationAggregation]); return ( { - const updatedRelationsType = - getRelationsType === 'direct' ? 'aggregated' : 'direct'; - setRelationsType(updatedRelationsType); + const updatedRelationAggregation = + getRelationAggregation === 'direct' + ? 'aggregated' + : 'direct'; + setRelationAggregation(updatedRelationAggregation); }} name="pin" inputProps={{ 'aria-label': 'Ownership Type Switch' }} @@ -136,7 +141,7 @@ export const OwnershipCard = (props: { className={classes.grid} entity={entity} entityLimit={entityLimit} - relationsType={getRelationsType} + relationAggregation={getRelationAggregation} entityFilterKind={entityFilterKind} /> diff --git a/plugins/org/src/components/Cards/OwnershipCard/useGetEntities.test.ts b/plugins/org/src/components/Cards/OwnershipCard/useGetEntities.test.ts index eac5a171ba..c6cec557c1 100644 --- a/plugins/org/src/components/Cards/OwnershipCard/useGetEntities.test.ts +++ b/plugins/org/src/components/Cards/OwnershipCard/useGetEntities.test.ts @@ -64,7 +64,7 @@ describe('useGetEntities', () => { ]), }); - describe('given aggregated relationsType', () => { + describe('given aggregated relationAggregation', () => { const whenHookIsCalledWith = async (_entity: Entity) => { const { result } = renderHook( ({ entity }) => useGetEntities(entity, 'aggregated'), @@ -205,7 +205,7 @@ describe('useGetEntities', () => { }); }); - describe('given direct relationsType', () => { + describe('given direct relationAggregation', () => { const whenHookIsCalledWith = async (_entity: Entity) => { const { result } = renderHook( ({ entity }) => useGetEntities(entity, 'direct'), diff --git a/plugins/org/src/components/Cards/OwnershipCard/useGetEntities.ts b/plugins/org/src/components/Cards/OwnershipCard/useGetEntities.ts index 5a708bcfee..d806bbfef2 100644 --- a/plugins/org/src/components/Cards/OwnershipCard/useGetEntities.ts +++ b/plugins/org/src/components/Cards/OwnershipCard/useGetEntities.ts @@ -125,11 +125,11 @@ const getChildOwnershipEntityRefs = async ( const getOwners = async ( entity: Entity, - relations: EntityRelationAggregation, + relationAggregation: EntityRelationAggregation, catalogApi: CatalogApi, ): Promise => { const isGroup = entity.kind === 'Group'; - const isAggregated = relations === 'aggregated'; + const isAggregated = relationAggregation === 'aggregated'; const isUserEntity = entity.kind === 'User'; if (isAggregated && isGroup) { @@ -166,7 +166,7 @@ const getOwnedEntitiesByOwners = ( export function useGetEntities( entity: Entity, - relations: EntityRelationAggregation, + relationAggregation: EntityRelationAggregation, entityFilterKind?: string[], entityLimit = 6, ): { @@ -189,7 +189,7 @@ export function useGetEntities( error, value: componentsWithCounters, } = useAsync(async () => { - const owners = await getOwners(entity, relations, catalogApi); + const owners = await getOwners(entity, relationAggregation, catalogApi); const ownedEntitiesList = await getOwnedEntitiesByOwners( owners, @@ -230,7 +230,7 @@ export function useGetEntities( kind: string; queryParams: string; }>; - }, [catalogApi, entity, relations]); + }, [catalogApi, entity, relationAggregation]); return { componentsWithCounters, From 64e9b71c6305fb949480a52747ca6c427c74bf31 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Thu, 6 Jun 2024 14:34:59 +0200 Subject: [PATCH 063/387] fix: update getCredentials in CatalogImportClient; update API reports Signed-off-by: Benjamin Janssens --- packages/integration-react/api-report.md | 4 ++-- plugins/catalog-import/src/api/CatalogImportClient.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/integration-react/api-report.md b/packages/integration-react/api-report.md index c1a2e34907..9e30875e79 100644 --- a/packages/integration-react/api-report.md +++ b/packages/integration-react/api-report.md @@ -70,7 +70,7 @@ export class ScmAuth implements ScmAuthApi { }, ): ScmAuth; getCredentials(options: ScmAuthTokenOptions): Promise; - isUrlSupported(url: URL): boolean; + isHostSupported(host: string): boolean; static merge(...providers: ScmAuth[]): ScmAuthApi; } @@ -93,7 +93,7 @@ export interface ScmAuthTokenOptions extends AuthRequestOptions { gitlab?: string[]; }; }; - url: string; + host: string; } // @public diff --git a/plugins/catalog-import/src/api/CatalogImportClient.ts b/plugins/catalog-import/src/api/CatalogImportClient.ts index cecb85f9a3..32bea5d7b4 100644 --- a/plugins/catalog-import/src/api/CatalogImportClient.ts +++ b/plugins/catalog-import/src/api/CatalogImportClient.ts @@ -260,7 +260,7 @@ the component will become available.\n\nFor more information, read an \ } = options; const { token } = await this.scmAuthApi.getCredentials({ - url: repositoryUrl, + host: new URL(repositoryUrl).host, additionalScope: { repoWrite: true, }, From 1759266332c26f48518f7458ce323c07896e06c0 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Thu, 6 Jun 2024 14:51:04 +0200 Subject: [PATCH 064/387] test: update tests Signed-off-by: Benjamin Janssens --- .../components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx index 1fa723c8c6..fe7d2ee7cc 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx @@ -254,7 +254,7 @@ describe('RepoUrlPicker', () => { }); expect(mockScmAuthApi.getCredentials).toHaveBeenCalledWith({ - url: 'https://github.com/backstage/repo123', + host: 'github.com', additionalScope: { repoWrite: true, customScopes: { @@ -321,7 +321,7 @@ describe('RepoUrlPicker', () => { }); expect(mockScmAuthApi.getCredentials).toHaveBeenCalledWith({ - url: 'https://gitlab.example.com/backstage/mysubgroup/repo123', + host: 'gitlab.example.com', additionalScope: { repoWrite: true, }, @@ -375,7 +375,7 @@ describe('RepoUrlPicker', () => { }); expect(mockScmAuthApi.getCredentials).toHaveBeenCalledWith({ - url: 'https://server.bitbucket.org/backstage/repo123', + host: 'server.bitbucket.org', additionalScope: { repoWrite: true, }, From 928193383653e1d20d220bb7c7a5e85cdf1a41de Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Thu, 6 Jun 2024 15:41:54 +0200 Subject: [PATCH 065/387] chore: update changesets Signed-off-by: Benjamin Janssens --- .changeset/cool-stingrays-eat.md | 5 +++++ .changeset/hungry-cups-jog.md | 2 +- .changeset/seven-chefs-share.md | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .changeset/cool-stingrays-eat.md create mode 100644 .changeset/seven-chefs-share.md diff --git a/.changeset/cool-stingrays-eat.md b/.changeset/cool-stingrays-eat.md new file mode 100644 index 0000000000..ba79391b49 --- /dev/null +++ b/.changeset/cool-stingrays-eat.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-import': patch +--- + +Updated `CatalogImportClient` to use the updated `ScmAuthTokenOptions` diff --git a/.changeset/hungry-cups-jog.md b/.changeset/hungry-cups-jog.md index af600c4f91..bd15fa92d3 100644 --- a/.changeset/hungry-cups-jog.md +++ b/.changeset/hungry-cups-jog.md @@ -2,4 +2,4 @@ '@backstage/plugin-scaffolder': patch --- -Removed waiting until all fields are filled in before requesting user credentials +Removed waiting for the workspace and repository fields to be filled in before requesting user credentials diff --git a/.changeset/seven-chefs-share.md b/.changeset/seven-chefs-share.md new file mode 100644 index 0000000000..76cf4682ff --- /dev/null +++ b/.changeset/seven-chefs-share.md @@ -0,0 +1,5 @@ +--- +'@backstage/integration-react': patch +--- + +Property `url` of class `ScmAuthTokenOptions` has been replaced with `host` From a05727d774d1503204b3aa5b0e33b2bd48f3b399 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Thu, 6 Jun 2024 15:43:59 +0200 Subject: [PATCH 066/387] chore: update changesets Signed-off-by: Benjamin Janssens --- .changeset/seven-chefs-share.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/seven-chefs-share.md b/.changeset/seven-chefs-share.md index 76cf4682ff..31dcfaf75a 100644 --- a/.changeset/seven-chefs-share.md +++ b/.changeset/seven-chefs-share.md @@ -2,4 +2,4 @@ '@backstage/integration-react': patch --- -Property `url` of class `ScmAuthTokenOptions` has been replaced with `host` +Replaced property `url` of class `ScmAuthTokenOptions` with `host` From 13b4ef6135709e672b9768dcad4fe614c0814042 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Thu, 6 Jun 2024 15:45:25 +0200 Subject: [PATCH 067/387] chore: update changesets Signed-off-by: Benjamin Janssens --- .changeset/seven-chefs-share.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/seven-chefs-share.md b/.changeset/seven-chefs-share.md index 31dcfaf75a..d673c7b239 100644 --- a/.changeset/seven-chefs-share.md +++ b/.changeset/seven-chefs-share.md @@ -2,4 +2,4 @@ '@backstage/integration-react': patch --- -Replaced property `url` of class `ScmAuthTokenOptions` with `host` +Replaced property `url` of class `ScmAuthTokenOptions` with property `host` From 847512f515c611f19051dd8aae1010e4ec1d1bf7 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Thu, 6 Jun 2024 15:47:36 +0200 Subject: [PATCH 068/387] chore: update changesets Signed-off-by: Benjamin Janssens --- .changeset/seven-chefs-share.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/seven-chefs-share.md b/.changeset/seven-chefs-share.md index d673c7b239..6fa031cafa 100644 --- a/.changeset/seven-chefs-share.md +++ b/.changeset/seven-chefs-share.md @@ -2,4 +2,4 @@ '@backstage/integration-react': patch --- -Replaced property `url` of class `ScmAuthTokenOptions` with property `host` +Replaced property `url` of `ScmAuthTokenOptions` with property `host` From 8ebb782550296e5f1f94615e96b469fe19d87876 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 13:52:34 +0000 Subject: [PATCH 069/387] Update chromaui/action digest to fa68b99 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/verify_storybook.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify_storybook.yml b/.github/workflows/verify_storybook.yml index 1859c0b8bc..3f54f58556 100644 --- a/.github/workflows/verify_storybook.yml +++ b/.github/workflows/verify_storybook.yml @@ -51,7 +51,7 @@ jobs: - run: yarn build-storybook - - uses: chromaui/action@3dcb6636a4f8eed347ef6214f5d74d2b5fee45e4 # v11 + - uses: chromaui/action@fa68b990eaee8aa67857557651a1953a8eb6d70b # v11 with: token: ${{ secrets.GITHUB_TOKEN }} # projectToken intentionally shared to allow collaborators to run Chromatic on forks From 6e11898ea2dda150e2bd9c58b2428e8e42f59cc6 Mon Sep 17 00:00:00 2001 From: Tavi Nolan Date: Thu, 6 Jun 2024 14:56:30 +0100 Subject: [PATCH 070/387] Updating template input documentation Signed-off-by: Tavi Nolan --- .../software-templates/input-examples.md | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/docs/features/software-templates/input-examples.md b/docs/features/software-templates/input-examples.md index a95cee24f4..32d37ae17c 100644 --- a/docs/features/software-templates/input-examples.md +++ b/docs/features/software-templates/input-examples.md @@ -238,3 +238,51 @@ spec: input: url: ${{ parameters.path if parameters.path else '/root' }} ``` + +## Use placeholders to reference remote files + +#### Note: testing of this functionality is not yet supported using _create/edit_ + +### template.yaml + +```yaml +spec: + parameters: + - $yaml: https://github.com/example/path/to/example.yaml + - title: Fill in some steps + properties: + path: + title: path + type: string + + steps: + - $yaml: https://github.com//example/path/to/action.yaml + + - id: fetch + name: Fetch template + action: fetch:template + input: + url: ${{ parameters.path if parameters.path else '/root' }} +``` + +### example.yaml + +```yaml +title: Provide simple information +required: + - url +properties: + url: + title: url + type: string +``` + +### action.yaml + +```yaml +id: publish +name: Publish files +action: publish:github +input: + repoUrl: ${{ parameters.url }} +``` From f61a4b3d8f890b540eaf26d141eeb9686a8238da Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Thu, 6 Jun 2024 16:06:48 +0200 Subject: [PATCH 071/387] test: update tests Signed-off-by: Benjamin Janssens --- .../RepoUrlPicker/RepoUrlPicker.test.tsx | 31 +++---------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx index fe7d2ee7cc..9afbaf30f5 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx @@ -213,7 +213,7 @@ describe('RepoUrlPicker', () => {
{JSON.stringify({ secrets })}
); }; - const { getAllByRole, getByTestId } = await renderInTestApp( + const { getByTestId } = await renderInTestApp( { , ); - const [ownerInput, repoInput] = getAllByRole('textbox'); - await act(async () => { - fireEvent.change(ownerInput, { target: { value: 'backstage' } }); - fireEvent.change(repoInput, { target: { value: 'repo123' } }); - // need to wait for the debounce to finish await new Promise(resolve => setTimeout(resolve, 600)); }); @@ -278,7 +273,7 @@ describe('RepoUrlPicker', () => {
{JSON.stringify({ secrets })}
); }; - const { getAllByRole } = await renderInTestApp( + await renderInTestApp( { , ); - const [projectInput, repoInput] = getAllByRole('textbox'); - await act(async () => { - fireEvent.change(projectInput, { - target: { value: 'backstage/mysubgroup' }, - }); - fireEvent.change(repoInput, { target: { value: 'repo123' } }); - // need to wait for the debounce to finish await new Promise(resolve => setTimeout(resolve, 600)); }); @@ -327,6 +315,7 @@ describe('RepoUrlPicker', () => { }, }); }); + it('should call the scmAuthApi with the correct params if only a project is set', async () => { const SecretsComponent = () => { const { secrets } = useTemplateSecrets(); @@ -334,7 +323,7 @@ describe('RepoUrlPicker', () => {
{JSON.stringify({ secrets })}
); }; - const { getAllByRole, getByTestId } = await renderInTestApp( + const { getByTestId } = await renderInTestApp( { , ); - const [projectInput, repoInput] = getAllByRole('textbox'); - await act(async () => { - fireEvent.change(projectInput, { target: { value: 'backstage' } }); - fireEvent.change(repoInput, { target: { value: 'repo123' } }); - // need to wait for the debounce to finish await new Promise(resolve => setTimeout(resolve, 600)); }); @@ -397,7 +381,7 @@ describe('RepoUrlPicker', () => {
{JSON.stringify({ secrets })}
); }; - const { getAllByRole, getByTestId } = await renderInTestApp( + const { getByTestId } = await renderInTestApp( { , ); - const [ownerInput, repoInput] = getAllByRole('textbox'); - await act(async () => { - fireEvent.change(ownerInput, { target: { value: 'backstage' } }); - fireEvent.change(repoInput, { target: { value: 'repo123' } }); - // need to wait for the debounce to finish await new Promise(resolve => setTimeout(resolve, 600)); }); From e3d0da09dcef58e2aad6adf37087b31beb56f4fd Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Thu, 6 Jun 2024 16:25:58 +0200 Subject: [PATCH 072/387] test: improve tests of CatalogImportClient Signed-off-by: Benjamin Janssens --- .../src/api/CatalogImportClient.test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plugins/catalog-import/src/api/CatalogImportClient.test.ts b/plugins/catalog-import/src/api/CatalogImportClient.test.ts index df44ec94c4..73b9d741b9 100644 --- a/plugins/catalog-import/src/api/CatalogImportClient.test.ts +++ b/plugins/catalog-import/src/api/CatalogImportClient.test.ts @@ -588,6 +588,12 @@ describe('CatalogImportClient', () => { 'https://github.com/backstage/backstage/blob/main/catalog-info.yaml', }); expect(catalogApi.validateEntity).toHaveBeenCalledTimes(1); + expect(scmAuthApi.getCredentials).toHaveBeenCalledWith({ + host: 'github.com', + additionalScope: { + repoWrite: true, + }, + }); expect( (new Octokit().git.createRef as any as jest.Mock).mock.calls[0][0], ).toEqual({ @@ -701,6 +707,13 @@ describe('CatalogImportClient', () => { }), ); + expect(scmAuthApi.getCredentials).toHaveBeenCalledWith({ + host: 'github.com', + additionalScope: { + repoWrite: true, + }, + }); + expect( (new Octokit().git.createRef as any as jest.Mock).mock.calls[0][0], ).toEqual( From 00e77ed3226740f95a4948e1903c6cd78f82381c Mon Sep 17 00:00:00 2001 From: Alan Serhan Date: Thu, 6 Jun 2024 17:34:13 +0100 Subject: [PATCH 073/387] Signed-off-by: Alan Serhan - Fix broken link to cli --- docs/features/software-templates/writing-custom-actions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/software-templates/writing-custom-actions.md b/docs/features/software-templates/writing-custom-actions.md index d937d9ea54..a24cf428fa 100644 --- a/docs/features/software-templates/writing-custom-actions.md +++ b/docs/features/software-templates/writing-custom-actions.md @@ -32,7 +32,7 @@ $ yarn backstage-cli new > scaffolder-module - An module exporting custom actions for @backstage/plugin-scaffolder-backend ``` -You can find a [list](../../local-dev/cli-commands.md) of all commands provided by the Backstage CLI. +You can find a [list](../../tooling/cli/03-commands.md) of all commands provided by the Backstage CLI. When prompted, select the option to generate a scaffolder module. This creates a solid foundation for your custom action. Enter the name of the module you wish to create, and the CLI will generate the required files and directory structure. From 68ec3614d795c660de5ea02af14c3e2182540e50 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 6 Jun 2024 20:39:53 +0200 Subject: [PATCH 074/387] Update OWNERS.md Co-authored-by: Bethany Griggs Signed-off-by: Patrik Oldsberg --- OWNERS.md | 1 - 1 file changed, 1 deletion(-) diff --git a/OWNERS.md b/OWNERS.md index 186263b045..1437629881 100644 --- a/OWNERS.md +++ b/OWNERS.md @@ -117,7 +117,6 @@ Scope: Tooling and Community Repo Maintainers for the Backstage [Community Plugi | André Wanlin | Spotify | [awanlin](https://github.com/awanlin) | `ahhhndre` | | Bethany Griggs | Red Hat | [BethGriggs](https://github.com/BethGriggs) | `bethgriggs` | | Nick Boldt | Red Hat | [nickboldt](https://github.com/nickboldt) | `nboldt` | -| Tomas Kral | Red Hat | [kadel](https://github.com/kadel) | `tomkral` | | Vincenzo Scamporlino | Spotify | [vinzscam](https://github.com/vinzscam) | `vinzscam` | ### Events From 92be25ef2769581d666add4be30648602761bf11 Mon Sep 17 00:00:00 2001 From: Ismail Mohammed Date: Fri, 7 Jun 2024 01:00:57 +0300 Subject: [PATCH 075/387] Corrected types Signed-off-by: Ismail Mohammed --- docs/features/software-catalog/api.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/features/software-catalog/api.md b/docs/features/software-catalog/api.md index 36b9e96220..ec699d2760 100644 --- a/docs/features/software-catalog/api.md +++ b/docs/features/software-catalog/api.md @@ -468,8 +468,7 @@ Request body is JSON, on the form ```json { - "entityRef": "", - "authorizationToken": "" + "entityRef": "" } ``` @@ -482,7 +481,7 @@ Request body is JSON, on the form ```json { "location": "", - "entity": "" + "entity": {} } ``` @@ -542,7 +541,12 @@ Response type is JSON, on the form ```json { - "facets": "" + "facets": [ + { + "value": "", + "count": 1 + } + ] } ``` @@ -615,12 +619,12 @@ And Response type is JSON, on the form }, { "description": "", - "value": "", + "value": {}, "state": "analysisSuggestedNoValue", "field": "" } ], - "entity": "" + "entity": {} } ], "existingEntityFiles": [ From eb6a71523accc4bb4621cf7f5891490a53ea04ad Mon Sep 17 00:00:00 2001 From: Emile Fokkema Date: Fri, 7 Jun 2024 20:55:00 +0000 Subject: [PATCH 076/387] add failing test Signed-off-by: Emile Fokkema --- .../src/components/Select/Select.test.tsx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/core-components/src/components/Select/Select.test.tsx b/packages/core-components/src/components/Select/Select.test.tsx index 71159150e4..e5651ca47f 100644 --- a/packages/core-components/src/components/Select/Select.test.tsx +++ b/packages/core-components/src/components/Select/Select.test.tsx @@ -55,6 +55,25 @@ describe(', + ); + + expect(getByTestId('select').textContent).toBe(initialValue); + + rerender(, From eb60b321bbe91d75170bf7436b8bf78b62eb6493 Mon Sep 17 00:00:00 2001 From: Emile Fokkema Date: Fri, 7 Jun 2024 20:56:59 +0000 Subject: [PATCH 077/387] make test pass Signed-off-by: Emile Fokkema --- packages/core-components/src/components/Select/Select.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core-components/src/components/Select/Select.tsx b/packages/core-components/src/components/Select/Select.tsx index 924b49f640..00fb4f21b4 100644 --- a/packages/core-components/src/components/Select/Select.tsx +++ b/packages/core-components/src/components/Select/Select.tsx @@ -254,7 +254,7 @@ export function SelectComponent(props: SelectProps) { getContentAnchorEl: null, }} > - {placeholder && !multiple && ( + {!!placeholder && !multiple && ( {placeholder} )} {native From d4ffdbbce3e76ead5ea97ded0b89a08b2f742533 Mon Sep 17 00:00:00 2001 From: Emile Fokkema Date: Fri, 7 Jun 2024 20:57:58 +0000 Subject: [PATCH 078/387] add changeset Signed-off-by: Emile Fokkema --- .changeset/eighty-games-wink.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/eighty-games-wink.md diff --git a/.changeset/eighty-games-wink.md b/.changeset/eighty-games-wink.md new file mode 100644 index 0000000000..46df27d16f --- /dev/null +++ b/.changeset/eighty-games-wink.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-components': patch +--- + +Fixed bug where component with empty string as placeholder gave error +Fixed bug where ` { + onChange(Array(e.target?.value.length).fill('*').join('')); + setSecrets({ [name]: e.target?.value }); + }} + value={secrets[name] ?? ''} + type="password" + autoComplete="off" + /> + + ); +}; diff --git a/plugins/scaffolder-react/src/next/components/SecretWidget/index.ts b/plugins/scaffolder-react/src/next/components/SecretWidget/index.ts new file mode 100644 index 0000000000..9f0964516c --- /dev/null +++ b/plugins/scaffolder-react/src/next/components/SecretWidget/index.ts @@ -0,0 +1,16 @@ +/* + * Copyright 2024 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. + */ +export * from './SecretWidget'; diff --git a/plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx b/plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx index 5bfdf1a44a..00232e2cd7 100644 --- a/plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx +++ b/plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx @@ -20,7 +20,6 @@ import MuiStep from '@material-ui/core/Step'; import MuiStepLabel from '@material-ui/core/StepLabel'; import Button from '@material-ui/core/Button'; import LinearProgress from '@material-ui/core/LinearProgress'; -import { makeStyles } from '@material-ui/core/styles'; import { type IChangeEvent } from '@rjsf/core'; import { ErrorSchema } from '@rjsf/utils'; import React, { @@ -49,6 +48,8 @@ import { } from '@backstage/plugin-scaffolder-react'; import { ReviewStepProps } from '@backstage/plugin-scaffolder-react'; import { ErrorListTemplate } from './ErrorListTemplate'; +import { makeStyles } from '@material-ui/core/styles'; +import { SecretWidget } from '../SecretWidget'; const useStyles = makeStyles(theme => ({ backButton: { @@ -232,6 +233,7 @@ export const Stepper = (stepperProps: StepperProps) => { showErrorList="top" templates={{ ErrorListTemplate }} onChange={handleChange} + widgets={{ password: SecretWidget }} experimental_defaultFormStateBehavior={{ allOf: 'populateDefaults', }} diff --git a/plugins/scaffolder-react/src/next/components/index.ts b/plugins/scaffolder-react/src/next/components/index.ts index 119f983a9f..02f00bb1a8 100644 --- a/plugins/scaffolder-react/src/next/components/index.ts +++ b/plugins/scaffolder-react/src/next/components/index.ts @@ -26,3 +26,4 @@ export * from './TaskLogStream'; export * from './TemplateCategoryPicker'; export * from './ScaffolderPageContextMenu'; export * from './ScaffolderField'; +export * from './SecretWidget'; diff --git a/plugins/scaffolder/src/components/fields/SecretInput/SecretInput.tsx b/plugins/scaffolder/src/components/fields/SecretInput/SecretInput.tsx index aac0cf809a..a588286d97 100644 --- a/plugins/scaffolder/src/components/fields/SecretInput/SecretInput.tsx +++ b/plugins/scaffolder/src/components/fields/SecretInput/SecretInput.tsx @@ -14,18 +14,15 @@ * limitations under the License. */ import React from 'react'; -import { useTemplateSecrets } from '@backstage/plugin-scaffolder-react'; import { ScaffolderRJSFFieldProps } from '@backstage/plugin-scaffolder-react'; -import { ScaffolderField } from '@backstage/plugin-scaffolder-react/alpha'; -import Input from '@material-ui/core/Input'; -import InputLabel from '@material-ui/core/InputLabel'; +import { + ScaffolderField, + SecretWidget, +} from '@backstage/plugin-scaffolder-react/alpha'; export const SecretInput = (props: ScaffolderRJSFFieldProps) => { - const { setSecrets, secrets } = useTemplateSecrets(); const { - name, - onChange, - schema: { title, description }, + schema: { description }, rawErrors, disabled, errors, @@ -40,18 +37,7 @@ export const SecretInput = (props: ScaffolderRJSFFieldProps) => { errors={errors} required={required} > - {title} - { - onChange(Array(e.target?.value.length).fill('*').join('')); - setSecrets({ [name]: e.target?.value }); - }} - value={secrets[name] ?? ''} - type="password" - autoComplete="off" - /> + ); }; From 62bd9ebfe3e69b5206f2a61a3297ab5a05ff8713 Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 20 May 2024 14:10:35 +0200 Subject: [PATCH 175/387] chore: added changeset Signed-off-by: blam --- .changeset/tricky-jobs-clap.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/tricky-jobs-clap.md diff --git a/.changeset/tricky-jobs-clap.md b/.changeset/tricky-jobs-clap.md new file mode 100644 index 0000000000..c11acc7318 --- /dev/null +++ b/.changeset/tricky-jobs-clap.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-scaffolder-react': minor +'@backstage/plugin-scaffolder': minor +--- + +Replace `ui:widget: password` with the `ui:field: Secret` implementation From 504661ab093ad05e68fdc5c04c76f4ba486ad8fa Mon Sep 17 00:00:00 2001 From: blam Date: Fri, 14 Jun 2024 11:07:46 +0200 Subject: [PATCH 176/387] chore: show an error for now, do not replace Signed-off-by: blam --- .../PasswordWidget/PasswordWidget.tsx | 53 +++++++++++++++++++ .../src/next/components/Stepper/Stepper.tsx | 3 +- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 plugins/scaffolder-react/src/next/components/PasswordWidget/PasswordWidget.tsx diff --git a/plugins/scaffolder-react/src/next/components/PasswordWidget/PasswordWidget.tsx b/plugins/scaffolder-react/src/next/components/PasswordWidget/PasswordWidget.tsx new file mode 100644 index 0000000000..6c1c2c176f --- /dev/null +++ b/plugins/scaffolder-react/src/next/components/PasswordWidget/PasswordWidget.tsx @@ -0,0 +1,53 @@ +/* + * Copyright 2024 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 { WidgetProps } from '@rjsf/utils'; +import InputLabel from '@material-ui/core/InputLabel'; +import Input from '@material-ui/core/Input'; +import React from 'react'; +import FormHelperText from '@material-ui/core/FormHelperText'; +import { MarkdownContent } from '@backstage/core-components'; + +export const PasswordWidget = ( + props: Pick, +) => { + const { + value, + onChange, + schema: { title }, + } = props; + + return ( + <> + {title} + { + onChange(e.target.value); + }} + value={value} + autoComplete="off" + /> + + + + + ); +}; diff --git a/plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx b/plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx index 00232e2cd7..fb950019ef 100644 --- a/plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx +++ b/plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx @@ -50,6 +50,7 @@ import { ReviewStepProps } from '@backstage/plugin-scaffolder-react'; import { ErrorListTemplate } from './ErrorListTemplate'; import { makeStyles } from '@material-ui/core/styles'; import { SecretWidget } from '../SecretWidget'; +import { PasswordWidget } from '../PasswordWidget/PasswordWidget'; const useStyles = makeStyles(theme => ({ backButton: { @@ -233,7 +234,7 @@ export const Stepper = (stepperProps: StepperProps) => { showErrorList="top" templates={{ ErrorListTemplate }} onChange={handleChange} - widgets={{ password: SecretWidget }} + widgets={{ password: PasswordWidget }} experimental_defaultFormStateBehavior={{ allOf: 'populateDefaults', }} From fd8fe4598f063172ccf7e9f79b0c8aeb4d4ce6a0 Mon Sep 17 00:00:00 2001 From: blam Date: Fri, 14 Jun 2024 11:12:18 +0200 Subject: [PATCH 177/387] chore: update changeset Signed-off-by: blam --- .changeset/tricky-jobs-clap.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.changeset/tricky-jobs-clap.md b/.changeset/tricky-jobs-clap.md index c11acc7318..e773a888c7 100644 --- a/.changeset/tricky-jobs-clap.md +++ b/.changeset/tricky-jobs-clap.md @@ -3,4 +3,32 @@ '@backstage/plugin-scaffolder': minor --- -Replace `ui:widget: password` with the `ui:field: Secret` implementation +Replace `ui:widget: password` with the a warning message stating that it's not secure and to use the build in `SecretField`. + +You can do this by updating your `template.yaml` files that have the reference `ui:widget: password` to `ui:field: Secret` instead. + +```diff +apiVersion: backstage.io/v1alpha1 +kind: Template +metadata: + ... + +spec: + parameters: + - title: collect some information + schema: + type: object + properties: + password: + title: Password + type: string +- ui:widget: password ++ ui:field: Secret + steps: + - id: collect-info + name: Collect some information + action: acme:do:something + input: +- password: ${{ parameters.password }} ++ password: ${{ secrets.password }} +``` From d7a8c736f8db1350fae7c5b85138e6159784d050 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Fri, 14 Jun 2024 11:22:17 +0200 Subject: [PATCH 178/387] refactor: revert ScmAuthTokenOptions API change Signed-off-by: Benjamin Janssens --- .changeset/cool-stingrays-eat.md | 5 -- .changeset/seven-chefs-share.md | 5 -- packages/integration-react/api-report.md | 4 +- .../integration-react/src/api/ScmAuth.test.ts | 84 +++++++++++-------- packages/integration-react/src/api/ScmAuth.ts | 14 ++-- .../integration-react/src/api/ScmAuthApi.ts | 6 +- .../src/api/CatalogImportClient.test.ts | 13 --- .../src/api/CatalogImportClient.ts | 2 +- 8 files changed, 60 insertions(+), 73 deletions(-) delete mode 100644 .changeset/cool-stingrays-eat.md delete mode 100644 .changeset/seven-chefs-share.md diff --git a/.changeset/cool-stingrays-eat.md b/.changeset/cool-stingrays-eat.md deleted file mode 100644 index ba79391b49..0000000000 --- a/.changeset/cool-stingrays-eat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-import': patch ---- - -Updated `CatalogImportClient` to use the updated `ScmAuthTokenOptions` diff --git a/.changeset/seven-chefs-share.md b/.changeset/seven-chefs-share.md deleted file mode 100644 index 6fa031cafa..0000000000 --- a/.changeset/seven-chefs-share.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/integration-react': patch ---- - -Replaced property `url` of `ScmAuthTokenOptions` with property `host` diff --git a/packages/integration-react/api-report.md b/packages/integration-react/api-report.md index 9e30875e79..c1a2e34907 100644 --- a/packages/integration-react/api-report.md +++ b/packages/integration-react/api-report.md @@ -70,7 +70,7 @@ export class ScmAuth implements ScmAuthApi { }, ): ScmAuth; getCredentials(options: ScmAuthTokenOptions): Promise; - isHostSupported(host: string): boolean; + isUrlSupported(url: URL): boolean; static merge(...providers: ScmAuth[]): ScmAuthApi; } @@ -93,7 +93,7 @@ export interface ScmAuthTokenOptions extends AuthRequestOptions { gitlab?: string[]; }; }; - host: string; + url: string; } // @public diff --git a/packages/integration-react/src/api/ScmAuth.test.ts b/packages/integration-react/src/api/ScmAuth.test.ts index de5ad516d7..d252b95b85 100644 --- a/packages/integration-react/src/api/ScmAuth.test.ts +++ b/packages/integration-react/src/api/ScmAuth.test.ts @@ -37,7 +37,9 @@ describe('ScmAuth', () => { }), ); - await expect(api.getCredentials({ host: 'github.com' })).resolves.toEqual({ + await expect( + api.getCredentials({ url: 'https://github.com/backstage/backstage' }), + ).resolves.toEqual({ token: 'github-access-token', headers: { Authorization: 'Bearer github-access-token', @@ -45,7 +47,7 @@ describe('ScmAuth', () => { }); await expect( api.getCredentials({ - host: 'ghe.example.com', + url: 'https://ghe.example.com/backstage/backstage', additionalScope: { repoWrite: true, }, @@ -78,13 +80,13 @@ describe('ScmAuth', () => { const githubAuth = ScmAuth.forGithub(mockAuthApi); await expect( - githubAuth.getCredentials({ host: 'example.com' }), + githubAuth.getCredentials({ url: 'http://example.com' }), ).resolves.toMatchObject({ token: 'repo read:org read:user', }); await expect( githubAuth.getCredentials({ - host: 'example.com', + url: 'http://example.com', additionalScope: { repoWrite: true }, }), ).resolves.toMatchObject({ @@ -93,13 +95,13 @@ describe('ScmAuth', () => { const gitlabAuth = ScmAuth.forGitlab(mockAuthApi); await expect( - gitlabAuth.getCredentials({ host: 'example.com' }), + gitlabAuth.getCredentials({ url: 'http://example.com' }), ).resolves.toMatchObject({ token: 'read_user read_api read_repository', }); await expect( gitlabAuth.getCredentials({ - host: 'example.com', + url: 'http://example.com', additionalScope: { repoWrite: true }, }), ).resolves.toMatchObject({ @@ -108,14 +110,14 @@ describe('ScmAuth', () => { const azureAuth = ScmAuth.forAzure(mockAuthApi); await expect( - azureAuth.getCredentials({ host: 'example.com' }), + azureAuth.getCredentials({ url: 'http://example.com' }), ).resolves.toMatchObject({ token: '499b84ac-1321-427f-aa17-267ca6975798/vso.build 499b84ac-1321-427f-aa17-267ca6975798/vso.code 499b84ac-1321-427f-aa17-267ca6975798/vso.graph 499b84ac-1321-427f-aa17-267ca6975798/vso.project 499b84ac-1321-427f-aa17-267ca6975798/vso.profile', }); await expect( azureAuth.getCredentials({ - host: 'example.com', + url: 'http://example.com', additionalScope: { repoWrite: true }, }), ).resolves.toMatchObject({ @@ -125,13 +127,13 @@ describe('ScmAuth', () => { const bitbucketAuth = ScmAuth.forBitbucket(mockAuthApi); await expect( - bitbucketAuth.getCredentials({ host: 'example.com' }), + bitbucketAuth.getCredentials({ url: 'http://example.com' }), ).resolves.toMatchObject({ token: 'account team pullrequest snippet issue', }); await expect( bitbucketAuth.getCredentials({ - host: 'example.com', + url: 'http://example.com', additionalScope: { repoWrite: true }, }), ).resolves.toMatchObject({ @@ -150,7 +152,7 @@ describe('ScmAuth', () => { const githubAuth = ScmAuth.forGithub(mockAuthApi); await expect( githubAuth.getCredentials({ - host: 'example.com', + url: 'http://example.com', additionalScope: { customScopes: { github: ['org:read', 'workflow'] }, }, @@ -162,7 +164,7 @@ describe('ScmAuth', () => { const gitlabAuth = ScmAuth.forGitlab(mockAuthApi); await expect( gitlabAuth.getCredentials({ - host: 'example.com', + url: 'http://example.com', additionalScope: { customScopes: { gitlab: ['write_repository'] } }, }), ).resolves.toMatchObject({ @@ -172,7 +174,7 @@ describe('ScmAuth', () => { const azureAuth = ScmAuth.forAzure(mockAuthApi); await expect( azureAuth.getCredentials({ - host: 'example.com', + url: 'http://example.com', additionalScope: { customScopes: { azure: ['499b84ac-1321-427f-aa17-267ca6975798/vso.org'], @@ -187,7 +189,7 @@ describe('ScmAuth', () => { const bitbucketAuth = ScmAuth.forBitbucket(mockAuthApi); await expect( bitbucketAuth.getCredentials({ - host: 'example.com', + url: 'http://example.com', additionalScope: { customScopes: { bitbucket: ['snippet:write', 'issue:write'] }, }, @@ -202,39 +204,47 @@ describe('ScmAuth', () => { getAccessToken: jest.fn(), }; - const expectHostSupport = (scm: ScmAuth, host: string) => { - expect(scm.isHostSupported(host)).toBe(true); - expect(scm.isHostSupported('not.supported.com')).toBe(false); + const expectUrlSupport = (scm: ScmAuth, url: string) => { + expect(scm.isUrlSupported(new URL(url))).toBe(true); + expect(scm.isUrlSupported(new URL('https://not.supported.com'))).toBe( + false, + ); }; - expectHostSupport(ScmAuth.forGithub(mockAuthApi), 'github.com'); - expectHostSupport(ScmAuth.forGitlab(mockAuthApi), 'gitlab.com'); - expectHostSupport(ScmAuth.forAzure(mockAuthApi, {}), 'dev.azure.com'); - expectHostSupport(ScmAuth.forBitbucket(mockAuthApi, {}), 'bitbucket.org'); - expectHostSupport( + expectUrlSupport(ScmAuth.forGithub(mockAuthApi), 'https://github.com'); + expectUrlSupport(ScmAuth.forGitlab(mockAuthApi), 'https://gitlab.com'); + expectUrlSupport( + ScmAuth.forAzure(mockAuthApi, {}), + 'https://dev.azure.com', + ); + expectUrlSupport( + ScmAuth.forBitbucket(mockAuthApi, {}), + 'https://bitbucket.org', + ); + expectUrlSupport( ScmAuth.forGithub(mockAuthApi, { host: 'example.com' }), - 'example.com', + 'https://example.com/abc', ); - expectHostSupport( + expectUrlSupport( ScmAuth.forGitlab(mockAuthApi, { host: 'example.com' }), - 'example.com', + 'http://example.com', ); - expectHostSupport( + expectUrlSupport( ScmAuth.forAzure(mockAuthApi, { host: 'example.com' }), - 'example.com', + 'https://example.com', ); - expectHostSupport( + expectUrlSupport( ScmAuth.forBitbucket(mockAuthApi, { host: 'example.com:8080' }), - 'example.com:8080', + 'https://example.com:8080', ); }); - it('should throw an error for unknown hosts', async () => { + it('should throw an error for unknown URLs', async () => { const emptyMux = ScmAuth.merge(); await expect( - emptyMux.getCredentials({ host: 'example.com' }), + emptyMux.getCredentials({ url: 'http://example.com' }), ).rejects.toThrow( - "No auth provider available for 'example.com', see https://backstage.io/link?scm-auth", + "No auth provider available for 'http://example.com', see https://backstage.io/link?scm-auth", ); const scmAuth = ScmAuth.merge( @@ -247,17 +257,17 @@ describe('ScmAuth', () => { }), ); await expect( - scmAuth.getCredentials({ host: 'example.com' }), + scmAuth.getCredentials({ url: 'http://example.com' }), ).resolves.toMatchObject({ token: 'token' }); await expect( - scmAuth.getCredentials({ host: 'not.example.com' }), + scmAuth.getCredentials({ url: 'http://not.example.com' }), ).rejects.toThrow( - "No auth provider available for 'not.example.com', see https://backstage.io/link?scm-auth", + "No auth provider available for 'http://not.example.com', see https://backstage.io/link?scm-auth", ); await expect( - scmAuth.getCredentials({ host: 'example.com:8080' }), + scmAuth.getCredentials({ url: 'http://example.com:8080' }), ).rejects.toThrow( - "No auth provider available for 'example.com:8080', see https://backstage.io/link?scm-auth", + "No auth provider available for 'http://example.com:8080', see https://backstage.io/link?scm-auth", ); }); }); diff --git a/packages/integration-react/src/api/ScmAuth.ts b/packages/integration-react/src/api/ScmAuth.ts index 05bb360d90..a22b15e400 100644 --- a/packages/integration-react/src/api/ScmAuth.ts +++ b/packages/integration-react/src/api/ScmAuth.ts @@ -49,11 +49,11 @@ class ScmAuthMux implements ScmAuthApi { async getCredentials( options: ScmAuthTokenOptions, ): Promise { - const { host } = options; - const provider = this.#providers.find(p => p.isHostSupported(host)); + const url = new URL(options.url); + const provider = this.#providers.find(p => p.isUrlSupported(url)); if (!provider) { throw new Error( - `No auth provider available for '${host}', see https://backstage.io/link?scm-auth`, + `No auth provider available for '${options.url}', see https://backstage.io/link?scm-auth`, ); } @@ -261,10 +261,10 @@ export class ScmAuth implements ScmAuthApi { } /** - * Checks whether the implementation is able to provide authentication for the given host. + * Checks whether the implementation is able to provide authentication for the given URL. */ - isHostSupported(host: string): boolean { - return host === this.#host; + isUrlSupported(url: URL): boolean { + return url.host === this.#host; } private getAdditionalScopesForProvider( @@ -283,7 +283,7 @@ export class ScmAuth implements ScmAuthApi { async getCredentials( options: ScmAuthTokenOptions, ): Promise { - const { host, additionalScope, ...restOptions } = options; + const { url, additionalScope, ...restOptions } = options; const scopes = this.#scopeMapping.default.slice(); if (additionalScope?.repoWrite) { diff --git a/packages/integration-react/src/api/ScmAuthApi.ts b/packages/integration-react/src/api/ScmAuthApi.ts index eafc630128..be65842bc1 100644 --- a/packages/integration-react/src/api/ScmAuthApi.ts +++ b/packages/integration-react/src/api/ScmAuthApi.ts @@ -27,11 +27,11 @@ import { */ export interface ScmAuthTokenOptions extends AuthRequestOptions { /** - * The host of the SCM resource to be accessed. + * The URL of the SCM resource to be accessed. * - * @example github.com + * @example https://github.com/backstage/backstage */ - host: string; + url: string; /** * Whether to request additional access scope. diff --git a/plugins/catalog-import/src/api/CatalogImportClient.test.ts b/plugins/catalog-import/src/api/CatalogImportClient.test.ts index 73b9d741b9..df44ec94c4 100644 --- a/plugins/catalog-import/src/api/CatalogImportClient.test.ts +++ b/plugins/catalog-import/src/api/CatalogImportClient.test.ts @@ -588,12 +588,6 @@ describe('CatalogImportClient', () => { 'https://github.com/backstage/backstage/blob/main/catalog-info.yaml', }); expect(catalogApi.validateEntity).toHaveBeenCalledTimes(1); - expect(scmAuthApi.getCredentials).toHaveBeenCalledWith({ - host: 'github.com', - additionalScope: { - repoWrite: true, - }, - }); expect( (new Octokit().git.createRef as any as jest.Mock).mock.calls[0][0], ).toEqual({ @@ -707,13 +701,6 @@ describe('CatalogImportClient', () => { }), ); - expect(scmAuthApi.getCredentials).toHaveBeenCalledWith({ - host: 'github.com', - additionalScope: { - repoWrite: true, - }, - }); - expect( (new Octokit().git.createRef as any as jest.Mock).mock.calls[0][0], ).toEqual( diff --git a/plugins/catalog-import/src/api/CatalogImportClient.ts b/plugins/catalog-import/src/api/CatalogImportClient.ts index 32bea5d7b4..cecb85f9a3 100644 --- a/plugins/catalog-import/src/api/CatalogImportClient.ts +++ b/plugins/catalog-import/src/api/CatalogImportClient.ts @@ -260,7 +260,7 @@ the component will become available.\n\nFor more information, read an \ } = options; const { token } = await this.scmAuthApi.getCredentials({ - host: new URL(repositoryUrl).host, + url: repositoryUrl, additionalScope: { repoWrite: true, }, From 872ac0b5186db6f9e98942678ed9b27ab14ba120 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Fri, 14 Jun 2024 11:37:16 +0200 Subject: [PATCH 179/387] refactor: update RepoUrlPicker to be compatible with the original API Signed-off-by: Benjamin Janssens --- .../components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx | 6 +++--- .../src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx index 9afbaf30f5..573838b960 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx @@ -249,7 +249,7 @@ describe('RepoUrlPicker', () => { }); expect(mockScmAuthApi.getCredentials).toHaveBeenCalledWith({ - host: 'github.com', + url: 'https://github.com', additionalScope: { repoWrite: true, customScopes: { @@ -309,7 +309,7 @@ describe('RepoUrlPicker', () => { }); expect(mockScmAuthApi.getCredentials).toHaveBeenCalledWith({ - host: 'gitlab.example.com', + url: 'https://gitlab.example.com', additionalScope: { repoWrite: true, }, @@ -359,7 +359,7 @@ describe('RepoUrlPicker', () => { }); expect(mockScmAuthApi.getCredentials).toHaveBeenCalledWith({ - host: 'server.bitbucket.org', + url: 'https://server.bitbucket.org', additionalScope: { repoWrite: true, }, diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx index ad01ee0fd7..85245639b0 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx @@ -137,7 +137,7 @@ export const RepoUrlPicker = (props: RepoUrlPickerProps) => { // so lets grab them using the scmAuthApi and pass through // any additional scopes from the ui:options const { token } = await scmAuthApi.getCredentials({ - host: state.host, + url: `https://${state.host}`, additionalScope: { repoWrite: true, customScopes: requestUserCredentials.additionalScopes, From 2c4374a97cc34ed001f4ca6903ba035a55a1d120 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Fri, 14 Jun 2024 11:51:43 +0200 Subject: [PATCH 180/387] chore: remove unnecessary test Signed-off-by: Benjamin Janssens --- .../RepoUrlPicker/RepoUrlPicker.test.tsx | 58 ------------------- 1 file changed, 58 deletions(-) diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx index 573838b960..59c09c106c 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx @@ -316,64 +316,6 @@ describe('RepoUrlPicker', () => { }); }); - it('should call the scmAuthApi with the correct params if only a project is set', async () => { - const SecretsComponent = () => { - const { secrets } = useTemplateSecrets(); - return ( -
{JSON.stringify({ secrets })}
- ); - }; - const { getByTestId } = await renderInTestApp( - - -
, - }} - /> - - - , - ); - - await act(async () => { - // need to wait for the debounce to finish - await new Promise(resolve => setTimeout(resolve, 600)); - }); - - expect(mockScmAuthApi.getCredentials).toHaveBeenCalledWith({ - url: 'https://server.bitbucket.org', - additionalScope: { - repoWrite: true, - }, - }); - - const currentSecrets = JSON.parse( - getByTestId('current-secrets').textContent!, - ); - - expect(currentSecrets).toEqual({ - secrets: { testKey: 'abc123' }, - }); - }); - it('should not call the scmAuthApi if secret is available in the state', async () => { const SecretsComponent = () => { const { secrets } = useTemplateSecrets(); From 7d652f33bc55af88d58adf5496179fda8a27bf6b Mon Sep 17 00:00:00 2001 From: blam Date: Fri, 14 Jun 2024 12:46:11 +0200 Subject: [PATCH 181/387] chore: fixing typescript Signed-off-by: blam --- plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx b/plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx index fb950019ef..269b6a11d5 100644 --- a/plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx +++ b/plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx @@ -49,7 +49,6 @@ import { import { ReviewStepProps } from '@backstage/plugin-scaffolder-react'; import { ErrorListTemplate } from './ErrorListTemplate'; import { makeStyles } from '@material-ui/core/styles'; -import { SecretWidget } from '../SecretWidget'; import { PasswordWidget } from '../PasswordWidget/PasswordWidget'; const useStyles = makeStyles(theme => ({ From 39e5dfd79b85ee45fb4122fcc8125d96ccb52b5a Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Thu, 6 Jun 2024 09:54:41 +0200 Subject: [PATCH 182/387] feat: fetch workspaces and projects in BitbucketRepoPicker; add support for access tokens to BitbucketCloudClient Signed-off-by: Benjamin Janssens --- .../integration/src/bitbucketCloud/config.ts | 5 ++ .../src/BitbucketCloudClient.ts | 19 +++++++ .../src/models/index.ts | 11 ++++ plugins/scaffolder/package.json | 1 + .../RepoUrlPicker/BitbucketRepoPicker.tsx | 54 ++++++++++++++++++- .../fields/RepoUrlPicker/RepoUrlPicker.tsx | 4 ++ yarn.lock | 1 + 7 files changed, 94 insertions(+), 1 deletion(-) diff --git a/packages/integration/src/bitbucketCloud/config.ts b/packages/integration/src/bitbucketCloud/config.ts index 5ecabfedc4..2f533480cc 100644 --- a/packages/integration/src/bitbucketCloud/config.ts +++ b/packages/integration/src/bitbucketCloud/config.ts @@ -46,6 +46,11 @@ export type BitbucketCloudIntegrationConfig = { * See https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/ */ appPassword?: string; + + /** + * The access token to use for requests to Bitbucket Cloud (bitbucket.org). + */ + accessToken?: string; }; /** diff --git a/plugins/bitbucket-cloud-common/src/BitbucketCloudClient.ts b/plugins/bitbucket-cloud-common/src/BitbucketCloudClient.ts index 3ac005fe2b..97d3d0e52e 100644 --- a/plugins/bitbucket-cloud-common/src/BitbucketCloudClient.ts +++ b/plugins/bitbucket-cloud-common/src/BitbucketCloudClient.ts @@ -69,6 +69,22 @@ export class BitbucketCloudClient { ); } + listProjectsByWorkspace( + workspace: string, + options?: FilterAndSortOptions & PartialResponseOptions, + ): WithPagination { + const workspaceEnc = encodeURIComponent(workspace); + + return new WithPagination( + paginationOptions => + this.createUrl(`/workspaces/${workspaceEnc}/projects`, { + ...paginationOptions, + ...options, + }), + url => this.getTypeMapped(url), + ); + } + private createUrl(endpoint: string, options?: RequestOptions): URL { const request = new URL(this.config.apiBaseUrl + endpoint); for (const key in options) { @@ -115,6 +131,9 @@ export class BitbucketCloudClient { headers.Authorization = `Basic ${buffer.toString('base64')}`; } + if (this.config.accessToken) + headers.Authorization = `Bearer ${this.config.accessToken}`; + return headers; } } diff --git a/plugins/bitbucket-cloud-common/src/models/index.ts b/plugins/bitbucket-cloud-common/src/models/index.ts index 8fce389a32..ace8ee4939 100644 --- a/plugins/bitbucket-cloud-common/src/models/index.ts +++ b/plugins/bitbucket-cloud-common/src/models/index.ts @@ -253,6 +253,17 @@ export namespace Models { values?: Set; } + /** + * A paginated list of projects. + * @public + */ + export interface PaginatedProjects extends Paginated { + /** + * The values of the current page. + */ + values?: Set; + } + /** * Object describing a user's role on resources like commits or pull requests. * @public diff --git a/plugins/scaffolder/package.json b/plugins/scaffolder/package.json index d1b58c8eca..a17fc14105 100644 --- a/plugins/scaffolder/package.json +++ b/plugins/scaffolder/package.json @@ -67,6 +67,7 @@ "@backstage/frontend-plugin-api": "workspace:^", "@backstage/integration": "workspace:^", "@backstage/integration-react": "workspace:^", + "@backstage/plugin-bitbucket-cloud-common": "workspace:^", "@backstage/plugin-catalog-common": "workspace:^", "@backstage/plugin-catalog-react": "workspace:^", "@backstage/plugin-permission-react": "workspace:^", diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx index d070e3fee5..5227f8a093 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx @@ -13,13 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import React, { useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import FormControl from '@material-ui/core/FormControl'; import FormHelperText from '@material-ui/core/FormHelperText'; import Input from '@material-ui/core/Input'; import InputLabel from '@material-ui/core/InputLabel'; import { Select, SelectItem } from '@backstage/core-components'; import { RepoUrlPickerState } from './types'; +import { BitbucketCloudClient } from '@backstage/plugin-bitbucket-cloud-common'; /** * The underlying component that is rendered in the form for the `BitbucketRepoPicker` @@ -36,6 +37,7 @@ export const BitbucketRepoPicker = (props: { onChange: (state: RepoUrlPickerState) => void; state: RepoUrlPickerState; rawErrors: string[]; + accessToken?: string; }) => { const { allowedOwners = [], @@ -43,6 +45,7 @@ export const BitbucketRepoPicker = (props: { onChange, rawErrors, state, + accessToken, } = props; const { host, workspace, project } = state; const ownerItems: SelectItem[] = allowedOwners @@ -58,6 +61,53 @@ export const BitbucketRepoPicker = (props: { } }, [allowedOwners, host, onChange]); + const [client, setClient] = useState(); + const [availableProjects, setAvailableProjects] = useState([]); + const [availableRepositories, setAvailableRepositories] = useState( + [], + ); + + useEffect(() => { + if (accessToken) + setClient( + BitbucketCloudClient.fromConfig({ + host: 'bitbucket.org', + apiBaseUrl: 'https://api.bitbucket.org/2.0', + accessToken, + }), + ); + }, [accessToken]); + + const onChangeWorkspace = async () => { + if (client) + if (!workspace) { + setAvailableProjects([]); + } else { + for await (const page of client + .listProjectsByWorkspace(workspace) + .iteratePages()) { + const keys = [...page.values!].map(p => p.key!); + setAvailableProjects([...availableProjects, ...keys]); + } + } + }; + + const onChangeProject = async () => { + if (client && workspace) + if (!project) { + setAvailableRepositories([]); + } else { + for await (const page of client + .listRepositoriesByWorkspace(workspace, { + q: `project.key="${project}"`, + }) + .iteratePages()) { + const keys = [...page.values!].map(p => p.slug!); + setAvailableRepositories([...availableRepositories, ...keys]); + } + } + }; + return ( <> {host === 'bitbucket.org' && ( @@ -84,6 +134,7 @@ export const BitbucketRepoPicker = (props: { id="workspaceInput" onChange={e => onChange({ workspace: e.target.value })} value={workspace} + onBlur={() => onChangeWorkspace()} /> )} @@ -115,6 +166,7 @@ export const BitbucketRepoPicker = (props: { id="projectInput" onChange={e => onChange({ project: e.target.value })} value={project} + onBlur={() => onChangeProject()} /> )} diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx index 85245639b0..cd749a08a1 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx @@ -203,6 +203,10 @@ export const RepoUrlPicker = (props: RepoUrlPickerProps) => { rawErrors={rawErrors} state={state} onChange={updateLocalState} + accessToken={ + uiSchema?.['ui:options']?.requestUserCredentials?.secretsKey && + secrets[uiSchema['ui:options'].requestUserCredentials.secretsKey] + } /> )} {hostType === 'azure' && ( diff --git a/yarn.lock b/yarn.lock index f0f0d02a5d..1719070c2f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7268,6 +7268,7 @@ __metadata: "@backstage/frontend-plugin-api": "workspace:^" "@backstage/integration": "workspace:^" "@backstage/integration-react": "workspace:^" + "@backstage/plugin-bitbucket-cloud-common": "workspace:^" "@backstage/plugin-catalog": "workspace:^" "@backstage/plugin-catalog-common": "workspace:^" "@backstage/plugin-catalog-react": "workspace:^" From fbbf152f50cc455eb15f179c94ca949bdf413ba4 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Thu, 6 Jun 2024 11:23:11 +0200 Subject: [PATCH 183/387] chore: add error handling Signed-off-by: Benjamin Janssens --- .../RepoUrlPicker/BitbucketRepoPicker.tsx | 37 ++++++++++++------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx index 5227f8a093..75ae840407 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx @@ -1,3 +1,4 @@ +/* eslint-disable no-restricted-syntax */ /* * Copyright 2021 The Backstage Authors * @@ -21,6 +22,8 @@ import InputLabel from '@material-ui/core/InputLabel'; import { Select, SelectItem } from '@backstage/core-components'; import { RepoUrlPickerState } from './types'; import { BitbucketCloudClient } from '@backstage/plugin-bitbucket-cloud-common'; +import Autocomplete from '@material-ui/lab/Autocomplete'; +import TextField from '@material-ui/core/TextField'; /** * The underlying component that is rendered in the form for the `BitbucketRepoPicker` @@ -83,11 +86,15 @@ export const BitbucketRepoPicker = (props: { if (!workspace) { setAvailableProjects([]); } else { - for await (const page of client - .listProjectsByWorkspace(workspace) - .iteratePages()) { - const keys = [...page.values!].map(p => p.key!); - setAvailableProjects([...availableProjects, ...keys]); + try { + for await (const page of client + .listProjectsByWorkspace(workspace) + .iteratePages()) { + const keys = [...page.values!].map(p => p.key!); + setAvailableProjects([...availableProjects, ...keys]); + } + } catch { + setAvailableProjects([]); } } }; @@ -160,15 +167,17 @@ export const BitbucketRepoPicker = (props: { items={projectItems} /> ) : ( - <> - Project - onChange({ project: e.target.value })} - value={project} - onBlur={() => onChangeProject()} - /> - + { + onChange({ project: newValue || '' }); + }} + options={availableProjects} + renderInput={params => } + freeSolo + onBlur={() => onChangeProject()} + autoSelect + /> )} The Project that this repo will belong to From 0aaf020359d48d57074ca259e59d1c47ee96de17 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Fri, 7 Jun 2024 13:15:14 +0200 Subject: [PATCH 184/387] feat: add auto-completion to workspaces and repositories Signed-off-by: Benjamin Janssens --- .../src/BitbucketCloudClient.ts | 10 ++ .../src/models/index.ts | 11 ++ .../RepoUrlPicker/BitbucketRepoPicker.tsx | 133 +++++++++++------- .../fields/RepoUrlPicker/RepoUrlPicker.tsx | 1 + .../RepoUrlPicker/RepoUrlPickerRepoName.tsx | 26 ++-- .../components/fields/RepoUrlPicker/types.ts | 1 + 6 files changed, 124 insertions(+), 58 deletions(-) diff --git a/plugins/bitbucket-cloud-common/src/BitbucketCloudClient.ts b/plugins/bitbucket-cloud-common/src/BitbucketCloudClient.ts index 97d3d0e52e..a06f7425d0 100644 --- a/plugins/bitbucket-cloud-common/src/BitbucketCloudClient.ts +++ b/plugins/bitbucket-cloud-common/src/BitbucketCloudClient.ts @@ -85,6 +85,16 @@ export class BitbucketCloudClient { ); } + listWorkspaces( + options?: FilterAndSortOptions & PartialResponseOptions, + ): WithPagination { + return new WithPagination( + paginationOptions => + this.createUrl('/workspaces', { ...paginationOptions, ...options }), + url => this.getTypeMapped(url), + ); + } + private createUrl(endpoint: string, options?: RequestOptions): URL { const request = new URL(this.config.apiBaseUrl + endpoint); for (const key in options) { diff --git a/plugins/bitbucket-cloud-common/src/models/index.ts b/plugins/bitbucket-cloud-common/src/models/index.ts index ace8ee4939..2cdc143d06 100644 --- a/plugins/bitbucket-cloud-common/src/models/index.ts +++ b/plugins/bitbucket-cloud-common/src/models/index.ts @@ -264,6 +264,17 @@ export namespace Models { values?: Set; } + /** + * A paginated list of workspaces. + * @public + */ + export interface PaginatedWorkspaces extends Paginated { + /** + * The values of the current page. + */ + values?: Set; + } + /** * Object describing a user's role on resources like commits or pull requests. * @public diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx index 75ae840407..a7c2efc75e 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx @@ -17,8 +17,6 @@ import React, { useEffect, useState } from 'react'; import FormControl from '@material-ui/core/FormControl'; import FormHelperText from '@material-ui/core/FormHelperText'; -import Input from '@material-ui/core/Input'; -import InputLabel from '@material-ui/core/InputLabel'; import { Select, SelectItem } from '@backstage/core-components'; import { RepoUrlPickerState } from './types'; import { BitbucketCloudClient } from '@backstage/plugin-bitbucket-cloud-common'; @@ -65,10 +63,8 @@ export const BitbucketRepoPicker = (props: { }, [allowedOwners, host, onChange]); const [client, setClient] = useState(); + const [availableWorkspaces, setAvailableWorkspaces] = useState([]); const [availableProjects, setAvailableProjects] = useState([]); - const [availableRepositories, setAvailableRepositories] = useState( - [], - ); useEffect(() => { if (accessToken) @@ -81,39 +77,78 @@ export const BitbucketRepoPicker = (props: { ); }, [accessToken]); - const onChangeWorkspace = async () => { - if (client) - if (!workspace) { - setAvailableProjects([]); - } else { - try { - for await (const page of client - .listProjectsByWorkspace(workspace) - .iteratePages()) { - const keys = [...page.values!].map(p => p.key!); - setAvailableProjects([...availableProjects, ...keys]); - } - } catch { - setAvailableProjects([]); - } - } - }; + // Update available workspaces when host changes + useEffect(() => { + const updateAvailableWorkspaces = async () => { + if (client) + if (!host) { + setAvailableWorkspaces([]); + } else { + const result: string[] = []; - const onChangeProject = async () => { - if (client && workspace) - if (!project) { - setAvailableRepositories([]); - } else { - for await (const page of client - .listRepositoriesByWorkspace(workspace, { - q: `project.key="${project}"`, - }) - .iteratePages()) { - const keys = [...page.values!].map(p => p.slug!); - setAvailableRepositories([...availableRepositories, ...keys]); + for await (const page of client.listWorkspaces().iteratePages()) { + const keys = [...page.values!].map(p => p.slug!); + result.push(...keys); + } + + setAvailableWorkspaces(result); } - } - }; + }; + + updateAvailableWorkspaces(); + }, [client, host]); + + // Update available repositories when workspace or project changes + useEffect(() => { + const updateAvailableRepositories = async () => { + if (client && workspace) + if (!project) { + onChange({ availableRepos: [] }); + } else { + const availableRepos: string[] = []; + + for await (const page of client + .listRepositoriesByWorkspace(workspace, { + q: `project.key="${project}"`, + }) + .iteratePages()) { + const keys = [...page.values!].map(p => p.slug!); + availableRepos.push(...keys); + } + + onChange({ availableRepos }); + } + }; + + updateAvailableRepositories(); + }, [client, workspace, project, onChange]); + + // Update available projects when workspace changes + useEffect(() => { + const updateAvailableProjects = async () => { + if (client) + if (!workspace) { + setAvailableProjects([]); + } else { + try { + const result: string[] = []; + + for await (const page of client + .listProjectsByWorkspace(workspace) + .iteratePages()) { + const keys = [...page.values!].map(p => p.key!); + result.push(...keys); + } + + setAvailableProjects(result); + } catch { + setAvailableProjects([]); + } + } + }; + + updateAvailableProjects(); + }, [client, workspace]); return ( <> @@ -135,15 +170,18 @@ export const BitbucketRepoPicker = (props: { items={ownerItems} /> ) : ( - <> - Workspace - onChange({ workspace: e.target.value })} - value={workspace} - onBlur={() => onChangeWorkspace()} - /> - + { + onChange({ workspace: newValue || '' }); + }} + options={availableWorkspaces} + renderInput={params => ( + + )} + freeSolo + autoSelect + /> )} The Workspace that this repo will belong to @@ -173,9 +211,10 @@ export const BitbucketRepoPicker = (props: { onChange({ project: newValue || '' }); }} options={availableProjects} - renderInput={params => } + renderInput={params => ( + + )} freeSolo - onBlur={() => onChangeProject()} autoSelect /> )} diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx index cd749a08a1..e0d714ffda 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx @@ -232,6 +232,7 @@ export const RepoUrlPicker = (props: RepoUrlPickerProps) => { setState(prevState => ({ ...prevState, repoName: repo })) } rawErrors={rawErrors} + availableRepos={state.availableRepos} /> ); diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.tsx index f2d68b08f3..80851b0cbb 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.tsx @@ -17,16 +17,17 @@ import React, { useEffect } from 'react'; import { Select, SelectItem } from '@backstage/core-components'; import FormControl from '@material-ui/core/FormControl'; import FormHelperText from '@material-ui/core/FormHelperText'; -import Input from '@material-ui/core/Input'; -import InputLabel from '@material-ui/core/InputLabel'; +import Autocomplete from '@material-ui/lab/Autocomplete'; +import TextField from '@material-ui/core/TextField'; export const RepoUrlPickerRepoName = (props: { repoName?: string; allowedRepos?: string[]; onChange: (host: string) => void; rawErrors: string[]; + availableRepos?: string[]; }) => { - const { repoName, allowedRepos, onChange, rawErrors } = props; + const { repoName, allowedRepos, onChange, rawErrors, availableRepos } = props; useEffect(() => { // If there is no repoName chosen currently @@ -61,14 +62,17 @@ export const RepoUrlPickerRepoName = (props: { items={repoItems} /> ) : ( - <> - Repository - onChange(String(e.target.value))} - value={repoName} - /> - + { + onChange(newValue || ''); + }} + options={availableRepos || []} + renderInput={params => ( + + )} + freeSolo + /> )} The name of the repository diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/types.ts b/plugins/scaffolder/src/components/fields/RepoUrlPicker/types.ts index 5e979e789e..1430b10b84 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/types.ts +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/types.ts @@ -20,4 +20,5 @@ export interface RepoUrlPickerState { organization?: string; workspace?: string; project?: string; + availableRepos?: string[]; } From c9af3ea5e2d8d377c2ea68f9a1de9b283923a10d Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Fri, 7 Jun 2024 13:44:37 +0200 Subject: [PATCH 185/387] test: add tests for BitbucketCloudClient Signed-off-by: Benjamin Janssens --- .../src/BitbucketCloudClient.test.ts | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/plugins/bitbucket-cloud-common/src/BitbucketCloudClient.test.ts b/plugins/bitbucket-cloud-common/src/BitbucketCloudClient.test.ts index c5c0d604be..92e3261410 100644 --- a/plugins/bitbucket-cloud-common/src/BitbucketCloudClient.test.ts +++ b/plugins/bitbucket-cloud-common/src/BitbucketCloudClient.test.ts @@ -107,4 +107,59 @@ describe('BitbucketCloudClient', () => { expect(results).toHaveLength(1); expect(results[0].slug).toEqual('repo1'); }); + + it('listProjectsByWorkspace', async () => { + server.use( + rest.get( + 'https://api.bitbucket.org/2.0/workspaces/ws/projects', + (_, res, ctx) => { + const response = { + values: [ + { + type: 'repository', + slug: 'project1', + } as Models.Project, + ], + }; + return res(ctx.json(response)); + }, + ), + ); + + const pagination = client.listProjectsByWorkspace('ws'); + + const results = []; + for await (const result of pagination.iterateResults()) { + results.push(result); + } + + expect(results).toHaveLength(1); + expect(results[0].slug).toEqual('project1'); + }); + + it('listWorkspaces', async () => { + server.use( + rest.get('https://api.bitbucket.org/2.0/workspaces', (_, res, ctx) => { + const response = { + values: [ + { + type: 'workspace', + slug: 'workspace1', + } as Models.Workspace, + ], + }; + return res(ctx.json(response)); + }), + ); + + const pagination = client.listWorkspaces(); + + const results = []; + for await (const result of pagination.iterateResults()) { + results.push(result); + } + + expect(results).toHaveLength(1); + expect(results[0].slug).toEqual('workspace1'); + }); }); From 0c5a38e854f37125c33cf8554929ba2062b7fe37 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Fri, 7 Jun 2024 15:48:34 +0200 Subject: [PATCH 186/387] fix: use onInputChange and useDebounce Signed-off-by: Benjamin Janssens --- .../RepoUrlPicker/BitbucketRepoPicker.tsx | 111 ++++++++++-------- .../RepoUrlPicker/RepoUrlPickerRepoName.tsx | 2 +- 2 files changed, 61 insertions(+), 52 deletions(-) diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx index a7c2efc75e..abbbe7a8e4 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx @@ -22,6 +22,7 @@ import { RepoUrlPickerState } from './types'; import { BitbucketCloudClient } from '@backstage/plugin-bitbucket-cloud-common'; import Autocomplete from '@material-ui/lab/Autocomplete'; import TextField from '@material-ui/core/TextField'; +import useDebounce from 'react-use/esm/useDebounce'; /** * The underlying component that is rendered in the form for the `BitbucketRepoPicker` @@ -78,59 +79,67 @@ export const BitbucketRepoPicker = (props: { }, [accessToken]); // Update available workspaces when host changes - useEffect(() => { - const updateAvailableWorkspaces = async () => { - if (client) - if (!host) { - setAvailableWorkspaces([]); - } else { - const result: string[] = []; + useDebounce( + () => { + const updateAvailableWorkspaces = async () => { + if (client) + if (!host) { + setAvailableWorkspaces([]); + } else { + const result: string[] = []; - for await (const page of client.listWorkspaces().iteratePages()) { - const keys = [...page.values!].map(p => p.slug!); - result.push(...keys); + for await (const page of client.listWorkspaces().iteratePages()) { + const keys = [...page.values!].map(p => p.slug!); + result.push(...keys); + } + + setAvailableWorkspaces(result); } + }; - setAvailableWorkspaces(result); - } - }; - - updateAvailableWorkspaces(); - }, [client, host]); + updateAvailableWorkspaces(); + }, + 500, + [client, host], + ); // Update available repositories when workspace or project changes - useEffect(() => { - const updateAvailableRepositories = async () => { - if (client && workspace) - if (!project) { - onChange({ availableRepos: [] }); - } else { - const availableRepos: string[] = []; + useDebounce( + () => { + const updateAvailableRepositories = async () => { + if (client && workspace) + if (!project) { + onChange({ availableRepos: [] }); + } else { + const availableRepos: string[] = []; - for await (const page of client - .listRepositoriesByWorkspace(workspace, { - q: `project.key="${project}"`, - }) - .iteratePages()) { - const keys = [...page.values!].map(p => p.slug!); - availableRepos.push(...keys); + for await (const page of client + .listRepositoriesByWorkspace(workspace, { + q: `project.key="${project}"`, + }) + .iteratePages()) { + const keys = [...page.values!].map(p => p.slug!); + availableRepos.push(...keys); + } + + onChange({ availableRepos }); } + }; - onChange({ availableRepos }); - } - }; - - updateAvailableRepositories(); - }, [client, workspace, project, onChange]); + updateAvailableRepositories(); + }, + 500, + [client, workspace, project, onChange], + ); // Update available projects when workspace changes - useEffect(() => { - const updateAvailableProjects = async () => { - if (client) - if (!workspace) { - setAvailableProjects([]); - } else { - try { + useDebounce( + () => { + const updateAvailableProjects = async () => { + if (client) + if (!workspace) { + setAvailableProjects([]); + } else { const result: string[] = []; for await (const page of client @@ -141,14 +150,14 @@ export const BitbucketRepoPicker = (props: { } setAvailableProjects(result); - } catch { - setAvailableProjects([]); } - } - }; + }; - updateAvailableProjects(); - }, [client, workspace]); + updateAvailableProjects(); + }, + 500, + [client, workspace], + ); return ( <> @@ -172,7 +181,7 @@ export const BitbucketRepoPicker = (props: { ) : ( { + onInputChange={(_, newValue) => { onChange({ workspace: newValue || '' }); }} options={availableWorkspaces} @@ -207,7 +216,7 @@ export const BitbucketRepoPicker = (props: { ) : ( { + onInputChange={(_, newValue) => { onChange({ project: newValue || '' }); }} options={availableProjects} diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.tsx index 80851b0cbb..0dcff7e6fc 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.tsx @@ -64,7 +64,7 @@ export const RepoUrlPickerRepoName = (props: { ) : ( { + onInputChange={(_, newValue) => { onChange(newValue || ''); }} options={availableRepos || []} From be26d90de13b2aaca2e52417247dab18ffd494d0 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Fri, 7 Jun 2024 15:52:45 +0200 Subject: [PATCH 187/387] fix: improve error handling Signed-off-by: Benjamin Janssens --- .../RepoUrlPicker/BitbucketRepoPicker.tsx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx index abbbe7a8e4..3bcb94d2f6 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx @@ -97,7 +97,11 @@ export const BitbucketRepoPicker = (props: { } }; - updateAvailableWorkspaces(); + try { + updateAvailableWorkspaces(); + } catch { + setAvailableWorkspaces([]); + } }, 500, [client, host], @@ -126,7 +130,11 @@ export const BitbucketRepoPicker = (props: { } }; - updateAvailableRepositories(); + try { + updateAvailableRepositories(); + } catch { + onChange({ availableRepos: [] }); + } }, 500, [client, workspace, project, onChange], @@ -153,7 +161,11 @@ export const BitbucketRepoPicker = (props: { } }; - updateAvailableProjects(); + try { + updateAvailableProjects(); + } catch { + setAvailableProjects([]); + } }, 500, [client, workspace], From f0781a53940ba3942a8fe81af0d6db0e4b699c57 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Fri, 7 Jun 2024 16:46:36 +0200 Subject: [PATCH 188/387] fix: make error handling work; add tests for RepoUrlPickerRepoName Signed-off-by: Benjamin Janssens --- .../RepoUrlPicker/BitbucketRepoPicker.tsx | 20 ++++--------- .../RepoUrlPickerRepoName.test.tsx | 28 +++++++++++++++++++ 2 files changed, 33 insertions(+), 15 deletions(-) diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx index 3bcb94d2f6..a56e1ad9ad 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx @@ -97,11 +97,7 @@ export const BitbucketRepoPicker = (props: { } }; - try { - updateAvailableWorkspaces(); - } catch { - setAvailableWorkspaces([]); - } + updateAvailableWorkspaces().catch(() => setAvailableWorkspaces([])); }, 500, [client, host], @@ -130,11 +126,9 @@ export const BitbucketRepoPicker = (props: { } }; - try { - updateAvailableRepositories(); - } catch { - onChange({ availableRepos: [] }); - } + updateAvailableRepositories().catch(() => + onChange({ availableRepos: [] }), + ); }, 500, [client, workspace, project, onChange], @@ -161,11 +155,7 @@ export const BitbucketRepoPicker = (props: { } }; - try { - updateAvailableProjects(); - } catch { - setAvailableProjects([]); - } + updateAvailableProjects().catch(() => setAvailableProjects([])); }, 500, [client, workspace], diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.test.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.test.tsx index 4c392d646c..8228f443df 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.test.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.test.tsx @@ -16,6 +16,7 @@ import React from 'react'; import { RepoUrlPickerRepoName } from './RepoUrlPickerRepoName'; import { render, fireEvent } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; describe('RepoUrlPickerRepoName', () => { it('should call onChange with the first allowed repo if there is none set already', async () => { @@ -73,4 +74,31 @@ describe('RepoUrlPickerRepoName', () => { expect(onChange).toHaveBeenCalledWith('foo'); }); + + it('should autocomplete with provided availableRepos', async () => { + const availableRepos = ['foo', 'bar']; + + const onChange = jest.fn(); + + const { getByRole, getByText } = render( + , + ); + + // Open the Autocomplete dropdown + const input = getByRole('textbox'); + await userEvent.click(input); + + // Verify that available repos are shown + for (const repo of availableRepos) { + expect(getByText(repo)).toBeInTheDocument(); + } + + // Verify that selecting an option calls onChange + await userEvent.click(getByText('foo')); + expect(onChange).toHaveBeenCalledWith('foo'); + }); }); From f78b919bf093fd3f1d462f61c587a018b88878bd Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Mon, 10 Jun 2024 13:10:44 +0200 Subject: [PATCH 189/387] test: add tests for BitbucketRepoPicker Signed-off-by: Benjamin Janssens --- .../src/BitbucketCloudClient.test.ts | 2 +- .../BitbucketRepoPicker.test.tsx | 133 +++++++++++++++++- .../RepoUrlPicker/BitbucketRepoPicker.tsx | 54 +++---- 3 files changed, 160 insertions(+), 29 deletions(-) diff --git a/plugins/bitbucket-cloud-common/src/BitbucketCloudClient.test.ts b/plugins/bitbucket-cloud-common/src/BitbucketCloudClient.test.ts index 92e3261410..f625f0daf8 100644 --- a/plugins/bitbucket-cloud-common/src/BitbucketCloudClient.test.ts +++ b/plugins/bitbucket-cloud-common/src/BitbucketCloudClient.test.ts @@ -116,7 +116,7 @@ describe('BitbucketCloudClient', () => { const response = { values: [ { - type: 'repository', + type: 'project', slug: 'project1', } as Models.Project, ], diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx index f799d68c2d..9dae5b24a6 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx @@ -16,7 +16,13 @@ import React from 'react'; import { BitbucketRepoPicker } from './BitbucketRepoPicker'; -import { render, fireEvent } from '@testing-library/react'; +import { render, fireEvent, waitFor } from '@testing-library/react'; +import { setupServer } from 'msw/node'; +import { rest } from 'msw'; +import { Models } from '@backstage/plugin-bitbucket-cloud-common'; +import userEvent from '@testing-library/user-event'; + +const server = setupServer(); describe('BitbucketRepoPicker', () => { it('renders a select if there is a list of allowed owners', async () => { @@ -136,4 +142,129 @@ describe('BitbucketRepoPicker', () => { expect(await findByText('project2')).toBeInTheDocument(); }); }); + + describe('autocompletion', () => { + beforeAll(() => server.listen({ onUnhandledRequest: 'error' })); + beforeEach(() => { + // BitbucketCloudClient.listWorkspaces() + server.use( + rest.get('https://api.bitbucket.org/2.0/workspaces', (_, res, ctx) => { + const response = { + values: [ + { + type: 'workspace', + slug: 'workspace1', + } as Models.Workspace, + ], + }; + return res(ctx.json(response)); + }), + ); + + // BitbucketCloudClient.listProjectsByWorkspace() + server.use( + rest.get( + 'https://api.bitbucket.org/2.0/workspaces/workspace1/projects', + (_, res, ctx) => { + const response = { + values: [ + { + type: 'project', + key: 'project1', + } as Models.Project, + ], + }; + return res(ctx.json(response)); + }, + ), + ); + + // BitbucketCloudClient.listRepositoriesByWorkspace() + server.use( + rest.get( + 'https://api.bitbucket.org/2.0/repositories/workspace1', + (_, res, ctx) => { + const response = { + values: [ + { + type: 'repository', + slug: 'repo1', + } as Models.Repository, + ], + }; + return res(ctx.json(response)); + }, + ), + ); + }); + afterAll(() => server.close()); + afterEach(() => server.resetHandlers()); + + it('should populate workspaces if host is set and accessToken is provided', async () => { + const onChange = jest.fn(); + const { getAllByRole, getByText } = render( + , + ); + + // Open the Autcomplete dropdown + const workspaceInput = getAllByRole('textbox')[0]; + await userEvent.click(workspaceInput); + + // Verify that the available workspaces are shown + await waitFor(() => expect(getByText('workspace1')).toBeInTheDocument()); + + // Verify that selecting an option calls onChange + await userEvent.click(getByText('workspace1')); + expect(onChange).toHaveBeenCalledWith({ workspace: 'workspace1' }); + }); + + it('should populate projects if host and workspace are set and accessToken is provided', async () => { + const onChange = jest.fn(); + const { getAllByRole, getByText } = render( + , + ); + + // Open the Autcomplete dropdown + const projectInput = getAllByRole('textbox')[1]; + await userEvent.click(projectInput); + + // Verify that the available projects are shown + await waitFor(() => expect(getByText('project1')).toBeInTheDocument()); + + // Verify that selecting an option calls onChange + await userEvent.click(getByText('project1')); + expect(onChange).toHaveBeenCalledWith({ project: 'project1' }); + }); + + it('should populate repositories if host, workspace and project are set and accessToken is provided', async () => { + const onChange = jest.fn(); + render( + , + ); + + // Verify that the available repos are updated + await waitFor(() => + expect(onChange).toHaveBeenCalledWith({ availableRepos: ['repo1'] }), + ); + }); + }); }); diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx index a56e1ad9ad..67e82abc3f 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx @@ -103,6 +103,33 @@ export const BitbucketRepoPicker = (props: { [client, host], ); + // Update available projects when workspace changes + useDebounce( + () => { + const updateAvailableProjects = async () => { + if (client) + if (!workspace) { + setAvailableProjects([]); + } else { + const result: string[] = []; + + for await (const page of client + .listProjectsByWorkspace(workspace) + .iteratePages()) { + const keys = [...page.values!].map(p => p.key!); + result.push(...keys); + } + + setAvailableProjects(result); + } + }; + + updateAvailableProjects().catch(() => setAvailableProjects([])); + }, + 500, + [client, workspace], + ); + // Update available repositories when workspace or project changes useDebounce( () => { @@ -134,33 +161,6 @@ export const BitbucketRepoPicker = (props: { [client, workspace, project, onChange], ); - // Update available projects when workspace changes - useDebounce( - () => { - const updateAvailableProjects = async () => { - if (client) - if (!workspace) { - setAvailableProjects([]); - } else { - const result: string[] = []; - - for await (const page of client - .listProjectsByWorkspace(workspace) - .iteratePages()) { - const keys = [...page.values!].map(p => p.key!); - result.push(...keys); - } - - setAvailableProjects(result); - } - }; - - updateAvailableProjects().catch(() => setAvailableProjects([])); - }, - 500, - [client, workspace], - ); - return ( <> {host === 'bitbucket.org' && ( From da3db7945a699f77ff64ff27ffbc5e03dcceb877 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Mon, 10 Jun 2024 13:47:00 +0200 Subject: [PATCH 190/387] chore: clean up some code Signed-off-by: Benjamin Janssens --- .../RepoUrlPicker/BitbucketRepoPicker.tsx | 80 +++++++++---------- 1 file changed, 38 insertions(+), 42 deletions(-) diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx index 67e82abc3f..5361b99b01 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx @@ -1,4 +1,3 @@ -/* eslint-disable no-restricted-syntax */ /* * Copyright 2021 The Backstage Authors * @@ -82,19 +81,18 @@ export const BitbucketRepoPicker = (props: { useDebounce( () => { const updateAvailableWorkspaces = async () => { - if (client) - if (!host) { - setAvailableWorkspaces([]); - } else { - const result: string[] = []; + if (client && host) { + const result: string[] = []; - for await (const page of client.listWorkspaces().iteratePages()) { - const keys = [...page.values!].map(p => p.slug!); - result.push(...keys); - } - - setAvailableWorkspaces(result); + for await (const page of client.listWorkspaces().iteratePages()) { + const keys = [...page.values!].map(p => p.slug!); + result.push(...keys); } + + setAvailableWorkspaces(result); + } else { + setAvailableWorkspaces([]); + } }; updateAvailableWorkspaces().catch(() => setAvailableWorkspaces([])); @@ -107,21 +105,20 @@ export const BitbucketRepoPicker = (props: { useDebounce( () => { const updateAvailableProjects = async () => { - if (client) - if (!workspace) { - setAvailableProjects([]); - } else { - const result: string[] = []; + if (client && workspace) { + const result: string[] = []; - for await (const page of client - .listProjectsByWorkspace(workspace) - .iteratePages()) { - const keys = [...page.values!].map(p => p.key!); - result.push(...keys); - } - - setAvailableProjects(result); + for await (const page of client + .listProjectsByWorkspace(workspace) + .iteratePages()) { + const keys = [...page.values!].map(p => p.key!); + result.push(...keys); } + + setAvailableProjects(result); + } else { + setAvailableProjects([]); + } }; updateAvailableProjects().catch(() => setAvailableProjects([])); @@ -134,23 +131,22 @@ export const BitbucketRepoPicker = (props: { useDebounce( () => { const updateAvailableRepositories = async () => { - if (client && workspace) - if (!project) { - onChange({ availableRepos: [] }); - } else { - const availableRepos: string[] = []; + if (client && workspace && project) { + const availableRepos: string[] = []; - for await (const page of client - .listRepositoriesByWorkspace(workspace, { - q: `project.key="${project}"`, - }) - .iteratePages()) { - const keys = [...page.values!].map(p => p.slug!); - availableRepos.push(...keys); - } - - onChange({ availableRepos }); + for await (const page of client + .listRepositoriesByWorkspace(workspace, { + q: `project.key="${project}"`, + }) + .iteratePages()) { + const keys = [...page.values!].map(p => p.slug!); + availableRepos.push(...keys); } + + onChange({ availableRepos }); + } else { + onChange({ availableRepos: [] }); + } }; updateAvailableRepositories().catch(() => @@ -184,7 +180,7 @@ export const BitbucketRepoPicker = (props: { { - onChange({ workspace: newValue || '' }); + onChange({ workspace: String(newValue) }); }} options={availableWorkspaces} renderInput={params => ( @@ -219,7 +215,7 @@ export const BitbucketRepoPicker = (props: { { - onChange({ project: newValue || '' }); + onChange({ project: String(newValue) }); }} options={availableProjects} renderInput={params => ( From 7bc44a99e6df85e22017e4bdb723beb1d9e30901 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Mon, 10 Jun 2024 14:25:51 +0200 Subject: [PATCH 191/387] chore: make client dependent on host Signed-off-by: Benjamin Janssens --- .../RepoUrlPicker/BitbucketRepoPicker.tsx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx index 5361b99b01..72c39fb11c 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx @@ -67,21 +67,24 @@ export const BitbucketRepoPicker = (props: { const [availableProjects, setAvailableProjects] = useState([]); useEffect(() => { - if (accessToken) + if (host === 'bitbucket.org' && accessToken) { setClient( BitbucketCloudClient.fromConfig({ - host: 'bitbucket.org', + host, apiBaseUrl: 'https://api.bitbucket.org/2.0', accessToken, }), ); - }, [accessToken]); + } else { + setClient(undefined); + } + }, [host, accessToken]); - // Update available workspaces when host changes + // Update available workspaces when client is available useDebounce( () => { const updateAvailableWorkspaces = async () => { - if (client && host) { + if (client) { const result: string[] = []; for await (const page of client.listWorkspaces().iteratePages()) { @@ -98,10 +101,10 @@ export const BitbucketRepoPicker = (props: { updateAvailableWorkspaces().catch(() => setAvailableWorkspaces([])); }, 500, - [client, host], + [client], ); - // Update available projects when workspace changes + // Update available projects when client is available and workspace changes useDebounce( () => { const updateAvailableProjects = async () => { @@ -127,7 +130,7 @@ export const BitbucketRepoPicker = (props: { [client, workspace], ); - // Update available repositories when workspace or project changes + // Update available repositories when client is available and workspace or project changes useDebounce( () => { const updateAvailableRepositories = async () => { From 2127b5ef04c87ea25b31dd9ee47a0723db3243b6 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Mon, 10 Jun 2024 14:44:40 +0200 Subject: [PATCH 192/387] chore: update API reports Signed-off-by: Benjamin Janssens --- packages/integration/api-report.md | 1 + plugins/bitbucket-cloud-common/api-report.md | 15 +++++++++++++++ .../RepoUrlPicker/RepoUrlPickerRepoName.tsx | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/integration/api-report.md b/packages/integration/api-report.md index f9a8426cf5..91abc7473f 100644 --- a/packages/integration/api-report.md +++ b/packages/integration/api-report.md @@ -186,6 +186,7 @@ export type BitbucketCloudIntegrationConfig = { apiBaseUrl: string; username?: string; appPassword?: string; + accessToken?: string; }; // @public @deprecated diff --git a/plugins/bitbucket-cloud-common/api-report.md b/plugins/bitbucket-cloud-common/api-report.md index 0f4e82d5d1..34c245facc 100644 --- a/plugins/bitbucket-cloud-common/api-report.md +++ b/plugins/bitbucket-cloud-common/api-report.md @@ -12,11 +12,20 @@ export class BitbucketCloudClient { config: BitbucketCloudIntegrationConfig, ): BitbucketCloudClient; // (undocumented) + listProjectsByWorkspace( + workspace: string, + options?: FilterAndSortOptions & PartialResponseOptions, + ): WithPagination; + // (undocumented) listRepositoriesByWorkspace( workspace: string, options?: FilterAndSortOptions & PartialResponseOptions, ): WithPagination; // (undocumented) + listWorkspaces( + options?: FilterAndSortOptions & PartialResponseOptions, + ): WithPagination; + // (undocumented) searchCode( workspace: string, query: string, @@ -200,9 +209,15 @@ export namespace Models { size?: number; values?: Array | Set; } + export interface PaginatedProjects extends Paginated { + values?: Set; + } export interface PaginatedRepositories extends Paginated { values?: Set; } + export interface PaginatedWorkspaces extends Paginated { + values?: Set; + } export interface Participant extends ModelObject { // (undocumented) approved?: boolean; diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.tsx index 0dcff7e6fc..cd346cf8ed 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.tsx @@ -65,7 +65,7 @@ export const RepoUrlPickerRepoName = (props: { { - onChange(newValue || ''); + onChange(String(newValue)); }} options={availableRepos || []} renderInput={params => ( From 0757000fad2a3ab99efd5811d7a8b428f883b6cf Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Tue, 11 Jun 2024 12:09:58 +0200 Subject: [PATCH 193/387] chore: add changesets for plugin-bitbucket-cloud-common Signed-off-by: Benjamin Janssens --- .changeset/five-forks-retire.md | 5 +++++ .changeset/great-colts-enjoy.md | 5 +++++ .changeset/rare-planes-switch.md | 5 +++++ 3 files changed, 15 insertions(+) create mode 100644 .changeset/five-forks-retire.md create mode 100644 .changeset/great-colts-enjoy.md create mode 100644 .changeset/rare-planes-switch.md diff --git a/.changeset/five-forks-retire.md b/.changeset/five-forks-retire.md new file mode 100644 index 0000000000..9b9573bfd4 --- /dev/null +++ b/.changeset/five-forks-retire.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-bitbucket-cloud-common': patch +--- + +Added support for access tokens diff --git a/.changeset/great-colts-enjoy.md b/.changeset/great-colts-enjoy.md new file mode 100644 index 0000000000..6907f661a5 --- /dev/null +++ b/.changeset/great-colts-enjoy.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-bitbucket-cloud-common': patch +--- + +Added method `listProjectsByWorkspace` for retrieving projects by workspace diff --git a/.changeset/rare-planes-switch.md b/.changeset/rare-planes-switch.md new file mode 100644 index 0000000000..622c6d48d8 --- /dev/null +++ b/.changeset/rare-planes-switch.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-bitbucket-cloud-common': patch +--- + +Added method `listWorkspaces` for retrieving workspaces From 5ecb6bc94258b91e2c75deea499881588dc039b1 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Tue, 11 Jun 2024 12:11:28 +0200 Subject: [PATCH 194/387] chore: add changesets for @backstage/integration Signed-off-by: Benjamin Janssens --- .changeset/nine-seals-sit.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/nine-seals-sit.md diff --git a/.changeset/nine-seals-sit.md b/.changeset/nine-seals-sit.md new file mode 100644 index 0000000000..5ec46e30b3 --- /dev/null +++ b/.changeset/nine-seals-sit.md @@ -0,0 +1,5 @@ +--- +'@backstage/integration': patch +--- + +Added support for access tokens to Bitbucket Cloud From 973ff9b74b51d64a075dc4c5874a4bb7fa023669 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Tue, 11 Jun 2024 12:13:29 +0200 Subject: [PATCH 195/387] chore: add changesets for @backstage/plugin-scaffolder Signed-off-by: Benjamin Janssens --- .changeset/angry-ladybugs-retire.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/angry-ladybugs-retire.md diff --git a/.changeset/angry-ladybugs-retire.md b/.changeset/angry-ladybugs-retire.md new file mode 100644 index 0000000000..eb6e8a5932 --- /dev/null +++ b/.changeset/angry-ladybugs-retire.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder': patch +--- + +Added autocompletion for Bitbucket Cloud From d79cd670cca8fe1f28a84a8d91828e8482581b8e Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Tue, 11 Jun 2024 12:25:43 +0200 Subject: [PATCH 196/387] chore: set changesets for @backstage/plugin-scaffolder and @backstage/integration to minor Signed-off-by: Benjamin Janssens --- .changeset/angry-ladybugs-retire.md | 2 +- .changeset/nine-seals-sit.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/angry-ladybugs-retire.md b/.changeset/angry-ladybugs-retire.md index eb6e8a5932..ca2b34676b 100644 --- a/.changeset/angry-ladybugs-retire.md +++ b/.changeset/angry-ladybugs-retire.md @@ -1,5 +1,5 @@ --- -'@backstage/plugin-scaffolder': patch +'@backstage/plugin-scaffolder': minor --- Added autocompletion for Bitbucket Cloud diff --git a/.changeset/nine-seals-sit.md b/.changeset/nine-seals-sit.md index 5ec46e30b3..0055a1be24 100644 --- a/.changeset/nine-seals-sit.md +++ b/.changeset/nine-seals-sit.md @@ -1,5 +1,5 @@ --- -'@backstage/integration': patch +'@backstage/integration': minor --- Added support for access tokens to Bitbucket Cloud From 21ddf605221eb3109cdf795bae1e2b1bfdaa11c1 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Thu, 13 Jun 2024 11:51:57 +0200 Subject: [PATCH 197/387] feat: add endpoint for bitbucket autocomplete in scaffolder Signed-off-by: Benjamin Janssens --- plugins/scaffolder-backend/package.json | 1 + .../src/service/autocomplete.ts | 79 +++++++++++++++++++ .../scaffolder-backend/src/service/router.ts | 24 ++++++ yarn.lock | 1 + 4 files changed, 105 insertions(+) create mode 100644 plugins/scaffolder-backend/src/service/autocomplete.ts diff --git a/plugins/scaffolder-backend/package.json b/plugins/scaffolder-backend/package.json index 4060529421..af6625c8b8 100644 --- a/plugins/scaffolder-backend/package.json +++ b/plugins/scaffolder-backend/package.json @@ -70,6 +70,7 @@ "@backstage/errors": "workspace:^", "@backstage/integration": "workspace:^", "@backstage/plugin-auth-node": "workspace:^", + "@backstage/plugin-bitbucket-cloud-common": "workspace:^", "@backstage/plugin-catalog-backend-module-scaffolder-entity-model": "workspace:^", "@backstage/plugin-catalog-node": "workspace:^", "@backstage/plugin-permission-common": "workspace:^", diff --git a/plugins/scaffolder-backend/src/service/autocomplete.ts b/plugins/scaffolder-backend/src/service/autocomplete.ts new file mode 100644 index 0000000000..034a201450 --- /dev/null +++ b/plugins/scaffolder-backend/src/service/autocomplete.ts @@ -0,0 +1,79 @@ +/* + * Copyright 2024 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 { InputError } from '@backstage/errors'; +import { BitbucketCloudClient } from '@backstage/plugin-bitbucket-cloud-common'; + +export async function handleBitbucketCloudRequest( + token: string, + resource: string, + parameters: Record, +): Promise { + const client = BitbucketCloudClient.fromConfig({ + host: 'bitbucket.org', + apiBaseUrl: 'https://api.bitbucket.org/2.0', + accessToken: token, + }); + + switch (resource) { + case 'workspaces': { + const result: string[] = []; + + for await (const page of client.listWorkspaces().iteratePages()) { + const slugs = [...page.values!].map(p => p.slug!); + result.push(...slugs); + } + + return result; + } + case 'projects': { + if (!parameters.workspace) + throw new InputError('Missing workspace query parameter'); + + const result: string[] = []; + + for await (const page of client + .listProjectsByWorkspace(parameters.workspace) + .iteratePages()) { + const keys = [...page.values!].map(p => p.key!); + result.push(...keys); + } + + return result; + } + case 'repositories': { + if (!parameters.workspace || !parameters.project) + throw new InputError( + 'Missing workspace and/or project query parameter', + ); + + const result: string[] = []; + + for await (const page of client + .listRepositoriesByWorkspace(parameters.workspace, { + q: `project.key="${parameters.project}"`, + }) + .iteratePages()) { + const slugs = [...page.values!].map(p => p.slug!); + result.push(...slugs); + } + + return result; + } + default: + throw new InputError(`Invalid resource: ${resource}`); + } +} diff --git a/plugins/scaffolder-backend/src/service/router.ts b/plugins/scaffolder-backend/src/service/router.ts index 384b9f5340..dbccd6ddb5 100644 --- a/plugins/scaffolder-backend/src/service/router.ts +++ b/plugins/scaffolder-backend/src/service/router.ts @@ -94,6 +94,7 @@ import { } from '@backstage/plugin-auth-node'; import { InternalTaskSecrets } from '../scaffolder/tasks/types'; import { checkPermission } from '../util/checkPermissions'; +import { handleBitbucketCloudRequest } from './autocomplete'; /** * @@ -771,6 +772,29 @@ export async function createRouter( base64Content: file.content.toString('base64'), })), }); + }) + .get('/v2/autocomplete/:provider/:resource', async (req, res) => { + const { token, ...query } = req.query; + const { provider, resource } = req.params; + + if (!token) throw new InputError('Missing token query parameter'); + + let result: string[]; + + switch (provider) { + case 'bitbucketCloud': { + result = await handleBitbucketCloudRequest( + token as string, + resource, + query as Record, + ); + break; + } + default: + throw new InputError(`Unsupported provider: ${provider}`); + } + + res.status(200).json(result); }); const app = express(); diff --git a/yarn.lock b/yarn.lock index 1719070c2f..7f44f1559c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7093,6 +7093,7 @@ __metadata: "@backstage/errors": "workspace:^" "@backstage/integration": "workspace:^" "@backstage/plugin-auth-node": "workspace:^" + "@backstage/plugin-bitbucket-cloud-common": "workspace:^" "@backstage/plugin-catalog-backend-module-scaffolder-entity-model": "workspace:^" "@backstage/plugin-catalog-node": "workspace:^" "@backstage/plugin-permission-common": "workspace:^" From 28c991d6e471eed1d73f679a4bb227b564b0d0ab Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Thu, 13 Jun 2024 12:53:50 +0200 Subject: [PATCH 198/387] test: add tests for autocomplete endpoint Signed-off-by: Benjamin Janssens --- .../src/service/router.test.ts | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/plugins/scaffolder-backend/src/service/router.test.ts b/plugins/scaffolder-backend/src/service/router.test.ts index 8ba26c68a4..0024a57bd9 100644 --- a/plugins/scaffolder-backend/src/service/router.test.ts +++ b/plugins/scaffolder-backend/src/service/router.test.ts @@ -46,6 +46,7 @@ import { PermissionEvaluator, } from '@backstage/plugin-permission-common'; import { mockCredentials, mockServices } from '@backstage/backend-test-utils'; +import { handleBitbucketCloudRequest } from './autocomplete'; const mockAccess = jest.fn(); @@ -62,6 +63,10 @@ jest.mock('fs-extra', () => ({ remove: jest.fn(), })); +jest.mock('./autocomplete', () => ({ + handleBitbucketCloudRequest: jest.fn(), +})); + function createDatabase(): PluginDatabaseManager { return DatabaseManager.fromConfig( new ConfigReader({ @@ -1461,5 +1466,22 @@ data: {"id":1,"taskId":"a-random-id","type":"completion","createdAt":"","body":{ expect(subscriber!.closed).toBe(true); }); }); + + describe('GET /v2/autocomplete/:provider/:resource', () => { + it('should handle requests for provider bitbucketCloud', async () => { + const bbToken = 'foo'; + const resource = 'bar'; + + await request(app) + .get(`/v2/autocomplete/bitbucketCloud/${resource}?token=${bbToken}`) + .send(); + + expect(jest.mocked(handleBitbucketCloudRequest)).toHaveBeenCalledWith( + bbToken, + resource, + {}, + ); + }); + }); }); }); From 8a03156d9165f3747eae3d9b8a19105c7b12606e Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Thu, 13 Jun 2024 14:58:38 +0200 Subject: [PATCH 199/387] feat: use autocomplete endpoint in frontend Signed-off-by: Benjamin Janssens --- plugins/scaffolder-react/src/api/types.ts | 7 + .../components/Workflow/Workflow.test.tsx | 1 + plugins/scaffolder/package.json | 1 - plugins/scaffolder/src/api.ts | 24 ++ .../BitbucketRepoPicker.test.tsx | 240 +++++++++--------- .../RepoUrlPicker/BitbucketRepoPicker.tsx | 73 ++---- .../TemplateWizardPage.test.tsx | 1 + yarn.lock | 1 - 8 files changed, 175 insertions(+), 173 deletions(-) diff --git a/plugins/scaffolder-react/src/api/types.ts b/plugins/scaffolder-react/src/api/types.ts index b4a3deea54..c79f98c780 100644 --- a/plugins/scaffolder-react/src/api/types.ts +++ b/plugins/scaffolder-react/src/api/types.ts @@ -229,4 +229,11 @@ export interface ScaffolderApi { streamLogs(options: ScaffolderStreamLogsOptions): Observable; dryRun?(options: ScaffolderDryRunOptions): Promise; + + autocomplete( + token: string, + provider: string, + resource: string, + params?: Record, + ): Promise; } diff --git a/plugins/scaffolder-react/src/next/components/Workflow/Workflow.test.tsx b/plugins/scaffolder-react/src/next/components/Workflow/Workflow.test.tsx index 27fde2083f..3a2aa1469f 100644 --- a/plugins/scaffolder-react/src/next/components/Workflow/Workflow.test.tsx +++ b/plugins/scaffolder-react/src/next/components/Workflow/Workflow.test.tsx @@ -36,6 +36,7 @@ const scaffolderApiMock: jest.Mocked = { streamLogs: jest.fn(), listActions: jest.fn(), listTasks: jest.fn(), + autocomplete: jest.fn(), }; const catalogApiMock: jest.Mocked = { getEntityByRef: jest.fn(), diff --git a/plugins/scaffolder/package.json b/plugins/scaffolder/package.json index a17fc14105..d1b58c8eca 100644 --- a/plugins/scaffolder/package.json +++ b/plugins/scaffolder/package.json @@ -67,7 +67,6 @@ "@backstage/frontend-plugin-api": "workspace:^", "@backstage/integration": "workspace:^", "@backstage/integration-react": "workspace:^", - "@backstage/plugin-bitbucket-cloud-common": "workspace:^", "@backstage/plugin-catalog-common": "workspace:^", "@backstage/plugin-catalog-react": "workspace:^", "@backstage/plugin-permission-react": "workspace:^", diff --git a/plugins/scaffolder/src/api.ts b/plugins/scaffolder/src/api.ts index 6ef5fff588..ff5c89e91e 100644 --- a/plugins/scaffolder/src/api.ts +++ b/plugins/scaffolder/src/api.ts @@ -337,4 +337,28 @@ export class ScaffolderClient implements ScaffolderApi { return await response.json(); } + + async autocomplete( + token: string, + provider: string, + resource: string, + params?: Record, + ): Promise { + const baseUrl = await this.discoveryApi.getBaseUrl('scaffolder'); + const query = new URLSearchParams({ + ...params, + token, + }); + const url = `${baseUrl}/v2/autocomplete/${provider}/${resource}?${query}`; + + const response = await this.fetchApi.fetch(url, { + method: 'GET', + }); + + if (!response.ok) { + throw await ResponseError.fromResponse(response); + } + + return await response.json(); + } } diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx index 9dae5b24a6..404fb6ddf6 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx @@ -17,23 +17,33 @@ import React from 'react'; import { BitbucketRepoPicker } from './BitbucketRepoPicker'; import { render, fireEvent, waitFor } from '@testing-library/react'; -import { setupServer } from 'msw/node'; -import { rest } from 'msw'; -import { Models } from '@backstage/plugin-bitbucket-cloud-common'; import userEvent from '@testing-library/user-event'; - -const server = setupServer(); +import { TestApiProvider } from '@backstage/test-utils'; +import { + ScaffolderApi, + scaffolderApiRef, +} from '@backstage/plugin-scaffolder-react'; describe('BitbucketRepoPicker', () => { + const scaffolderApiMock: Partial = { + autocomplete: jest + .fn() + .mockImplementation((_token, _provider, resource) => [ + `${resource}_example`, + ]), + }; + it('renders a select if there is a list of allowed owners', async () => { const allowedOwners = ['owner1', 'owner2']; const { findByText } = render( - , + + + , ); expect(await findByText('owner1')).toBeInTheDocument(); @@ -44,7 +54,13 @@ describe('BitbucketRepoPicker', () => { const state = { host: 'bitbucket.org', workspace: 'lolsWorkspace' }; const { getAllByRole } = render( - , + + + , ); expect(getAllByRole('textbox')).toHaveLength(2); @@ -57,7 +73,13 @@ describe('BitbucketRepoPicker', () => { }; const { getAllByRole } = render( - , + + + , ); expect(getAllByRole('textbox')).toHaveLength(1); @@ -67,11 +89,13 @@ describe('BitbucketRepoPicker', () => { it('calls onChange when the workspace changes', () => { const onChange = jest.fn(); const { getAllByRole } = render( - , + + + , ); const workspaceInput = getAllByRole('textbox')[0]; @@ -86,11 +110,13 @@ describe('BitbucketRepoPicker', () => { it('calls onChange when the project changes', () => { const onChange = jest.fn(); const { getAllByRole } = render( - , + + + , ); const projectInput = getAllByRole('textbox')[1]; @@ -102,11 +128,13 @@ describe('BitbucketRepoPicker', () => { it('Does not render a select if the list of allowed projects does not exist', async () => { const { getAllByRole } = render( - , + + + , ); expect(getAllByRole('textbox')).toHaveLength(2); @@ -115,12 +143,14 @@ describe('BitbucketRepoPicker', () => { it('Does not render a select if the list of allowed projects is empty', async () => { const { getAllByRole } = render( - , + + + , ); expect(getAllByRole('textbox')).toHaveLength(2); @@ -130,12 +160,14 @@ describe('BitbucketRepoPicker', () => { it('Does render a select if there is a list of allowed projects', async () => { const allowedProjects = ['project1', 'project2']; const { findByText } = render( - , + + + , ); expect(await findByText('project1')).toBeInTheDocument(); @@ -144,71 +176,17 @@ describe('BitbucketRepoPicker', () => { }); describe('autocompletion', () => { - beforeAll(() => server.listen({ onUnhandledRequest: 'error' })); - beforeEach(() => { - // BitbucketCloudClient.listWorkspaces() - server.use( - rest.get('https://api.bitbucket.org/2.0/workspaces', (_, res, ctx) => { - const response = { - values: [ - { - type: 'workspace', - slug: 'workspace1', - } as Models.Workspace, - ], - }; - return res(ctx.json(response)); - }), - ); - - // BitbucketCloudClient.listProjectsByWorkspace() - server.use( - rest.get( - 'https://api.bitbucket.org/2.0/workspaces/workspace1/projects', - (_, res, ctx) => { - const response = { - values: [ - { - type: 'project', - key: 'project1', - } as Models.Project, - ], - }; - return res(ctx.json(response)); - }, - ), - ); - - // BitbucketCloudClient.listRepositoriesByWorkspace() - server.use( - rest.get( - 'https://api.bitbucket.org/2.0/repositories/workspace1', - (_, res, ctx) => { - const response = { - values: [ - { - type: 'repository', - slug: 'repo1', - } as Models.Repository, - ], - }; - return res(ctx.json(response)); - }, - ), - ); - }); - afterAll(() => server.close()); - afterEach(() => server.resetHandlers()); - it('should populate workspaces if host is set and accessToken is provided', async () => { const onChange = jest.fn(); const { getAllByRole, getByText } = render( - , + + + , ); // Open the Autcomplete dropdown @@ -216,22 +194,28 @@ describe('BitbucketRepoPicker', () => { await userEvent.click(workspaceInput); // Verify that the available workspaces are shown - await waitFor(() => expect(getByText('workspace1')).toBeInTheDocument()); + await waitFor(() => + expect(getByText('workspaces_example')).toBeInTheDocument(), + ); // Verify that selecting an option calls onChange - await userEvent.click(getByText('workspace1')); - expect(onChange).toHaveBeenCalledWith({ workspace: 'workspace1' }); + await userEvent.click(getByText('workspaces_example')); + expect(onChange).toHaveBeenCalledWith({ + workspace: 'workspaces_example', + }); }); it('should populate projects if host and workspace are set and accessToken is provided', async () => { const onChange = jest.fn(); const { getAllByRole, getByText } = render( - , + + + , ); // Open the Autcomplete dropdown @@ -239,31 +223,37 @@ describe('BitbucketRepoPicker', () => { await userEvent.click(projectInput); // Verify that the available projects are shown - await waitFor(() => expect(getByText('project1')).toBeInTheDocument()); + await waitFor(() => + expect(getByText('projects_example')).toBeInTheDocument(), + ); // Verify that selecting an option calls onChange - await userEvent.click(getByText('project1')); - expect(onChange).toHaveBeenCalledWith({ project: 'project1' }); + await userEvent.click(getByText('projects_example')); + expect(onChange).toHaveBeenCalledWith({ project: 'projects_example' }); }); it('should populate repositories if host, workspace and project are set and accessToken is provided', async () => { const onChange = jest.fn(); render( - , + + + , ); // Verify that the available repos are updated await waitFor(() => - expect(onChange).toHaveBeenCalledWith({ availableRepos: ['repo1'] }), + expect(onChange).toHaveBeenCalledWith({ + availableRepos: ['repositories_example'], + }), ); }); }); diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx index 72c39fb11c..995470fbcb 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx @@ -18,10 +18,11 @@ import FormControl from '@material-ui/core/FormControl'; import FormHelperText from '@material-ui/core/FormHelperText'; import { Select, SelectItem } from '@backstage/core-components'; import { RepoUrlPickerState } from './types'; -import { BitbucketCloudClient } from '@backstage/plugin-bitbucket-cloud-common'; import Autocomplete from '@material-ui/lab/Autocomplete'; import TextField from '@material-ui/core/TextField'; import useDebounce from 'react-use/esm/useDebounce'; +import { useApi } from '@backstage/core-plugin-api'; +import { scaffolderApiRef } from '@backstage/plugin-scaffolder-react'; /** * The underlying component that is rendered in the form for the `BitbucketRepoPicker` @@ -62,35 +63,21 @@ export const BitbucketRepoPicker = (props: { } }, [allowedOwners, host, onChange]); - const [client, setClient] = useState(); + const scaffolderApi = useApi(scaffolderApiRef); + const [availableWorkspaces, setAvailableWorkspaces] = useState([]); const [availableProjects, setAvailableProjects] = useState([]); - useEffect(() => { - if (host === 'bitbucket.org' && accessToken) { - setClient( - BitbucketCloudClient.fromConfig({ - host, - apiBaseUrl: 'https://api.bitbucket.org/2.0', - accessToken, - }), - ); - } else { - setClient(undefined); - } - }, [host, accessToken]); - // Update available workspaces when client is available useDebounce( () => { const updateAvailableWorkspaces = async () => { - if (client) { - const result: string[] = []; - - for await (const page of client.listWorkspaces().iteratePages()) { - const keys = [...page.values!].map(p => p.slug!); - result.push(...keys); - } + if (host === 'bitbucket.org' && accessToken) { + const result = await scaffolderApi.autocomplete( + accessToken, + 'bitbucketCloud', + 'workspaces', + ); setAvailableWorkspaces(result); } else { @@ -101,22 +88,20 @@ export const BitbucketRepoPicker = (props: { updateAvailableWorkspaces().catch(() => setAvailableWorkspaces([])); }, 500, - [client], + [host, accessToken], ); // Update available projects when client is available and workspace changes useDebounce( () => { const updateAvailableProjects = async () => { - if (client && workspace) { - const result: string[] = []; - - for await (const page of client - .listProjectsByWorkspace(workspace) - .iteratePages()) { - const keys = [...page.values!].map(p => p.key!); - result.push(...keys); - } + if (host === 'bitbucket.org' && accessToken && workspace) { + const result = await scaffolderApi.autocomplete( + accessToken, + 'bitbucketCloud', + 'projects', + { workspace }, + ); setAvailableProjects(result); } else { @@ -127,24 +112,20 @@ export const BitbucketRepoPicker = (props: { updateAvailableProjects().catch(() => setAvailableProjects([])); }, 500, - [client, workspace], + [host, accessToken, workspace], ); // Update available repositories when client is available and workspace or project changes useDebounce( () => { const updateAvailableRepositories = async () => { - if (client && workspace && project) { - const availableRepos: string[] = []; - - for await (const page of client - .listRepositoriesByWorkspace(workspace, { - q: `project.key="${project}"`, - }) - .iteratePages()) { - const keys = [...page.values!].map(p => p.slug!); - availableRepos.push(...keys); - } + if (host === 'bitbucket.org' && accessToken && workspace && project) { + const availableRepos = await scaffolderApi.autocomplete( + accessToken, + 'bitbucketCloud', + 'repositories', + { workspace, project }, + ); onChange({ availableRepos }); } else { @@ -157,7 +138,7 @@ export const BitbucketRepoPicker = (props: { ); }, 500, - [client, workspace, project, onChange], + [host, accessToken, workspace, project], ); return ( diff --git a/plugins/scaffolder/src/next/TemplateWizardPage/TemplateWizardPage.test.tsx b/plugins/scaffolder/src/next/TemplateWizardPage/TemplateWizardPage.test.tsx index 269ff81271..2639e8149c 100644 --- a/plugins/scaffolder/src/next/TemplateWizardPage/TemplateWizardPage.test.tsx +++ b/plugins/scaffolder/src/next/TemplateWizardPage/TemplateWizardPage.test.tsx @@ -51,6 +51,7 @@ const scaffolderApiMock: jest.Mocked = { streamLogs: jest.fn(), listActions: jest.fn(), listTasks: jest.fn(), + autocomplete: jest.fn(), }; const catalogApiMock: jest.Mocked = { diff --git a/yarn.lock b/yarn.lock index 7f44f1559c..f81ce9dabd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7269,7 +7269,6 @@ __metadata: "@backstage/frontend-plugin-api": "workspace:^" "@backstage/integration": "workspace:^" "@backstage/integration-react": "workspace:^" - "@backstage/plugin-bitbucket-cloud-common": "workspace:^" "@backstage/plugin-catalog": "workspace:^" "@backstage/plugin-catalog-common": "workspace:^" "@backstage/plugin-catalog-react": "workspace:^" From a1709aa4eeba6a175b128d0f84c872c952222ada Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Thu, 13 Jun 2024 15:30:00 +0200 Subject: [PATCH 200/387] chore: add changesets for @backstage/plugin-scaffolder-backend and @backstage/plugin-scaffolder-react; update API reports; update tests of ActionsPage Signed-off-by: Benjamin Janssens --- .changeset/slimy-ties-relate.md | 5 +++++ .changeset/tame-geese-run.md | 5 +++++ plugins/scaffolder-react/api-report.md | 7 +++++++ plugins/scaffolder/api-report.md | 7 +++++++ .../src/components/ActionsPage/ActionsPage.test.tsx | 1 + 5 files changed, 25 insertions(+) create mode 100644 .changeset/slimy-ties-relate.md create mode 100644 .changeset/tame-geese-run.md diff --git a/.changeset/slimy-ties-relate.md b/.changeset/slimy-ties-relate.md new file mode 100644 index 0000000000..d4da9972f1 --- /dev/null +++ b/.changeset/slimy-ties-relate.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend': patch +--- + +Added endpoint for autocompleting provider resources (currently only supports Bitbucket) diff --git a/.changeset/tame-geese-run.md b/.changeset/tame-geese-run.md new file mode 100644 index 0000000000..785ae6c7fc --- /dev/null +++ b/.changeset/tame-geese-run.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-react': patch +--- + +Added method `autocomplete` to interface `ScaffolderApi` diff --git a/plugins/scaffolder-react/api-report.md b/plugins/scaffolder-react/api-report.md index 850c30ced8..cc6672a8a5 100644 --- a/plugins/scaffolder-react/api-report.md +++ b/plugins/scaffolder-react/api-report.md @@ -179,6 +179,13 @@ export type ReviewStepProps = { // @public export interface ScaffolderApi { + // (undocumented) + autocomplete( + token: string, + provider: string, + resource: string, + params?: Record, + ): Promise; cancelTask(taskId: string): Promise; // (undocumented) dryRun?(options: ScaffolderDryRunOptions): Promise; diff --git a/plugins/scaffolder/api-report.md b/plugins/scaffolder/api-report.md index 5c766af890..affc69ed93 100644 --- a/plugins/scaffolder/api-report.md +++ b/plugins/scaffolder/api-report.md @@ -502,6 +502,13 @@ export class ScaffolderClient implements ScaffolderApi_2 { useLongPollingLogs?: boolean; }); // (undocumented) + autocomplete( + token: string, + provider: string, + resource: string, + params?: Record, + ): Promise; + // (undocumented) cancelTask(taskId: string): Promise; // (undocumented) dryRun( diff --git a/plugins/scaffolder/src/components/ActionsPage/ActionsPage.test.tsx b/plugins/scaffolder/src/components/ActionsPage/ActionsPage.test.tsx index 614e3fcff0..b548bcbad4 100644 --- a/plugins/scaffolder/src/components/ActionsPage/ActionsPage.test.tsx +++ b/plugins/scaffolder/src/components/ActionsPage/ActionsPage.test.tsx @@ -33,6 +33,7 @@ const scaffolderApiMock: jest.Mocked = { streamLogs: jest.fn(), listActions: jest.fn(), listTasks: jest.fn(), + autocomplete: jest.fn(), }; const apis = TestApiRegistry.from([scaffolderApiRef, scaffolderApiMock]); From 62a9dcf8df69aba686557de3a58a873a69c6bf5e Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Thu, 13 Jun 2024 17:00:14 +0200 Subject: [PATCH 201/387] fix: use onChange instead of onInputChange to make autocomplete actually work Signed-off-by: Benjamin Janssens --- .../fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx | 5 +++++ .../fields/RepoUrlPicker/BitbucketRepoPicker.tsx | 8 ++++---- .../fields/RepoUrlPicker/RepoUrlPickerRepoName.test.tsx | 3 +++ .../fields/RepoUrlPicker/RepoUrlPickerRepoName.tsx | 5 +++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx index 404fb6ddf6..10c049b3a0 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx @@ -23,6 +23,7 @@ import { ScaffolderApi, scaffolderApiRef, } from '@backstage/plugin-scaffolder-react'; +import { act } from 'react-dom/test-utils'; describe('BitbucketRepoPicker', () => { const scaffolderApiMock: Partial = { @@ -100,7 +101,9 @@ describe('BitbucketRepoPicker', () => { const workspaceInput = getAllByRole('textbox')[0]; + act(() => workspaceInput.focus()); fireEvent.change(workspaceInput, { target: { value: 'test-workspace' } }); + act(() => workspaceInput.blur()); expect(onChange).toHaveBeenCalledWith({ workspace: 'test-workspace' }); }); @@ -121,7 +124,9 @@ describe('BitbucketRepoPicker', () => { const projectInput = getAllByRole('textbox')[1]; + act(() => projectInput.focus()); fireEvent.change(projectInput, { target: { value: 'test-project' } }); + act(() => projectInput.blur()); expect(onChange).toHaveBeenCalledWith({ project: 'test-project' }); }); diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx index 995470fbcb..51bd1f5c67 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx @@ -163,8 +163,8 @@ export const BitbucketRepoPicker = (props: { ) : ( { - onChange({ workspace: String(newValue) }); + onChange={(_, newValue) => { + onChange({ workspace: newValue || '' }); }} options={availableWorkspaces} renderInput={params => ( @@ -198,8 +198,8 @@ export const BitbucketRepoPicker = (props: { ) : ( { - onChange({ project: String(newValue) }); + onChange={(_, newValue) => { + onChange({ project: newValue || '' }); }} options={availableProjects} renderInput={params => ( diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.test.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.test.tsx index 8228f443df..efc3c94e71 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.test.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.test.tsx @@ -17,6 +17,7 @@ import React from 'react'; import { RepoUrlPickerRepoName } from './RepoUrlPickerRepoName'; import { render, fireEvent } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; +import { act } from 'react-dom/test-utils'; describe('RepoUrlPickerRepoName', () => { it('should call onChange with the first allowed repo if there is none set already', async () => { @@ -70,7 +71,9 @@ describe('RepoUrlPickerRepoName', () => { expect(textArea).toBeVisible(); + act(() => textArea.focus()); fireEvent.change(textArea, { target: { value: 'foo' } }); + act(() => textArea.blur()); expect(onChange).toHaveBeenCalledWith('foo'); }); diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.tsx index cd346cf8ed..01878cb619 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.tsx @@ -64,14 +64,15 @@ export const RepoUrlPickerRepoName = (props: { ) : ( { - onChange(String(newValue)); + onChange={(_, newValue) => { + onChange(newValue || ''); }} options={availableRepos || []} renderInput={params => ( )} freeSolo + autoSelect /> )} The name of the repository From 4d88b29995acf47b3065fa83bb89d9340f7bd806 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Thu, 13 Jun 2024 18:01:21 +0200 Subject: [PATCH 202/387] test: update tests to work with onChange Signed-off-by: Benjamin Janssens --- .../RepoUrlPicker/BitbucketRepoPicker.test.tsx | 18 ++++++++++++------ .../RepoUrlPicker/RepoUrlPicker.test.tsx | 13 ++++++++++--- .../RepoUrlPickerRepoName.test.tsx | 8 +++++--- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx index 10c049b3a0..eb8c1f3a2c 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx @@ -101,9 +101,13 @@ describe('BitbucketRepoPicker', () => { const workspaceInput = getAllByRole('textbox')[0]; - act(() => workspaceInput.focus()); - fireEvent.change(workspaceInput, { target: { value: 'test-workspace' } }); - act(() => workspaceInput.blur()); + act(() => { + workspaceInput.focus(); + fireEvent.change(workspaceInput, { + target: { value: 'test-workspace' }, + }); + workspaceInput.blur(); + }); expect(onChange).toHaveBeenCalledWith({ workspace: 'test-workspace' }); }); @@ -124,9 +128,11 @@ describe('BitbucketRepoPicker', () => { const projectInput = getAllByRole('textbox')[1]; - act(() => projectInput.focus()); - fireEvent.change(projectInput, { target: { value: 'test-project' } }); - act(() => projectInput.blur()); + act(() => { + projectInput.focus(); + fireEvent.change(projectInput, { target: { value: 'test-project' } }); + projectInput.blur(); + }); expect(onChange).toHaveBeenCalledWith({ project: 'test-project' }); }); diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx index 59c09c106c..af78bc0395 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx @@ -32,7 +32,7 @@ import { useTemplateSecrets, ScaffolderRJSFField, } from '@backstage/plugin-scaffolder-react'; -import { act, fireEvent } from '@testing-library/react'; +import { act, fireEvent, waitFor } from '@testing-library/react'; describe('RepoUrlPicker', () => { const mockScaffolderApi: Partial = { @@ -98,8 +98,15 @@ describe('RepoUrlPicker', () => { const [ownerInput, repoInput] = getAllByRole('textbox'); const submitButton = getByRole('button'); - fireEvent.change(ownerInput, { target: { value: 'backstage' } }); - fireEvent.change(repoInput, { target: { value: 'repo123' } }); + act(() => { + ownerInput.focus(); + fireEvent.change(ownerInput, { target: { value: 'backstage' } }); + ownerInput.blur(); + + repoInput.focus(); + fireEvent.change(repoInput, { target: { value: 'repo123' } }); + repoInput.blur(); + }); fireEvent.click(submitButton); diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.test.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.test.tsx index efc3c94e71..3a32b6e175 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.test.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.test.tsx @@ -71,9 +71,11 @@ describe('RepoUrlPickerRepoName', () => { expect(textArea).toBeVisible(); - act(() => textArea.focus()); - fireEvent.change(textArea, { target: { value: 'foo' } }); - act(() => textArea.blur()); + act(() => { + textArea.focus(); + fireEvent.change(textArea, { target: { value: 'foo' } }); + textArea.blur(); + }); expect(onChange).toHaveBeenCalledWith('foo'); }); From 74c95163438eac8e0a7e51d2bf04ae7f4d1cea60 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Fri, 14 Jun 2024 13:22:30 +0200 Subject: [PATCH 203/387] chore: remove unused import Signed-off-by: Benjamin Janssens --- .../src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx index af78bc0395..002652cfab 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx @@ -32,7 +32,7 @@ import { useTemplateSecrets, ScaffolderRJSFField, } from '@backstage/plugin-scaffolder-react'; -import { act, fireEvent, waitFor } from '@testing-library/react'; +import { act, fireEvent } from '@testing-library/react'; describe('RepoUrlPicker', () => { const mockScaffolderApi: Partial = { From 6b4f2d199b83d8455e4a45f15b54a7242c84edb5 Mon Sep 17 00:00:00 2001 From: Himanshu Mishra Date: Fri, 14 Jun 2024 17:15:55 +0530 Subject: [PATCH 204/387] Update .changeset/dull-moose-cough.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fredrik Adelöw Signed-off-by: Himanshu Mishra --- .changeset/dull-moose-cough.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/dull-moose-cough.md b/.changeset/dull-moose-cough.md index c06d62c109..4de43fb35f 100644 --- a/.changeset/dull-moose-cough.md +++ b/.changeset/dull-moose-cough.md @@ -1,5 +1,5 @@ --- -'@backstage/integration': minor +'@backstage/integration': patch --- Updated function for getHarnessEditContentsUrl From 3e8b5822dba5e29564799dbe5fe93c171857a925 Mon Sep 17 00:00:00 2001 From: blam Date: Fri, 14 Jun 2024 14:02:18 +0200 Subject: [PATCH 205/387] chore: added secret widget export Signed-off-by: blam --- plugins/scaffolder-react/api-report-alpha.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/scaffolder-react/api-report-alpha.md b/plugins/scaffolder-react/api-report-alpha.md index 683b8cf8be..4655cbfd62 100644 --- a/plugins/scaffolder-react/api-report-alpha.md +++ b/plugins/scaffolder-react/api-report-alpha.md @@ -33,6 +33,7 @@ import { TemplateGroupFilter } from '@backstage/plugin-scaffolder-react'; import { TemplateParameterSchema } from '@backstage/plugin-scaffolder-react'; import { TemplatePresentationV1beta3 } from '@backstage/plugin-scaffolder-common'; import { UiSchema } from '@rjsf/utils'; +import { WidgetProps } from '@rjsf/utils'; // @alpha (undocumented) export type BackstageOverrides = Overrides & { @@ -149,6 +150,11 @@ export type ScaffolderReactComponentsNameToClassKey = { // @alpha (undocumented) export type ScaffolderReactTemplateCategoryPickerClassKey = 'root' | 'label'; +// @alpha +export const SecretWidget: ( + props: Pick, +) => React_2.JSX.Element; + // @alpha export const Stepper: (stepperProps: StepperProps) => React_2.JSX.Element; From a3573a8f28d36c33a16e065d027ae8f3edf63e65 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 12:10:16 +0000 Subject: [PATCH 206/387] chore(deps): update actions/checkout digest to 692973e Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/api-breaking-changes-comment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/api-breaking-changes-comment.yml b/.github/workflows/api-breaking-changes-comment.yml index 317690f875..f8fc638905 100644 --- a/.github/workflows/api-breaking-changes-comment.yml +++ b/.github/workflows/api-breaking-changes-comment.yml @@ -90,7 +90,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 # Identify comment to be updated - name: Find comment for API Changes From 753e69c83c40bdcc51234567dae12cb2992d5c00 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 12:16:05 +0000 Subject: [PATCH 207/387] chore(deps): update github/codeql-action action to v3.25.10 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/scorecard.yml | 2 +- .github/workflows/sync_snyk-monitor.yml | 2 +- .github/workflows/verify_codeql.yml | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 0a39df1580..d17b9ddcf2 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: 'Upload to code-scanning' - uses: github/codeql-action/upload-sarif@530d4feaa9c62aaab2d250371e2061eb7a172363 # v3.25.9 + uses: github/codeql-action/upload-sarif@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10 with: sarif_file: results.sarif diff --git a/.github/workflows/sync_snyk-monitor.yml b/.github/workflows/sync_snyk-monitor.yml index c28b03c075..ba03362daf 100644 --- a/.github/workflows/sync_snyk-monitor.yml +++ b/.github/workflows/sync_snyk-monitor.yml @@ -58,6 +58,6 @@ jobs: SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} NODE_OPTIONS: --max-old-space-size=7168 - name: Upload Snyk report - uses: github/codeql-action/upload-sarif@530d4feaa9c62aaab2d250371e2061eb7a172363 # v3.25.9 + uses: github/codeql-action/upload-sarif@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10 with: sarif_file: snyk.sarif diff --git a/.github/workflows/verify_codeql.yml b/.github/workflows/verify_codeql.yml index 21feada54e..ed3e40d0e0 100644 --- a/.github/workflows/verify_codeql.yml +++ b/.github/workflows/verify_codeql.yml @@ -55,7 +55,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@530d4feaa9c62aaab2d250371e2061eb7a172363 # v3.25.9 + uses: github/codeql-action/init@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -66,7 +66,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@530d4feaa9c62aaab2d250371e2061eb7a172363 # v3.25.9 + uses: github/codeql-action/autobuild@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -80,4 +80,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@530d4feaa9c62aaab2d250371e2061eb7a172363 # v3.25.9 + uses: github/codeql-action/analyze@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10 From 5ebfbb522370c5b3704b18d905289318dfa20547 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 13:14:54 +0000 Subject: [PATCH 208/387] fix(deps): update dependency mysql2 to v3.10.1 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index fe6afaea88..9513149eaa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -34281,8 +34281,8 @@ __metadata: linkType: hard "mysql2@npm:^3.0.0": - version: 3.10.0 - resolution: "mysql2@npm:3.10.0" + version: 3.10.1 + resolution: "mysql2@npm:3.10.1" dependencies: denque: ^2.1.0 generate-function: ^2.3.1 @@ -34292,7 +34292,7 @@ __metadata: named-placeholders: ^1.1.3 seq-queue: ^0.0.5 sqlstring: ^2.3.2 - checksum: 4306de21317a05fcd4bbf28679e6b61b5e3421f7b8e2813ce7be8a06a8f7f4e09067bbd77507de465aba59a5742d1c48a3ed1038e96fb76935d24e1648d4b9c3 + checksum: 293e1a76bfdbde146285ee7028336da7693b5dfb507a7c264216fdb3fe2088ba0f5d5a45a0a9e7c4de4f39c3f44edbe890fb05b28299d6c731fc2e4a281836e3 languageName: node linkType: hard From 54970115968e8c0d0ec613063bb2424ca5981ad7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 13:15:02 +0000 Subject: [PATCH 209/387] chore(deps): update docker/login-action action to v3.2.0 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/deploy_docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_docker-image.yml b/.github/workflows/deploy_docker-image.yml index 2314f372a9..3d796e2503 100644 --- a/.github/workflows/deploy_docker-image.yml +++ b/.github/workflows/deploy_docker-image.yml @@ -51,7 +51,7 @@ jobs: working-directory: ./example-app - name: Login to GitHub Container Registry - uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0 + uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0 with: registry: ghcr.io username: ${{ github.actor }} From 1d495e65556b9539646e98ad60853a00086a2304 Mon Sep 17 00:00:00 2001 From: sblausten Date: Fri, 14 Jun 2024 14:36:20 +0200 Subject: [PATCH 210/387] Use extname Signed-off-by: sblausten --- .../src/analyzers/GithubLocationAnalyzer.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.ts b/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.ts index e3b367eb14..4d84d6b5d1 100644 --- a/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.ts +++ b/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.ts @@ -22,7 +22,7 @@ import { ScmIntegrations, } from '@backstage/integration'; import { Octokit } from '@octokit/rest'; -import { trimEnd } from 'lodash'; +import { isEmpty, trimEnd } from 'lodash'; import parseGitUrl from 'git-url-parse'; import { AnalyzeOptions, @@ -35,6 +35,7 @@ import { } from '@backstage/backend-common'; import { Config } from '@backstage/config'; import { AuthService } from '@backstage/backend-plugin-api'; +import { extname } from 'path'; /** @public */ export type GithubLocationAnalyzerOptions = { @@ -76,13 +77,10 @@ export class GithubLocationAnalyzer implements ScmLocationAnalyzer { const { owner, name: repo } = parseGitUrl(url); const catalogFile = catalogFilename || 'catalog-info.yaml'; - const fileParts = catalogFile.split('.'); - const extension = - fileParts.length > 0 - ? `extension:${fileParts[fileParts.length - 1]}` - : ''; + const extension = extname(catalogFile); + const extensionQuery = !isEmpty(extension) ? `extension:${extension}` : ''; - const query = `filename:${catalogFile} ${extension} repo:${owner}/${repo}`; + const query = `filename:${catalogFile} ${extensionQuery} repo:${owner}/${repo}`; const integration = this.integrations.github.byUrl(url); if (!integration) { From bb3cdd685f4896dc4d78aa54b47b01081a15f3a2 Mon Sep 17 00:00:00 2001 From: sblausten Date: Fri, 14 Jun 2024 14:49:56 +0200 Subject: [PATCH 211/387] Use extname Signed-off-by: sblausten --- .../analyzers/GithubLocationAnalyzer.test.ts | 26 +++++++++++++++++++ .../src/analyzers/GithubLocationAnalyzer.ts | 4 ++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.test.ts b/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.test.ts index 8fcffd1a33..e5c7eb5896 100644 --- a/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.test.ts +++ b/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.test.ts @@ -162,4 +162,30 @@ describe('GithubLocationAnalyzer', () => { target: 'https://github.com/foo/bar/blob/my_default_branch/anvil.yaml', }); }); + + it('should use the provided entity file extension in search query only if present', async () => { + octokit.search.code.mockImplementation((opts: { q: string }) => { + if (opts.q === 'filename:.gitignore repo:foo/bar') { + return Promise.resolve({ + data: { items: [{ path: '.gitignore' }], total_count: 1 }, + }); + } + return Promise.reject(); + }); + + const analyzer = new GithubLocationAnalyzer({ + discovery: mockDiscoveryApi, + auth: mockAuthService, + config, + }); + const result = await analyzer.analyze({ + url: 'https://github.com/foo/bar', + catalogFilename: '.gitignore', + }); + + expect(result.existing[0].location).toEqual({ + type: 'url', + target: 'https://github.com/foo/bar/blob/my_default_branch/.gitignore', + }); + }); }); diff --git a/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.ts b/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.ts index 4d84d6b5d1..7e6ac73054 100644 --- a/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.ts +++ b/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.ts @@ -78,7 +78,9 @@ export class GithubLocationAnalyzer implements ScmLocationAnalyzer { const catalogFile = catalogFilename || 'catalog-info.yaml'; const extension = extname(catalogFile); - const extensionQuery = !isEmpty(extension) ? `extension:${extension}` : ''; + const extensionQuery = !isEmpty(extension) + ? `extension:${extension.replace('.', '')}` + : ''; const query = `filename:${catalogFile} ${extensionQuery} repo:${owner}/${repo}`; From 5db753618fac375a5dc8c327e8685c86b662adc6 Mon Sep 17 00:00:00 2001 From: Calvin Lee Date: Fri, 14 Jun 2024 10:56:53 -0600 Subject: [PATCH 212/387] fix: enable support for edit_url in TechDocs Signed-off-by: Calvin Lee --- .changeset/tasty-forks-compare.md | 5 +++++ plugins/techdocs-node/src/stages/generate/helpers.ts | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changeset/tasty-forks-compare.md diff --git a/.changeset/tasty-forks-compare.md b/.changeset/tasty-forks-compare.md new file mode 100644 index 0000000000..6e748d884b --- /dev/null +++ b/.changeset/tasty-forks-compare.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs-node': patch +--- + +Updated getRepoUrlFromLocationAnnotation to check for harness scm integration diff --git a/plugins/techdocs-node/src/stages/generate/helpers.ts b/plugins/techdocs-node/src/stages/generate/helpers.ts index df1a31470d..5efe96877f 100644 --- a/plugins/techdocs-node/src/stages/generate/helpers.ts +++ b/plugins/techdocs-node/src/stages/generate/helpers.ts @@ -101,11 +101,13 @@ export const getRepoUrlFromLocationAnnotation = ( if (locationType === 'url') { const integration = scmIntegrations.byUrl(target); - // We only support it for github, gitlab and bitbucketServer for now as the edit_uri + // We only support it for github, gitlab, bitbucketServer and harness for now as the edit_uri // is not properly supported for others yet. if ( integration && - ['github', 'gitlab', 'bitbucketServer'].includes(integration.type) + ['github', 'gitlab', 'bitbucketServer', 'harness'].includes( + integration.type, + ) ) { // handle the case where a user manually writes url:https://github.com/backstage/backstage i.e. without /blob/... const { filepathtype } = gitUrlParse(target); From 8c3dac5340743b1f1312d977a54a9cf70a0aa1c5 Mon Sep 17 00:00:00 2001 From: Calvin Lee Date: Fri, 14 Jun 2024 11:25:27 -0600 Subject: [PATCH 213/387] fix: enable support for edit_url in TechDocs-comments Signed-off-by: Calvin Lee --- .changeset/tasty-forks-compare.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/tasty-forks-compare.md b/.changeset/tasty-forks-compare.md index 6e748d884b..2b525ed51a 100644 --- a/.changeset/tasty-forks-compare.md +++ b/.changeset/tasty-forks-compare.md @@ -2,4 +2,4 @@ '@backstage/plugin-techdocs-node': patch --- -Updated getRepoUrlFromLocationAnnotation to check for harness scm integration +Updated `getRepoUrlFromLocationAnnotation` to check for Harness SCM integration From 80e69623f5cef0a482a895167356e80be580d38c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 17:36:56 +0000 Subject: [PATCH 214/387] chore(deps): update helm/kind-action action to v1.10.0 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/verify_e2e-kubernetes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify_e2e-kubernetes.yml b/.github/workflows/verify_e2e-kubernetes.yml index ff6a6cf0c4..03555fb760 100644 --- a/.github/workflows/verify_e2e-kubernetes.yml +++ b/.github/workflows/verify_e2e-kubernetes.yml @@ -40,7 +40,7 @@ jobs: cache-prefix: ${{ runner.os }}-v${{ matrix.node-version }} - name: bootstrap kind - uses: helm/kind-action@99576bfa6ddf9a8e612d83b513da5a75875caced # v1.9.0 + uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0 - name: kubernetes test working-directory: packages/backend-common From f3bf66f1dae741e223b84f67a993fa167e5de6e1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 18:42:48 +0000 Subject: [PATCH 215/387] chore(deps): update step-security/harden-runner action to v2.8.1 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/api-breaking-changes-comment.yml | 2 +- .github/workflows/api-breaking-changes.yml | 2 +- .github/workflows/automate_area-labels.yml | 2 +- .github/workflows/automate_changeset_feedback.yml | 2 +- .github/workflows/automate_merge_message.yml | 2 +- .github/workflows/automate_stale.yml | 2 +- .github/workflows/ci-noop.yml | 2 +- .github/workflows/ci.yml | 4 ++-- .github/workflows/cron.yml | 2 +- .github/workflows/deploy_docker-image.yml | 2 +- .github/workflows/deploy_microsite.yml | 2 +- .github/workflows/deploy_nightly.yml | 2 +- .github/workflows/deploy_packages.yml | 2 +- .github/workflows/issue.yaml | 2 +- .github/workflows/pr-review-comment-trigger.yaml | 2 +- .github/workflows/pr-review-comment.yaml | 2 +- .github/workflows/pr.yaml | 2 +- .github/workflows/scorecard.yml | 2 +- .github/workflows/sync_code-formatting.yml | 2 +- .github/workflows/sync_dependabot-changesets.yml | 2 +- .github/workflows/sync_release-manifest.yml | 2 +- .github/workflows/sync_renovate-changesets.yml | 2 +- .github/workflows/sync_snyk-github-issues.yml | 2 +- .github/workflows/sync_snyk-monitor.yml | 2 +- .github/workflows/sync_version-packages.yml | 2 +- .github/workflows/verify_accessibility-noop.yml | 2 +- .github/workflows/verify_accessibility.yml | 2 +- .github/workflows/verify_codeql.yml | 2 +- .github/workflows/verify_docs-quality.yml | 2 +- .github/workflows/verify_e2e-kubernetes-noop.yml | 2 +- .github/workflows/verify_e2e-kubernetes.yml | 2 +- .github/workflows/verify_e2e-linux-noop.yml | 2 +- .github/workflows/verify_e2e-linux.yml | 2 +- .github/workflows/verify_e2e-techdocs.yml | 2 +- .github/workflows/verify_e2e-windows-noop.yml | 2 +- .github/workflows/verify_e2e-windows.yml | 2 +- .github/workflows/verify_fossa.yml | 2 +- .github/workflows/verify_microsite-noop.yml | 2 +- .github/workflows/verify_microsite.yml | 2 +- .github/workflows/verify_microsite_accessibility-noop.yml | 2 +- .github/workflows/verify_microsite_accessibility.yml | 2 +- .github/workflows/verify_storybook-noop.yml | 2 +- .github/workflows/verify_storybook.yml | 2 +- .github/workflows/verify_windows.yml | 2 +- 44 files changed, 45 insertions(+), 45 deletions(-) diff --git a/.github/workflows/api-breaking-changes-comment.yml b/.github/workflows/api-breaking-changes-comment.yml index f8fc638905..c3886e05b9 100644 --- a/.github/workflows/api-breaking-changes-comment.yml +++ b/.github/workflows/api-breaking-changes-comment.yml @@ -22,7 +22,7 @@ jobs: action: ${{ steps.event.outputs.ACTION }} steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: disable-sudo: true egress-policy: block diff --git a/.github/workflows/api-breaking-changes.yml b/.github/workflows/api-breaking-changes.yml index 4bf55e1928..e334a29b82 100644 --- a/.github/workflows/api-breaking-changes.yml +++ b/.github/workflows/api-breaking-changes.yml @@ -14,7 +14,7 @@ jobs: if: ${{ github.event_name != 'pull_request' || github.event.action != 'closed' }} steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/automate_area-labels.yml b/.github/workflows/automate_area-labels.yml index 74f577f360..bde8f15606 100644 --- a/.github/workflows/automate_area-labels.yml +++ b/.github/workflows/automate_area-labels.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/automate_changeset_feedback.yml b/.github/workflows/automate_changeset_feedback.yml index e0558ca269..94b4b51848 100644 --- a/.github/workflows/automate_changeset_feedback.yml +++ b/.github/workflows/automate_changeset_feedback.yml @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/automate_merge_message.yml b/.github/workflows/automate_merge_message.yml index d96c03f8e0..2aac0a17f6 100644 --- a/.github/workflows/automate_merge_message.yml +++ b/.github/workflows/automate_merge_message.yml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/automate_stale.yml b/.github/workflows/automate_stale.yml index afb8f3b838..6cb16937c6 100644 --- a/.github/workflows/automate_stale.yml +++ b/.github/workflows/automate_stale.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/ci-noop.yml b/.github/workflows/ci-noop.yml index 4dc8594bc9..adf0feb926 100644 --- a/.github/workflows/ci-noop.yml +++ b/.github/workflows/ci-noop.yml @@ -40,7 +40,7 @@ jobs: name: Test ${{ matrix.node-version }} steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5dccceefd..135076ba40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: name: Install ${{ matrix.node-version }} steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit @@ -64,7 +64,7 @@ jobs: name: Verify ${{ matrix.node-version }} steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index ede29d2730..923293667a 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/deploy_docker-image.yml b/.github/workflows/deploy_docker-image.yml index 2314f372a9..43442787ab 100644 --- a/.github/workflows/deploy_docker-image.yml +++ b/.github/workflows/deploy_docker-image.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/deploy_microsite.yml b/.github/workflows/deploy_microsite.yml index 7163bf7348..a0cdae5774 100644 --- a/.github/workflows/deploy_microsite.yml +++ b/.github/workflows/deploy_microsite.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/deploy_nightly.yml b/.github/workflows/deploy_nightly.yml index 2ba1ee2179..db9489dbb8 100644 --- a/.github/workflows/deploy_nightly.yml +++ b/.github/workflows/deploy_nightly.yml @@ -15,7 +15,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/deploy_packages.yml b/.github/workflows/deploy_packages.yml index f9724eaf60..81e95fab97 100644 --- a/.github/workflows/deploy_packages.yml +++ b/.github/workflows/deploy_packages.yml @@ -154,7 +154,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/issue.yaml b/.github/workflows/issue.yaml index 7afc0a81bb..26e394fd87 100644 --- a/.github/workflows/issue.yaml +++ b/.github/workflows/issue.yaml @@ -10,7 +10,7 @@ jobs: if: github.repository == 'backstage/backstage' steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/pr-review-comment-trigger.yaml b/.github/workflows/pr-review-comment-trigger.yaml index bea1618608..ccf02d5aee 100644 --- a/.github/workflows/pr-review-comment-trigger.yaml +++ b/.github/workflows/pr-review-comment-trigger.yaml @@ -20,7 +20,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/pr-review-comment.yaml b/.github/workflows/pr-review-comment.yaml index d722894df7..1b2b9ee5be 100644 --- a/.github/workflows/pr-review-comment.yaml +++ b/.github/workflows/pr-review-comment.yaml @@ -17,7 +17,7 @@ jobs: steps: # Inspired by https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 8193bfaf79..bf7c5cfa8d 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -18,7 +18,7 @@ jobs: if: github.repository == 'backstage/backstage' && ( github.event.pull_request || github.event.issue.pull_request ) steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 54434f8935..6b277f362b 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -29,7 +29,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/sync_code-formatting.yml b/.github/workflows/sync_code-formatting.yml index 13d6d7096c..9886c94830 100644 --- a/.github/workflows/sync_code-formatting.yml +++ b/.github/workflows/sync_code-formatting.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/sync_dependabot-changesets.yml b/.github/workflows/sync_dependabot-changesets.yml index 246cff50fb..ce79efb148 100644 --- a/.github/workflows/sync_dependabot-changesets.yml +++ b/.github/workflows/sync_dependabot-changesets.yml @@ -11,7 +11,7 @@ jobs: if: github.actor == 'dependabot[bot]' && github.repository == 'backstage/backstage' steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/sync_release-manifest.yml b/.github/workflows/sync_release-manifest.yml index ae988d35e0..db35945550 100644 --- a/.github/workflows/sync_release-manifest.yml +++ b/.github/workflows/sync_release-manifest.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/sync_renovate-changesets.yml b/.github/workflows/sync_renovate-changesets.yml index 788e5c4ef1..4ba792d4e0 100644 --- a/.github/workflows/sync_renovate-changesets.yml +++ b/.github/workflows/sync_renovate-changesets.yml @@ -11,7 +11,7 @@ jobs: if: github.actor == 'renovate[bot]' && github.repository == 'backstage/backstage' steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/sync_snyk-github-issues.yml b/.github/workflows/sync_snyk-github-issues.yml index 48909a7425..fb3456bfb6 100644 --- a/.github/workflows/sync_snyk-github-issues.yml +++ b/.github/workflows/sync_snyk-github-issues.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/sync_snyk-monitor.yml b/.github/workflows/sync_snyk-monitor.yml index 9fdf9a3a71..090db36fea 100644 --- a/.github/workflows/sync_snyk-monitor.yml +++ b/.github/workflows/sync_snyk-monitor.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/sync_version-packages.yml b/.github/workflows/sync_version-packages.yml index b53eab54d0..3a10083b7e 100644 --- a/.github/workflows/sync_version-packages.yml +++ b/.github/workflows/sync_version-packages.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/verify_accessibility-noop.yml b/.github/workflows/verify_accessibility-noop.yml index 7ec67cbf0f..6b51713aa1 100644 --- a/.github/workflows/verify_accessibility-noop.yml +++ b/.github/workflows/verify_accessibility-noop.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/verify_accessibility.yml b/.github/workflows/verify_accessibility.yml index 4883018fa6..bb46bbd4c1 100644 --- a/.github/workflows/verify_accessibility.yml +++ b/.github/workflows/verify_accessibility.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/verify_codeql.yml b/.github/workflows/verify_codeql.yml index 8322515cfe..c2ba781f0c 100644 --- a/.github/workflows/verify_codeql.yml +++ b/.github/workflows/verify_codeql.yml @@ -42,7 +42,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/verify_docs-quality.yml b/.github/workflows/verify_docs-quality.yml index 19bf87c0b0..2a0c4449a9 100644 --- a/.github/workflows/verify_docs-quality.yml +++ b/.github/workflows/verify_docs-quality.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/verify_e2e-kubernetes-noop.yml b/.github/workflows/verify_e2e-kubernetes-noop.yml index 6352abce70..b51c7fd201 100644 --- a/.github/workflows/verify_e2e-kubernetes-noop.yml +++ b/.github/workflows/verify_e2e-kubernetes-noop.yml @@ -23,7 +23,7 @@ jobs: name: Kubernetes ${{ matrix.node-version }} steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/verify_e2e-kubernetes.yml b/.github/workflows/verify_e2e-kubernetes.yml index ff6a6cf0c4..d8b2bc56db 100644 --- a/.github/workflows/verify_e2e-kubernetes.yml +++ b/.github/workflows/verify_e2e-kubernetes.yml @@ -22,7 +22,7 @@ jobs: name: Kubernetes ${{ matrix.node-version }} steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/verify_e2e-linux-noop.yml b/.github/workflows/verify_e2e-linux-noop.yml index 2b7eb1d84b..c042bdeac7 100644 --- a/.github/workflows/verify_e2e-linux-noop.yml +++ b/.github/workflows/verify_e2e-linux-noop.yml @@ -29,7 +29,7 @@ jobs: name: E2E Linux ${{ matrix.node-version }} steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/verify_e2e-linux.yml b/.github/workflows/verify_e2e-linux.yml index 4e8b86cd56..d6491f1e3c 100644 --- a/.github/workflows/verify_e2e-linux.yml +++ b/.github/workflows/verify_e2e-linux.yml @@ -41,7 +41,7 @@ jobs: name: E2E Linux ${{ matrix.node-version }} steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/verify_e2e-techdocs.yml b/.github/workflows/verify_e2e-techdocs.yml index f18f244b46..41f76a6410 100644 --- a/.github/workflows/verify_e2e-techdocs.yml +++ b/.github/workflows/verify_e2e-techdocs.yml @@ -30,7 +30,7 @@ jobs: name: Techdocs steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/verify_e2e-windows-noop.yml b/.github/workflows/verify_e2e-windows-noop.yml index fd90b86b0d..299489fcbe 100644 --- a/.github/workflows/verify_e2e-windows-noop.yml +++ b/.github/workflows/verify_e2e-windows-noop.yml @@ -25,7 +25,7 @@ jobs: name: E2E Windows ${{ matrix.node-version }} steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/verify_e2e-windows.yml b/.github/workflows/verify_e2e-windows.yml index a31b9238ba..d7575cadf7 100644 --- a/.github/workflows/verify_e2e-windows.yml +++ b/.github/workflows/verify_e2e-windows.yml @@ -31,7 +31,7 @@ jobs: name: E2E Windows ${{ matrix.node-version }} steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/verify_fossa.yml b/.github/workflows/verify_fossa.yml index a5b0c7a102..ad94f9ece5 100644 --- a/.github/workflows/verify_fossa.yml +++ b/.github/workflows/verify_fossa.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/verify_microsite-noop.yml b/.github/workflows/verify_microsite-noop.yml index a9a82b140b..d8ccaf73e5 100644 --- a/.github/workflows/verify_microsite-noop.yml +++ b/.github/workflows/verify_microsite-noop.yml @@ -21,7 +21,7 @@ jobs: name: Microsite steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/verify_microsite.yml b/.github/workflows/verify_microsite.yml index 9aee979bc4..1a5bc8075b 100644 --- a/.github/workflows/verify_microsite.yml +++ b/.github/workflows/verify_microsite.yml @@ -24,7 +24,7 @@ jobs: name: Microsite steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/verify_microsite_accessibility-noop.yml b/.github/workflows/verify_microsite_accessibility-noop.yml index 8ac2672b22..9f0ecc65be 100644 --- a/.github/workflows/verify_microsite_accessibility-noop.yml +++ b/.github/workflows/verify_microsite_accessibility-noop.yml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/verify_microsite_accessibility.yml b/.github/workflows/verify_microsite_accessibility.yml index 6583e0119e..c9ed1696cd 100644 --- a/.github/workflows/verify_microsite_accessibility.yml +++ b/.github/workflows/verify_microsite_accessibility.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/verify_storybook-noop.yml b/.github/workflows/verify_storybook-noop.yml index e98da4ae02..a1a1c1965d 100644 --- a/.github/workflows/verify_storybook-noop.yml +++ b/.github/workflows/verify_storybook-noop.yml @@ -28,7 +28,7 @@ jobs: name: Storybook steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/verify_storybook.yml b/.github/workflows/verify_storybook.yml index f4871baa46..83ddac8429 100644 --- a/.github/workflows/verify_storybook.yml +++ b/.github/workflows/verify_storybook.yml @@ -28,7 +28,7 @@ jobs: name: Storybook steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit diff --git a/.github/workflows/verify_windows.yml b/.github/workflows/verify_windows.yml index 3426880dbd..736193cad6 100644 --- a/.github/workflows/verify_windows.yml +++ b/.github/workflows/verify_windows.yml @@ -29,7 +29,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit From 06273c0c3b5007f148b678e6353492b471ac3159 Mon Sep 17 00:00:00 2001 From: Ryan <42385438+ryan-WORK@users.noreply.github.com> Date: Fri, 14 Jun 2024 12:23:38 -0700 Subject: [PATCH 216/387] Update org.md Typo in this documentation Signed-off-by: Ryan <42385438+ryan-WORK@users.noreply.github.com> --- docs/integrations/ldap/org.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/integrations/ldap/org.md b/docs/integrations/ldap/org.md index f70d02afed..38f19af257 100644 --- a/docs/integrations/ldap/org.md +++ b/docs/integrations/ldap/org.md @@ -301,11 +301,11 @@ map: In case you want to customize the ingested entities, the provider allows to pass transformers for users and groups. -Transformers can be configured by extending `ldapOrgEntityProviderTransformExtensionPoint`. Here is an example: +Transformers can be configured by extending `ldapOrgEntityProviderTransformsExtensionPoint`. Here is an example: ```ts title="packages/backend/src/index.ts" import { createBackendModule } from '@backstage/backend-plugin-api'; -import { ldapOrgEntityProviderTransformExtensionPoint } from '@backstage/plugin-catalog-backend-module-ldap'; +import { ldapOrgEntityProviderTransformsExtensionPoint } from '@backstage/plugin-catalog-backend-module-ldap'; import { myUserTransformer, myGroupTransformer } from './transformers'; backend.add( @@ -316,7 +316,7 @@ backend.add( env.registerInit({ deps: { /* highlight-add-start */ - ldapTransformers: ldapOrgEntityProviderTransformExtensionPoint, + ldapTransformers: ldapOrgEntityProviderTransformsExtensionPoint, /* highlight-add-end */ }, async init({ ldapTransformers }) { From b5bc997fa6bef51811c0e37031ecbe67ecb2c164 Mon Sep 17 00:00:00 2001 From: Camila Belo Date: Sun, 16 Jun 2024 08:56:49 +0200 Subject: [PATCH 217/387] refactor: remove inline cache types Signed-off-by: Camila Belo --- .changeset/late-badgers-rest.md | 5 ++++ packages/backend-defaults/api-report-cache.md | 9 ++----- .../src/entrypoints/cache/CacheManager.ts | 27 +++---------------- 3 files changed, 10 insertions(+), 31 deletions(-) create mode 100644 .changeset/late-badgers-rest.md diff --git a/.changeset/late-badgers-rest.md b/.changeset/late-badgers-rest.md new file mode 100644 index 0000000000..51d37fb45a --- /dev/null +++ b/.changeset/late-badgers-rest.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-defaults': patch +--- + +Refactor cache manager inline types. diff --git a/packages/backend-defaults/api-report-cache.md b/packages/backend-defaults/api-report-cache.md index 2cd2f3efc9..c41d553ac8 100644 --- a/packages/backend-defaults/api-report-cache.md +++ b/packages/backend-defaults/api-report-cache.md @@ -11,15 +11,10 @@ import { ServiceFactory } from '@backstage/backend-plugin-api'; // @public export class CacheManager { - forPlugin(pluginId: string): { - getClient(options?: CacheServiceOptions): CacheService; - }; + forPlugin(pluginId: string): PluginCacheManager; static fromConfig( config: Config, - options?: { - logger?: LoggerService; - onError?: (err: Error) => void; - }, + options?: CacheManagerOptions, ): CacheManager; } diff --git a/packages/backend-defaults/src/entrypoints/cache/CacheManager.ts b/packages/backend-defaults/src/entrypoints/cache/CacheManager.ts index 70f952ea46..89fabfe977 100644 --- a/packages/backend-defaults/src/entrypoints/cache/CacheManager.ts +++ b/packages/backend-defaults/src/entrypoints/cache/CacheManager.ts @@ -15,24 +15,16 @@ */ import { - CacheService, CacheServiceOptions, LoggerService, } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import Keyv from 'keyv'; import { DefaultCacheClient } from './CacheClient'; -import { CacheManagerOptions } from './types'; +import { CacheManagerOptions, PluginCacheManager } from './types'; type StoreFactory = (pluginId: string, defaultTtl: number | undefined) => Keyv; -/* - * TODO(freben): This class intentionally inlines the CacheManagerOptions and - * PluginCacheManager types, to not break the api reports in backend-common - * which re-exports it. When backend-common is deprecated, we can stop inlining - * those types. - */ - /** * Implements a Cache Manager which will automatically create new cache clients * for plugins when requested. All requested cache clients are created with the @@ -66,18 +58,7 @@ export class CacheManager { */ static fromConfig( config: Config, - options: { - /** - * An optional logger for use by the PluginCacheManager. - */ - logger?: LoggerService; - - /** - * An optional handler for connection errors emitted from the underlying data - * store. - */ - onError?: (err: Error) => void; - } = {}, + options: CacheManagerOptions = {}, ): CacheManager { // If no `backend.cache` config is provided, instantiate the CacheManager // with an in-memory cache client. @@ -126,9 +107,7 @@ export class CacheManager { * @param pluginId - The plugin that the cache manager should be created for. * Plugin names should be unique. */ - forPlugin(pluginId: string): { - getClient(options?: CacheServiceOptions): CacheService; - } { + forPlugin(pluginId: string): PluginCacheManager { return { getClient: (defaultOptions = {}) => { const clientFactory = (options: CacheServiceOptions) => { From b82eaf64e2a522d7970d924ee275fbde2c9e9eda Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Sun, 16 Jun 2024 11:19:39 +0200 Subject: [PATCH 218/387] test: add tests for handleBitbucketCloudRequest Signed-off-by: Benjamin Janssens --- .../src/service/autocomplete.test.ts | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 plugins/scaffolder-backend/src/service/autocomplete.test.ts diff --git a/plugins/scaffolder-backend/src/service/autocomplete.test.ts b/plugins/scaffolder-backend/src/service/autocomplete.test.ts new file mode 100644 index 0000000000..53816f0126 --- /dev/null +++ b/plugins/scaffolder-backend/src/service/autocomplete.test.ts @@ -0,0 +1,87 @@ +/* + * Copyright 2024 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 { BitbucketCloudClient } from '@backstage/plugin-bitbucket-cloud-common'; +import { handleBitbucketCloudRequest } from './autocomplete'; +import { InputError } from '@backstage/errors'; + +describe('handleBitbucketCloudRequest', () => { + const client: Partial = { + listWorkspaces: jest.fn().mockReturnValue({ + iteratePages: jest + .fn() + .mockReturnValue([{ values: [{ slug: 'workspace1' }] }]), + }), + listProjectsByWorkspace: jest.fn().mockReturnValue({ + iteratePages: jest + .fn() + .mockReturnValue([{ values: [{ key: 'project1' }] }]), + }), + listRepositoriesByWorkspace: jest.fn().mockReturnValue({ + iteratePages: jest + .fn() + .mockReturnValue([{ values: [{ slug: 'repository1' }] }]), + }), + }; + + const fromConfig = jest + .spyOn(BitbucketCloudClient, 'fromConfig') + .mockReturnValue(client as BitbucketCloudClient); + + it('should pass the token to the client', async () => { + const accessToken = 'foo'; + await handleBitbucketCloudRequest(accessToken, 'workspaces', {}); + + expect(fromConfig).toHaveBeenCalledWith( + expect.objectContaining({ accessToken }), + ); + }); + + it('should return workspaces', async () => { + const result = await handleBitbucketCloudRequest('foo', 'workspaces', {}); + + expect(result).toEqual(['workspace1']); + }); + + it('should return projects', async () => { + const result = await handleBitbucketCloudRequest('foo', 'projects', { + workspace: 'workspace1', + }); + + expect(result).toEqual(['project1']); + }); + + it('should return repositories', async () => { + const result = await handleBitbucketCloudRequest('foo', 'repositories', { + workspace: 'workspace1', + project: 'project1', + }); + + expect(result).toEqual(['repository1']); + }); + + it('should throw an error when passing an invalid resource', async () => { + await expect( + handleBitbucketCloudRequest('token', 'invalid', {}), + ).rejects.toThrow(InputError); + }); + + it('should throw an error when there are missing parameters', async () => { + await expect( + handleBitbucketCloudRequest('token', 'projects', {}), + ).rejects.toThrow(InputError); + }); +}); From 2aa81ad13a19ddaf3a3960a976ead3ae0a83762c Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Sun, 16 Jun 2024 11:50:05 +0200 Subject: [PATCH 219/387] test: improve tests for autocomplete endpoint Signed-off-by: Benjamin Janssens --- .../src/service/router.test.ts | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/plugins/scaffolder-backend/src/service/router.test.ts b/plugins/scaffolder-backend/src/service/router.test.ts index 0024a57bd9..f9ff1b2a04 100644 --- a/plugins/scaffolder-backend/src/service/router.test.ts +++ b/plugins/scaffolder-backend/src/service/router.test.ts @@ -63,9 +63,7 @@ jest.mock('fs-extra', () => ({ remove: jest.fn(), })); -jest.mock('./autocomplete', () => ({ - handleBitbucketCloudRequest: jest.fn(), -})); +jest.mock('./autocomplete'); function createDatabase(): PluginDatabaseManager { return DatabaseManager.fromConfig( @@ -1469,18 +1467,25 @@ data: {"id":1,"taskId":"a-random-id","type":"completion","createdAt":"","body":{ describe('GET /v2/autocomplete/:provider/:resource', () => { it('should handle requests for provider bitbucketCloud', async () => { + jest + .mocked(handleBitbucketCloudRequest) + .mockResolvedValue(['resource1']); + const bbToken = 'foo'; const resource = 'bar'; - await request(app) - .get(`/v2/autocomplete/bitbucketCloud/${resource}?token=${bbToken}`) - .send(); + const response = await request(app) + .get(`/v2/autocomplete/bitbucketCloud/${resource}`) + .query({ token: bbToken, workspace: 'workspace1' }); - expect(jest.mocked(handleBitbucketCloudRequest)).toHaveBeenCalledWith( + expect(handleBitbucketCloudRequest).toHaveBeenCalledWith( bbToken, resource, - {}, + { workspace: 'workspace1' }, ); + + expect(response.status).toEqual(200); + expect(response.body).toEqual(['resource1']); }); }); }); From 025f23f01343b66f85e439fc684546f9abf2cc2f Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Sun, 16 Jun 2024 12:02:23 +0200 Subject: [PATCH 220/387] test: clean up tests Signed-off-by: Benjamin Janssens --- .../fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx | 3 +++ .../fields/RepoUrlPicker/RepoUrlPickerRepoName.test.tsx | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx index eb8c1f3a2c..18ce8d2c76 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx @@ -189,6 +189,7 @@ describe('BitbucketRepoPicker', () => { describe('autocompletion', () => { it('should populate workspaces if host is set and accessToken is provided', async () => { const onChange = jest.fn(); + const { getAllByRole, getByText } = render( { it('should populate projects if host and workspace are set and accessToken is provided', async () => { const onChange = jest.fn(); + const { getAllByRole, getByText } = render( { it('should populate repositories if host, workspace and project are set and accessToken is provided', async () => { const onChange = jest.fn(); + render( { } // Verify that selecting an option calls onChange - await userEvent.click(getByText('foo')); - expect(onChange).toHaveBeenCalledWith('foo'); + await userEvent.click(getByText(availableRepos[0])); + expect(onChange).toHaveBeenCalledWith(availableRepos[0]); }); }); From 4a50a8736466fcf1b90d59be311a668255b62d0c Mon Sep 17 00:00:00 2001 From: Phil Kuang Date: Sun, 16 Jun 2024 10:52:30 -0400 Subject: [PATCH 221/387] refactor(userInfo): minor updates Signed-off-by: Phil Kuang --- .changeset/cold-comics-rush.md | 2 ++ packages/backend-app-api/package.json | 1 + .../implementations/userInfo/userInfoServiceFactory.ts | 1 + plugins/auth-backend/src/identity/TokenFactory.test.ts | 3 ++- plugins/auth-backend/src/identity/TokenFactory.ts | 5 ++++- .../src/identity/UserInfoDatabaseHandler.test.ts | 7 ++++--- yarn.lock | 1 + 7 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.changeset/cold-comics-rush.md b/.changeset/cold-comics-rush.md index edb481fd83..4bd9a4de22 100644 --- a/.changeset/cold-comics-rush.md +++ b/.changeset/cold-comics-rush.md @@ -4,3 +4,5 @@ --- Limited user tokens will no longer include the `ent` field in its payload. Ownership claims will now be fetched from the user info service. + +NOTE: Limited tokens issued prior to this change will no longer be valid. Users may have to clear their browser cookies in order to refresh their auth tokens. diff --git a/packages/backend-app-api/package.json b/packages/backend-app-api/package.json index f188b4aa51..9ede813a3a 100644 --- a/packages/backend-app-api/package.json +++ b/packages/backend-app-api/package.json @@ -79,6 +79,7 @@ "minimatch": "^9.0.0", "minimist": "^1.2.5", "morgan": "^1.10.0", + "node-fetch": "^2.6.7", "node-forge": "^1.3.1", "path-to-regexp": "^6.2.1", "selfsigned": "^2.0.0", diff --git a/packages/backend-app-api/src/services/implementations/userInfo/userInfoServiceFactory.ts b/packages/backend-app-api/src/services/implementations/userInfo/userInfoServiceFactory.ts index 5362ff83b0..db550bf9e8 100644 --- a/packages/backend-app-api/src/services/implementations/userInfo/userInfoServiceFactory.ts +++ b/packages/backend-app-api/src/services/implementations/userInfo/userInfoServiceFactory.ts @@ -24,6 +24,7 @@ import { } from '@backstage/backend-plugin-api'; import { ResponseError } from '@backstage/errors'; import { decodeJwt } from 'jose'; +import fetch from 'node-fetch'; import { toInternalBackstageCredentials } from '../auth/helpers'; type Options = { diff --git a/plugins/auth-backend/src/identity/TokenFactory.test.ts b/plugins/auth-backend/src/identity/TokenFactory.test.ts index d4221ed389..34e04aa858 100644 --- a/plugins/auth-backend/src/identity/TokenFactory.test.ts +++ b/plugins/auth-backend/src/identity/TokenFactory.test.ts @@ -22,6 +22,7 @@ import { decodeProtectedHeader, jwtVerify, } from 'jose'; +import { omit } from 'lodash'; import { MemoryKeyStore } from './MemoryKeyStore'; import { TokenFactory } from './TokenFactory'; import { UserInfoDatabaseHandler } from './UserInfoDatabaseHandler'; @@ -88,7 +89,7 @@ describe('TokenFactory', () => { ); expect(mockUserInfoDatabaseHandler.addUserInfo).toHaveBeenCalledWith({ - claims: verifyResult.payload, + claims: omit(verifyResult.payload, ['aud', 'iat', 'iss', 'uip']), }); // Emulate the reconstruction of a limited user token diff --git a/plugins/auth-backend/src/identity/TokenFactory.ts b/plugins/auth-backend/src/identity/TokenFactory.ts index 12798a4d79..a1643cdbe3 100644 --- a/plugins/auth-backend/src/identity/TokenFactory.ts +++ b/plugins/auth-backend/src/identity/TokenFactory.ts @@ -25,6 +25,7 @@ import { GeneralSign, KeyLike, } from 'jose'; +import { omit } from 'lodash'; import { DateTime } from 'luxon'; import { v4 as uuid } from 'uuid'; import { LoggerService } from '@backstage/backend-plugin-api'; @@ -220,7 +221,9 @@ export class TokenFactory implements TokenIssuer { // Store the user info in the database upon successful token // issuance so that it can be retrieved later by limited user tokens - await this.userInfoDatabaseHandler.addUserInfo({ claims }); + await this.userInfoDatabaseHandler.addUserInfo({ + claims: omit(claims, ['aud', 'iat', 'iss', 'uip']), + }); return token; } diff --git a/plugins/auth-backend/src/identity/UserInfoDatabaseHandler.test.ts b/plugins/auth-backend/src/identity/UserInfoDatabaseHandler.test.ts index b9f4d84bd5..ef3d0f6c8b 100644 --- a/plugins/auth-backend/src/identity/UserInfoDatabaseHandler.test.ts +++ b/plugins/auth-backend/src/identity/UserInfoDatabaseHandler.test.ts @@ -24,6 +24,8 @@ const migrationsDir = resolvePackagePath( 'migrations', ); +jest.setTimeout(60_000); + describe('UserInfoDatabaseHandler', () => { const databases = TestDatabases.create(); @@ -41,14 +43,14 @@ describe('UserInfoDatabaseHandler', () => { } describe.each(databases.eachSupportedId())( - '%p', + 'should support database %p', databaseId => { let knex: Knex; let dbHandler: UserInfoDatabaseHandler; beforeEach(async () => { ({ knex, dbHandler } = await createDatabaseHandler(databaseId)); - }, 30000); + }); it('addUserInfo', async () => { const userInfo = { @@ -104,6 +106,5 @@ describe('UserInfoDatabaseHandler', () => { expect(savedUserInfo).toEqual(userInfo); }); }, - 60000, ); }); diff --git a/yarn.lock b/yarn.lock index 977e2b724f..5fb392ee4d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3325,6 +3325,7 @@ __metadata: minimist: ^1.2.5 morgan: ^1.10.0 msw: ^1.0.0 + node-fetch: ^2.6.7 node-forge: ^1.3.1 path-to-regexp: ^6.2.1 selfsigned: ^2.0.0 From 032a7a63551dccde969084dfb8e43a969c1f10f1 Mon Sep 17 00:00:00 2001 From: Camila Belo Date: Mon, 17 Jun 2024 09:17:16 +0200 Subject: [PATCH 222/387] refactor: reorganize deprecated files Signed-off-by: Camila Belo --- .changeset/witty-avocados-pump.md | 5 + packages/backend-common/api-report.md | 22 +- .../src/auth/createLegacyAuthAdapters.ts | 2 +- packages/backend-common/src/config.ts | 2 +- .../backend-common/src/deprecated/index.ts | 270 ++++++++++++++++++ .../logging/createRootLogger.ts | 4 +- .../{ => deprecated}/logging/globalLoggers.ts | 0 .../src/deprecated/logging/index.ts | 22 ++ .../middleware/errorHandler.test.ts | 8 +- .../middleware/errorHandler.ts | 5 +- .../middleware}/index.ts | 8 +- .../middleware/notFoundHandler.test.ts | 0 .../middleware/notFoundHandler.ts | 2 +- .../middleware/requestLoggingHandler.test.ts | 0 .../middleware/requestLoggingHandler.ts | 6 +- .../service/createServiceBuilder.ts | 0 .../src/deprecated/service/index.ts | 18 ++ .../service/lib/ServiceBuilderImpl.test.ts | 0 .../service/lib/ServiceBuilderImpl.ts | 4 +- .../src/{ => deprecated}/service/types.ts | 1 + .../src/discovery/HostDiscovery.ts | 51 ---- packages/backend-common/src/index.ts | 4 +- packages/backend-common/src/logging/index.ts | 6 - .../backend-common/src/middleware/index.ts | 3 - packages/backend-common/src/reading/index.ts | 220 -------------- .../src/service/createStatusCheckRouter.ts | 3 +- packages/backend-common/src/service/index.ts | 2 - 27 files changed, 350 insertions(+), 318 deletions(-) create mode 100644 .changeset/witty-avocados-pump.md rename packages/backend-common/src/{ => deprecated}/logging/createRootLogger.ts (98%) rename packages/backend-common/src/{ => deprecated}/logging/globalLoggers.ts (100%) create mode 100644 packages/backend-common/src/deprecated/logging/index.ts rename packages/backend-common/src/{ => deprecated}/middleware/errorHandler.test.ts (100%) rename packages/backend-common/src/{ => deprecated}/middleware/errorHandler.ts (92%) rename packages/backend-common/src/{discovery => deprecated/middleware}/index.ts (84%) rename packages/backend-common/src/{ => deprecated}/middleware/notFoundHandler.test.ts (100%) rename packages/backend-common/src/{ => deprecated}/middleware/notFoundHandler.ts (93%) rename packages/backend-common/src/{ => deprecated}/middleware/requestLoggingHandler.test.ts (100%) rename packages/backend-common/src/{ => deprecated}/middleware/requestLoggingHandler.ts (86%) rename packages/backend-common/src/{ => deprecated}/service/createServiceBuilder.ts (100%) create mode 100644 packages/backend-common/src/deprecated/service/index.ts rename packages/backend-common/src/{ => deprecated}/service/lib/ServiceBuilderImpl.test.ts (100%) rename packages/backend-common/src/{ => deprecated}/service/lib/ServiceBuilderImpl.ts (98%) rename packages/backend-common/src/{ => deprecated}/service/types.ts (96%) delete mode 100644 packages/backend-common/src/discovery/HostDiscovery.ts delete mode 100644 packages/backend-common/src/reading/index.ts diff --git a/.changeset/witty-avocados-pump.md b/.changeset/witty-avocados-pump.md new file mode 100644 index 0000000000..e3d781c8d3 --- /dev/null +++ b/.changeset/witty-avocados-pump.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-common': patch +--- + +Deprecate the legacy error and request logging handler types, respectively: `ErrorHandlerOptions` and `RequestLoggingHandlerFactory`. diff --git a/packages/backend-common/api-report.md b/packages/backend-common/api-report.md index 84328924bd..b508796d9a 100644 --- a/packages/backend-common/api-report.md +++ b/packages/backend-common/api-report.md @@ -48,21 +48,21 @@ import { PluginMetadataService } from '@backstage/backend-plugin-api'; import { PushResult } from 'isomorphic-git'; import { Readable } from 'stream'; import { ReadCommitResult } from 'isomorphic-git'; -import type { ReadTreeOptions as ReadTreeOptions_2 } from '@backstage/backend-plugin-api'; -import type { ReadTreeResponse as ReadTreeResponse_2 } from '@backstage/backend-plugin-api'; -import type { ReadTreeResponseDirOptions as ReadTreeResponseDirOptions_2 } from '@backstage/backend-plugin-api'; -import type { ReadTreeResponseFile as ReadTreeResponseFile_2 } from '@backstage/backend-plugin-api'; -import type { ReadUrlOptions as ReadUrlOptions_2 } from '@backstage/backend-plugin-api'; -import type { ReadUrlResponse as ReadUrlResponse_2 } from '@backstage/backend-plugin-api'; +import { ReadTreeOptions as ReadTreeOptions_2 } from '@backstage/backend-plugin-api'; +import { ReadTreeResponse as ReadTreeResponse_2 } from '@backstage/backend-plugin-api'; +import { ReadTreeResponseDirOptions as ReadTreeResponseDirOptions_2 } from '@backstage/backend-plugin-api'; +import { ReadTreeResponseFile as ReadTreeResponseFile_2 } from '@backstage/backend-plugin-api'; +import { ReadUrlOptions as ReadUrlOptions_2 } from '@backstage/backend-plugin-api'; +import { ReadUrlResponse as ReadUrlResponse_2 } from '@backstage/backend-plugin-api'; import { RequestHandler } from 'express'; import { resolvePackagePath as resolvePackagePath_2 } from '@backstage/backend-plugin-api'; import { resolveSafeChildPath as resolveSafeChildPath_2 } from '@backstage/backend-plugin-api'; import { RootConfigService } from '@backstage/backend-plugin-api'; import { Router } from 'express'; import { SchedulerService } from '@backstage/backend-plugin-api'; -import type { SearchOptions as SearchOptions_2 } from '@backstage/backend-plugin-api'; -import type { SearchResponse as SearchResponse_2 } from '@backstage/backend-plugin-api'; -import type { SearchResponseFile as SearchResponseFile_2 } from '@backstage/backend-plugin-api'; +import { SearchOptions as SearchOptions_2 } from '@backstage/backend-plugin-api'; +import { SearchResponse as SearchResponse_2 } from '@backstage/backend-plugin-api'; +import { SearchResponseFile as SearchResponseFile_2 } from '@backstage/backend-plugin-api'; import { Server } from 'http'; import { ServiceRef } from '@backstage/backend-plugin-api'; import { TokenManagerService } from '@backstage/backend-plugin-api'; @@ -230,7 +230,7 @@ export function errorHandler( options?: ErrorHandlerOptions, ): ErrorRequestHandler; -// @public +// @public @deprecated export type ErrorHandlerOptions = { showStackTraces?: boolean; logger?: LoggerService; @@ -538,7 +538,7 @@ export function redactWinstonLogLine( // @public @deprecated export function requestLoggingHandler(logger?: LoggerService): RequestHandler; -// @public +// @public @deprecated export type RequestLoggingHandlerFactory = ( logger?: LoggerService, ) => RequestHandler; diff --git a/packages/backend-common/src/auth/createLegacyAuthAdapters.ts b/packages/backend-common/src/auth/createLegacyAuthAdapters.ts index 94f997640d..8bef5ddcc8 100644 --- a/packages/backend-common/src/auth/createLegacyAuthAdapters.ts +++ b/packages/backend-common/src/auth/createLegacyAuthAdapters.ts @@ -43,7 +43,7 @@ import { } from '@backstage/plugin-auth-node'; import { decodeJwt } from 'jose'; import { TokenManager } from '../deprecated'; -import { PluginEndpointDiscovery } from '../discovery'; +import { PluginEndpointDiscovery } from '../deprecated'; import { JsonObject } from '@backstage/types'; class AuthCompat implements AuthService { diff --git a/packages/backend-common/src/config.ts b/packages/backend-common/src/config.ts index 733cd62390..8e5e8d7be7 100644 --- a/packages/backend-common/src/config.ts +++ b/packages/backend-common/src/config.ts @@ -22,7 +22,7 @@ import { import { LoggerService } from '@backstage/backend-plugin-api'; import { AppConfig, Config } from '@backstage/config'; import { LoadConfigOptionsRemote } from '@backstage/config-loader'; -import { setRootLoggerRedactionList } from './logging/createRootLogger'; +import { setRootLoggerRedactionList } from './deprecated/logging/createRootLogger'; /** * Load configuration for a Backend. diff --git a/packages/backend-common/src/deprecated/index.ts b/packages/backend-common/src/deprecated/index.ts index 5309240ccb..1099633e07 100644 --- a/packages/backend-common/src/deprecated/index.ts +++ b/packages/backend-common/src/deprecated/index.ts @@ -14,15 +14,59 @@ * limitations under the License. */ +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { HostDiscovery as _HostDiscovery } from '../../../backend-defaults/src/entrypoints/discovery/HostDiscovery'; + // eslint-disable-next-line @backstage/no-relative-monorepo-imports import { CacheManager as _CacheManager } from '../../../backend-defaults/src/entrypoints/cache/CacheManager'; + // eslint-disable-next-line @backstage/no-relative-monorepo-imports import { type PluginCacheManager as _PluginCacheManager, type CacheManagerOptions as _CacheManagerOptions, } from '../../../backend-defaults/src/entrypoints/cache/types'; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { AzureUrlReader as _AzureUrlReader } from '../../../backend-defaults/src/entrypoints/urlReader/lib/AzureUrlReader'; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { BitbucketCloudUrlReader as _BitbucketCloudUrlReader } from '../../../backend-defaults/src/entrypoints/urlReader/lib/BitbucketCloudUrlReader'; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { BitbucketUrlReader as _BitbucketUrlReader } from '../../../backend-defaults/src/entrypoints/urlReader/lib/BitbucketUrlReader'; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { BitbucketServerUrlReader as _BitbucketServerUrlReader } from '../../../backend-defaults/src/entrypoints/urlReader/lib/BitbucketServerUrlReader'; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { GerritUrlReader as _GerritUrlReader } from '../../../backend-defaults/src/entrypoints/urlReader/lib/GerritUrlReader'; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { GithubUrlReader as _GithubUrlReader } from '../../../backend-defaults/src/entrypoints/urlReader/lib/GithubUrlReader'; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { GitlabUrlReader as _GitlabUrlReader } from '../../../backend-defaults/src/entrypoints/urlReader/lib/GitlabUrlReader'; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { GiteaUrlReader as _GiteaUrlReader } from '../../../backend-defaults/src/entrypoints/urlReader/lib/GiteaUrlReader'; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { HarnessUrlReader as _HarnessUrlReader } from '../../../backend-defaults/src/entrypoints/urlReader/lib/HarnessUrlReader'; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { AwsS3UrlReader as _AwsS3UrlReader } from '../../../backend-defaults/src/entrypoints/urlReader/lib/AwsS3UrlReader'; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { FetchUrlReader as _FetchUrlReader } from '../../../backend-defaults/src/entrypoints/urlReader/lib/FetchUrlReader'; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { UrlReaders as _UrlReaders } from '../../../backend-defaults/src/entrypoints/urlReader/lib/UrlReaders'; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { ReadUrlResponseFactory as _ReadUrlResponseFactory } from '../../../backend-defaults/src/entrypoints/urlReader/lib/ReadUrlResponseFactory'; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import type { UrlReadersOptions as _UrlReadersOptions } from '../../../backend-defaults/src/entrypoints/urlReader/lib/UrlReaders'; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import type { FromReadableArrayOptions as _FromReadableArrayOptions } from '../../../backend-defaults/src/entrypoints/urlReader/lib/types'; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import type { + ReaderFactory as _ReaderFactory, + ReadTreeResponseFactory as _ReadTreeResponseFactory, + ReadTreeResponseFactoryOptions as _ReadTreeResponseFactoryOptions, + ReadUrlResponseFactoryFromStreamOptions as _ReadUrlResponseFactoryFromStreamOptions, + UrlReaderPredicateTuple as _UrlReaderPredicateTuple, +} from '../../../backend-defaults/src/entrypoints/urlReader/lib/types'; + import { + DiscoveryService, CacheService, CacheServiceOptions, CacheServiceSetOptions, @@ -30,10 +74,55 @@ import { resolvePackagePath as _resolvePackagePath, resolveSafeChildPath as _resolveSafeChildPath, isChildPath as _isChildPath, + ReadTreeOptions as _ReadTreeOptions, + ReadTreeResponse as _ReadTreeResponse, + ReadTreeResponseFile as _ReadTreeResponseFile, + ReadTreeResponseDirOptions as _ReadTreeResponseDirOptions, + ReadUrlOptions as _ReadUrlOptions, + ReadUrlResponse as _ReadUrlResponse, + SearchOptions as _SearchOptions, + SearchResponse as _SearchResponse, + SearchResponseFile as _SearchResponseFile, + UrlReaderService as _UrlReaderService, } from '@backstage/backend-plugin-api'; export * from './scm'; export * from './tokens'; +export * from './logging'; +export * from './service'; +export * from './middleware'; + +/** + * @public + * @deprecated Use `DiscoveryService` from `@backstage/backend-plugin-api` instead + */ +export type PluginEndpointDiscovery = DiscoveryService; + +/** + * HostDiscovery is a basic PluginEndpointDiscovery implementation + * that can handle plugins that are hosted in a single or multiple deployments. + * + * The deployment may be scaled horizontally, as long as the external URL + * is the same for all instances. However, internal URLs will always be + * resolved to the same host, so there won't be any balancing of internal traffic. + * + * @public + * @deprecated Please import from `@backstage/backend-defaults/discovery` instead. + */ +export const HostDiscovery = _HostDiscovery; + +/** + * SingleHostDiscovery is a basic PluginEndpointDiscovery implementation + * that assumes that all plugins are hosted in a single deployment. + * + * The deployment may be scaled horizontally, as long as the external URL + * is the same for all instances. However, internal URLs will always be + * resolved to the same host, so there won't be any balancing of internal traffic. + * + * @public + * @deprecated Use `HostDiscovery` from `@backstage/backend-defaults/discovery` instead + */ +export const SingleHostDiscovery = _HostDiscovery; /** * @public @@ -98,3 +187,184 @@ export const resolveSafeChildPath = _resolveSafeChildPath; * Please use the `isChildPath` function from the `@backstage/cli-common` package instead. */ export const isChildPath = _isChildPath; + +/** + * @public + * @deprecated Import from `@backstage/backend-defaults/urlReader` instead + */ +export const AzureUrlReader = _AzureUrlReader; + +/** + * @public + * @deprecated Import from `@backstage/backend-defaults/urlReader` instead + */ +export const BitbucketCloudUrlReader = _BitbucketCloudUrlReader; + +/** + * @public + * @deprecated Import from `@backstage/backend-defaults/urlReader` instead + */ +export const BitbucketUrlReader = _BitbucketUrlReader; + +/** + * @public + * @deprecated Import from `@backstage/backend-defaults/urlReader` instead + */ +export const BitbucketServerUrlReader = _BitbucketServerUrlReader; + +/** + * @public + * @deprecated Import from `@backstage/backend-defaults/urlReader` instead + */ +export const GerritUrlReader = _GerritUrlReader; + +/** + * @public + * @deprecated Import from `@backstage/backend-defaults/urlReader` instead + */ +export const GithubUrlReader = _GithubUrlReader; + +/** + * @public + * @deprecated Import from `@backstage/backend-defaults/urlReader` instead + */ +export const GitlabUrlReader = _GitlabUrlReader; + +/** + * @public + * @deprecated Import from `@backstage/backend-defaults/urlReader` instead + */ +export const GiteaUrlReader = _GiteaUrlReader; + +/** + * @public + * @deprecated Import from `@backstage/backend-defaults/urlReader` instead + */ +export const HarnessUrlReader = _HarnessUrlReader; + +/** + * @public + * @deprecated Import from `@backstage/backend-defaults/urlReader` instead + */ +export const AwsS3UrlReader = _AwsS3UrlReader; + +/** + * @public + * @deprecated Import from `@backstage/backend-defaults/urlReader` instead + */ +export const FetchUrlReader = _FetchUrlReader; + +/** + * @public + * @deprecated Import from `@backstage/backend-defaults/urlReader` instead + */ +export const UrlReaders = _UrlReaders; + +/** + * @public + * @deprecated Import from `@backstage/backend-defaults/urlReader` instead + */ +export const ReadUrlResponseFactory = _ReadUrlResponseFactory; + +/** + * @public + * @deprecated Import from `@backstage/backend-defaults/urlReader` instead + */ +export type UrlReadersOptions = _UrlReadersOptions; + +/** + * @public + * @deprecated Import from `@backstage/backend-defaults/urlReader` instead + */ +export type FromReadableArrayOptions = _FromReadableArrayOptions; + +/** + * @public + * @deprecated Import from `@backstage/backend-defaults/urlReader` instead + */ +export type ReaderFactory = _ReaderFactory; + +/** + * @public + * @deprecated Import from `@backstage/backend-defaults/urlReader` instead + */ +export type ReadTreeResponseFactory = _ReadTreeResponseFactory; + +/** + * @public + * @deprecated Import from `@backstage/backend-defaults/urlReader` instead + */ +export type ReadTreeResponseFactoryOptions = _ReadTreeResponseFactoryOptions; + +/** + * @public + * @deprecated Import from `@backstage/backend-defaults/urlReader` instead + */ +export type ReadUrlResponseFactoryFromStreamOptions = + _ReadUrlResponseFactoryFromStreamOptions; + +/** + * @public + * @deprecated Import from `@backstage/backend-defaults/urlReader` instead + */ +export type UrlReaderPredicateTuple = _UrlReaderPredicateTuple; + +/** + * @public + * @deprecated Use `UrlReaderServiceReadTreeOptions` from `@backstage/backend-plugin-api` instead + */ +export type ReadTreeOptions = _ReadTreeOptions; + +/** + * @public + * @deprecated Use `UrlReaderServiceReadTreeResponse` from `@backstage/backend-plugin-api` instead + */ +export type ReadTreeResponse = _ReadTreeResponse; + +/** + * @public + * @deprecated Use `UrlReaderServiceReadTreeResponseFile` from `@backstage/backend-plugin-api` instead + */ +export type ReadTreeResponseFile = _ReadTreeResponseFile; + +/** + * @public + * @deprecated Use `UrlReaderServiceReadTreeResponseDirOptions` from `@backstage/backend-plugin-api` instead + */ +export type ReadTreeResponseDirOptions = _ReadTreeResponseDirOptions; + +/** + * @public + * @deprecated Use `UrlReaderServiceReadUrlOptions` from `@backstage/backend-plugin-api` instead + */ +export type ReadUrlOptions = _ReadUrlOptions; + +/** + * @public + * @deprecated Use `UrlReaderServiceReadUrlResponse` from `@backstage/backend-plugin-api` instead + */ +export type ReadUrlResponse = _ReadUrlResponse; + +/** + * @public + * @deprecated Use `UrlReaderServiceSearchOptions` from `@backstage/backend-plugin-api` instead + */ +export type SearchOptions = _SearchOptions; + +/** + * @public + * @deprecated Use `UrlReaderServiceSearchResponse` from `@backstage/backend-plugin-api` instead + */ +export type SearchResponse = _SearchResponse; + +/** + * @public + * @deprecated Use `UrlReaderServiceSearchResponseFile` from `@backstage/backend-plugin-api` instead + */ +export type SearchResponseFile = _SearchResponseFile; + +/** + * @public + * @deprecated Use `UrlReaderService` from `@backstage/backend-plugin-api` instead + */ +export type UrlReader = _UrlReaderService; diff --git a/packages/backend-common/src/logging/createRootLogger.ts b/packages/backend-common/src/deprecated/logging/createRootLogger.ts similarity index 98% rename from packages/backend-common/src/logging/createRootLogger.ts rename to packages/backend-common/src/deprecated/logging/createRootLogger.ts index 20ee272b79..b177024601 100644 --- a/packages/backend-common/src/logging/createRootLogger.ts +++ b/packages/backend-common/src/deprecated/logging/createRootLogger.ts @@ -15,12 +15,12 @@ */ // eslint-disable-next-line @backstage/no-relative-monorepo-imports -import { WinstonLogger } from '../../../backend-app-api/src/logging/WinstonLogger'; +import { WinstonLogger } from '../../../../backend-app-api/src/logging/WinstonLogger'; import { merge } from 'lodash'; import * as winston from 'winston'; import { format, LoggerOptions } from 'winston'; -import { setRootLogger } from './globalLoggers'; import { TransformableInfo } from 'logform'; +import { setRootLogger } from './globalLoggers'; const getRedacter = (() => { let redacter: ReturnType | undefined = diff --git a/packages/backend-common/src/logging/globalLoggers.ts b/packages/backend-common/src/deprecated/logging/globalLoggers.ts similarity index 100% rename from packages/backend-common/src/logging/globalLoggers.ts rename to packages/backend-common/src/deprecated/logging/globalLoggers.ts diff --git a/packages/backend-common/src/deprecated/logging/index.ts b/packages/backend-common/src/deprecated/logging/index.ts new file mode 100644 index 0000000000..b223f5c946 --- /dev/null +++ b/packages/backend-common/src/deprecated/logging/index.ts @@ -0,0 +1,22 @@ +/* + * Copyright 2020 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. + */ + +export { getRootLogger, getVoidLogger, setRootLogger } from './globalLoggers'; +export { + createRootLogger, + redactWinstonLogLine, + coloredFormat, +} from './createRootLogger'; diff --git a/packages/backend-common/src/middleware/errorHandler.test.ts b/packages/backend-common/src/deprecated/middleware/errorHandler.test.ts similarity index 100% rename from packages/backend-common/src/middleware/errorHandler.test.ts rename to packages/backend-common/src/deprecated/middleware/errorHandler.test.ts index ab07a91022..2544a0a863 100644 --- a/packages/backend-common/src/middleware/errorHandler.test.ts +++ b/packages/backend-common/src/deprecated/middleware/errorHandler.test.ts @@ -14,6 +14,10 @@ * limitations under the License. */ +import express from 'express'; +import { STATUS_CODES } from 'http'; +import createError from 'http-errors'; +import request from 'supertest'; import { AuthenticationError, ConflictError, @@ -23,11 +27,7 @@ import { NotModifiedError, ResponseError, } from '@backstage/errors'; -import express from 'express'; -import createError from 'http-errors'; -import request from 'supertest'; import { errorHandler } from './errorHandler'; -import { STATUS_CODES } from 'http'; describe('errorHandler', () => { it('gives default code and message', async () => { diff --git a/packages/backend-common/src/middleware/errorHandler.ts b/packages/backend-common/src/deprecated/middleware/errorHandler.ts similarity index 92% rename from packages/backend-common/src/middleware/errorHandler.ts rename to packages/backend-common/src/deprecated/middleware/errorHandler.ts index 346fe01645..618e30ffa1 100644 --- a/packages/backend-common/src/middleware/errorHandler.ts +++ b/packages/backend-common/src/deprecated/middleware/errorHandler.ts @@ -16,15 +16,16 @@ import { ErrorRequestHandler } from 'express'; import { LoggerService } from '@backstage/backend-plugin-api'; -import { getRootLogger } from '../logging'; import { ConfigReader } from '@backstage/config'; // eslint-disable-next-line @backstage/no-relative-monorepo-imports -import { MiddlewareFactory } from '../../../backend-app-api/src/http/MiddlewareFactory'; +import { MiddlewareFactory } from '../../../../backend-app-api/src/http/MiddlewareFactory'; +import { getRootLogger } from '../logging'; /** * Options passed to the {@link errorHandler} middleware. * * @public + * @deprecated This type is being deprecated along with the {@link @backstage/backend-common#errorHandler} function. */ export type ErrorHandlerOptions = { /** diff --git a/packages/backend-common/src/discovery/index.ts b/packages/backend-common/src/deprecated/middleware/index.ts similarity index 84% rename from packages/backend-common/src/discovery/index.ts rename to packages/backend-common/src/deprecated/middleware/index.ts index 827fd059ad..6c284cc6ec 100644 --- a/packages/backend-common/src/discovery/index.ts +++ b/packages/backend-common/src/deprecated/middleware/index.ts @@ -14,8 +14,6 @@ * limitations under the License. */ -export { - HostDiscovery, - SingleHostDiscovery, - type PluginEndpointDiscovery, -} from './HostDiscovery'; +export * from './errorHandler'; +export * from './notFoundHandler'; +export * from './requestLoggingHandler'; diff --git a/packages/backend-common/src/middleware/notFoundHandler.test.ts b/packages/backend-common/src/deprecated/middleware/notFoundHandler.test.ts similarity index 100% rename from packages/backend-common/src/middleware/notFoundHandler.test.ts rename to packages/backend-common/src/deprecated/middleware/notFoundHandler.test.ts diff --git a/packages/backend-common/src/middleware/notFoundHandler.ts b/packages/backend-common/src/deprecated/middleware/notFoundHandler.ts similarity index 93% rename from packages/backend-common/src/middleware/notFoundHandler.ts rename to packages/backend-common/src/deprecated/middleware/notFoundHandler.ts index 19c01ede9c..f499418dba 100644 --- a/packages/backend-common/src/middleware/notFoundHandler.ts +++ b/packages/backend-common/src/deprecated/middleware/notFoundHandler.ts @@ -15,7 +15,7 @@ */ // eslint-disable-next-line @backstage/no-relative-monorepo-imports -import { MiddlewareFactory } from '../../../backend-app-api/src/http/MiddlewareFactory'; +import { MiddlewareFactory } from '../../../../backend-app-api/src/http/MiddlewareFactory'; import { ConfigReader } from '@backstage/config'; import { RequestHandler } from 'express'; import { getRootLogger } from '../logging'; diff --git a/packages/backend-common/src/middleware/requestLoggingHandler.test.ts b/packages/backend-common/src/deprecated/middleware/requestLoggingHandler.test.ts similarity index 100% rename from packages/backend-common/src/middleware/requestLoggingHandler.test.ts rename to packages/backend-common/src/deprecated/middleware/requestLoggingHandler.test.ts diff --git a/packages/backend-common/src/middleware/requestLoggingHandler.ts b/packages/backend-common/src/deprecated/middleware/requestLoggingHandler.ts similarity index 86% rename from packages/backend-common/src/middleware/requestLoggingHandler.ts rename to packages/backend-common/src/deprecated/middleware/requestLoggingHandler.ts index fd6973f9b6..74859b4741 100644 --- a/packages/backend-common/src/middleware/requestLoggingHandler.ts +++ b/packages/backend-common/src/deprecated/middleware/requestLoggingHandler.ts @@ -15,11 +15,11 @@ */ // eslint-disable-next-line @backstage/no-relative-monorepo-imports -import { MiddlewareFactory } from '../../../backend-app-api/src/http/MiddlewareFactory'; +import { MiddlewareFactory } from '../../../../backend-app-api/src/http/MiddlewareFactory'; import { RequestHandler } from 'express'; +import { ConfigReader } from '@backstage/config'; import { LoggerService } from '@backstage/backend-plugin-api'; import { getRootLogger } from '../logging'; -import { ConfigReader } from '@backstage/config'; /** * Logs incoming requests. @@ -27,7 +27,7 @@ import { ConfigReader } from '@backstage/config'; * @public * @param logger - An optional logger to use. If not specified, the root logger will be used. * @returns An Express request handler - * @deprecated @deprecated Use {@link @backstage/backend-app-api#MiddlewareFactory.create.logging} instead + * @deprecated Use {@link @backstage/backend-app-api#MiddlewareFactory.create.logging} instead */ export function requestLoggingHandler(logger?: LoggerService): RequestHandler { return MiddlewareFactory.create({ diff --git a/packages/backend-common/src/service/createServiceBuilder.ts b/packages/backend-common/src/deprecated/service/createServiceBuilder.ts similarity index 100% rename from packages/backend-common/src/service/createServiceBuilder.ts rename to packages/backend-common/src/deprecated/service/createServiceBuilder.ts diff --git a/packages/backend-common/src/deprecated/service/index.ts b/packages/backend-common/src/deprecated/service/index.ts new file mode 100644 index 0000000000..a9fc43c22a --- /dev/null +++ b/packages/backend-common/src/deprecated/service/index.ts @@ -0,0 +1,18 @@ +/* + * Copyright 2020 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. + */ + +export { createServiceBuilder } from './createServiceBuilder'; +export type { ServiceBuilder, RequestLoggingHandlerFactory } from './types'; diff --git a/packages/backend-common/src/service/lib/ServiceBuilderImpl.test.ts b/packages/backend-common/src/deprecated/service/lib/ServiceBuilderImpl.test.ts similarity index 100% rename from packages/backend-common/src/service/lib/ServiceBuilderImpl.test.ts rename to packages/backend-common/src/deprecated/service/lib/ServiceBuilderImpl.test.ts diff --git a/packages/backend-common/src/service/lib/ServiceBuilderImpl.ts b/packages/backend-common/src/deprecated/service/lib/ServiceBuilderImpl.ts similarity index 98% rename from packages/backend-common/src/service/lib/ServiceBuilderImpl.ts rename to packages/backend-common/src/deprecated/service/lib/ServiceBuilderImpl.ts index 039a9a51eb..1586d7c5c6 100644 --- a/packages/backend-common/src/service/lib/ServiceBuilderImpl.ts +++ b/packages/backend-common/src/deprecated/service/lib/ServiceBuilderImpl.ts @@ -22,7 +22,7 @@ import helmet, { HelmetOptions } from 'helmet'; import { ContentSecurityPolicyOptions } from 'helmet/dist/types/middlewares/content-security-policy'; import * as http from 'http'; import { LoggerService } from '@backstage/backend-plugin-api'; -import { useHotCleanup } from '../../hot'; +import { useHotCleanup } from '../../../hot'; import { getRootLogger } from '../../logging'; import { errorHandler as defaultErrorHandler, @@ -37,7 +37,7 @@ import { readHttpServerOptions, HttpServerOptions, createHttpServer, -} from '../../../../backend-app-api/src/http'; +} from '../../../../../backend-app-api/src/http'; export type CspOptions = Record; diff --git a/packages/backend-common/src/service/types.ts b/packages/backend-common/src/deprecated/service/types.ts similarity index 96% rename from packages/backend-common/src/service/types.ts rename to packages/backend-common/src/deprecated/service/types.ts index bb4f98cd1c..ace0712d2f 100644 --- a/packages/backend-common/src/service/types.ts +++ b/packages/backend-common/src/deprecated/service/types.ts @@ -128,6 +128,7 @@ export type ServiceBuilder = { * A factory for request loggers. * * @public + * @deprecated This type is being deprecated along with the {@link @backstage/backend-common#createServiceBuilder} function. */ export type RequestLoggingHandlerFactory = ( logger?: LoggerService, diff --git a/packages/backend-common/src/discovery/HostDiscovery.ts b/packages/backend-common/src/discovery/HostDiscovery.ts deleted file mode 100644 index ec8d02cce0..0000000000 --- a/packages/backend-common/src/discovery/HostDiscovery.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2020 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. - */ - -// eslint-disable-next-line @backstage/no-relative-monorepo-imports -import { HostDiscovery as _HostDiscovery } from '../../../backend-defaults/src/entrypoints/discovery/HostDiscovery'; -import { DiscoveryService } from '@backstage/backend-plugin-api'; - -/** - * @public - * @deprecated Use `DiscoveryService` from `@backstage/backend-plugin-api` instead - */ -export type PluginEndpointDiscovery = DiscoveryService; - -/** - * HostDiscovery is a basic PluginEndpointDiscovery implementation - * that can handle plugins that are hosted in a single or multiple deployments. - * - * The deployment may be scaled horizontally, as long as the external URL - * is the same for all instances. However, internal URLs will always be - * resolved to the same host, so there won't be any balancing of internal traffic. - * - * @public - * @deprecated Please import from `@backstage/backend-defaults/discovery` instead. - */ -export const HostDiscovery = _HostDiscovery; - -/** - * SingleHostDiscovery is a basic PluginEndpointDiscovery implementation - * that assumes that all plugins are hosted in a single deployment. - * - * The deployment may be scaled horizontally, as long as the external URL - * is the same for all instances. However, internal URLs will always be - * resolved to the same host, so there won't be any balancing of internal traffic. - * - * @public - * @deprecated Use `HostDiscovery` from `@backstage/backend-defaults/discovery` instead - */ -export const SingleHostDiscovery = _HostDiscovery; diff --git a/packages/backend-common/src/index.ts b/packages/backend-common/src/index.ts index bd6fdb2bb6..498b93ad8a 100644 --- a/packages/backend-common/src/index.ts +++ b/packages/backend-common/src/index.ts @@ -23,14 +23,12 @@ export { legacyPlugin, makeLegacyPlugin } from './legacy'; export type { LegacyCreateRouter } from './legacy'; export { loadBackendConfig } from './config'; +export * from './deprecated'; export * from './auth'; export * from './cache'; -export * from './deprecated'; export * from './database'; -export * from './discovery'; export * from './hot'; export * from './logging'; export * from './middleware'; -export * from './reading'; export * from './service'; export * from './util'; diff --git a/packages/backend-common/src/logging/index.ts b/packages/backend-common/src/logging/index.ts index e6b29afa15..10f949050c 100644 --- a/packages/backend-common/src/logging/index.ts +++ b/packages/backend-common/src/logging/index.ts @@ -14,10 +14,4 @@ * limitations under the License. */ -export { getRootLogger, getVoidLogger, setRootLogger } from './globalLoggers'; -export { - createRootLogger, - redactWinstonLogLine, - coloredFormat, -} from './createRootLogger'; export { loggerToWinstonLogger } from './loggerToWinstonLogger'; diff --git a/packages/backend-common/src/middleware/index.ts b/packages/backend-common/src/middleware/index.ts index f4f4fcde0b..f1754ef4d8 100644 --- a/packages/backend-common/src/middleware/index.ts +++ b/packages/backend-common/src/middleware/index.ts @@ -14,7 +14,4 @@ * limitations under the License. */ -export * from './errorHandler'; -export * from './notFoundHandler'; -export * from './requestLoggingHandler'; export * from './statusCheckHandler'; diff --git a/packages/backend-common/src/reading/index.ts b/packages/backend-common/src/reading/index.ts deleted file mode 100644 index 14863d2044..0000000000 --- a/packages/backend-common/src/reading/index.ts +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright 2020 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. - */ - -// eslint-disable-next-line @backstage/no-relative-monorepo-imports -import { AzureUrlReader as _AzureUrlReader } from '../../../backend-defaults/src/entrypoints/urlReader/lib/AzureUrlReader'; -// eslint-disable-next-line @backstage/no-relative-monorepo-imports -import { BitbucketCloudUrlReader as _BitbucketCloudUrlReader } from '../../../backend-defaults/src/entrypoints/urlReader/lib/BitbucketCloudUrlReader'; -// eslint-disable-next-line @backstage/no-relative-monorepo-imports -import { BitbucketUrlReader as _BitbucketUrlReader } from '../../../backend-defaults/src/entrypoints/urlReader/lib/BitbucketUrlReader'; -// eslint-disable-next-line @backstage/no-relative-monorepo-imports -import { BitbucketServerUrlReader as _BitbucketServerUrlReader } from '../../../backend-defaults/src/entrypoints/urlReader/lib/BitbucketServerUrlReader'; -// eslint-disable-next-line @backstage/no-relative-monorepo-imports -import { GerritUrlReader as _GerritUrlReader } from '../../../backend-defaults/src/entrypoints/urlReader/lib/GerritUrlReader'; -// eslint-disable-next-line @backstage/no-relative-monorepo-imports -import { GithubUrlReader as _GithubUrlReader } from '../../../backend-defaults/src/entrypoints/urlReader/lib/GithubUrlReader'; -// eslint-disable-next-line @backstage/no-relative-monorepo-imports -import { GitlabUrlReader as _GitlabUrlReader } from '../../../backend-defaults/src/entrypoints/urlReader/lib/GitlabUrlReader'; -// eslint-disable-next-line @backstage/no-relative-monorepo-imports -import { GiteaUrlReader as _GiteaUrlReader } from '../../../backend-defaults/src/entrypoints/urlReader/lib/GiteaUrlReader'; -// eslint-disable-next-line @backstage/no-relative-monorepo-imports -import { HarnessUrlReader as _HarnessUrlReader } from '../../../backend-defaults/src/entrypoints/urlReader/lib/HarnessUrlReader'; -// eslint-disable-next-line @backstage/no-relative-monorepo-imports -import { AwsS3UrlReader as _AwsS3UrlReader } from '../../../backend-defaults/src/entrypoints/urlReader/lib/AwsS3UrlReader'; -// eslint-disable-next-line @backstage/no-relative-monorepo-imports -import { FetchUrlReader as _FetchUrlReader } from '../../../backend-defaults/src/entrypoints/urlReader/lib/FetchUrlReader'; -// eslint-disable-next-line @backstage/no-relative-monorepo-imports -import { UrlReaders as _UrlReaders } from '../../../backend-defaults/src/entrypoints/urlReader/lib/UrlReaders'; -// eslint-disable-next-line @backstage/no-relative-monorepo-imports -import { ReadUrlResponseFactory as _ReadUrlResponseFactory } from '../../../backend-defaults/src/entrypoints/urlReader/lib/ReadUrlResponseFactory'; -// eslint-disable-next-line @backstage/no-relative-monorepo-imports -import type { UrlReadersOptions as _UrlReadersOptions } from '../../../backend-defaults/src/entrypoints/urlReader/lib/UrlReaders'; -// eslint-disable-next-line @backstage/no-relative-monorepo-imports -import type { FromReadableArrayOptions as _FromReadableArrayOptions } from '../../../backend-defaults/src/entrypoints/urlReader/lib/types'; -// eslint-disable-next-line @backstage/no-relative-monorepo-imports -import type { - ReaderFactory as _ReaderFactory, - ReadTreeResponseFactory as _ReadTreeResponseFactory, - ReadTreeResponseFactoryOptions as _ReadTreeResponseFactoryOptions, - ReadUrlResponseFactoryFromStreamOptions as _ReadUrlResponseFactoryFromStreamOptions, - UrlReaderPredicateTuple as _UrlReaderPredicateTuple, -} from '../../../backend-defaults/src/entrypoints/urlReader/lib/types'; - -import type { - ReadTreeOptions as _ReadTreeOptions, - ReadTreeResponse as _ReadTreeResponse, - ReadTreeResponseFile as _ReadTreeResponseFile, - ReadTreeResponseDirOptions as _ReadTreeResponseDirOptions, - ReadUrlOptions as _ReadUrlOptions, - ReadUrlResponse as _ReadUrlResponse, - SearchOptions as _SearchOptions, - SearchResponse as _SearchResponse, - SearchResponseFile as _SearchResponseFile, - UrlReaderService as _UrlReaderService, -} from '@backstage/backend-plugin-api'; - -/** - * @public - * @deprecated Import from `@backstage/backend-defaults/urlReader` instead - */ -export const AzureUrlReader = _AzureUrlReader; -/** - * @public - * @deprecated Import from `@backstage/backend-defaults/urlReader` instead - */ -export const BitbucketCloudUrlReader = _BitbucketCloudUrlReader; -/** - * @public - * @deprecated Import from `@backstage/backend-defaults/urlReader` instead - */ -export const BitbucketUrlReader = _BitbucketUrlReader; -/** - * @public - * @deprecated Import from `@backstage/backend-defaults/urlReader` instead - */ -export const BitbucketServerUrlReader = _BitbucketServerUrlReader; -/** - * @public - * @deprecated Import from `@backstage/backend-defaults/urlReader` instead - */ -export const GerritUrlReader = _GerritUrlReader; -/** - * @public - * @deprecated Import from `@backstage/backend-defaults/urlReader` instead - */ -export const GithubUrlReader = _GithubUrlReader; -/** - * @public - * @deprecated Import from `@backstage/backend-defaults/urlReader` instead - */ -export const GitlabUrlReader = _GitlabUrlReader; -/** - * @public - * @deprecated Import from `@backstage/backend-defaults/urlReader` instead - */ -export const GiteaUrlReader = _GiteaUrlReader; -/** - * @public - * @deprecated Import from `@backstage/backend-defaults/urlReader` instead - */ -export const HarnessUrlReader = _HarnessUrlReader; -/** - * @public - * @deprecated Import from `@backstage/backend-defaults/urlReader` instead - */ -export const AwsS3UrlReader = _AwsS3UrlReader; -/** - * @public - * @deprecated Import from `@backstage/backend-defaults/urlReader` instead - */ -export const FetchUrlReader = _FetchUrlReader; -/** - * @public - * @deprecated Import from `@backstage/backend-defaults/urlReader` instead - */ -export const UrlReaders = _UrlReaders; -/** - * @public - * @deprecated Import from `@backstage/backend-defaults/urlReader` instead - */ -export const ReadUrlResponseFactory = _ReadUrlResponseFactory; -/** - * @public - * @deprecated Import from `@backstage/backend-defaults/urlReader` instead - */ -export type UrlReadersOptions = _UrlReadersOptions; -/** - * @public - * @deprecated Import from `@backstage/backend-defaults/urlReader` instead - */ -export type FromReadableArrayOptions = _FromReadableArrayOptions; -/** - * @public - * @deprecated Import from `@backstage/backend-defaults/urlReader` instead - */ -export type ReaderFactory = _ReaderFactory; -/** - * @public - * @deprecated Import from `@backstage/backend-defaults/urlReader` instead - */ -export type ReadTreeResponseFactory = _ReadTreeResponseFactory; -/** - * @public - * @deprecated Import from `@backstage/backend-defaults/urlReader` instead - */ -export type ReadTreeResponseFactoryOptions = _ReadTreeResponseFactoryOptions; -/** - * @public - * @deprecated Import from `@backstage/backend-defaults/urlReader` instead - */ -export type ReadUrlResponseFactoryFromStreamOptions = - _ReadUrlResponseFactoryFromStreamOptions; -/** - * @public - * @deprecated Import from `@backstage/backend-defaults/urlReader` instead - */ -export type UrlReaderPredicateTuple = _UrlReaderPredicateTuple; - -/** - * @public - * @deprecated Use `UrlReaderServiceReadTreeOptions` from `@backstage/backend-plugin-api` instead - */ -export type ReadTreeOptions = _ReadTreeOptions; -/** - * @public - * @deprecated Use `UrlReaderServiceReadTreeResponse` from `@backstage/backend-plugin-api` instead - */ -export type ReadTreeResponse = _ReadTreeResponse; -/** - * @public - * @deprecated Use `UrlReaderServiceReadTreeResponseFile` from `@backstage/backend-plugin-api` instead - */ -export type ReadTreeResponseFile = _ReadTreeResponseFile; -/** - * @public - * @deprecated Use `UrlReaderServiceReadTreeResponseDirOptions` from `@backstage/backend-plugin-api` instead - */ -export type ReadTreeResponseDirOptions = _ReadTreeResponseDirOptions; -/** - * @public - * @deprecated Use `UrlReaderServiceReadUrlOptions` from `@backstage/backend-plugin-api` instead - */ -export type ReadUrlOptions = _ReadUrlOptions; -/** - * @public - * @deprecated Use `UrlReaderServiceReadUrlResponse` from `@backstage/backend-plugin-api` instead - */ -export type ReadUrlResponse = _ReadUrlResponse; -/** - * @public - * @deprecated Use `UrlReaderServiceSearchOptions` from `@backstage/backend-plugin-api` instead - */ -export type SearchOptions = _SearchOptions; -/** - * @public - * @deprecated Use `UrlReaderServiceSearchResponse` from `@backstage/backend-plugin-api` instead - */ -export type SearchResponse = _SearchResponse; -/** - * @public - * @deprecated Use `UrlReaderServiceSearchResponseFile` from `@backstage/backend-plugin-api` instead - */ -export type SearchResponseFile = _SearchResponseFile; -/** - * @public - * @deprecated Use `UrlReaderService` from `@backstage/backend-plugin-api` instead - */ -export type UrlReader = _UrlReaderService; diff --git a/packages/backend-common/src/service/createStatusCheckRouter.ts b/packages/backend-common/src/service/createStatusCheckRouter.ts index b43bd5585c..1a5953a748 100644 --- a/packages/backend-common/src/service/createStatusCheckRouter.ts +++ b/packages/backend-common/src/service/createStatusCheckRouter.ts @@ -17,7 +17,8 @@ import { LoggerService } from '@backstage/backend-plugin-api'; import Router from 'express-promise-router'; import express from 'express'; -import { errorHandler, statusCheckHandler, StatusCheck } from '../middleware'; +import { errorHandler } from '../deprecated'; +import { statusCheckHandler, StatusCheck } from '../middleware'; /** * Creates a default status checking router, that you can add to your express diff --git a/packages/backend-common/src/service/index.ts b/packages/backend-common/src/service/index.ts index d01f25fad3..c2ae6ba87b 100644 --- a/packages/backend-common/src/service/index.ts +++ b/packages/backend-common/src/service/index.ts @@ -14,6 +14,4 @@ * limitations under the License. */ -export { createServiceBuilder } from './createServiceBuilder'; export { createStatusCheckRouter } from './createStatusCheckRouter'; -export type { ServiceBuilder, RequestLoggingHandlerFactory } from './types'; From e8c01ddc0a7d210bd6d7490445398348164510fc Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Mon, 17 Jun 2024 10:00:52 +0200 Subject: [PATCH 223/387] techdocs-node: still export ContainerRunner from backend-common Signed-off-by: Vincenzo Scamporlino --- .changeset/famous-roses-smell.md | 4 ++-- plugins/techdocs-node/api-report.md | 3 +++ plugins/techdocs-node/src/stages/generate/techdocs.ts | 11 ++++++++--- plugins/techdocs-node/src/stages/generate/types.ts | 2 ++ 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.changeset/famous-roses-smell.md b/.changeset/famous-roses-smell.md index 26cbc4b9d3..a091a6f32e 100644 --- a/.changeset/famous-roses-smell.md +++ b/.changeset/famous-roses-smell.md @@ -1,5 +1,5 @@ --- -'@backstage/plugin-techdocs-node': minor +'@backstage/plugin-techdocs-node': patch --- -**BREAKING**: `TechdocsGenerator` won't require a `containerRunner` option anymore for generating TechDocs in docker. +`TechdocsGenerator` won't require a `containerRunner` option anymore for generating TechDocs in docker. diff --git a/plugins/techdocs-node/api-report.md b/plugins/techdocs-node/api-report.md index 81bba6990f..7275586ef8 100644 --- a/plugins/techdocs-node/api-report.md +++ b/plugins/techdocs-node/api-report.md @@ -7,6 +7,7 @@ import { CompoundEntityRef } from '@backstage/catalog-model'; import { Config } from '@backstage/config'; +import { ContainerRunner } from '@backstage/backend-common'; import { Entity } from '@backstage/catalog-model'; import express from 'express'; import { ExtensionPoint } from '@backstage/backend-plugin-api'; @@ -48,6 +49,7 @@ export type GeneratorBuilder = { // @public export type GeneratorOptions = { logger: Logger; + containerRunner?: ContainerRunner; }; // @public @@ -261,6 +263,7 @@ export interface TechDocsDocument extends IndexableDocument { export class TechdocsGenerator implements GeneratorBase { constructor(options: { logger: Logger; + containerRunner?: ContainerRunner; config: Config; scmIntegrations: ScmIntegrationRegistry; }); diff --git a/plugins/techdocs-node/src/stages/generate/techdocs.ts b/plugins/techdocs-node/src/stages/generate/techdocs.ts index b53e1c27d0..d66fd1e6f4 100644 --- a/plugins/techdocs-node/src/stages/generate/techdocs.ts +++ b/plugins/techdocs-node/src/stages/generate/techdocs.ts @@ -43,6 +43,7 @@ import { } from './types'; import { ForwardedError } from '@backstage/errors'; import { DockerContainerRunner } from './DockerContainerRunner'; +import { ContainerRunner } from '@backstage/backend-common'; /** * Generates documentation files @@ -55,6 +56,7 @@ export class TechdocsGenerator implements GeneratorBase { */ public static readonly defaultDockerImage = 'spotify/techdocs:v1.2.3'; private readonly logger: Logger; + private readonly containerRunner: ContainerRunner; private readonly options: GeneratorConfig; private readonly scmIntegrations: ScmIntegrationRegistry; @@ -64,10 +66,11 @@ export class TechdocsGenerator implements GeneratorBase { * @param options - Options to configure the generator */ static fromConfig(config: Config, options: GeneratorOptions) { - const { logger } = options; + const { containerRunner, logger } = options; const scmIntegrations = ScmIntegrations.fromConfig(config); return new TechdocsGenerator({ logger, + containerRunner, config, scmIntegrations, }); @@ -75,11 +78,14 @@ export class TechdocsGenerator implements GeneratorBase { constructor(options: { logger: Logger; + containerRunner?: ContainerRunner; config: Config; scmIntegrations: ScmIntegrationRegistry; }) { this.logger = options.logger; this.options = readGeneratorConfig(options.config, options.logger); + this.containerRunner = + options.containerRunner || new DockerContainerRunner(); this.scmIntegrations = options.scmIntegrations; } @@ -152,8 +158,7 @@ export class TechdocsGenerator implements GeneratorBase { ); break; case 'docker': { - const containerRunner = new DockerContainerRunner(); - await containerRunner.runContainer({ + await this.containerRunner.runContainer({ imageName: this.options.dockerImage ?? TechdocsGenerator.defaultDockerImage, args: ['build', '-d', '/output'], diff --git a/plugins/techdocs-node/src/stages/generate/types.ts b/plugins/techdocs-node/src/stages/generate/types.ts index 8a54ec5188..80468905fd 100644 --- a/plugins/techdocs-node/src/stages/generate/types.ts +++ b/plugins/techdocs-node/src/stages/generate/types.ts @@ -18,6 +18,7 @@ import { Entity } from '@backstage/catalog-model'; import { Writable } from 'stream'; import { Logger } from 'winston'; import { ParsedLocationAnnotation } from '../../helpers'; +import { ContainerRunner } from '@backstage/backend-common'; // Determines where the generator will be run export type GeneratorRunInType = 'docker' | 'local'; @@ -28,6 +29,7 @@ export type GeneratorRunInType = 'docker' | 'local'; */ export type GeneratorOptions = { logger: Logger; + containerRunner?: ContainerRunner; }; /** From 3bcfbf39d129541f25f8169b0993c1f87671f245 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Mon, 17 Jun 2024 10:28:29 +0200 Subject: [PATCH 224/387] techdocs-node: mark as deprecated Signed-off-by: Vincenzo Scamporlino --- plugins/techdocs-node/src/stages/generate/types.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/techdocs-node/src/stages/generate/types.ts b/plugins/techdocs-node/src/stages/generate/types.ts index 80468905fd..ca816d560f 100644 --- a/plugins/techdocs-node/src/stages/generate/types.ts +++ b/plugins/techdocs-node/src/stages/generate/types.ts @@ -29,6 +29,10 @@ export type GeneratorRunInType = 'docker' | 'local'; */ export type GeneratorOptions = { logger: Logger; + /** + * @deprecated containerRunner is now instantiated in + * the generator and this option will be removed in the future + */ containerRunner?: ContainerRunner; }; From 86c64685e286eef0b9640ee9d48abf4e92950dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Mon, 17 Jun 2024 11:44:55 +0200 Subject: [PATCH 225/387] fix some old style events installation instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- docs/integrations/gitlab/discovery.md | 2 +- docs/integrations/gitlab/org.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/integrations/gitlab/discovery.md b/docs/integrations/gitlab/discovery.md index b16f6db839..98fbb0fbce 100644 --- a/docs/integrations/gitlab/discovery.md +++ b/docs/integrations/gitlab/discovery.md @@ -120,8 +120,8 @@ export default async function createPlugin( }), // optional: alternatively, use schedule scheduler: env.scheduler, + events: env.events, }); - env.eventBroker.subscribe(gitlabProvider); builder.addEntityProvider(gitlabProvider); /* highlight-add-end */ const { processingEngine, router } = await builder.build(); diff --git a/docs/integrations/gitlab/org.md b/docs/integrations/gitlab/org.md index 2cc0dcfb82..ccf8f19239 100644 --- a/docs/integrations/gitlab/org.md +++ b/docs/integrations/gitlab/org.md @@ -130,9 +130,9 @@ export default async function createPlugin( }), // optional: alternatively, use schedule scheduler: env.scheduler, + events: env.events, }, ); - env.eventBroker.subscribe(gitlabOrgProvider); builder.addEntityProvider(gitlabOrgProvider); /* highlight-add-end */ const { processingEngine, router } = await builder.build(); From 9539a0b0a95e093107e54f9d50d56b5650a2f682 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 14 Jun 2024 12:09:48 +0200 Subject: [PATCH 226/387] move the auth services to backend-defaults MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/brave-icons-dream.md | 5 + .changeset/chilly-peaches-dress.md | 5 + .changeset/new-chefs-rescue.md | 5 + .changeset/witty-parents-give.md | 5 + packages/backend-app-api/api-report.md | 6 +- .../auth/authServiceFactory.ts | 75 +---- .../services/implementations/deprecated.ts | 3 + .../httpAuth/httpAuthServiceFactory.ts | 276 +---------------- .../src/services/implementations/index.ts | 3 - .../userInfo/userInfoServiceFactory.ts | 93 +----- .../src/auth/createLegacyAuthAdapters.ts | 2 +- packages/backend-defaults/api-report-auth.md | 13 + .../backend-defaults/api-report-httpAuth.md | 16 + .../backend-defaults/api-report-userInfo.md | 16 + packages/backend-defaults/config.d.ts | 277 +++++++++++++++++ .../auth}/20240327104803_public_keys.js | 0 packages/backend-defaults/package.json | 17 + .../backend-defaults/src/CreateBackend.ts | 6 +- .../entrypoints}/auth/DefaultAuthService.ts | 0 .../src/entrypoints}/auth/JwksClient.ts | 0 .../auth/authServiceFactory.test.ts | 2 +- .../entrypoints/auth/authServiceFactory.ts | 89 ++++++ .../external/ExternalTokenHandler.test.ts | 0 .../auth/external/ExternalTokenHandler.ts | 0 .../auth/external/helpers.test.ts | 0 .../src/entrypoints}/auth/external/helpers.ts | 0 .../entrypoints}/auth/external/jwks.test.ts | 0 .../src/entrypoints}/auth/external/jwks.ts | 0 .../entrypoints}/auth/external/legacy.test.ts | 0 .../src/entrypoints}/auth/external/legacy.ts | 0 .../entrypoints}/auth/external/static.test.ts | 0 .../src/entrypoints}/auth/external/static.ts | 0 .../src/entrypoints}/auth/external/types.ts | 0 .../src/entrypoints}/auth/helpers.ts | 0 .../src/entrypoints/auth/index.ts | 17 + .../auth/plugin/PluginTokenHandler.test.ts | 0 .../auth/plugin/PluginTokenHandler.ts | 0 .../auth/plugin/keys/DatabaseKeyStore.test.ts | 0 .../auth/plugin/keys/DatabaseKeyStore.ts | 4 +- .../keys/DatabasePluginKeySource.test.ts | 0 .../plugin/keys/DatabasePluginKeySource.ts | 0 .../keys/StaticConfigPluginKeySource.test.ts | 0 .../keys/StaticConfigPluginKeySource.ts | 0 .../plugin/keys/createPluginKeySource.test.ts | 0 .../auth/plugin/keys/createPluginKeySource.ts | 0 .../entrypoints}/auth/plugin/keys/types.ts | 0 .../src/entrypoints}/auth/types.ts | 0 .../auth/user/UserTokenHandler.test.ts | 0 .../auth/user/UserTokenHandler.ts | 0 .../httpAuth/httpAuthServiceFactory.ts | 290 ++++++++++++++++++ .../src/entrypoints/httpAuth/index.ts | 17 + .../src/entrypoints/userInfo/index.ts | 17 + .../userInfo/userInfoServiceFactory.ts | 103 +++++++ .../src/services/definitions/coreServices.ts | 114 +++++-- yarn.lock | 5 + 55 files changed, 1026 insertions(+), 455 deletions(-) create mode 100644 .changeset/brave-icons-dream.md create mode 100644 .changeset/chilly-peaches-dress.md create mode 100644 .changeset/new-chefs-rescue.md create mode 100644 .changeset/witty-parents-give.md create mode 100644 packages/backend-defaults/api-report-auth.md create mode 100644 packages/backend-defaults/api-report-httpAuth.md create mode 100644 packages/backend-defaults/api-report-userInfo.md rename packages/{backend-app-api/migrations => backend-defaults/migrations/auth}/20240327104803_public_keys.js (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/DefaultAuthService.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/JwksClient.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/authServiceFactory.test.ts (99%) create mode 100644 packages/backend-defaults/src/entrypoints/auth/authServiceFactory.ts rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/external/ExternalTokenHandler.test.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/external/ExternalTokenHandler.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/external/helpers.test.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/external/helpers.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/external/jwks.test.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/external/jwks.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/external/legacy.test.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/external/legacy.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/external/static.test.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/external/static.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/external/types.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/helpers.ts (100%) create mode 100644 packages/backend-defaults/src/entrypoints/auth/index.ts rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/plugin/PluginTokenHandler.test.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/plugin/PluginTokenHandler.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/plugin/keys/DatabaseKeyStore.test.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/plugin/keys/DatabaseKeyStore.ts (98%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/plugin/keys/DatabasePluginKeySource.test.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/plugin/keys/DatabasePluginKeySource.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/plugin/keys/StaticConfigPluginKeySource.test.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/plugin/keys/StaticConfigPluginKeySource.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/plugin/keys/createPluginKeySource.test.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/plugin/keys/createPluginKeySource.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/plugin/keys/types.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/types.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/user/UserTokenHandler.test.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/auth/user/UserTokenHandler.ts (100%) create mode 100644 packages/backend-defaults/src/entrypoints/httpAuth/httpAuthServiceFactory.ts create mode 100644 packages/backend-defaults/src/entrypoints/httpAuth/index.ts create mode 100644 packages/backend-defaults/src/entrypoints/userInfo/index.ts create mode 100644 packages/backend-defaults/src/entrypoints/userInfo/userInfoServiceFactory.ts diff --git a/.changeset/brave-icons-dream.md b/.changeset/brave-icons-dream.md new file mode 100644 index 0000000000..0d73c71f47 --- /dev/null +++ b/.changeset/brave-icons-dream.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-common': patch +--- + +Import utility functions from `backend-defaults` instead of `backend-app-api` diff --git a/.changeset/chilly-peaches-dress.md b/.changeset/chilly-peaches-dress.md new file mode 100644 index 0000000000..e97588c5d8 --- /dev/null +++ b/.changeset/chilly-peaches-dress.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-app-api': patch +--- + +Deprecated `authServiceFactory`, `httpAuthServiceFactory`, and `userInfoServiceFactory`. Please import them from `@backstage/backend-defaults/auth`, `@backstage/backend-defaults/httpAuth`, and `@backstage/backend-defaults/userInfo` respectively instead. diff --git a/.changeset/new-chefs-rescue.md b/.changeset/new-chefs-rescue.md new file mode 100644 index 0000000000..7ebb7f4719 --- /dev/null +++ b/.changeset/new-chefs-rescue.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-plugin-api': patch +--- + +Improved `coreServices` doc comments diff --git a/.changeset/witty-parents-give.md b/.changeset/witty-parents-give.md new file mode 100644 index 0000000000..e169d8160a --- /dev/null +++ b/.changeset/witty-parents-give.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-defaults': patch +--- + +Added `@backstage/backend-defaults/auth`, `@backstage/backend-defaults/httpAuth`, and `@backstage/backend-defaults/userInfo` to house their respective backend service factories. You should now import these services from those new locations, instead of `@backstage/backend-app-api`. diff --git a/packages/backend-app-api/api-report.md b/packages/backend-app-api/api-report.md index 3d7357cb87..45525efa75 100644 --- a/packages/backend-app-api/api-report.md +++ b/packages/backend-app-api/api-report.md @@ -45,7 +45,7 @@ import { transport } from 'winston'; import { UrlReaderService } from '@backstage/backend-plugin-api'; import { UserInfoService } from '@backstage/backend-plugin-api'; -// @public (undocumented) +// @public @deprecated (undocumented) export const authServiceFactory: () => ServiceFactory; // @public (undocumented) @@ -151,7 +151,7 @@ export class HostDiscovery implements DiscoveryService { getExternalBaseUrl(pluginId: string): Promise; } -// @public (undocumented) +// @public @deprecated (undocumented) export const httpAuthServiceFactory: () => ServiceFactory< HttpAuthService, 'plugin' @@ -344,7 +344,7 @@ export const urlReaderServiceFactory: () => ServiceFactory< 'plugin' >; -// @public (undocumented) +// @public @deprecated (undocumented) export const userInfoServiceFactory: () => ServiceFactory< UserInfoService, 'plugin' diff --git a/packages/backend-app-api/src/services/implementations/auth/authServiceFactory.ts b/packages/backend-app-api/src/services/implementations/auth/authServiceFactory.ts index 2a5a210cb7..988b907b4c 100644 --- a/packages/backend-app-api/src/services/implementations/auth/authServiceFactory.ts +++ b/packages/backend-app-api/src/services/implementations/auth/authServiceFactory.ts @@ -14,72 +14,11 @@ * limitations under the License. */ -import { - coreServices, - createServiceFactory, -} from '@backstage/backend-plugin-api'; -import { DefaultAuthService } from './DefaultAuthService'; -import { ExternalTokenHandler } from './external/ExternalTokenHandler'; -import { PluginTokenHandler } from './plugin/PluginTokenHandler'; -import { createPluginKeySource } from './plugin/keys/createPluginKeySource'; -import { UserTokenHandler } from './user/UserTokenHandler'; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { authServiceFactory as _authServiceFactory } from '../../../../../backend-defaults/src/entrypoints/auth'; -/** @public */ -export const authServiceFactory = createServiceFactory({ - service: coreServices.auth, - deps: { - config: coreServices.rootConfig, - logger: coreServices.rootLogger, - discovery: coreServices.discovery, - plugin: coreServices.pluginMetadata, - database: coreServices.database, - // Re-using the token manager makes sure that we use the same generated keys for - // development as plugins that have not yet been migrated. It's important that this - // keeps working as long as there are plugins that have not been migrated to the - // new auth services in the new backend system. - tokenManager: coreServices.tokenManager, - }, - async factory({ config, discovery, plugin, tokenManager, logger, database }) { - const disableDefaultAuthPolicy = - config.getOptionalBoolean( - 'backend.auth.dangerouslyDisableDefaultAuthPolicy', - ) ?? false; - - const keyDuration = { hours: 1 }; - - const keySource = await createPluginKeySource({ - config, - database, - logger, - keyDuration, - }); - - const userTokens = UserTokenHandler.create({ - discovery, - }); - - const pluginTokens = PluginTokenHandler.create({ - ownPluginId: plugin.getId(), - logger, - keySource, - keyDuration, - discovery, - }); - - const externalTokens = ExternalTokenHandler.create({ - ownPluginId: plugin.getId(), - config, - logger, - }); - - return new DefaultAuthService( - userTokens, - pluginTokens, - externalTokens, - tokenManager, - plugin.getId(), - disableDefaultAuthPolicy, - keySource, - ); - }, -}); +/** + * @public + * @deprecated Please import from `@backstage/backend-defaults/auth` instead. + */ +export const authServiceFactory = _authServiceFactory; diff --git a/packages/backend-app-api/src/services/implementations/deprecated.ts b/packages/backend-app-api/src/services/implementations/deprecated.ts index 6f4f76e679..5bf022bb57 100644 --- a/packages/backend-app-api/src/services/implementations/deprecated.ts +++ b/packages/backend-app-api/src/services/implementations/deprecated.ts @@ -14,4 +14,7 @@ * limitations under the License. */ +export * from './auth'; +export * from './httpAuth'; export * from './scheduler'; +export * from './userInfo'; diff --git a/packages/backend-app-api/src/services/implementations/httpAuth/httpAuthServiceFactory.ts b/packages/backend-app-api/src/services/implementations/httpAuth/httpAuthServiceFactory.ts index c85ba6e4b3..373dd10ead 100644 --- a/packages/backend-app-api/src/services/implementations/httpAuth/httpAuthServiceFactory.ts +++ b/packages/backend-app-api/src/services/implementations/httpAuth/httpAuthServiceFactory.ts @@ -14,273 +14,11 @@ * limitations under the License. */ -import { - AuthService, - BackstageCredentials, - BackstagePrincipalTypes, - BackstageUserPrincipal, - DiscoveryService, - HttpAuthService, - coreServices, - createServiceFactory, -} from '@backstage/backend-plugin-api'; -import { AuthenticationError, NotAllowedError } from '@backstage/errors'; -import { parse as parseCookie } from 'cookie'; -import { Request, Response } from 'express'; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { httpAuthServiceFactory as _httpAuthServiceFactory } from '../../../../../backend-defaults/src/entrypoints/httpAuth'; -const FIVE_MINUTES_MS = 5 * 60 * 1000; - -const BACKSTAGE_AUTH_COOKIE = 'backstage-auth'; - -function getTokenFromRequest(req: Request) { - // TODO: support multiple auth headers (iterate rawHeaders) - const authHeader = req.headers.authorization; - if (typeof authHeader === 'string') { - const matches = authHeader.match(/^Bearer[ ]+(\S+)$/i); - const token = matches?.[1]; - if (token) { - return token; - } - } - - return undefined; -} - -function getCookieFromRequest(req: Request) { - const cookieHeader = req.headers.cookie; - if (cookieHeader) { - const cookies = parseCookie(cookieHeader); - const token = cookies[BACKSTAGE_AUTH_COOKIE]; - if (token) { - return token; - } - } - - return undefined; -} - -function willExpireSoon(expiresAt: Date) { - return Date.now() + FIVE_MINUTES_MS > expiresAt.getTime(); -} - -const credentialsSymbol = Symbol('backstage-credentials'); -const limitedCredentialsSymbol = Symbol('backstage-limited-credentials'); - -type RequestWithCredentials = Request & { - [credentialsSymbol]?: Promise; - [limitedCredentialsSymbol]?: Promise; -}; - -class DefaultHttpAuthService implements HttpAuthService { - readonly #auth: AuthService; - readonly #discovery: DiscoveryService; - readonly #pluginId: string; - - constructor( - auth: AuthService, - discovery: DiscoveryService, - pluginId: string, - ) { - this.#auth = auth; - this.#discovery = discovery; - this.#pluginId = pluginId; - } - - async #extractCredentialsFromRequest(req: Request) { - const token = getTokenFromRequest(req); - if (!token) { - return await this.#auth.getNoneCredentials(); - } - - return await this.#auth.authenticate(token); - } - - async #extractLimitedCredentialsFromRequest(req: Request) { - const token = getTokenFromRequest(req); - if (token) { - return await this.#auth.authenticate(token, { - allowLimitedAccess: true, - }); - } - - const cookie = getCookieFromRequest(req); - if (cookie) { - return await this.#auth.authenticate(cookie, { - allowLimitedAccess: true, - }); - } - - return await this.#auth.getNoneCredentials(); - } - - async #getCredentials(req: RequestWithCredentials) { - return (req[credentialsSymbol] ??= - this.#extractCredentialsFromRequest(req)); - } - - async #getLimitedCredentials(req: RequestWithCredentials) { - return (req[limitedCredentialsSymbol] ??= - this.#extractLimitedCredentialsFromRequest(req)); - } - - async credentials( - req: Request, - options?: { - allow?: Array; - allowLimitedAccess?: boolean; - }, - ): Promise> { - // Limited and full credentials are treated as two separate cases, this lets - // us avoid internal dependencies between the AuthService and - // HttpAuthService implementations - const credentials = options?.allowLimitedAccess - ? await this.#getLimitedCredentials(req) - : await this.#getCredentials(req); - - const allowed = options?.allow; - if (!allowed) { - return credentials as any; - } - - if (this.#auth.isPrincipal(credentials, 'none')) { - if (allowed.includes('none' as TAllowed)) { - return credentials as any; - } - - throw new AuthenticationError('Missing credentials'); - } else if (this.#auth.isPrincipal(credentials, 'user')) { - if (allowed.includes('user' as TAllowed)) { - return credentials as any; - } - - throw new NotAllowedError( - `This endpoint does not allow 'user' credentials`, - ); - } else if (this.#auth.isPrincipal(credentials, 'service')) { - if (allowed.includes('service' as TAllowed)) { - return credentials as any; - } - - throw new NotAllowedError( - `This endpoint does not allow 'service' credentials`, - ); - } - - throw new NotAllowedError( - 'Unknown principal type, this should never happen', - ); - } - - async issueUserCookie( - res: Response, - options?: { credentials?: BackstageCredentials }, - ): Promise<{ expiresAt: Date }> { - if (res.headersSent) { - throw new Error('Failed to issue user cookie, headers were already sent'); - } - - let credentials: BackstageCredentials; - if (options?.credentials) { - if (this.#auth.isPrincipal(options.credentials, 'none')) { - res.clearCookie( - BACKSTAGE_AUTH_COOKIE, - await this.#getCookieOptions(res.req), - ); - return { expiresAt: new Date() }; - } - if (!this.#auth.isPrincipal(options.credentials, 'user')) { - throw new AuthenticationError( - 'Refused to issue cookie for non-user principal', - ); - } - credentials = options.credentials; - } else { - credentials = await this.credentials(res.req, { allow: ['user'] }); - } - - const existingExpiresAt = await this.#existingCookieExpiration(res.req); - if (existingExpiresAt && !willExpireSoon(existingExpiresAt)) { - return { expiresAt: existingExpiresAt }; - } - - const { token, expiresAt } = await this.#auth.getLimitedUserToken( - credentials, - ); - if (!token) { - throw new Error('User credentials is unexpectedly missing token'); - } - - res.cookie(BACKSTAGE_AUTH_COOKIE, token, { - ...(await this.#getCookieOptions(res.req)), - expires: expiresAt, - }); - - return { expiresAt }; - } - - async #getCookieOptions(_req: Request): Promise<{ - domain: string; - httpOnly: true; - secure: boolean; - priority: 'high'; - sameSite: 'none' | 'lax'; - }> { - // TODO: eventually we should read from `${req.protocol}://${req.hostname}` - // once https://github.com/backstage/backstage/issues/24169 has landed - const externalBaseUrlStr = await this.#discovery.getExternalBaseUrl( - this.#pluginId, - ); - const externalBaseUrl = new URL(externalBaseUrlStr); - - const secure = - externalBaseUrl.protocol === 'https:' || - externalBaseUrl.hostname === 'localhost'; - - return { - domain: externalBaseUrl.hostname, - httpOnly: true, - secure, - priority: 'high', - sameSite: secure ? 'none' : 'lax', - }; - } - - async #existingCookieExpiration(req: Request): Promise { - const existingCookie = getCookieFromRequest(req); - if (!existingCookie) { - return undefined; - } - - try { - const existingCredentials = await this.#auth.authenticate( - existingCookie, - { - allowLimitedAccess: true, - }, - ); - if (!this.#auth.isPrincipal(existingCredentials, 'user')) { - return undefined; - } - - return existingCredentials.expiresAt; - } catch (error) { - if (error.name === 'AuthenticationError') { - return undefined; - } - throw error; - } - } -} - -/** @public */ -export const httpAuthServiceFactory = createServiceFactory({ - service: coreServices.httpAuth, - deps: { - auth: coreServices.auth, - discovery: coreServices.discovery, - plugin: coreServices.pluginMetadata, - }, - async factory({ auth, discovery, plugin }) { - return new DefaultHttpAuthService(auth, discovery, plugin.getId()); - }, -}); +/** + * @public + * @deprecated Please import from `@backstage/backend-defaults/httpAuth` instead. + */ +export const httpAuthServiceFactory = _httpAuthServiceFactory; diff --git a/packages/backend-app-api/src/services/implementations/index.ts b/packages/backend-app-api/src/services/implementations/index.ts index e6656801a9..b03031549f 100644 --- a/packages/backend-app-api/src/services/implementations/index.ts +++ b/packages/backend-app-api/src/services/implementations/index.ts @@ -14,12 +14,10 @@ * limitations under the License. */ -export * from './auth'; export * from './cache'; export * from './config'; export * from './database'; export * from './discovery'; -export * from './httpAuth'; export * from './httpRouter'; export * from './identity'; export * from './lifecycle'; @@ -30,6 +28,5 @@ export * from './rootLifecycle'; export * from './rootLogger'; export * from './tokenManager'; export * from './urlReader'; -export * from './userInfo'; export * from './deprecated'; diff --git a/packages/backend-app-api/src/services/implementations/userInfo/userInfoServiceFactory.ts b/packages/backend-app-api/src/services/implementations/userInfo/userInfoServiceFactory.ts index db550bf9e8..746f480c41 100644 --- a/packages/backend-app-api/src/services/implementations/userInfo/userInfoServiceFactory.ts +++ b/packages/backend-app-api/src/services/implementations/userInfo/userInfoServiceFactory.ts @@ -14,90 +14,11 @@ * limitations under the License. */ -import { - UserInfoService, - BackstageUserInfo, - coreServices, - createServiceFactory, - DiscoveryService, - BackstageCredentials, -} from '@backstage/backend-plugin-api'; -import { ResponseError } from '@backstage/errors'; -import { decodeJwt } from 'jose'; -import fetch from 'node-fetch'; -import { toInternalBackstageCredentials } from '../auth/helpers'; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { userInfoServiceFactory as _userInfoServiceFactory } from '../../../../../backend-defaults/src/entrypoints/userInfo'; -type Options = { - discovery: DiscoveryService; -}; - -export class DefaultUserInfoService implements UserInfoService { - private readonly discovery: DiscoveryService; - - constructor(options: Options) { - this.discovery = options.discovery; - } - - async getUserInfo( - credentials: BackstageCredentials, - ): Promise { - const internalCredentials = toInternalBackstageCredentials(credentials); - if (internalCredentials.principal.type !== 'user') { - throw new Error('Only user credentials are supported'); - } - if (!internalCredentials.token) { - throw new Error('User credentials is unexpectedly missing token'); - } - const { sub: userEntityRef, ent: tokenEnt } = decodeJwt( - internalCredentials.token, - ); - - if (typeof userEntityRef !== 'string') { - throw new Error('User entity ref must be a string'); - } - - let ownershipEntityRefs = tokenEnt; - - if (!ownershipEntityRefs) { - const userInfoResp = await fetch( - `${await this.discovery.getBaseUrl('auth')}/v1/userinfo`, - { - headers: { - Authorization: `Bearer ${internalCredentials.token}`, - }, - }, - ); - - if (!userInfoResp.ok) { - throw await ResponseError.fromResponse(userInfoResp); - } - - const { - claims: { ent }, - } = await userInfoResp.json(); - ownershipEntityRefs = ent; - } - - if (!ownershipEntityRefs) { - throw new Error('Ownership entity refs can not be determined'); - } else if ( - !Array.isArray(ownershipEntityRefs) || - ownershipEntityRefs.some(ref => typeof ref !== 'string') - ) { - throw new Error('Ownership entity refs must be an array of strings'); - } - - return { userEntityRef, ownershipEntityRefs }; - } -} - -/** @public */ -export const userInfoServiceFactory = createServiceFactory({ - service: coreServices.userInfo, - deps: { - discovery: coreServices.discovery, - }, - async factory({ discovery }) { - return new DefaultUserInfoService({ discovery }); - }, -}); +/** + * @public + * @deprecated Please import from `@backstage/backend-defaults/userInfo` instead. + */ +export const userInfoServiceFactory = _userInfoServiceFactory; diff --git a/packages/backend-common/src/auth/createLegacyAuthAdapters.ts b/packages/backend-common/src/auth/createLegacyAuthAdapters.ts index 94f997640d..5e342783f7 100644 --- a/packages/backend-common/src/auth/createLegacyAuthAdapters.ts +++ b/packages/backend-common/src/auth/createLegacyAuthAdapters.ts @@ -35,7 +35,7 @@ import { createCredentialsWithUserPrincipal, createCredentialsWithNonePrincipal, toInternalBackstageCredentials, -} from '../../../backend-app-api/src/services/implementations/auth/helpers'; +} from '../../../backend-defaults/src/entrypoints/auth/helpers'; // TODO is this circular thingy a problem? Test in e2e import { type IdentityApiGetIdentityRequest, diff --git a/packages/backend-defaults/api-report-auth.md b/packages/backend-defaults/api-report-auth.md new file mode 100644 index 0000000000..d64ce5bc2a --- /dev/null +++ b/packages/backend-defaults/api-report-auth.md @@ -0,0 +1,13 @@ +## API Report File for "@backstage/backend-defaults" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import { AuthService } from '@backstage/backend-plugin-api'; +import { ServiceFactory } from '@backstage/backend-plugin-api'; + +// @public +export const authServiceFactory: () => ServiceFactory; + +// (No @packageDocumentation comment for this package) +``` diff --git a/packages/backend-defaults/api-report-httpAuth.md b/packages/backend-defaults/api-report-httpAuth.md new file mode 100644 index 0000000000..6ffe3d6539 --- /dev/null +++ b/packages/backend-defaults/api-report-httpAuth.md @@ -0,0 +1,16 @@ +## API Report File for "@backstage/backend-defaults" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import { HttpAuthService } from '@backstage/backend-plugin-api'; +import { ServiceFactory } from '@backstage/backend-plugin-api'; + +// @public +export const httpAuthServiceFactory: () => ServiceFactory< + HttpAuthService, + 'plugin' +>; + +// (No @packageDocumentation comment for this package) +``` diff --git a/packages/backend-defaults/api-report-userInfo.md b/packages/backend-defaults/api-report-userInfo.md new file mode 100644 index 0000000000..d11fb69718 --- /dev/null +++ b/packages/backend-defaults/api-report-userInfo.md @@ -0,0 +1,16 @@ +## API Report File for "@backstage/backend-defaults" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import { ServiceFactory } from '@backstage/backend-plugin-api'; +import { UserInfoService } from '@backstage/backend-plugin-api'; + +// @public +export const userInfoServiceFactory: () => ServiceFactory< + UserInfoService, + 'plugin' +>; + +// (No @packageDocumentation comment for this package) +``` diff --git a/packages/backend-defaults/config.d.ts b/packages/backend-defaults/config.d.ts index 569ab436db..ab1e443fc2 100644 --- a/packages/backend-defaults/config.d.ts +++ b/packages/backend-defaults/config.d.ts @@ -15,6 +15,283 @@ */ export interface Config { + backend?: { + /** + * Options used by the default auth, httpAuth and userInfo services. + */ + auth?: { + /** + * This disables the otherwise default auth policy, which requires all + * requests to be authenticated with either user or service credentials. + * + * Disabling this check means that the backend will no longer block + * unauthenticated requests, but instead allow them to pass through to + * plugins. + * + * If permissions are enabled, unauthenticated requests will be treated + * exactly as such, leaving it to the permission policy to determine what + * permissions should be allowed for an unauthenticated identity. Note + * that this will also apply to service-to-service calls between plugins + * unless you configure credentials for service calls. + */ + dangerouslyDisableDefaultAuthPolicy?: boolean; + + /** Controls how to store keys for plugin-to-plugin auth */ + pluginKeyStore?: + | { type: 'database' } + | { + type: 'static'; + static: { + /** + * Must be declared at least once and the first one will be used for signing. + */ + keys: Array<{ + /** + * Path to the public key file in the SPKI format. Should be an absolute path. + */ + publicKeyFile: string; + /** + * Path to the matching private key file in the PKCS#8 format. Should be an absolute path. + * + * The first array entry must specify a private key file, the rest must not. + */ + privateKeyFile?: string; + /** + * ID to uniquely identify this key within the JWK set. + */ + keyId: string; + /** + * JWS "alg" (Algorithm) Header Parameter value. Defaults to ES256. + * Must match the algorithm used to generate the keys in the provided files + */ + algorithm?: string; + }>; + }; + }; + + /** + * Configures methods of external access, ie ways for callers outside of + * the Backstage ecosystem to get authorized for access to APIs that do + * not permit unauthorized access. + */ + externalAccess: Array< + | { + /** + * This is the legacy service-to-service access method, where a set + * of static keys were shared among plugins and used for symmetric + * signing and verification. These correspond to the old + * `backend.auth.keys` set and retain their behavior for backwards + * compatibility. Please migrate to other access methods when + * possible. + * + * Callers generate JWT tokens with the following payload: + * + * ```json + * { + * "sub": "backstage-plugin", + * "exp": + * } + * ``` + * + * And sign them with HS256, using the base64 decoded secret. The + * tokens are then passed along with requests in the Authorization + * header: + * + * ``` + * Authorization: Bearer eyJhbGciOiJIUzI... + * ``` + */ + type: 'legacy'; + options: { + /** + * Any set of base64 encoded random bytes to be used as both the + * signing and verification key. Should be sufficiently long so as + * not to be easy to guess by brute force. + * + * Can be generated eg using + * + * ```sh + * node -p 'require("crypto").randomBytes(24).toString("base64")' + * ``` + * + * @visibility secret + */ + secret: string; + + /** + * Sets the subject of the principal, when matching this token. + * Useful for debugging and tracking purposes. + */ + subject: string; + }; + /** + * Restricts what types of access that are permitted for this access + * method. If no access restrictions are given, it'll have unlimited + * access. This access restriction applies for the framework level; + * individual plugins may have their own access control mechanisms + * on top of this. + */ + accessRestrictions?: Array<{ + /** + * Permit access to make requests to this plugin. + * + * Can be further refined by setting additional fields below. + */ + plugin: string; + /** + * If given, this method is limited to only performing actions + * with these named permissions in this plugin. + * + * Note that this only applies where permissions checks are + * enabled in the first place. Endpoints that are not protected by + * the permissions system at all, are not affected by this + * setting. + */ + permission?: string | Array; + /** + * If given, this method is limited to only performing actions + * whose permissions have these attributes. + * + * Note that this only applies where permissions checks are + * enabled in the first place. Endpoints that are not protected by + * the permissions system at all, are not affected by this + * setting. + */ + permissionAttribute?: { + /** + * One of more of 'create', 'read', 'update', or 'delete'. + */ + action?: string | Array; + }; + }>; + } + | { + /** + * This access method consists of random static tokens that can be + * handed out to callers. + * + * The tokens are then passed along verbatim with requests in the + * Authorization header: + * + * ``` + * Authorization: Bearer eZv5o+fW3KnR3kVabMW4ZcDNLPl8nmMW + * ``` + */ + type: 'static'; + options: { + /** + * A raw token that can be any string, but for security reasons + * should be sufficiently long so as not to be easy to guess by + * brute force. + * + * Can be generated eg using + * + * ```sh + * node -p 'require("crypto").randomBytes(24).toString("base64")' + * ``` + * + * Since the tokens can be any string, you are free to add + * additional identifying data to them if you like. For example, + * adding a `freben-local-dev-` prefix for debugging purposes to a + * token that you know will be handed out for use as a personal + * access token during development. + * + * @visibility secret + */ + token: string; + + /** + * Sets the subject of the principal, when matching this token. + * Useful for debugging and tracking purposes. + */ + subject: string; + }; + /** + * Restricts what types of access that are permitted for this access + * method. If no access restrictions are given, it'll have unlimited + * access. This access restriction applies for the framework level; + * individual plugins may have their own access control mechanisms + * on top of this. + */ + accessRestrictions?: Array<{ + /** + * Permit access to make requests to this plugin. + * + * Can be further refined by setting additional fields below. + */ + plugin: string; + /** + * If given, this method is limited to only performing actions + * with these named permissions in this plugin. + * + * Note that this only applies where permissions checks are + * enabled in the first place. Endpoints that are not protected by + * the permissions system at all, are not affected by this + * setting. + */ + permission?: string | Array; + /** + * If given, this method is limited to only performing actions + * whose permissions have these attributes. + * + * Note that this only applies where permissions checks are + * enabled in the first place. Endpoints that are not protected by + * the permissions system at all, are not affected by this + * setting. + */ + permissionAttribute?: { + /** + * One of more of 'create', 'read', 'update', or 'delete'. + */ + action?: string | Array; + }; + }>; + } + | { + /** + * This access method consists of a JWKS endpoint that can be used to + * verify JWT tokens. + * + * Callers generate JWT tokens via 3rd party tooling + * and pass them in the Authorization header: + * + * ``` + * Authorization: Bearer eZv5o+fW3KnR3kVabMW4ZcDNLPl8nmMW + * ``` + */ + type: 'jwks'; + options: { + /** + * The full URL of the JWKS endpoint. + */ + url: string; + /** + * Sets the algorithm(s) that should be used to verify the JWT tokens. + * The passed JWTs must have been signed using one of the listed algorithms. + */ + algorithm?: string | string[]; + /** + * Sets the issuer(s) that should be used to verify the JWT tokens. + * Passed JWTs must have an `iss` claim which matches one of the specified issuers. + */ + issuer?: string | string[]; + /** + * Sets the audience(s) that should be used to verify the JWT tokens. + * The passed JWTs must have an "aud" claim that matches one of the audiences specified, + * or have no audience specified. + */ + audience?: string | string[]; + /** + * Sets an optional subject prefix. Passes the subject to called plugins. + * Useful for debugging and tracking purposes. + */ + subjectPrefix?: string; + }; + } + >; + }; + }; + /** * Options used by the default discovery service. */ diff --git a/packages/backend-app-api/migrations/20240327104803_public_keys.js b/packages/backend-defaults/migrations/auth/20240327104803_public_keys.js similarity index 100% rename from packages/backend-app-api/migrations/20240327104803_public_keys.js rename to packages/backend-defaults/migrations/auth/20240327104803_public_keys.js diff --git a/packages/backend-defaults/package.json b/packages/backend-defaults/package.json index 2cdf30e0d2..06be729126 100644 --- a/packages/backend-defaults/package.json +++ b/packages/backend-defaults/package.json @@ -20,21 +20,27 @@ "license": "Apache-2.0", "exports": { ".": "./src/index.ts", + "./auth": "./src/entrypoints/auth/index.ts", "./cache": "./src/entrypoints/cache/index.ts", "./database": "./src/entrypoints/database/index.ts", "./discovery": "./src/entrypoints/discovery/index.ts", + "./httpAuth": "./src/entrypoints/httpAuth/index.ts", "./lifecycle": "./src/entrypoints/lifecycle/index.ts", "./permissions": "./src/entrypoints/permissions/index.ts", "./rootConfig": "./src/entrypoints/rootConfig/index.ts", "./rootLifecycle": "./src/entrypoints/rootLifecycle/index.ts", "./scheduler": "./src/entrypoints/scheduler/index.ts", "./urlReader": "./src/entrypoints/urlReader/index.ts", + "./userInfo": "./src/entrypoints/userInfo/index.ts", "./package.json": "./package.json" }, "main": "src/index.ts", "types": "src/index.ts", "typesVersions": { "*": { + "auth": [ + "src/entrypoints/auth/index.ts" + ], "cache": [ "src/entrypoints/cache/index.ts" ], @@ -44,6 +50,9 @@ "discovery": [ "src/entrypoints/discovery/index.ts" ], + "httpAuth": [ + "src/entrypoints/httpAuth/index.ts" + ], "lifecycle": [ "src/entrypoints/lifecycle/index.ts" ], @@ -62,6 +71,9 @@ "urlReader": [ "src/entrypoints/urlReader/index.ts" ], + "userInfo": [ + "src/entrypoints/userInfo/index.ts" + ], "package.json": [ "package.json" ] @@ -88,6 +100,7 @@ "@aws-sdk/credential-providers": "^3.350.0", "@aws-sdk/types": "^3.347.0", "@backstage/backend-app-api": "workspace:^", + "@backstage/backend-common": "workspace:^", "@backstage/backend-dev-utils": "workspace:^", "@backstage/backend-plugin-api": "workspace:^", "@backstage/config": "workspace:^", @@ -95,6 +108,7 @@ "@backstage/errors": "workspace:^", "@backstage/integration": "workspace:^", "@backstage/integration-aws-node": "workspace:^", + "@backstage/plugin-auth-node": "workspace:^", "@backstage/plugin-events-node": "workspace:^", "@backstage/plugin-permission-node": "workspace:^", "@backstage/types": "workspace:^", @@ -107,10 +121,13 @@ "base64-stream": "^1.0.0", "better-sqlite3": "^9.0.0", "concat-stream": "^2.0.0", + "cookie": "^0.6.0", "cron": "^3.0.0", + "express": "^4.17.1", "fs-extra": "^11.2.0", "git-url-parse": "^14.0.0", "isomorphic-git": "^1.23.0", + "jose": "^5.0.0", "keyv": "^4.5.2", "knex": "^3.0.0", "lodash": "^4.17.21", diff --git a/packages/backend-defaults/src/CreateBackend.ts b/packages/backend-defaults/src/CreateBackend.ts index 823b3c2833..834d54e9e5 100644 --- a/packages/backend-defaults/src/CreateBackend.ts +++ b/packages/backend-defaults/src/CreateBackend.ts @@ -16,26 +16,26 @@ import { Backend, - authServiceFactory, createSpecializedBackend, - httpAuthServiceFactory, httpRouterServiceFactory, identityServiceFactory, loggerServiceFactory, rootHttpRouterServiceFactory, rootLoggerServiceFactory, tokenManagerServiceFactory, - userInfoServiceFactory, } from '@backstage/backend-app-api'; +import { authServiceFactory } from '@backstage/backend-defaults/auth'; import { cacheServiceFactory } from '@backstage/backend-defaults/cache'; import { databaseServiceFactory } from '@backstage/backend-defaults/database'; import { discoveryServiceFactory } from '@backstage/backend-defaults/discovery'; +import { httpAuthServiceFactory } from '@backstage/backend-defaults/httpAuth'; import { lifecycleServiceFactory } from '@backstage/backend-defaults/lifecycle'; import { permissionsServiceFactory } from '@backstage/backend-defaults/permissions'; import { rootConfigServiceFactory } from '@backstage/backend-defaults/rootConfig'; import { rootLifecycleServiceFactory } from '@backstage/backend-defaults/rootLifecycle'; import { schedulerServiceFactory } from '@backstage/backend-defaults/scheduler'; import { urlReaderServiceFactory } from '@backstage/backend-defaults/urlReader'; +import { userInfoServiceFactory } from '@backstage/backend-defaults/userInfo'; import { eventsServiceFactory } from '@backstage/plugin-events-node'; export const defaultServiceFactories = [ diff --git a/packages/backend-app-api/src/services/implementations/auth/DefaultAuthService.ts b/packages/backend-defaults/src/entrypoints/auth/DefaultAuthService.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/DefaultAuthService.ts rename to packages/backend-defaults/src/entrypoints/auth/DefaultAuthService.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/JwksClient.ts b/packages/backend-defaults/src/entrypoints/auth/JwksClient.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/JwksClient.ts rename to packages/backend-defaults/src/entrypoints/auth/JwksClient.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/authServiceFactory.test.ts b/packages/backend-defaults/src/entrypoints/auth/authServiceFactory.test.ts similarity index 99% rename from packages/backend-app-api/src/services/implementations/auth/authServiceFactory.test.ts rename to packages/backend-defaults/src/entrypoints/auth/authServiceFactory.test.ts index a717d5a2bb..22357d0f49 100644 --- a/packages/backend-app-api/src/services/implementations/auth/authServiceFactory.test.ts +++ b/packages/backend-defaults/src/entrypoints/auth/authServiceFactory.test.ts @@ -19,6 +19,7 @@ import { mockServices, setupRequestMockHandlers, } from '@backstage/backend-test-utils'; +import { tokenManagerServiceFactory } from '@backstage/backend-app-api'; import { authServiceFactory } from './authServiceFactory'; import { base64url, decodeJwt } from 'jose'; import { discoveryServiceFactory } from '../discovery'; @@ -26,7 +27,6 @@ import { BackstageServicePrincipal, BackstageUserPrincipal, } from '@backstage/backend-plugin-api'; -import { tokenManagerServiceFactory } from '../tokenManager'; import { rest } from 'msw'; import { setupServer } from 'msw/node'; import { InternalBackstageCredentials } from './types'; diff --git a/packages/backend-defaults/src/entrypoints/auth/authServiceFactory.ts b/packages/backend-defaults/src/entrypoints/auth/authServiceFactory.ts new file mode 100644 index 0000000000..6a1aa51604 --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/auth/authServiceFactory.ts @@ -0,0 +1,89 @@ +/* + * Copyright 2024 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 { + coreServices, + createServiceFactory, +} from '@backstage/backend-plugin-api'; +import { DefaultAuthService } from './DefaultAuthService'; +import { ExternalTokenHandler } from './external/ExternalTokenHandler'; +import { PluginTokenHandler } from './plugin/PluginTokenHandler'; +import { createPluginKeySource } from './plugin/keys/createPluginKeySource'; +import { UserTokenHandler } from './user/UserTokenHandler'; + +/** + * Token authentication and credentials management. + * + * @public + */ +export const authServiceFactory = createServiceFactory({ + service: coreServices.auth, + deps: { + config: coreServices.rootConfig, + logger: coreServices.rootLogger, + discovery: coreServices.discovery, + plugin: coreServices.pluginMetadata, + database: coreServices.database, + // Re-using the token manager makes sure that we use the same generated keys for + // development as plugins that have not yet been migrated. It's important that this + // keeps working as long as there are plugins that have not been migrated to the + // new auth services in the new backend system. + tokenManager: coreServices.tokenManager, + }, + async factory({ config, discovery, plugin, tokenManager, logger, database }) { + const disableDefaultAuthPolicy = + config.getOptionalBoolean( + 'backend.auth.dangerouslyDisableDefaultAuthPolicy', + ) ?? false; + + const keyDuration = { hours: 1 }; + + const keySource = await createPluginKeySource({ + config, + database, + logger, + keyDuration, + }); + + const userTokens = UserTokenHandler.create({ + discovery, + }); + + const pluginTokens = PluginTokenHandler.create({ + ownPluginId: plugin.getId(), + logger, + keySource, + keyDuration, + discovery, + }); + + const externalTokens = ExternalTokenHandler.create({ + ownPluginId: plugin.getId(), + config, + logger, + }); + + return new DefaultAuthService( + userTokens, + pluginTokens, + externalTokens, + tokenManager, + plugin.getId(), + disableDefaultAuthPolicy, + keySource, + ); + }, +}); diff --git a/packages/backend-app-api/src/services/implementations/auth/external/ExternalTokenHandler.test.ts b/packages/backend-defaults/src/entrypoints/auth/external/ExternalTokenHandler.test.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/external/ExternalTokenHandler.test.ts rename to packages/backend-defaults/src/entrypoints/auth/external/ExternalTokenHandler.test.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/external/ExternalTokenHandler.ts b/packages/backend-defaults/src/entrypoints/auth/external/ExternalTokenHandler.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/external/ExternalTokenHandler.ts rename to packages/backend-defaults/src/entrypoints/auth/external/ExternalTokenHandler.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/external/helpers.test.ts b/packages/backend-defaults/src/entrypoints/auth/external/helpers.test.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/external/helpers.test.ts rename to packages/backend-defaults/src/entrypoints/auth/external/helpers.test.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/external/helpers.ts b/packages/backend-defaults/src/entrypoints/auth/external/helpers.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/external/helpers.ts rename to packages/backend-defaults/src/entrypoints/auth/external/helpers.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/external/jwks.test.ts b/packages/backend-defaults/src/entrypoints/auth/external/jwks.test.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/external/jwks.test.ts rename to packages/backend-defaults/src/entrypoints/auth/external/jwks.test.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/external/jwks.ts b/packages/backend-defaults/src/entrypoints/auth/external/jwks.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/external/jwks.ts rename to packages/backend-defaults/src/entrypoints/auth/external/jwks.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/external/legacy.test.ts b/packages/backend-defaults/src/entrypoints/auth/external/legacy.test.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/external/legacy.test.ts rename to packages/backend-defaults/src/entrypoints/auth/external/legacy.test.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/external/legacy.ts b/packages/backend-defaults/src/entrypoints/auth/external/legacy.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/external/legacy.ts rename to packages/backend-defaults/src/entrypoints/auth/external/legacy.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/external/static.test.ts b/packages/backend-defaults/src/entrypoints/auth/external/static.test.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/external/static.test.ts rename to packages/backend-defaults/src/entrypoints/auth/external/static.test.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/external/static.ts b/packages/backend-defaults/src/entrypoints/auth/external/static.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/external/static.ts rename to packages/backend-defaults/src/entrypoints/auth/external/static.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/external/types.ts b/packages/backend-defaults/src/entrypoints/auth/external/types.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/external/types.ts rename to packages/backend-defaults/src/entrypoints/auth/external/types.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/helpers.ts b/packages/backend-defaults/src/entrypoints/auth/helpers.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/helpers.ts rename to packages/backend-defaults/src/entrypoints/auth/helpers.ts diff --git a/packages/backend-defaults/src/entrypoints/auth/index.ts b/packages/backend-defaults/src/entrypoints/auth/index.ts new file mode 100644 index 0000000000..1b55d46a83 --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/auth/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2024 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. + */ + +export { authServiceFactory } from './authServiceFactory'; diff --git a/packages/backend-app-api/src/services/implementations/auth/plugin/PluginTokenHandler.test.ts b/packages/backend-defaults/src/entrypoints/auth/plugin/PluginTokenHandler.test.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/plugin/PluginTokenHandler.test.ts rename to packages/backend-defaults/src/entrypoints/auth/plugin/PluginTokenHandler.test.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/plugin/PluginTokenHandler.ts b/packages/backend-defaults/src/entrypoints/auth/plugin/PluginTokenHandler.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/plugin/PluginTokenHandler.ts rename to packages/backend-defaults/src/entrypoints/auth/plugin/PluginTokenHandler.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/plugin/keys/DatabaseKeyStore.test.ts b/packages/backend-defaults/src/entrypoints/auth/plugin/keys/DatabaseKeyStore.test.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/plugin/keys/DatabaseKeyStore.test.ts rename to packages/backend-defaults/src/entrypoints/auth/plugin/keys/DatabaseKeyStore.test.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/plugin/keys/DatabaseKeyStore.ts b/packages/backend-defaults/src/entrypoints/auth/plugin/keys/DatabaseKeyStore.ts similarity index 98% rename from packages/backend-app-api/src/services/implementations/auth/plugin/keys/DatabaseKeyStore.ts rename to packages/backend-defaults/src/entrypoints/auth/plugin/keys/DatabaseKeyStore.ts index aea126d00a..9f5c278a9c 100644 --- a/packages/backend-app-api/src/services/implementations/auth/plugin/keys/DatabaseKeyStore.ts +++ b/packages/backend-defaults/src/entrypoints/auth/plugin/keys/DatabaseKeyStore.ts @@ -37,8 +37,8 @@ type Row = { export function applyDatabaseMigrations(knex: Knex): Promise { const migrationsDir = resolvePackagePath( - '@backstage/backend-app-api', - 'migrations', + '@backstage/backend-defaults', + 'migrations/auth', ); return knex.migrate.latest({ diff --git a/packages/backend-app-api/src/services/implementations/auth/plugin/keys/DatabasePluginKeySource.test.ts b/packages/backend-defaults/src/entrypoints/auth/plugin/keys/DatabasePluginKeySource.test.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/plugin/keys/DatabasePluginKeySource.test.ts rename to packages/backend-defaults/src/entrypoints/auth/plugin/keys/DatabasePluginKeySource.test.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/plugin/keys/DatabasePluginKeySource.ts b/packages/backend-defaults/src/entrypoints/auth/plugin/keys/DatabasePluginKeySource.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/plugin/keys/DatabasePluginKeySource.ts rename to packages/backend-defaults/src/entrypoints/auth/plugin/keys/DatabasePluginKeySource.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/plugin/keys/StaticConfigPluginKeySource.test.ts b/packages/backend-defaults/src/entrypoints/auth/plugin/keys/StaticConfigPluginKeySource.test.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/plugin/keys/StaticConfigPluginKeySource.test.ts rename to packages/backend-defaults/src/entrypoints/auth/plugin/keys/StaticConfigPluginKeySource.test.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/plugin/keys/StaticConfigPluginKeySource.ts b/packages/backend-defaults/src/entrypoints/auth/plugin/keys/StaticConfigPluginKeySource.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/plugin/keys/StaticConfigPluginKeySource.ts rename to packages/backend-defaults/src/entrypoints/auth/plugin/keys/StaticConfigPluginKeySource.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/plugin/keys/createPluginKeySource.test.ts b/packages/backend-defaults/src/entrypoints/auth/plugin/keys/createPluginKeySource.test.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/plugin/keys/createPluginKeySource.test.ts rename to packages/backend-defaults/src/entrypoints/auth/plugin/keys/createPluginKeySource.test.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/plugin/keys/createPluginKeySource.ts b/packages/backend-defaults/src/entrypoints/auth/plugin/keys/createPluginKeySource.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/plugin/keys/createPluginKeySource.ts rename to packages/backend-defaults/src/entrypoints/auth/plugin/keys/createPluginKeySource.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/plugin/keys/types.ts b/packages/backend-defaults/src/entrypoints/auth/plugin/keys/types.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/plugin/keys/types.ts rename to packages/backend-defaults/src/entrypoints/auth/plugin/keys/types.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/types.ts b/packages/backend-defaults/src/entrypoints/auth/types.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/types.ts rename to packages/backend-defaults/src/entrypoints/auth/types.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/user/UserTokenHandler.test.ts b/packages/backend-defaults/src/entrypoints/auth/user/UserTokenHandler.test.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/user/UserTokenHandler.test.ts rename to packages/backend-defaults/src/entrypoints/auth/user/UserTokenHandler.test.ts diff --git a/packages/backend-app-api/src/services/implementations/auth/user/UserTokenHandler.ts b/packages/backend-defaults/src/entrypoints/auth/user/UserTokenHandler.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/auth/user/UserTokenHandler.ts rename to packages/backend-defaults/src/entrypoints/auth/user/UserTokenHandler.ts diff --git a/packages/backend-defaults/src/entrypoints/httpAuth/httpAuthServiceFactory.ts b/packages/backend-defaults/src/entrypoints/httpAuth/httpAuthServiceFactory.ts new file mode 100644 index 0000000000..e24c80aa6a --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/httpAuth/httpAuthServiceFactory.ts @@ -0,0 +1,290 @@ +/* + * Copyright 2024 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 { + AuthService, + BackstageCredentials, + BackstagePrincipalTypes, + BackstageUserPrincipal, + DiscoveryService, + HttpAuthService, + coreServices, + createServiceFactory, +} from '@backstage/backend-plugin-api'; +import { AuthenticationError, NotAllowedError } from '@backstage/errors'; +import { parse as parseCookie } from 'cookie'; +import { Request, Response } from 'express'; + +const FIVE_MINUTES_MS = 5 * 60 * 1000; + +const BACKSTAGE_AUTH_COOKIE = 'backstage-auth'; + +function getTokenFromRequest(req: Request) { + // TODO: support multiple auth headers (iterate rawHeaders) + const authHeader = req.headers.authorization; + if (typeof authHeader === 'string') { + const matches = authHeader.match(/^Bearer[ ]+(\S+)$/i); + const token = matches?.[1]; + if (token) { + return token; + } + } + + return undefined; +} + +function getCookieFromRequest(req: Request) { + const cookieHeader = req.headers.cookie; + if (cookieHeader) { + const cookies = parseCookie(cookieHeader); + const token = cookies[BACKSTAGE_AUTH_COOKIE]; + if (token) { + return token; + } + } + + return undefined; +} + +function willExpireSoon(expiresAt: Date) { + return Date.now() + FIVE_MINUTES_MS > expiresAt.getTime(); +} + +const credentialsSymbol = Symbol('backstage-credentials'); +const limitedCredentialsSymbol = Symbol('backstage-limited-credentials'); + +type RequestWithCredentials = Request & { + [credentialsSymbol]?: Promise; + [limitedCredentialsSymbol]?: Promise; +}; + +class DefaultHttpAuthService implements HttpAuthService { + readonly #auth: AuthService; + readonly #discovery: DiscoveryService; + readonly #pluginId: string; + + constructor( + auth: AuthService, + discovery: DiscoveryService, + pluginId: string, + ) { + this.#auth = auth; + this.#discovery = discovery; + this.#pluginId = pluginId; + } + + async #extractCredentialsFromRequest(req: Request) { + const token = getTokenFromRequest(req); + if (!token) { + return await this.#auth.getNoneCredentials(); + } + + return await this.#auth.authenticate(token); + } + + async #extractLimitedCredentialsFromRequest(req: Request) { + const token = getTokenFromRequest(req); + if (token) { + return await this.#auth.authenticate(token, { + allowLimitedAccess: true, + }); + } + + const cookie = getCookieFromRequest(req); + if (cookie) { + return await this.#auth.authenticate(cookie, { + allowLimitedAccess: true, + }); + } + + return await this.#auth.getNoneCredentials(); + } + + async #getCredentials(req: RequestWithCredentials) { + return (req[credentialsSymbol] ??= + this.#extractCredentialsFromRequest(req)); + } + + async #getLimitedCredentials(req: RequestWithCredentials) { + return (req[limitedCredentialsSymbol] ??= + this.#extractLimitedCredentialsFromRequest(req)); + } + + async credentials( + req: Request, + options?: { + allow?: Array; + allowLimitedAccess?: boolean; + }, + ): Promise> { + // Limited and full credentials are treated as two separate cases, this lets + // us avoid internal dependencies between the AuthService and + // HttpAuthService implementations + const credentials = options?.allowLimitedAccess + ? await this.#getLimitedCredentials(req) + : await this.#getCredentials(req); + + const allowed = options?.allow; + if (!allowed) { + return credentials as any; + } + + if (this.#auth.isPrincipal(credentials, 'none')) { + if (allowed.includes('none' as TAllowed)) { + return credentials as any; + } + + throw new AuthenticationError('Missing credentials'); + } else if (this.#auth.isPrincipal(credentials, 'user')) { + if (allowed.includes('user' as TAllowed)) { + return credentials as any; + } + + throw new NotAllowedError( + `This endpoint does not allow 'user' credentials`, + ); + } else if (this.#auth.isPrincipal(credentials, 'service')) { + if (allowed.includes('service' as TAllowed)) { + return credentials as any; + } + + throw new NotAllowedError( + `This endpoint does not allow 'service' credentials`, + ); + } + + throw new NotAllowedError( + 'Unknown principal type, this should never happen', + ); + } + + async issueUserCookie( + res: Response, + options?: { credentials?: BackstageCredentials }, + ): Promise<{ expiresAt: Date }> { + if (res.headersSent) { + throw new Error('Failed to issue user cookie, headers were already sent'); + } + + let credentials: BackstageCredentials; + if (options?.credentials) { + if (this.#auth.isPrincipal(options.credentials, 'none')) { + res.clearCookie( + BACKSTAGE_AUTH_COOKIE, + await this.#getCookieOptions(res.req), + ); + return { expiresAt: new Date() }; + } + if (!this.#auth.isPrincipal(options.credentials, 'user')) { + throw new AuthenticationError( + 'Refused to issue cookie for non-user principal', + ); + } + credentials = options.credentials; + } else { + credentials = await this.credentials(res.req, { allow: ['user'] }); + } + + const existingExpiresAt = await this.#existingCookieExpiration(res.req); + if (existingExpiresAt && !willExpireSoon(existingExpiresAt)) { + return { expiresAt: existingExpiresAt }; + } + + const { token, expiresAt } = await this.#auth.getLimitedUserToken( + credentials, + ); + if (!token) { + throw new Error('User credentials is unexpectedly missing token'); + } + + res.cookie(BACKSTAGE_AUTH_COOKIE, token, { + ...(await this.#getCookieOptions(res.req)), + expires: expiresAt, + }); + + return { expiresAt }; + } + + async #getCookieOptions(_req: Request): Promise<{ + domain: string; + httpOnly: true; + secure: boolean; + priority: 'high'; + sameSite: 'none' | 'lax'; + }> { + // TODO: eventually we should read from `${req.protocol}://${req.hostname}` + // once https://github.com/backstage/backstage/issues/24169 has landed + const externalBaseUrlStr = await this.#discovery.getExternalBaseUrl( + this.#pluginId, + ); + const externalBaseUrl = new URL(externalBaseUrlStr); + + const secure = + externalBaseUrl.protocol === 'https:' || + externalBaseUrl.hostname === 'localhost'; + + return { + domain: externalBaseUrl.hostname, + httpOnly: true, + secure, + priority: 'high', + sameSite: secure ? 'none' : 'lax', + }; + } + + async #existingCookieExpiration(req: Request): Promise { + const existingCookie = getCookieFromRequest(req); + if (!existingCookie) { + return undefined; + } + + try { + const existingCredentials = await this.#auth.authenticate( + existingCookie, + { + allowLimitedAccess: true, + }, + ); + if (!this.#auth.isPrincipal(existingCredentials, 'user')) { + return undefined; + } + + return existingCredentials.expiresAt; + } catch (error) { + if (error.name === 'AuthenticationError') { + return undefined; + } + throw error; + } + } +} + +/** + * Authentication of HTTP requests. + * + * @public + */ +export const httpAuthServiceFactory = createServiceFactory({ + service: coreServices.httpAuth, + deps: { + auth: coreServices.auth, + discovery: coreServices.discovery, + plugin: coreServices.pluginMetadata, + }, + async factory({ auth, discovery, plugin }) { + return new DefaultHttpAuthService(auth, discovery, plugin.getId()); + }, +}); diff --git a/packages/backend-defaults/src/entrypoints/httpAuth/index.ts b/packages/backend-defaults/src/entrypoints/httpAuth/index.ts new file mode 100644 index 0000000000..edd7e53026 --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/httpAuth/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2024 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. + */ + +export { httpAuthServiceFactory } from './httpAuthServiceFactory'; diff --git a/packages/backend-defaults/src/entrypoints/userInfo/index.ts b/packages/backend-defaults/src/entrypoints/userInfo/index.ts new file mode 100644 index 0000000000..13b42f053c --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/userInfo/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2024 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. + */ + +export { userInfoServiceFactory } from './userInfoServiceFactory'; diff --git a/packages/backend-defaults/src/entrypoints/userInfo/userInfoServiceFactory.ts b/packages/backend-defaults/src/entrypoints/userInfo/userInfoServiceFactory.ts new file mode 100644 index 0000000000..db550bf9e8 --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/userInfo/userInfoServiceFactory.ts @@ -0,0 +1,103 @@ +/* + * Copyright 2024 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 { + UserInfoService, + BackstageUserInfo, + coreServices, + createServiceFactory, + DiscoveryService, + BackstageCredentials, +} from '@backstage/backend-plugin-api'; +import { ResponseError } from '@backstage/errors'; +import { decodeJwt } from 'jose'; +import fetch from 'node-fetch'; +import { toInternalBackstageCredentials } from '../auth/helpers'; + +type Options = { + discovery: DiscoveryService; +}; + +export class DefaultUserInfoService implements UserInfoService { + private readonly discovery: DiscoveryService; + + constructor(options: Options) { + this.discovery = options.discovery; + } + + async getUserInfo( + credentials: BackstageCredentials, + ): Promise { + const internalCredentials = toInternalBackstageCredentials(credentials); + if (internalCredentials.principal.type !== 'user') { + throw new Error('Only user credentials are supported'); + } + if (!internalCredentials.token) { + throw new Error('User credentials is unexpectedly missing token'); + } + const { sub: userEntityRef, ent: tokenEnt } = decodeJwt( + internalCredentials.token, + ); + + if (typeof userEntityRef !== 'string') { + throw new Error('User entity ref must be a string'); + } + + let ownershipEntityRefs = tokenEnt; + + if (!ownershipEntityRefs) { + const userInfoResp = await fetch( + `${await this.discovery.getBaseUrl('auth')}/v1/userinfo`, + { + headers: { + Authorization: `Bearer ${internalCredentials.token}`, + }, + }, + ); + + if (!userInfoResp.ok) { + throw await ResponseError.fromResponse(userInfoResp); + } + + const { + claims: { ent }, + } = await userInfoResp.json(); + ownershipEntityRefs = ent; + } + + if (!ownershipEntityRefs) { + throw new Error('Ownership entity refs can not be determined'); + } else if ( + !Array.isArray(ownershipEntityRefs) || + ownershipEntityRefs.some(ref => typeof ref !== 'string') + ) { + throw new Error('Ownership entity refs must be an array of strings'); + } + + return { userEntityRef, ownershipEntityRefs }; + } +} + +/** @public */ +export const userInfoServiceFactory = createServiceFactory({ + service: coreServices.userInfo, + deps: { + discovery: coreServices.discovery, + }, + async factory({ discovery }) { + return new DefaultUserInfoService({ discovery }); + }, +}); diff --git a/packages/backend-plugin-api/src/services/definitions/coreServices.ts b/packages/backend-plugin-api/src/services/definitions/coreServices.ts index 4e02611f80..b0518fb9d4 100644 --- a/packages/backend-plugin-api/src/services/definitions/coreServices.ts +++ b/packages/backend-plugin-api/src/services/definitions/coreServices.ts @@ -23,7 +23,11 @@ import { createServiceRef } from '../system'; */ export namespace coreServices { /** - * The service reference for the plugin scoped {@link AuthService}. + * Handles token authentication and credentials management. + * + * See {@link AuthService} + * and {@link https://backstage.io/docs/backend-system/core-services/auth | the service docs} + * for more information. * * @public */ @@ -32,7 +36,11 @@ export namespace coreServices { }); /** - * The service reference for the plugin scoped {@link UserInfoService}. + * Authenticated user information retrieval. + * + * See {@link UserInfoService} + * and {@link https://backstage.io/docs/backend-system/core-services/user-info | the service docs} + * for more information. * * @public */ @@ -43,7 +51,11 @@ export namespace coreServices { }); /** - * The service reference for the plugin scoped {@link CacheService}. + * Key-value store for caching data. + * + * See {@link CacheService} + * and {@link https://backstage.io/docs/backend-system/core-services/cache | the service docs} + * for more information. * * @public */ @@ -52,7 +64,11 @@ export namespace coreServices { }); /** - * The service reference for the root scoped {@link RootConfigService}. + * Access to static configuration. + * + * See {@link RootConfigService} + * and {@link https://backstage.io/docs/backend-system/core-services/root-config | the service docs} + * for more information. * * @public */ @@ -61,7 +77,11 @@ export namespace coreServices { >({ id: 'core.rootConfig', scope: 'root' }); /** - * The service reference for the plugin scoped {@link DatabaseService}. + * Database access and management via `knex`. + * + * See {@link DatabaseService} + * and {@link https://backstage.io/docs/backend-system/core-services/database | the service docs} + * for more information. * * @public */ @@ -70,7 +90,11 @@ export namespace coreServices { >({ id: 'core.database' }); /** - * The service reference for the plugin scoped {@link DiscoveryService}. + * Service discovery for inter-plugin communication. + * + * See {@link DiscoveryService} + * and {@link https://backstage.io/docs/backend-system/core-services/discovery | the service docs} + * for more information. * * @public */ @@ -79,7 +103,11 @@ export namespace coreServices { >({ id: 'core.discovery' }); /** - * The service reference for the plugin scoped {@link HttpAuthService}. + * Authentication of HTTP requests. + * + * See {@link HttpAuthService} + * and {@link https://backstage.io/docs/backend-system/core-services/http-auth | the service docs} + * for more information. * * @public */ @@ -88,7 +116,11 @@ export namespace coreServices { >({ id: 'core.httpAuth' }); /** - * The service reference for the plugin scoped {@link HttpRouterService}. + * HTTP route registration for plugins. + * + * See {@link HttpRouterService} + * and {@link https://backstage.io/docs/backend-system/core-services/http-router | the service docs} + * for more information. * * @public */ @@ -97,7 +129,11 @@ export namespace coreServices { >({ id: 'core.httpRouter' }); /** - * The service reference for the plugin scoped {@link LifecycleService}. + * Registration of plugin startup and shutdown lifecycle hooks. + * + * See {@link LifecycleService} + * and {@link https://backstage.io/docs/backend-system/core-services/lifecycle | the service docs} + * for more information. * * @public */ @@ -106,7 +142,11 @@ export namespace coreServices { >({ id: 'core.lifecycle' }); /** - * The service reference for the plugin scoped {@link LoggerService}. + * Plugin-level logging. + * + * See {@link LoggerService} + * and {@link https://backstage.io/docs/backend-system/core-services/logger | the service docs} + * for more information. * * @public */ @@ -115,7 +155,11 @@ export namespace coreServices { >({ id: 'core.logger' }); /** - * The service reference for the plugin scoped {@link PermissionsService}. + * Permission system integration for authorization of user actions. + * + * See {@link PermissionsService} + * and {@link https://backstage.io/docs/backend-system/core-services/permissions | the service docs} + * for more information. * * @public */ @@ -124,7 +168,11 @@ export namespace coreServices { >({ id: 'core.permissions' }); /** - * The service reference for the plugin scoped {@link PluginMetadataService}. + * Built-in service for accessing metadata about the current plugin. + * + * See {@link PluginMetadataService} + * and {@link https://backstage.io/docs/backend-system/core-services/plugin-metadata | the service docs} + * for more information. * * @public */ @@ -133,7 +181,11 @@ export namespace coreServices { >({ id: 'core.pluginMetadata' }); /** - * The service reference for the root scoped {@link RootHttpRouterService}. + * HTTP route registration for root services. + * + * See {@link RootHttpRouterService} + * and {@link https://backstage.io/docs/backend-system/core-services/root-http-router | the service docs} + * for more information. * * @public */ @@ -142,7 +194,11 @@ export namespace coreServices { >({ id: 'core.rootHttpRouter', scope: 'root' }); /** - * The service reference for the root scoped {@link RootLifecycleService}. + * Registration of backend startup and shutdown lifecycle hooks. + * + * See {@link RootLifecycleService} + * and {@link https://backstage.io/docs/backend-system/core-services/root-lifecycle | the service docs} + * for more information. * * @public */ @@ -151,7 +207,11 @@ export namespace coreServices { >({ id: 'core.rootLifecycle', scope: 'root' }); /** - * The service reference for the root scoped {@link RootLoggerService}. + * Root-level logging. + * + * See {@link RootLoggerService} + * and {@link https://backstage.io/docs/backend-system/core-services/root-logger | the service docs} + * for more information. * * @public */ @@ -160,7 +220,11 @@ export namespace coreServices { >({ id: 'core.rootLogger', scope: 'root' }); /** - * The service reference for the plugin scoped {@link SchedulerService}. + * Scheduling of distributed background tasks. + * + * See {@link SchedulerService} + * and {@link https://backstage.io/docs/backend-system/core-services/scheduler | the service docs} + * for more information. * * @public */ @@ -169,7 +233,11 @@ export namespace coreServices { >({ id: 'core.scheduler' }); /** - * The service reference for the plugin scoped {@link TokenManagerService}. + * Deprecated service authentication service, use the `auth` service instead. + * + * See {@link TokenManagerService} + * and {@link https://backstage.io/docs/backend-system/core-services/token-manager | the service docs} + * for more information. * * @public * @deprecated Please migrate to the new `coreServices.auth`, `coreServices.httpAuth`, and `coreServices.userInfo` services as needed instead @@ -179,7 +247,11 @@ export namespace coreServices { >({ id: 'core.tokenManager' }); /** - * The service reference for the plugin scoped {@link UrlReaderService}. + * Reading content from external systems. + * + * See {@link UrlReaderService} + * and {@link https://backstage.io/docs/backend-system/core-services/url-reader | the service docs} + * for more information. * * @public */ @@ -188,7 +260,11 @@ export namespace coreServices { >({ id: 'core.urlReader' }); /** - * The service reference for the plugin scoped {@link IdentityService}. + * Deprecated user authentication service, use the `auth` service instead. + * + * See {@link IdentityService} + * and {@link https://backstage.io/docs/backend-system/core-services/identity | the service docs} + * for more information. * * @public * @deprecated Please migrate to the new `coreServices.auth`, `coreServices.httpAuth`, and `coreServices.userInfo` services as needed instead diff --git a/yarn.lock b/yarn.lock index 984ba1b998..8e40f43582 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3606,6 +3606,7 @@ __metadata: "@aws-sdk/types": ^3.347.0 "@aws-sdk/util-stream-node": ^3.350.0 "@backstage/backend-app-api": "workspace:^" + "@backstage/backend-common": "workspace:^" "@backstage/backend-dev-utils": "workspace:^" "@backstage/backend-plugin-api": "workspace:^" "@backstage/backend-test-utils": "workspace:^" @@ -3615,6 +3616,7 @@ __metadata: "@backstage/errors": "workspace:^" "@backstage/integration": "workspace:^" "@backstage/integration-aws-node": "workspace:^" + "@backstage/plugin-auth-node": "workspace:^" "@backstage/plugin-events-node": "workspace:^" "@backstage/plugin-permission-node": "workspace:^" "@backstage/types": "workspace:^" @@ -3628,10 +3630,13 @@ __metadata: base64-stream: ^1.0.0 better-sqlite3: ^9.0.0 concat-stream: ^2.0.0 + cookie: ^0.6.0 cron: ^3.0.0 + express: ^4.17.1 fs-extra: ^11.2.0 git-url-parse: ^14.0.0 isomorphic-git: ^1.23.0 + jose: ^5.0.0 keyv: ^4.5.2 knex: ^3.0.0 lodash: ^4.17.21 From d7f9894950079d98c01c1b87062b66d3b7cc4ead Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Mon, 17 Jun 2024 13:46:43 +0200 Subject: [PATCH 227/387] techdocs-node: move default containerRunner init Signed-off-by: Vincenzo Scamporlino --- plugins/techdocs-node/src/stages/generate/techdocs.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/techdocs-node/src/stages/generate/techdocs.ts b/plugins/techdocs-node/src/stages/generate/techdocs.ts index d66fd1e6f4..e5e2b7191e 100644 --- a/plugins/techdocs-node/src/stages/generate/techdocs.ts +++ b/plugins/techdocs-node/src/stages/generate/techdocs.ts @@ -56,7 +56,7 @@ export class TechdocsGenerator implements GeneratorBase { */ public static readonly defaultDockerImage = 'spotify/techdocs:v1.2.3'; private readonly logger: Logger; - private readonly containerRunner: ContainerRunner; + private readonly containerRunner?: ContainerRunner; private readonly options: GeneratorConfig; private readonly scmIntegrations: ScmIntegrationRegistry; @@ -84,8 +84,7 @@ export class TechdocsGenerator implements GeneratorBase { }) { this.logger = options.logger; this.options = readGeneratorConfig(options.config, options.logger); - this.containerRunner = - options.containerRunner || new DockerContainerRunner(); + this.containerRunner = options.containerRunner; this.scmIntegrations = options.scmIntegrations; } @@ -158,7 +157,9 @@ export class TechdocsGenerator implements GeneratorBase { ); break; case 'docker': { - await this.containerRunner.runContainer({ + const containerRunner = + this.containerRunner || new DockerContainerRunner(); + await containerRunner.runContainer({ imageName: this.options.dockerImage ?? TechdocsGenerator.defaultDockerImage, args: ['build', '-d', '/output'], From 1fbd0c4f27d5c7a4e8580e1ba2bd9406fffed699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Mon, 17 Jun 2024 13:52:07 +0200 Subject: [PATCH 228/387] better doc comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- packages/backend-app-api/api-report.md | 8 +- .../httpRouter/httpRouterServiceFactory.ts | 10 ++- .../logger/loggerServiceFactory.ts | 10 ++- .../rootHttpRouterServiceFactory.ts | 6 ++ .../rootLogger/rootLoggerServiceFactory.ts | 10 ++- packages/backend-defaults/api-report-cache.md | 2 +- .../backend-defaults/api-report-database.md | 2 +- .../backend-defaults/api-report-discovery.md | 2 +- .../api-report-permissions.md | 2 +- .../backend-defaults/api-report-rootConfig.md | 2 +- .../backend-defaults/api-report-urlReader.md | 2 +- .../entrypoints/auth/authServiceFactory.ts | 6 +- .../entrypoints/cache/cacheServiceFactory.ts | 6 ++ .../database/databaseServiceFactory.ts | 6 ++ .../discovery/discoveryServiceFactory.ts | 10 ++- .../httpAuth/httpAuthServiceFactory.ts | 4 + .../lifecycle/lifecycleServiceFactory.ts | 6 +- .../permissions/permissionsServiceFactory.ts | 6 ++ .../rootConfig/rootConfigServiceFactory.ts | 6 ++ .../rootLifecycleServiceFactory.ts | 6 +- .../scheduler/schedulerServiceFactory.ts | 6 +- .../urlReader/urlReaderServiceFactory.ts | 10 ++- .../userInfo/userInfoServiceFactory.ts | 83 +++---------------- 23 files changed, 119 insertions(+), 92 deletions(-) diff --git a/packages/backend-app-api/api-report.md b/packages/backend-app-api/api-report.md index 45525efa75..94eb164f8a 100644 --- a/packages/backend-app-api/api-report.md +++ b/packages/backend-app-api/api-report.md @@ -162,7 +162,7 @@ export interface HttpRouterFactoryOptions { getPath?(pluginId: string): string; } -// @public (undocumented) +// @public export const httpRouterServiceFactory: ( options?: HttpRouterFactoryOptions | undefined, ) => ServiceFactory; @@ -224,7 +224,7 @@ export function loadBackendConfig(options: { config: Config; }>; -// @public (undocumented) +// @public export const loggerServiceFactory: () => ServiceFactory< LoggerService, 'plugin' @@ -303,7 +303,7 @@ export interface RootHttpRouterConfigureContext { server: Server; } -// @public (undocumented) +// @public export type RootHttpRouterFactoryOptions = { indexPath?: string | false; configure?(context: RootHttpRouterConfigureContext): void; @@ -320,7 +320,7 @@ export const rootLifecycleServiceFactory: () => ServiceFactory< 'root' >; -// @public (undocumented) +// @public export const rootLoggerServiceFactory: () => ServiceFactory< RootLoggerService, 'root' diff --git a/packages/backend-app-api/src/services/implementations/httpRouter/httpRouterServiceFactory.ts b/packages/backend-app-api/src/services/implementations/httpRouter/httpRouterServiceFactory.ts index 5e3a26252f..4a0dec49e6 100644 --- a/packages/backend-app-api/src/services/implementations/httpRouter/httpRouterServiceFactory.ts +++ b/packages/backend-app-api/src/services/implementations/httpRouter/httpRouterServiceFactory.ts @@ -36,7 +36,15 @@ export interface HttpRouterFactoryOptions { getPath?(pluginId: string): string; } -/** @public */ +/** + * HTTP route registration for plugins. + * + * See {@link @backstage/code-plugin-api#HttpRouterService} + * and {@link https://backstage.io/docs/backend-system/core-services/http-router | the service docs} + * for more information. + * + * @public + */ export const httpRouterServiceFactory = createServiceFactory( (options?: HttpRouterFactoryOptions) => ({ service: coreServices.httpRouter, diff --git a/packages/backend-app-api/src/services/implementations/logger/loggerServiceFactory.ts b/packages/backend-app-api/src/services/implementations/logger/loggerServiceFactory.ts index d9158529ca..4eff798e11 100644 --- a/packages/backend-app-api/src/services/implementations/logger/loggerServiceFactory.ts +++ b/packages/backend-app-api/src/services/implementations/logger/loggerServiceFactory.ts @@ -19,7 +19,15 @@ import { coreServices, } from '@backstage/backend-plugin-api'; -/** @public */ +/** + * Plugin-level logging. + * + * See {@link @backstage/code-plugin-api#LoggerService} + * and {@link https://backstage.io/docs/backend-system/core-services/logger | the service docs} + * for more information. + * + * @public + */ export const loggerServiceFactory = createServiceFactory({ service: coreServices.logger, deps: { diff --git a/packages/backend-app-api/src/services/implementations/rootHttpRouter/rootHttpRouterServiceFactory.ts b/packages/backend-app-api/src/services/implementations/rootHttpRouter/rootHttpRouterServiceFactory.ts index a469a2f303..88cc863374 100644 --- a/packages/backend-app-api/src/services/implementations/rootHttpRouter/rootHttpRouterServiceFactory.ts +++ b/packages/backend-app-api/src/services/implementations/rootHttpRouter/rootHttpRouterServiceFactory.ts @@ -45,6 +45,12 @@ export interface RootHttpRouterConfigureContext { } /** + * HTTP route registration for root services. + * + * See {@link @backstage/code-plugin-api#RootHttpRouterService} + * and {@link https://backstage.io/docs/backend-system/core-services/root-http-router | the service docs} + * for more information. + * * @public */ export type RootHttpRouterFactoryOptions = { diff --git a/packages/backend-app-api/src/services/implementations/rootLogger/rootLoggerServiceFactory.ts b/packages/backend-app-api/src/services/implementations/rootLogger/rootLoggerServiceFactory.ts index bd45df383f..e33de09297 100644 --- a/packages/backend-app-api/src/services/implementations/rootLogger/rootLoggerServiceFactory.ts +++ b/packages/backend-app-api/src/services/implementations/rootLogger/rootLoggerServiceFactory.ts @@ -22,7 +22,15 @@ import { WinstonLogger } from '../../../logging'; import { transports, format } from 'winston'; import { createConfigSecretEnumerator } from '../../../config'; -/** @public */ +/** + * Root-level logging. + * + * See {@link @backstage/code-plugin-api#RootLoggerService} + * and {@link https://backstage.io/docs/backend-system/core-services/root-logger | the service docs} + * for more information. + * + * @public + */ export const rootLoggerServiceFactory = createServiceFactory({ service: coreServices.rootLogger, deps: { diff --git a/packages/backend-defaults/api-report-cache.md b/packages/backend-defaults/api-report-cache.md index c41d553ac8..0bfd7eb463 100644 --- a/packages/backend-defaults/api-report-cache.md +++ b/packages/backend-defaults/api-report-cache.md @@ -24,7 +24,7 @@ export type CacheManagerOptions = { onError?: (err: Error) => void; }; -// @public (undocumented) +// @public export const cacheServiceFactory: () => ServiceFactory; // @public (undocumented) diff --git a/packages/backend-defaults/api-report-database.md b/packages/backend-defaults/api-report-database.md index 728c228899..116830343a 100644 --- a/packages/backend-defaults/api-report-database.md +++ b/packages/backend-defaults/api-report-database.md @@ -31,7 +31,7 @@ export type DatabaseManagerOptions = { logger?: LoggerService; }; -// @public (undocumented) +// @public export const databaseServiceFactory: () => ServiceFactory< DatabaseService, 'plugin' diff --git a/packages/backend-defaults/api-report-discovery.md b/packages/backend-defaults/api-report-discovery.md index 0ff734b8a7..b434dab6fc 100644 --- a/packages/backend-defaults/api-report-discovery.md +++ b/packages/backend-defaults/api-report-discovery.md @@ -7,7 +7,7 @@ import { Config } from '@backstage/config'; import { DiscoveryService } from '@backstage/backend-plugin-api'; import { ServiceFactory } from '@backstage/backend-plugin-api'; -// @public (undocumented) +// @public export const discoveryServiceFactory: () => ServiceFactory< DiscoveryService, 'plugin' diff --git a/packages/backend-defaults/api-report-permissions.md b/packages/backend-defaults/api-report-permissions.md index 9006a62018..c436443ff1 100644 --- a/packages/backend-defaults/api-report-permissions.md +++ b/packages/backend-defaults/api-report-permissions.md @@ -6,7 +6,7 @@ import { PermissionsService } from '@backstage/backend-plugin-api'; import { ServiceFactory } from '@backstage/backend-plugin-api'; -// @public (undocumented) +// @public export const permissionsServiceFactory: () => ServiceFactory< PermissionsService, 'plugin' diff --git a/packages/backend-defaults/api-report-rootConfig.md b/packages/backend-defaults/api-report-rootConfig.md index 60c8fbcb57..2d46370c27 100644 --- a/packages/backend-defaults/api-report-rootConfig.md +++ b/packages/backend-defaults/api-report-rootConfig.md @@ -7,7 +7,7 @@ import { RemoteConfigSourceOptions } from '@backstage/config-loader'; import { RootConfigService } from '@backstage/backend-plugin-api'; import { ServiceFactory } from '@backstage/backend-plugin-api'; -// @public (undocumented) +// @public export interface RootConfigFactoryOptions { argv?: string[]; remote?: Pick; diff --git a/packages/backend-defaults/api-report-urlReader.md b/packages/backend-defaults/api-report-urlReader.md index a1976f5a1c..c56cdba69b 100644 --- a/packages/backend-defaults/api-report-urlReader.md +++ b/packages/backend-defaults/api-report-urlReader.md @@ -425,7 +425,7 @@ export class UrlReaders { static default(options: UrlReadersOptions): UrlReaderService; } -// @public (undocumented) +// @public export const urlReaderServiceFactory: () => ServiceFactory< UrlReaderService, 'plugin' diff --git a/packages/backend-defaults/src/entrypoints/auth/authServiceFactory.ts b/packages/backend-defaults/src/entrypoints/auth/authServiceFactory.ts index 6a1aa51604..e275e2be00 100644 --- a/packages/backend-defaults/src/entrypoints/auth/authServiceFactory.ts +++ b/packages/backend-defaults/src/entrypoints/auth/authServiceFactory.ts @@ -25,7 +25,11 @@ import { createPluginKeySource } from './plugin/keys/createPluginKeySource'; import { UserTokenHandler } from './user/UserTokenHandler'; /** - * Token authentication and credentials management. + * Handles token authentication and credentials management. + * + * See {@link @backstage/code-plugin-api#AuthService} + * and {@link https://backstage.io/docs/backend-system/core-services/auth | the service docs} + * for more information. * * @public */ diff --git a/packages/backend-defaults/src/entrypoints/cache/cacheServiceFactory.ts b/packages/backend-defaults/src/entrypoints/cache/cacheServiceFactory.ts index f60d770644..f16b306d81 100644 --- a/packages/backend-defaults/src/entrypoints/cache/cacheServiceFactory.ts +++ b/packages/backend-defaults/src/entrypoints/cache/cacheServiceFactory.ts @@ -21,6 +21,12 @@ import { import { CacheManager } from './CacheManager'; /** + * Key-value store for caching data. + * + * See {@link @backstage/code-plugin-api#CacheService} + * and {@link https://backstage.io/docs/backend-system/core-services/cache | the service docs} + * for more information. + * * @public */ export const cacheServiceFactory = createServiceFactory({ diff --git a/packages/backend-defaults/src/entrypoints/database/databaseServiceFactory.ts b/packages/backend-defaults/src/entrypoints/database/databaseServiceFactory.ts index 0720d05b43..3bdf1790f3 100644 --- a/packages/backend-defaults/src/entrypoints/database/databaseServiceFactory.ts +++ b/packages/backend-defaults/src/entrypoints/database/databaseServiceFactory.ts @@ -22,6 +22,12 @@ import { ConfigReader } from '@backstage/config'; import { DatabaseManager } from './DatabaseManager'; /** + * Database access and management via `knex`. + * + * See {@link @backstage/code-plugin-api#DatabaseService} + * and {@link https://backstage.io/docs/backend-system/core-services/database | the service docs} + * for more information. + * * @public */ export const databaseServiceFactory = createServiceFactory({ diff --git a/packages/backend-defaults/src/entrypoints/discovery/discoveryServiceFactory.ts b/packages/backend-defaults/src/entrypoints/discovery/discoveryServiceFactory.ts index bfc5a6a489..18ceac4a91 100644 --- a/packages/backend-defaults/src/entrypoints/discovery/discoveryServiceFactory.ts +++ b/packages/backend-defaults/src/entrypoints/discovery/discoveryServiceFactory.ts @@ -20,7 +20,15 @@ import { } from '@backstage/backend-plugin-api'; import { HostDiscovery } from './HostDiscovery'; -/** @public */ +/** + * Service discovery for inter-plugin communication. + * + * See {@link @backstage/code-plugin-api#DiscoveryService} + * and {@link https://backstage.io/docs/backend-system/core-services/discovery | the service docs} + * for more information. + * + * @public + */ export const discoveryServiceFactory = createServiceFactory({ service: coreServices.discovery, deps: { diff --git a/packages/backend-defaults/src/entrypoints/httpAuth/httpAuthServiceFactory.ts b/packages/backend-defaults/src/entrypoints/httpAuth/httpAuthServiceFactory.ts index e24c80aa6a..76550873f6 100644 --- a/packages/backend-defaults/src/entrypoints/httpAuth/httpAuthServiceFactory.ts +++ b/packages/backend-defaults/src/entrypoints/httpAuth/httpAuthServiceFactory.ts @@ -275,6 +275,10 @@ class DefaultHttpAuthService implements HttpAuthService { /** * Authentication of HTTP requests. * + * See {@link @backstage/code-plugin-api#HttpAuthService} + * and {@link https://backstage.io/docs/backend-system/core-services/http-auth | the service docs} + * for more information. + * * @public */ export const httpAuthServiceFactory = createServiceFactory({ diff --git a/packages/backend-defaults/src/entrypoints/lifecycle/lifecycleServiceFactory.ts b/packages/backend-defaults/src/entrypoints/lifecycle/lifecycleServiceFactory.ts index 3eb43d6c6e..192886ca61 100644 --- a/packages/backend-defaults/src/entrypoints/lifecycle/lifecycleServiceFactory.ts +++ b/packages/backend-defaults/src/entrypoints/lifecycle/lifecycleServiceFactory.ts @@ -85,7 +85,11 @@ export class BackendPluginLifecycleImpl implements LifecycleService { } /** - * Allows plugins to register shutdown hooks that are run when the process is about to exit. + * Registration of plugin startup and shutdown lifecycle hooks. + * + * See {@link @backstage/code-plugin-api#LifecycleService} + * and {@link https://backstage.io/docs/backend-system/core-services/lifecycle | the service docs} + * for more information. * * @public */ diff --git a/packages/backend-defaults/src/entrypoints/permissions/permissionsServiceFactory.ts b/packages/backend-defaults/src/entrypoints/permissions/permissionsServiceFactory.ts index f675dd6719..873d6a4fa0 100644 --- a/packages/backend-defaults/src/entrypoints/permissions/permissionsServiceFactory.ts +++ b/packages/backend-defaults/src/entrypoints/permissions/permissionsServiceFactory.ts @@ -21,6 +21,12 @@ import { import { ServerPermissionClient } from '@backstage/plugin-permission-node'; /** + * Permission system integration for authorization of user actions. + * + * See {@link @backstage/code-plugin-api#PermissionsService} + * and {@link https://backstage.io/docs/backend-system/core-services/permissions | the service docs} + * for more information. + * * @public */ export const permissionsServiceFactory = createServiceFactory({ diff --git a/packages/backend-defaults/src/entrypoints/rootConfig/rootConfigServiceFactory.ts b/packages/backend-defaults/src/entrypoints/rootConfig/rootConfigServiceFactory.ts index 92d1a89c0f..5752a9c634 100644 --- a/packages/backend-defaults/src/entrypoints/rootConfig/rootConfigServiceFactory.ts +++ b/packages/backend-defaults/src/entrypoints/rootConfig/rootConfigServiceFactory.ts @@ -24,6 +24,12 @@ import { } from '@backstage/config-loader'; /** + * Access to static configuration. + * + * See {@link @backstage/code-plugin-api#RootConfigService} + * and {@link https://backstage.io/docs/backend-system/core-services/root-config | the service docs} + * for more information. + * * @public */ export interface RootConfigFactoryOptions { diff --git a/packages/backend-defaults/src/entrypoints/rootLifecycle/rootLifecycleServiceFactory.ts b/packages/backend-defaults/src/entrypoints/rootLifecycle/rootLifecycleServiceFactory.ts index 197f99b97a..e724c2f5cb 100644 --- a/packages/backend-defaults/src/entrypoints/rootLifecycle/rootLifecycleServiceFactory.ts +++ b/packages/backend-defaults/src/entrypoints/rootLifecycle/rootLifecycleServiceFactory.ts @@ -105,7 +105,11 @@ export class BackendLifecycleImpl implements RootLifecycleService { } /** - * Allows plugins to register shutdown hooks that are run when the process is about to exit. + * Registration of backend startup and shutdown lifecycle hooks. + * + * See {@link @backstage/code-plugin-api#RootLifecycleService} + * and {@link https://backstage.io/docs/backend-system/core-services/root-lifecycle | the service docs} + * for more information. * * @public */ diff --git a/packages/backend-defaults/src/entrypoints/scheduler/schedulerServiceFactory.ts b/packages/backend-defaults/src/entrypoints/scheduler/schedulerServiceFactory.ts index 1105c86332..effa5c5925 100644 --- a/packages/backend-defaults/src/entrypoints/scheduler/schedulerServiceFactory.ts +++ b/packages/backend-defaults/src/entrypoints/scheduler/schedulerServiceFactory.ts @@ -21,7 +21,11 @@ import { import { DefaultSchedulerService } from './lib/DefaultSchedulerService'; /** - * The default service factory for {@link @backstage/backend-plugin-api#coreServices.scheduler}. + * Scheduling of distributed background tasks. + * + * See {@link @backstage/code-plugin-api#SchedulerService} + * and {@link https://backstage.io/docs/backend-system/core-services/scheduler | the service docs} + * for more information. * * @public */ diff --git a/packages/backend-defaults/src/entrypoints/urlReader/urlReaderServiceFactory.ts b/packages/backend-defaults/src/entrypoints/urlReader/urlReaderServiceFactory.ts index dae8d692cb..810882edf8 100644 --- a/packages/backend-defaults/src/entrypoints/urlReader/urlReaderServiceFactory.ts +++ b/packages/backend-defaults/src/entrypoints/urlReader/urlReaderServiceFactory.ts @@ -20,7 +20,15 @@ import { createServiceFactory, } from '@backstage/backend-plugin-api'; -/** @public */ +/** + * Reading content from external systems. + * + * See {@link @backstage/code-plugin-api#UrlReaderService} + * and {@link https://backstage.io/docs/backend-system/core-services/url-reader | the service docs} + * for more information. + * + * @public + */ export const urlReaderServiceFactory = createServiceFactory({ service: coreServices.urlReader, deps: { diff --git a/packages/backend-defaults/src/entrypoints/userInfo/userInfoServiceFactory.ts b/packages/backend-defaults/src/entrypoints/userInfo/userInfoServiceFactory.ts index db550bf9e8..fe8c398bca 100644 --- a/packages/backend-defaults/src/entrypoints/userInfo/userInfoServiceFactory.ts +++ b/packages/backend-defaults/src/entrypoints/userInfo/userInfoServiceFactory.ts @@ -15,83 +15,20 @@ */ import { - UserInfoService, - BackstageUserInfo, coreServices, createServiceFactory, - DiscoveryService, - BackstageCredentials, } from '@backstage/backend-plugin-api'; -import { ResponseError } from '@backstage/errors'; -import { decodeJwt } from 'jose'; -import fetch from 'node-fetch'; -import { toInternalBackstageCredentials } from '../auth/helpers'; +import { DefaultUserInfoService } from './DefaultUserInfoService'; -type Options = { - discovery: DiscoveryService; -}; - -export class DefaultUserInfoService implements UserInfoService { - private readonly discovery: DiscoveryService; - - constructor(options: Options) { - this.discovery = options.discovery; - } - - async getUserInfo( - credentials: BackstageCredentials, - ): Promise { - const internalCredentials = toInternalBackstageCredentials(credentials); - if (internalCredentials.principal.type !== 'user') { - throw new Error('Only user credentials are supported'); - } - if (!internalCredentials.token) { - throw new Error('User credentials is unexpectedly missing token'); - } - const { sub: userEntityRef, ent: tokenEnt } = decodeJwt( - internalCredentials.token, - ); - - if (typeof userEntityRef !== 'string') { - throw new Error('User entity ref must be a string'); - } - - let ownershipEntityRefs = tokenEnt; - - if (!ownershipEntityRefs) { - const userInfoResp = await fetch( - `${await this.discovery.getBaseUrl('auth')}/v1/userinfo`, - { - headers: { - Authorization: `Bearer ${internalCredentials.token}`, - }, - }, - ); - - if (!userInfoResp.ok) { - throw await ResponseError.fromResponse(userInfoResp); - } - - const { - claims: { ent }, - } = await userInfoResp.json(); - ownershipEntityRefs = ent; - } - - if (!ownershipEntityRefs) { - throw new Error('Ownership entity refs can not be determined'); - } else if ( - !Array.isArray(ownershipEntityRefs) || - ownershipEntityRefs.some(ref => typeof ref !== 'string') - ) { - throw new Error('Ownership entity refs must be an array of strings'); - } - - return { userEntityRef, ownershipEntityRefs }; - } -} - -/** @public */ +/** + * Authenticated user information retrieval. + * + * See {@link @backstage/code-plugin-api#UserInfoService} + * and {@link https://backstage.io/docs/backend-system/core-services/user-info | the service docs} + * for more information. + * + * @public + */ export const userInfoServiceFactory = createServiceFactory({ service: coreServices.userInfo, deps: { From ed3074e7bd9642a6702130377009beda9e377779 Mon Sep 17 00:00:00 2001 From: Camila Belo Date: Sat, 15 Jun 2024 09:37:18 +0200 Subject: [PATCH 229/387] refactor: deprecate common database manager Signed-off-by: Camila Belo --- .changeset/early-donkeys-cheer.md | 5 + packages/backend-app-api/api-report.md | 4 +- packages/backend-common/api-report.md | 47 ++++---- packages/backend-common/src/database/index.ts | 18 ---- .../backend-common/src/database/reexport.ts | 37 ------- packages/backend-common/src/database/types.ts | 100 ------------------ .../backend-common/src/deprecated/index.ts | 62 +++++++++++ packages/backend-common/src/index.ts | 1 - 8 files changed, 94 insertions(+), 180 deletions(-) create mode 100644 .changeset/early-donkeys-cheer.md delete mode 100644 packages/backend-common/src/database/index.ts delete mode 100644 packages/backend-common/src/database/reexport.ts delete mode 100644 packages/backend-common/src/database/types.ts diff --git a/.changeset/early-donkeys-cheer.md b/.changeset/early-donkeys-cheer.md new file mode 100644 index 0000000000..f5f4623acf --- /dev/null +++ b/.changeset/early-donkeys-cheer.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-common': patch +--- + +The `database` types, helpers and implementations were moved to the package `@backstage/backend-defaults` and deprecated from the package `@backstage/backend-commons`. diff --git a/packages/backend-app-api/api-report.md b/packages/backend-app-api/api-report.md index 3d7357cb87..2c5f5d6b78 100644 --- a/packages/backend-app-api/api-report.md +++ b/packages/backend-app-api/api-report.md @@ -12,6 +12,7 @@ import { CacheService } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { ConfigSchema } from '@backstage/config-loader'; import { CorsOptions } from 'cors'; +import { DatabaseService } from '@backstage/backend-plugin-api'; import { DiscoveryService } from '@backstage/backend-plugin-api'; import { ErrorRequestHandler } from 'express'; import { Express as Express_2 } from 'express'; @@ -28,7 +29,6 @@ import { LifecycleService } from '@backstage/backend-plugin-api'; import { LoadConfigOptionsRemote } from '@backstage/config-loader'; import { LoggerService } from '@backstage/backend-plugin-api'; import { PermissionsService } from '@backstage/backend-plugin-api'; -import { PluginDatabaseManager } from '@backstage/backend-common'; import { RemoteConfigSourceOptions } from '@backstage/config-loader'; import { RequestHandler } from 'express'; import { RequestListener } from 'http'; @@ -102,7 +102,7 @@ export interface CreateSpecializedBackendOptions { // @public @deprecated (undocumented) export const databaseServiceFactory: () => ServiceFactory< - PluginDatabaseManager, + DatabaseService, 'plugin' >; diff --git a/packages/backend-common/api-report.md b/packages/backend-common/api-report.md index 31c8d27f45..d9766f9814 100644 --- a/packages/backend-common/api-report.md +++ b/packages/backend-common/api-report.md @@ -22,6 +22,7 @@ import { CacheServiceOptions } from '@backstage/backend-plugin-api'; import { CacheServiceSetOptions } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import cors from 'cors'; +import { DatabaseService } from '@backstage/backend-plugin-api'; import { DiscoveryService } from '@backstage/backend-plugin-api'; import Docker from 'dockerode'; import { ErrorRequestHandler } from 'express'; @@ -43,7 +44,6 @@ import { Logger } from 'winston'; import { LoggerService } from '@backstage/backend-plugin-api'; import { MergeResult } from 'isomorphic-git'; import { PermissionsService } from '@backstage/backend-plugin-api'; -import { DatabaseService as PluginDatabaseManager } from '@backstage/backend-plugin-api'; import { PluginMetadataService } from '@backstage/backend-plugin-api'; import { PushResult } from 'isomorphic-git'; import { Readable } from 'stream'; @@ -191,26 +191,29 @@ export function createStatusCheckRouter(options: { statusCheck?: StatusCheck; }): Promise; -// @public +// @public @deprecated (undocumented) export class DatabaseManager implements LegacyRootDatabaseService { + // (undocumented) forPlugin( pluginId: string, - deps?: { - lifecycle: LifecycleService; - pluginMetadata: PluginMetadataService; - }, + deps?: + | { + lifecycle: LifecycleService; + pluginMetadata: PluginMetadataService; + } + | undefined, ): PluginDatabaseManager; + // (undocumented) static fromConfig( config: Config, options?: DatabaseManagerOptions, ): DatabaseManager; } -// @public -export type DatabaseManagerOptions = { - migrations?: PluginDatabaseManager['migrations']; - logger?: LoggerService; -}; +// Warning: (ae-forgotten-export) The symbol "DatabaseManagerOptions_2" needs to be exported by the entry point index.d.ts +// +// @public @deprecated (undocumented) +export type DatabaseManagerOptions = DatabaseManagerOptions_2; // @public export class DockerContainerRunner implements ContainerRunner { @@ -219,11 +222,10 @@ export class DockerContainerRunner implements ContainerRunner { runContainer(options: RunContainerOptions): Promise; } -// @public @deprecated -export function dropDatabase( - dbConfig: Config, - ...databaseNames: string[] -): Promise; +// Warning: (ae-forgotten-export) The symbol "dropDatabase_2" needs to be exported by the entry point index.d.ts +// +// @public @deprecated (undocumented) +export const dropDatabase: typeof dropDatabase_2; // @public @deprecated export function errorHandler( @@ -400,7 +402,7 @@ export const legacyPlugin: ( { cache: CacheService; config: RootConfigService; - database: PluginDatabaseManager; + database: DatabaseService; discovery: DiscoveryService; logger: LoggerService; permissions: PermissionsService; @@ -420,10 +422,10 @@ export const legacyPlugin: ( }>, ) => BackendFeatureCompat; -// @public -export type LegacyRootDatabaseService = { - forPlugin(pluginId: string): PluginDatabaseManager; -}; +// Warning: (ae-forgotten-export) The symbol "LegacyRootDatabaseService_2" needs to be exported by the entry point index.d.ts +// +// @public @deprecated (undocumented) +export type LegacyRootDatabaseService = LegacyRootDatabaseService_2; // @public @deprecated export function loadBackendConfig(options: { @@ -466,7 +468,8 @@ export function notFoundHandler(): RequestHandler; // @public @deprecated (undocumented) export type PluginCacheManager = PluginCacheManager_2; -export { PluginDatabaseManager }; +// @public @deprecated (undocumented) +export type PluginDatabaseManager = DatabaseService; // @public @deprecated (undocumented) export type PluginEndpointDiscovery = DiscoveryService; diff --git a/packages/backend-common/src/database/index.ts b/packages/backend-common/src/database/index.ts deleted file mode 100644 index 0e95261d82..0000000000 --- a/packages/backend-common/src/database/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2020 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. - */ - -export * from './reexport'; -export type { PluginDatabaseManager } from './types'; diff --git a/packages/backend-common/src/database/reexport.ts b/packages/backend-common/src/database/reexport.ts deleted file mode 100644 index 1ecff9be15..0000000000 --- a/packages/backend-common/src/database/reexport.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2024 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. - */ - -/* - * NOTE(freben): This is a temporary hack. We use cross-package imports so that - * we do not have to maintain double implementations for the time being, until - * backend-common is properly removed. When it is, the impleemntation should be - * moved into this part of the repo instead. - */ - -// eslint-disable-next-line @backstage/no-relative-monorepo-imports -import { - DatabaseManager, - dropDatabase, - type DatabaseManagerOptions, - type LegacyRootDatabaseService, -} from '../../../backend-defaults/src/entrypoints/database/DatabaseManager'; - -export { - DatabaseManager, - dropDatabase, - type DatabaseManagerOptions, - type LegacyRootDatabaseService, -}; diff --git a/packages/backend-common/src/database/types.ts b/packages/backend-common/src/database/types.ts deleted file mode 100644 index a9cceaa1f9..0000000000 --- a/packages/backend-common/src/database/types.ts +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2020 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 { - LifecycleService, - PluginMetadataService, -} from '@backstage/backend-plugin-api'; -import { Config } from '@backstage/config'; -import { Knex } from 'knex'; - -export type { DatabaseService as PluginDatabaseManager } from '@backstage/backend-plugin-api'; - -/** - * Manages an underlying Knex database driver. - */ -export interface DatabaseConnector { - /** - * Provides an instance of a knex database connector. - */ - createClient( - dbConfig: Config, - overrides?: Partial, - deps?: { - lifecycle: LifecycleService; - pluginMetadata: PluginMetadataService; - }, - ): Knex; - - /** - * Provides a partial knex config sufficient to override a database name. - */ - createNameOverride(name: string): Partial; - - /** - * Provides a partial knex config sufficient to override a PostgreSQL schema - * name within utilizing the `searchPath` knex configuration. - */ - createSchemaOverride?(name: string): Partial; - - /** - * Produces a knex connection config object representing a database connection - * string. - */ - parseConnectionString( - connectionString: string, - client?: string, - ): Knex.StaticConnectionConfig; - - /** - * Performs a side-effect to ensure database names passed in are present. - * - * Calling this function on databases which already exist should do nothing. - * Missing databases should be created if needed. - */ - ensureDatabaseExists?( - dbConfig: Config, - ...databases: Array - ): Promise; - - /** - * Performs a side-effect to ensure schema names passed in are present. - * - * Calling this function on schemas which already exist should do nothing. - * Missing schemas should be created if needed. - */ - ensureSchemaExists?( - dbConfig: Config, - ...schemas: Array - ): Promise; - - /** - * Deletes databases. - */ - dropDatabase?(dbConfig: Config, ...databases: Array): Promise; -} - -export interface Connector { - getClient( - pluginId: string, - deps?: { - lifecycle: LifecycleService; - pluginMetadata: PluginMetadataService; - }, - ): Promise; - - dropDatabase(...databaseNames: string[]): Promise; -} diff --git a/packages/backend-common/src/deprecated/index.ts b/packages/backend-common/src/deprecated/index.ts index 1099633e07..b789bb66e0 100644 --- a/packages/backend-common/src/deprecated/index.ts +++ b/packages/backend-common/src/deprecated/index.ts @@ -14,6 +14,8 @@ * limitations under the License. */ +import { Config } from '@backstage/config'; + // eslint-disable-next-line @backstage/no-relative-monorepo-imports import { HostDiscovery as _HostDiscovery } from '../../../backend-defaults/src/entrypoints/discovery/HostDiscovery'; @@ -26,6 +28,14 @@ import { type CacheManagerOptions as _CacheManagerOptions, } from '../../../backend-defaults/src/entrypoints/cache/types'; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { + dropDatabase as _dropDatabase, + DatabaseManager as _DatabaseManager, + type DatabaseManagerOptions as _DatabaseManagerOptions, + type LegacyRootDatabaseService as _LegacyRootDatabaseService, +} from '../../../backend-defaults/src/entrypoints/database/DatabaseManager'; + // eslint-disable-next-line @backstage/no-relative-monorepo-imports import { AzureUrlReader as _AzureUrlReader } from '../../../backend-defaults/src/entrypoints/urlReader/lib/AzureUrlReader'; // eslint-disable-next-line @backstage/no-relative-monorepo-imports @@ -67,9 +77,12 @@ import type { import { DiscoveryService, + LifecycleService, + PluginMetadataService, CacheService, CacheServiceOptions, CacheServiceSetOptions, + DatabaseService as _PluginDatabaseManager, isDatabaseConflictError as _isDatabaseConflictError, resolvePackagePath as _resolvePackagePath, resolveSafeChildPath as _resolveSafeChildPath, @@ -160,6 +173,55 @@ export type CacheClientSetOptions = CacheServiceSetOptions; */ export type CacheClientOptions = CacheServiceOptions; +/** + * @public + * @deprecated Use `DatabaseManager` from the `@backstage/backend-defaults` package instead + */ +export class DatabaseManager implements LegacyRootDatabaseService { + private constructor(private readonly _databaseManager: _DatabaseManager) {} + + static fromConfig( + config: Config, + options?: DatabaseManagerOptions, + ): DatabaseManager { + const _databaseManager = _DatabaseManager.fromConfig(config, options); + return new DatabaseManager(_databaseManager); + } + + forPlugin( + pluginId: string, + deps?: + | { lifecycle: LifecycleService; pluginMetadata: PluginMetadataService } + | undefined, + ): PluginDatabaseManager { + return this._databaseManager.forPlugin(pluginId, deps); + } +} + +/** + * @public + * @deprecated Use `DatabaseManagerOptions` from the `@backstage/backend-defaults` package instead + */ +export type DatabaseManagerOptions = _DatabaseManagerOptions; + +/** + * @public + * @deprecated Use `DatabaseService` from the `@backstage/backend-plugin-api` package instead + */ +export type PluginDatabaseManager = _PluginDatabaseManager; + +/** + * @public + * @deprecated Use `LegacyRootDatabaseService` from the `@backstage/backend-defaults` package instead + */ +export type LegacyRootDatabaseService = _LegacyRootDatabaseService; + +/** + * @public + * @deprecated Use `dropDatabase` from the `@backstage/backend-defaults` package instead + */ +export const dropDatabase = _dropDatabase; + /** * @public * @deprecated This function is deprecated and will be removed in a future release, see https://github.com/backstage/backstage/issues/24493. diff --git a/packages/backend-common/src/index.ts b/packages/backend-common/src/index.ts index 498b93ad8a..62cc970870 100644 --- a/packages/backend-common/src/index.ts +++ b/packages/backend-common/src/index.ts @@ -26,7 +26,6 @@ export { loadBackendConfig } from './config'; export * from './deprecated'; export * from './auth'; export * from './cache'; -export * from './database'; export * from './hot'; export * from './logging'; export * from './middleware'; From fe0e7ba63cdd4e1d76e5b51604c8b72658d74a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Mon, 17 Jun 2024 14:17:44 +0200 Subject: [PATCH 230/387] break out class and make test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .../userInfo/DefaultUserInfoService.test.ts | 169 ++++++++++++++++++ .../userInfo/DefaultUserInfoService.ts | 90 ++++++++++ 2 files changed, 259 insertions(+) create mode 100644 packages/backend-defaults/src/entrypoints/userInfo/DefaultUserInfoService.test.ts create mode 100644 packages/backend-defaults/src/entrypoints/userInfo/DefaultUserInfoService.ts diff --git a/packages/backend-defaults/src/entrypoints/userInfo/DefaultUserInfoService.test.ts b/packages/backend-defaults/src/entrypoints/userInfo/DefaultUserInfoService.test.ts new file mode 100644 index 0000000000..b63b24fb18 --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/userInfo/DefaultUserInfoService.test.ts @@ -0,0 +1,169 @@ +/* + * Copyright 2024 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 { BackstageUserPrincipal } from '@backstage/backend-plugin-api'; +import { + mockServices, + setupRequestMockHandlers, +} from '@backstage/backend-test-utils'; +import { JsonObject } from '@backstage/types'; +import { SignJWT, base64url, importJWK } from 'jose'; +import { rest } from 'msw'; +import { setupServer } from 'msw/node'; +import { InternalBackstageCredentials } from '../auth/types'; +import { DefaultUserInfoService } from './DefaultUserInfoService'; + +describe('DefaultUserInfoService', () => { + const server = setupServer(); + setupRequestMockHandlers(server); + + const mockPublicKey = { + kty: 'EC', + x: 'GHlwg744e8JekzukPTdtix6R868D6fcWy0ooOx-NEZI', + y: 'Lyujcm0M6X9_yQi3l1eH09z0brU8K9cwrLml_fRFKro', + crv: 'P-256', + kid: 'mock', + alg: 'ES256', + }; + const mockPrivateKey = { + ...mockPublicKey, + d: 'KEn_mDqXYbZdRHb-JnCrW53LDOv5x4NL1FnlKcqBsFI', + }; + + function encodeData(data: JsonObject) { + return base64url.encode(JSON.stringify(data)); + } + + async function createToken(options: { + header: JsonObject; + payload: JsonObject; + signature?: string; + }) { + if (options.signature) { + const header = encodeData(options.header); + const payload = encodeData(options.payload); + + return `${header}.${payload}.${options.signature}`; + } + + return await new SignJWT(options.payload) + .setProtectedHeader({ ...options.header, alg: 'ES256' }) + .sign(await importJWK(mockPrivateKey)); + } + + const discovery = mockServices.discovery.mock({ + getBaseUrl: async pluginId => `https://example.com/api/${pluginId}`, + }); + + it('makes the expected call when no ent in the token', async () => { + const token = await createToken({ + header: { + typ: 'vnd.backstage.user', + alg: 'ES256', + kid: mockPublicKey.kid, + }, + payload: { + sub: 'user:default/alice', + }, + }); + const credentials = { + $$type: '@backstage/BackstageCredentials', + version: 'v1', + token: token, + principal: { + type: 'user', + userEntityRef: 'user:default/alice', + }, + } as InternalBackstageCredentials; + + server.use( + rest.get('https://example.com/api/auth/v1/userinfo', (req, res, ctx) => { + expect(req.headers.get('authorization')).toBe(`Bearer ${token}`); + return res(ctx.json({ claims: { ent: ['group:default/my-team'] } })); + }), + ); + + const service = new DefaultUserInfoService({ discovery }); + await expect(service.getUserInfo(credentials)).resolves.toEqual({ + userEntityRef: 'user:default/alice', + ownershipEntityRefs: ['group:default/my-team'], + }); + }); + + it('uses the ent from the token when present', async () => { + const token = await createToken({ + header: { + typ: 'vnd.backstage.user', + alg: 'ES256', + kid: mockPublicKey.kid, + }, + payload: { + sub: 'user:default/alice', + ent: ['group:default/my-team'], + }, + }); + const credentials = { + $$type: '@backstage/BackstageCredentials', + version: 'v1', + token: token, + principal: { + type: 'user', + userEntityRef: 'user:default/alice', + }, + } as InternalBackstageCredentials; + + const service = new DefaultUserInfoService({ discovery }); + await expect(service.getUserInfo(credentials)).resolves.toEqual({ + userEntityRef: 'user:default/alice', + ownershipEntityRefs: ['group:default/my-team'], + }); + }); + + it('passes on server errors', async () => { + const token = await createToken({ + header: { + typ: 'vnd.backstage.user', + alg: 'ES256', + kid: mockPublicKey.kid, + }, + payload: { + sub: 'user:default/alice', + }, + }); + const credentials = { + $$type: '@backstage/BackstageCredentials', + version: 'v1', + token: token, + principal: { + type: 'user', + userEntityRef: 'user:default/alice', + }, + } as InternalBackstageCredentials; + + server.use( + rest.get('https://example.com/api/auth/v1/userinfo', (_req, res, ctx) => { + return res(ctx.status(404)); + }), + ); + + const service = new DefaultUserInfoService({ discovery }); + await expect( + service.getUserInfo(credentials), + ).rejects.toMatchInlineSnapshot( + `[ResponseError: Request failed with 404 Not Found]`, + ); + }); +}); diff --git a/packages/backend-defaults/src/entrypoints/userInfo/DefaultUserInfoService.ts b/packages/backend-defaults/src/entrypoints/userInfo/DefaultUserInfoService.ts new file mode 100644 index 0000000000..83bbba89b7 --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/userInfo/DefaultUserInfoService.ts @@ -0,0 +1,90 @@ +/* + * Copyright 2024 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 { + UserInfoService, + BackstageUserInfo, + DiscoveryService, + BackstageCredentials, +} from '@backstage/backend-plugin-api'; +import { ResponseError } from '@backstage/errors'; +import { decodeJwt } from 'jose'; +import fetch from 'node-fetch'; +import { toInternalBackstageCredentials } from '../auth/helpers'; + +export type Options = { + discovery: DiscoveryService; +}; + +export class DefaultUserInfoService implements UserInfoService { + private readonly discovery: DiscoveryService; + + constructor(options: Options) { + this.discovery = options.discovery; + } + + async getUserInfo( + credentials: BackstageCredentials, + ): Promise { + const internalCredentials = toInternalBackstageCredentials(credentials); + if (internalCredentials.principal.type !== 'user') { + throw new Error('Only user credentials are supported'); + } + if (!internalCredentials.token) { + throw new Error('User credentials is unexpectedly missing token'); + } + const { sub: userEntityRef, ent: tokenEnt } = decodeJwt( + internalCredentials.token, + ); + + if (typeof userEntityRef !== 'string') { + throw new Error('User entity ref must be a string'); + } + + let ownershipEntityRefs = tokenEnt; + + if (!ownershipEntityRefs) { + const userInfoResp = await fetch( + `${await this.discovery.getBaseUrl('auth')}/v1/userinfo`, + { + headers: { + Authorization: `Bearer ${internalCredentials.token}`, + }, + }, + ); + + if (!userInfoResp.ok) { + throw await ResponseError.fromResponse(userInfoResp); + } + + const { + claims: { ent }, + } = await userInfoResp.json(); + ownershipEntityRefs = ent; + } + + if (!ownershipEntityRefs) { + throw new Error('Ownership entity refs can not be determined'); + } else if ( + !Array.isArray(ownershipEntityRefs) || + ownershipEntityRefs.some(ref => typeof ref !== 'string') + ) { + throw new Error('Ownership entity refs must be an array of strings'); + } + + return { userEntityRef, ownershipEntityRefs }; + } +} From f2f41aad7e6152f13c9b5d50674511382847f298 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Mon, 17 Jun 2024 14:30:40 +0200 Subject: [PATCH 231/387] backend-common: deprecate container runners Signed-off-by: Vincenzo Scamporlino --- .../{ => deprecated}/util/ContainerRunner.ts | 3 + .../util/DockerContainerRunner.test.ts | 0 .../util/DockerContainerRunner.ts | 1 + .../util/KubernetesContainerRunner.test.ts | 0 .../util/KubernetesContainerRunner.ts | 3 + .../src/{ => deprecated}/util/index.ts | 0 .../src/util/escapeRegExp.test.ts | 84 ------------------- .../backend-common/src/util/escapeRegExp.ts | 24 ------ 8 files changed, 7 insertions(+), 108 deletions(-) rename packages/backend-common/src/{ => deprecated}/util/ContainerRunner.ts (87%) rename packages/backend-common/src/{ => deprecated}/util/DockerContainerRunner.test.ts (100%) rename packages/backend-common/src/{ => deprecated}/util/DockerContainerRunner.ts (98%) rename packages/backend-common/src/{ => deprecated}/util/KubernetesContainerRunner.test.ts (100%) rename packages/backend-common/src/{ => deprecated}/util/KubernetesContainerRunner.ts (97%) rename packages/backend-common/src/{ => deprecated}/util/index.ts (100%) delete mode 100644 packages/backend-common/src/util/escapeRegExp.test.ts delete mode 100644 packages/backend-common/src/util/escapeRegExp.ts diff --git a/packages/backend-common/src/util/ContainerRunner.ts b/packages/backend-common/src/deprecated/util/ContainerRunner.ts similarity index 87% rename from packages/backend-common/src/util/ContainerRunner.ts rename to packages/backend-common/src/deprecated/util/ContainerRunner.ts index 351a5da613..92081cea16 100644 --- a/packages/backend-common/src/util/ContainerRunner.ts +++ b/packages/backend-common/src/deprecated/util/ContainerRunner.ts @@ -22,6 +22,7 @@ import { Writable } from 'stream'; * {@link https://github.com/apocas/dockerode?tab=readme-ov-file#pull-from-private-repos} * * @public + * @deprecated This interface is deprecated and will be removed in a future release. */ export interface PullOptions { authconfig?: { @@ -39,6 +40,7 @@ export interface PullOptions { * Options passed to the {@link ContainerRunner.runContainer} method. * * @public + * @deprecated This type is deprecated and will be removed in a future release. */ export type RunContainerOptions = { imageName: string; @@ -57,6 +59,7 @@ export type RunContainerOptions = { * Handles the running of containers, on behalf of others. * * @public + * @deprecated This interface is deprecated and will be removed in a future release. */ export interface ContainerRunner { /** diff --git a/packages/backend-common/src/util/DockerContainerRunner.test.ts b/packages/backend-common/src/deprecated/util/DockerContainerRunner.test.ts similarity index 100% rename from packages/backend-common/src/util/DockerContainerRunner.test.ts rename to packages/backend-common/src/deprecated/util/DockerContainerRunner.test.ts diff --git a/packages/backend-common/src/util/DockerContainerRunner.ts b/packages/backend-common/src/deprecated/util/DockerContainerRunner.ts similarity index 98% rename from packages/backend-common/src/util/DockerContainerRunner.ts rename to packages/backend-common/src/deprecated/util/DockerContainerRunner.ts index 89a17fff51..ea576e4a3a 100644 --- a/packages/backend-common/src/util/DockerContainerRunner.ts +++ b/packages/backend-common/src/deprecated/util/DockerContainerRunner.ts @@ -28,6 +28,7 @@ export type UserOptions = { * A {@link ContainerRunner} for Docker containers. * * @public + * @deprecated This class is deprecated and will be removed in a future release. */ export class DockerContainerRunner implements ContainerRunner { private readonly dockerClient: Docker; diff --git a/packages/backend-common/src/util/KubernetesContainerRunner.test.ts b/packages/backend-common/src/deprecated/util/KubernetesContainerRunner.test.ts similarity index 100% rename from packages/backend-common/src/util/KubernetesContainerRunner.test.ts rename to packages/backend-common/src/deprecated/util/KubernetesContainerRunner.test.ts diff --git a/packages/backend-common/src/util/KubernetesContainerRunner.ts b/packages/backend-common/src/deprecated/util/KubernetesContainerRunner.ts similarity index 97% rename from packages/backend-common/src/util/KubernetesContainerRunner.ts rename to packages/backend-common/src/deprecated/util/KubernetesContainerRunner.ts index 4b235caf2c..0402f70079 100644 --- a/packages/backend-common/src/util/KubernetesContainerRunner.ts +++ b/packages/backend-common/src/deprecated/util/KubernetesContainerRunner.ts @@ -37,6 +37,7 @@ import { v4 as uuid } from 'uuid'; * Every mount must start with the 'basePath'. * * @public + * @deprecated This type is deprecated and will be removed in a future release. */ export type KubernetesContainerRunnerMountBase = { volumeName: string; @@ -53,6 +54,7 @@ export type KubernetesContainerRunnerMountBase = { * a volume definition named as the {@link KubernetesContainerRunnerMountBase} 'volumeName'. * * @public + * @deprecated This type is deprecated and will be removed in a future release. */ export type KubernetesContainerRunnerOptions = { kubeConfig: KubeConfig; @@ -69,6 +71,7 @@ export type KubernetesContainerRunnerOptions = { * Runs containers leveraging Jobs on a Kubernetes cluster * * @public + * @deprecated This class is deprecated and will be removed in a future release. */ export class KubernetesContainerRunner implements ContainerRunner { private readonly kubeConfig: KubeConfig; diff --git a/packages/backend-common/src/util/index.ts b/packages/backend-common/src/deprecated/util/index.ts similarity index 100% rename from packages/backend-common/src/util/index.ts rename to packages/backend-common/src/deprecated/util/index.ts diff --git a/packages/backend-common/src/util/escapeRegExp.test.ts b/packages/backend-common/src/util/escapeRegExp.test.ts deleted file mode 100644 index 13c6ae4a5a..0000000000 --- a/packages/backend-common/src/util/escapeRegExp.test.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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 { escapeRegExp } from './escapeRegExp'; - -describe('escapeRegExp', () => { - test('does not escape non-regex characters', () => { - expect(escapeRegExp('Backstage Backstage')).toBe('Backstage Backstage'); - }); - - test('all the characters', () => { - expect(escapeRegExp('^$\\.*+?()[]{}|')).toBe( - '\\^\\$\\\\\\.\\*\\+\\?\\(\\)\\[\\]\\{\\}\\|', - ); - }); - - test('character: ^', () => { - expect(escapeRegExp('^')).toBe('\\^'); - }); - - test('character: $', () => { - expect(escapeRegExp('$')).toBe('\\$'); - }); - - test('character: \\', () => { - expect(escapeRegExp('\\')).toBe('\\\\'); - }); - - test('character: .', () => { - expect(escapeRegExp('.')).toBe('\\.'); - }); - - test('character: *', () => { - expect(escapeRegExp('*')).toBe('\\*'); - }); - - test('character: +', () => { - expect(escapeRegExp('+')).toBe('\\+'); - }); - - test('character: ?', () => { - expect(escapeRegExp('?')).toBe('\\?'); - }); - - test('character: (', () => { - expect(escapeRegExp('(')).toBe('\\('); - }); - - test('character: )', () => { - expect(escapeRegExp(')')).toBe('\\)'); - }); - - test('character: [', () => { - expect(escapeRegExp('[')).toBe('\\['); - }); - - test('character: ]', () => { - expect(escapeRegExp(']')).toBe('\\]'); - }); - - test('character: {', () => { - expect(escapeRegExp('{')).toBe('\\{'); - }); - - test('character: }', () => { - expect(escapeRegExp('}')).toBe('\\}'); - }); - - test('character: |', () => { - expect(escapeRegExp('|')).toBe('\\|'); - }); -}); diff --git a/packages/backend-common/src/util/escapeRegExp.ts b/packages/backend-common/src/util/escapeRegExp.ts deleted file mode 100644 index bc78967ebe..0000000000 --- a/packages/backend-common/src/util/escapeRegExp.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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. - */ - -/** - * Escapes a given string to be used inside a RegExp. - * - * Taken from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions - */ -export const escapeRegExp = (text: string) => { - return text.replace(/[.*+?^${}(\)|[\]\\]/g, '\\$&'); -}; From 1a6f38a9e1d434dc7acdaea0bba70b517ed8edf6 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Mon, 17 Jun 2024 14:30:57 +0200 Subject: [PATCH 232/387] backend-common: changeset Signed-off-by: Vincenzo Scamporlino --- .changeset/gorgeous-spiders-fry.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/gorgeous-spiders-fry.md diff --git a/.changeset/gorgeous-spiders-fry.md b/.changeset/gorgeous-spiders-fry.md new file mode 100644 index 0000000000..6a1d4e7296 --- /dev/null +++ b/.changeset/gorgeous-spiders-fry.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-common': patch +--- + +`ContainerRunner`, `DockerContainerRunner` and `KubernetesContainerRunner` are now deprecated From 09a9be8967a5f7467e14650b8c5c24857a19a1d5 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Mon, 17 Jun 2024 14:38:06 +0200 Subject: [PATCH 233/387] backend-common: api reports Signed-off-by: Vincenzo Scamporlino --- packages/backend-common/api-report.md | 14 +++++++------- packages/backend-common/src/deprecated/index.ts | 1 + packages/backend-common/src/index.ts | 1 - 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/backend-common/api-report.md b/packages/backend-common/api-report.md index 31c8d27f45..2902599cf5 100644 --- a/packages/backend-common/api-report.md +++ b/packages/backend-common/api-report.md @@ -137,7 +137,7 @@ export function cacheToPluginCacheManager(cache: CacheService): { // @public @deprecated export const coloredFormat: winston.Logform.Format; -// @public +// @public @deprecated export interface ContainerRunner { runContainer(opts: RunContainerOptions): Promise; } @@ -212,7 +212,7 @@ export type DatabaseManagerOptions = { logger?: LoggerService; }; -// @public +// @public @deprecated export class DockerContainerRunner implements ContainerRunner { constructor(options: { dockerClient: Docker }); // (undocumented) @@ -365,20 +365,20 @@ export const isChildPath: typeof isChildPath_2; // @public @deprecated (undocumented) export const isDatabaseConflictError: typeof isDatabaseConflictError_2; -// @public +// @public @deprecated export class KubernetesContainerRunner implements ContainerRunner { constructor(options: KubernetesContainerRunnerOptions); // (undocumented) runContainer(options: RunContainerOptions): Promise; } -// @public +// @public @deprecated export type KubernetesContainerRunnerMountBase = { volumeName: string; basePath: string; }; -// @public +// @public @deprecated export type KubernetesContainerRunnerOptions = { kubeConfig: KubeConfig; name: string; @@ -471,7 +471,7 @@ export { PluginDatabaseManager }; // @public @deprecated (undocumented) export type PluginEndpointDiscovery = DiscoveryService; -// @public +// @public @deprecated export interface PullOptions { // (undocumented) [key: string]: unknown; @@ -549,7 +549,7 @@ export const resolvePackagePath: typeof resolvePackagePath_2; // @public @deprecated (undocumented) export const resolveSafeChildPath: typeof resolveSafeChildPath_2; -// @public +// @public @deprecated export type RunContainerOptions = { imageName: string; command?: string | string[]; diff --git a/packages/backend-common/src/deprecated/index.ts b/packages/backend-common/src/deprecated/index.ts index 1099633e07..d3eb5bf012 100644 --- a/packages/backend-common/src/deprecated/index.ts +++ b/packages/backend-common/src/deprecated/index.ts @@ -91,6 +91,7 @@ export * from './tokens'; export * from './logging'; export * from './service'; export * from './middleware'; +export * from './util'; /** * @public diff --git a/packages/backend-common/src/index.ts b/packages/backend-common/src/index.ts index 498b93ad8a..8772457f83 100644 --- a/packages/backend-common/src/index.ts +++ b/packages/backend-common/src/index.ts @@ -31,4 +31,3 @@ export * from './hot'; export * from './logging'; export * from './middleware'; export * from './service'; -export * from './util'; From f59e1c67d072b7748609bd52c893d83c4fa269c9 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Mon, 17 Jun 2024 15:51:06 +0200 Subject: [PATCH 234/387] techdocs-node: add missing option Signed-off-by: Vincenzo Scamporlino --- plugins/techdocs-node/api-report.md | 1 + plugins/techdocs-node/src/stages/generate/generators.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/plugins/techdocs-node/api-report.md b/plugins/techdocs-node/api-report.md index 7275586ef8..3966b7d2d8 100644 --- a/plugins/techdocs-node/api-report.md +++ b/plugins/techdocs-node/api-report.md @@ -72,6 +72,7 @@ export class Generators implements GeneratorBuilder { config: Config, options: { logger: Logger; + containerRunner?: ContainerRunner; customGenerator?: TechdocsGenerator; }, ): Promise; diff --git a/plugins/techdocs-node/src/stages/generate/generators.ts b/plugins/techdocs-node/src/stages/generate/generators.ts index 60798cf9c0..0c20ac1588 100644 --- a/plugins/techdocs-node/src/stages/generate/generators.ts +++ b/plugins/techdocs-node/src/stages/generate/generators.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +import { ContainerRunner } from '@backstage/backend-common'; import { Entity } from '@backstage/catalog-model'; import { Config } from '@backstage/config'; import { Logger } from 'winston'; @@ -41,6 +42,7 @@ export class Generators implements GeneratorBuilder { config: Config, options: { logger: Logger; + containerRunner?: ContainerRunner; customGenerator?: TechdocsGenerator; }, ): Promise { From a311472366315d1761c52c8150f7fcebeb593c38 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Mon, 17 Jun 2024 16:24:55 +0200 Subject: [PATCH 235/387] create-app: remove dockerode Signed-off-by: Vincenzo Scamporlino --- .../templates/default-app/packages/backend/package.json.hbs | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/create-app/templates/default-app/packages/backend/package.json.hbs b/packages/create-app/templates/default-app/packages/backend/package.json.hbs index b2c9b239d6..8d95ee60a5 100644 --- a/packages/create-app/templates/default-app/packages/backend/package.json.hbs +++ b/packages/create-app/templates/default-app/packages/backend/package.json.hbs @@ -40,7 +40,6 @@ "@backstage/plugin-techdocs-backend": "^{{version '@backstage/plugin-techdocs-backend'}}", "app": "link:../app", "better-sqlite3": "^9.0.0", - "dockerode": "^3.3.1", "node-gyp": "^10.0.0", "pg": "^8.11.3", "winston": "^3.2.1" From 9b3b1b532ae22a49afe182a1c315809955da2ffc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 06:30:47 +0000 Subject: [PATCH 236/387] build(deps): bump ws from 7.5.9 to 7.5.10 in /microsite Bumps [ws](https://github.com/websockets/ws) from 7.5.9 to 7.5.10. - [Release notes](https://github.com/websockets/ws/releases) - [Commits](https://github.com/websockets/ws/compare/7.5.9...7.5.10) --- updated-dependencies: - dependency-name: ws dependency-type: indirect ... Signed-off-by: dependabot[bot] --- microsite/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/microsite/yarn.lock b/microsite/yarn.lock index 08d343e681..00732d79f2 100644 --- a/microsite/yarn.lock +++ b/microsite/yarn.lock @@ -11872,8 +11872,8 @@ __metadata: linkType: hard "ws@npm:^7.3.1": - version: 7.5.9 - resolution: "ws@npm:7.5.9" + version: 7.5.10 + resolution: "ws@npm:7.5.10" peerDependencies: bufferutil: ^4.0.1 utf-8-validate: ^5.0.2 @@ -11882,7 +11882,7 @@ __metadata: optional: true utf-8-validate: optional: true - checksum: c3c100a181b731f40b7f2fddf004aa023f79d64f489706a28bc23ff88e87f6a64b3c6651fbec3a84a53960b75159574d7a7385709847a62ddb7ad6af76f49138 + checksum: f9bb062abf54cc8f02d94ca86dcd349c3945d63851f5d07a3a61c2fcb755b15a88e943a63cf580cbdb5b74436d67ef6b67f745b8f7c0814e411379138e1863cb languageName: node linkType: hard From a2f8ba85bef7e334706dade75c745cd79f145bb0 Mon Sep 17 00:00:00 2001 From: Kacper Nowacki Date: Tue, 18 Jun 2024 09:36:27 +0200 Subject: [PATCH 237/387] Update .changeset/fair-rockets-leave.md Signed-off-by: Kacper Nowacki --- .changeset/fair-rockets-leave.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/fair-rockets-leave.md b/.changeset/fair-rockets-leave.md index 41cf28fc9e..20f2e97552 100644 --- a/.changeset/fair-rockets-leave.md +++ b/.changeset/fair-rockets-leave.md @@ -2,5 +2,5 @@ '@backstage/plugin-scaffolder-backend-module-bitbucket-server': patch --- -Instead of using hardcoded targetBranch we are fetching the default branch from Bitbucket repository. -This prevents from errors when no targetBranch is provided and the default repository branch is different from `master`, for example: `main`. +Instead of using hardcoded `targetBranch` now fetch the default branch from Bitbucket repository. +This prevents from errors when no `targetBranch` is provided and the default repository branch is different from `master`, for example: `main`. From 3a9a84c1d30881a1c7e55be0dace4649d970a83f Mon Sep 17 00:00:00 2001 From: Camila Belo Date: Tue, 18 Jun 2024 09:51:43 +0200 Subject: [PATCH 238/387] refactor: group compat files and move more files to deprecated Signed-off-by: Camila Belo --- packages/backend-common/src/alpha.ts | 2 +- .../auth/createLegacyAuthAdapters.test.ts | 0 .../auth/createLegacyAuthAdapters.ts | 5 ++--- .../src/{ => compat}/auth/index.ts | 0 .../cache/cacheToPluginCacheManager.ts | 0 .../src/{ => compat}/cache/index.ts | 0 .../src/{urls.ts => compat/index.ts} | 15 +++++-------- .../{urls.test.ts => compat/legacy/index.ts} | 22 +++---------------- .../src/{ => compat/legacy}/legacy.test.ts | 6 ++--- .../src/{ => compat/legacy}/legacy.ts | 6 ++--- .../src/{ => compat}/logging/index.ts | 0 .../logging/loggerToWinstonLogger.ts | 0 .../src/{ => deprecated}/config.ts | 4 ++-- .../context/AbortContext.test.ts | 0 .../{ => deprecated}/context/AbortContext.ts | 0 .../{ => deprecated}/context/Contexts.test.ts | 0 .../src/{ => deprecated}/context/Contexts.ts | 0 .../context/RootContext.test.ts | 0 .../{ => deprecated}/context/RootContext.ts | 0 .../context/ValueContext.test.ts | 0 .../{ => deprecated}/context/ValueContext.ts | 0 .../src/{ => deprecated}/context/index.ts | 0 .../src/{ => deprecated}/context/types.ts | 0 .../src/{ => deprecated}/hot.ts | 0 .../backend-common/src/deprecated/index.ts | 2 ++ .../service/lib/ServiceBuilderImpl.ts | 2 +- packages/backend-common/src/index.ts | 8 +------ 27 files changed, 23 insertions(+), 49 deletions(-) rename packages/backend-common/src/{ => compat}/auth/createLegacyAuthAdapters.test.ts (100%) rename packages/backend-common/src/{ => compat}/auth/createLegacyAuthAdapters.ts (98%) rename packages/backend-common/src/{ => compat}/auth/index.ts (100%) rename packages/backend-common/src/{ => compat}/cache/cacheToPluginCacheManager.ts (100%) rename packages/backend-common/src/{ => compat}/cache/index.ts (100%) rename packages/backend-common/src/{urls.ts => compat/index.ts} (73%) rename packages/backend-common/src/{urls.test.ts => compat/legacy/index.ts} (50%) rename packages/backend-common/src/{ => compat/legacy}/legacy.test.ts (93%) rename packages/backend-common/src/{ => compat/legacy}/legacy.ts (96%) rename packages/backend-common/src/{ => compat}/logging/index.ts (100%) rename packages/backend-common/src/{ => compat}/logging/loggerToWinstonLogger.ts (100%) rename packages/backend-common/src/{ => deprecated}/config.ts (93%) rename packages/backend-common/src/{ => deprecated}/context/AbortContext.test.ts (100%) rename packages/backend-common/src/{ => deprecated}/context/AbortContext.ts (100%) rename packages/backend-common/src/{ => deprecated}/context/Contexts.test.ts (100%) rename packages/backend-common/src/{ => deprecated}/context/Contexts.ts (100%) rename packages/backend-common/src/{ => deprecated}/context/RootContext.test.ts (100%) rename packages/backend-common/src/{ => deprecated}/context/RootContext.ts (100%) rename packages/backend-common/src/{ => deprecated}/context/ValueContext.test.ts (100%) rename packages/backend-common/src/{ => deprecated}/context/ValueContext.ts (100%) rename packages/backend-common/src/{ => deprecated}/context/index.ts (100%) rename packages/backend-common/src/{ => deprecated}/context/types.ts (100%) rename packages/backend-common/src/{ => deprecated}/hot.ts (100%) diff --git a/packages/backend-common/src/alpha.ts b/packages/backend-common/src/alpha.ts index e0a5b2ddc2..0fd15459fe 100644 --- a/packages/backend-common/src/alpha.ts +++ b/packages/backend-common/src/alpha.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export * from './context'; +export * from './deprecated/context'; diff --git a/packages/backend-common/src/auth/createLegacyAuthAdapters.test.ts b/packages/backend-common/src/compat/auth/createLegacyAuthAdapters.test.ts similarity index 100% rename from packages/backend-common/src/auth/createLegacyAuthAdapters.test.ts rename to packages/backend-common/src/compat/auth/createLegacyAuthAdapters.test.ts diff --git a/packages/backend-common/src/auth/createLegacyAuthAdapters.ts b/packages/backend-common/src/compat/auth/createLegacyAuthAdapters.ts similarity index 98% rename from packages/backend-common/src/auth/createLegacyAuthAdapters.ts rename to packages/backend-common/src/compat/auth/createLegacyAuthAdapters.ts index a96d6ebb76..0f591eac6c 100644 --- a/packages/backend-common/src/auth/createLegacyAuthAdapters.ts +++ b/packages/backend-common/src/compat/auth/createLegacyAuthAdapters.ts @@ -35,15 +35,14 @@ import { createCredentialsWithUserPrincipal, createCredentialsWithNonePrincipal, toInternalBackstageCredentials, -} from '../../../backend-defaults/src/entrypoints/auth/helpers'; +} from '../../../../backend-defaults/src/entrypoints/auth/helpers'; // TODO is this circular thingy a problem? Test in e2e import { type IdentityApiGetIdentityRequest, DefaultIdentityClient, } from '@backstage/plugin-auth-node'; import { decodeJwt } from 'jose'; -import { TokenManager } from '../deprecated'; -import { PluginEndpointDiscovery } from '../deprecated'; +import { TokenManager, PluginEndpointDiscovery } from '../../deprecated'; import { JsonObject } from '@backstage/types'; class AuthCompat implements AuthService { diff --git a/packages/backend-common/src/auth/index.ts b/packages/backend-common/src/compat/auth/index.ts similarity index 100% rename from packages/backend-common/src/auth/index.ts rename to packages/backend-common/src/compat/auth/index.ts diff --git a/packages/backend-common/src/cache/cacheToPluginCacheManager.ts b/packages/backend-common/src/compat/cache/cacheToPluginCacheManager.ts similarity index 100% rename from packages/backend-common/src/cache/cacheToPluginCacheManager.ts rename to packages/backend-common/src/compat/cache/cacheToPluginCacheManager.ts diff --git a/packages/backend-common/src/cache/index.ts b/packages/backend-common/src/compat/cache/index.ts similarity index 100% rename from packages/backend-common/src/cache/index.ts rename to packages/backend-common/src/compat/cache/index.ts diff --git a/packages/backend-common/src/urls.ts b/packages/backend-common/src/compat/index.ts similarity index 73% rename from packages/backend-common/src/urls.ts rename to packages/backend-common/src/compat/index.ts index 848cea25d9..d702772335 100644 --- a/packages/backend-common/src/urls.ts +++ b/packages/backend-common/src/compat/index.ts @@ -1,5 +1,5 @@ /* - * Copyright 2021 The Backstage Authors + * Copyright 2024 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. @@ -14,12 +14,7 @@ * limitations under the License. */ -export function isValidUrl(url: string): boolean { - try { - // eslint-disable-next-line no-new - new URL(url); - return true; - } catch { - return false; - } -} +export * from './legacy'; +export * from './auth'; +export * from './cache'; +export * from './logging'; diff --git a/packages/backend-common/src/urls.test.ts b/packages/backend-common/src/compat/legacy/index.ts similarity index 50% rename from packages/backend-common/src/urls.test.ts rename to packages/backend-common/src/compat/legacy/index.ts index c2a67fb849..1172084cd7 100644 --- a/packages/backend-common/src/urls.test.ts +++ b/packages/backend-common/src/compat/legacy/index.ts @@ -1,5 +1,5 @@ /* - * Copyright 2021 The Backstage Authors + * Copyright 2024 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. @@ -14,21 +14,5 @@ * limitations under the License. */ -import { isValidUrl } from './urls'; - -describe('isValidUrl', () => { - it('should return true for url', () => { - const validUrl = isValidUrl('http://some.valid.url'); - expect(validUrl).toBe(true); - }); - - it('should return false for absolute path', () => { - const validUrl = isValidUrl('/some/absolute/path'); - expect(validUrl).toBe(false); - }); - - it('should return false for relative path', () => { - const validUrl = isValidUrl('../some/relative/path'); - expect(validUrl).toBe(false); - }); -}); +export { legacyPlugin, makeLegacyPlugin } from './legacy'; +export type { LegacyCreateRouter } from './legacy'; diff --git a/packages/backend-common/src/legacy.test.ts b/packages/backend-common/src/compat/legacy/legacy.test.ts similarity index 93% rename from packages/backend-common/src/legacy.test.ts rename to packages/backend-common/src/compat/legacy/legacy.test.ts index 09545daef4..e5d395a8f9 100644 --- a/packages/backend-common/src/legacy.test.ts +++ b/packages/backend-common/src/compat/legacy/legacy.test.ts @@ -21,12 +21,12 @@ import { import { mockServices, startTestBackend } from '@backstage/backend-test-utils'; import { EventEmitter } from 'events'; import { Router } from 'express'; -import { createLegacyAuthAdapters } from './auth'; +import { createLegacyAuthAdapters } from '..'; import { legacyPlugin } from './legacy'; // eslint-disable-next-line @backstage/no-relative-monorepo-imports -import { authServiceFactory } from '../../backend-app-api/src/services/implementations/auth'; +import { authServiceFactory } from '../../../../backend-app-api/src/services/implementations/auth'; // eslint-disable-next-line @backstage/no-relative-monorepo-imports -import { tokenManagerServiceFactory } from '../../backend-app-api/src/services/implementations/tokenManager'; +import { tokenManagerServiceFactory } from '../../../../backend-app-api/src/services/implementations/tokenManager'; describe('legacyPlugin', () => { it('can auth across the new and old systems', async () => { diff --git a/packages/backend-common/src/legacy.ts b/packages/backend-common/src/compat/legacy/legacy.ts similarity index 96% rename from packages/backend-common/src/legacy.ts rename to packages/backend-common/src/compat/legacy/legacy.ts index 420126f519..57220a8430 100644 --- a/packages/backend-common/src/legacy.ts +++ b/packages/backend-common/src/compat/legacy/legacy.ts @@ -21,9 +21,9 @@ import { ServiceRef, } from '@backstage/backend-plugin-api'; import { RequestHandler } from 'express'; -import { cacheToPluginCacheManager } from './cache'; -import { loggerToWinstonLogger } from './logging'; -import { TokenManager } from './deprecated'; +import { cacheToPluginCacheManager } from '../cache'; +import { loggerToWinstonLogger } from '../logging'; +import { TokenManager } from '../../deprecated'; /** * @public diff --git a/packages/backend-common/src/logging/index.ts b/packages/backend-common/src/compat/logging/index.ts similarity index 100% rename from packages/backend-common/src/logging/index.ts rename to packages/backend-common/src/compat/logging/index.ts diff --git a/packages/backend-common/src/logging/loggerToWinstonLogger.ts b/packages/backend-common/src/compat/logging/loggerToWinstonLogger.ts similarity index 100% rename from packages/backend-common/src/logging/loggerToWinstonLogger.ts rename to packages/backend-common/src/compat/logging/loggerToWinstonLogger.ts diff --git a/packages/backend-common/src/config.ts b/packages/backend-common/src/deprecated/config.ts similarity index 93% rename from packages/backend-common/src/config.ts rename to packages/backend-common/src/deprecated/config.ts index 8e5e8d7be7..2d06ca2072 100644 --- a/packages/backend-common/src/config.ts +++ b/packages/backend-common/src/deprecated/config.ts @@ -18,11 +18,11 @@ import { createConfigSecretEnumerator, loadBackendConfig as newLoadBackendConfig, -} from '../../backend-app-api/src/config'; +} from '../../../backend-app-api/src/config'; import { LoggerService } from '@backstage/backend-plugin-api'; import { AppConfig, Config } from '@backstage/config'; import { LoadConfigOptionsRemote } from '@backstage/config-loader'; -import { setRootLoggerRedactionList } from './deprecated/logging/createRootLogger'; +import { setRootLoggerRedactionList } from './logging/createRootLogger'; /** * Load configuration for a Backend. diff --git a/packages/backend-common/src/context/AbortContext.test.ts b/packages/backend-common/src/deprecated/context/AbortContext.test.ts similarity index 100% rename from packages/backend-common/src/context/AbortContext.test.ts rename to packages/backend-common/src/deprecated/context/AbortContext.test.ts diff --git a/packages/backend-common/src/context/AbortContext.ts b/packages/backend-common/src/deprecated/context/AbortContext.ts similarity index 100% rename from packages/backend-common/src/context/AbortContext.ts rename to packages/backend-common/src/deprecated/context/AbortContext.ts diff --git a/packages/backend-common/src/context/Contexts.test.ts b/packages/backend-common/src/deprecated/context/Contexts.test.ts similarity index 100% rename from packages/backend-common/src/context/Contexts.test.ts rename to packages/backend-common/src/deprecated/context/Contexts.test.ts diff --git a/packages/backend-common/src/context/Contexts.ts b/packages/backend-common/src/deprecated/context/Contexts.ts similarity index 100% rename from packages/backend-common/src/context/Contexts.ts rename to packages/backend-common/src/deprecated/context/Contexts.ts diff --git a/packages/backend-common/src/context/RootContext.test.ts b/packages/backend-common/src/deprecated/context/RootContext.test.ts similarity index 100% rename from packages/backend-common/src/context/RootContext.test.ts rename to packages/backend-common/src/deprecated/context/RootContext.test.ts diff --git a/packages/backend-common/src/context/RootContext.ts b/packages/backend-common/src/deprecated/context/RootContext.ts similarity index 100% rename from packages/backend-common/src/context/RootContext.ts rename to packages/backend-common/src/deprecated/context/RootContext.ts diff --git a/packages/backend-common/src/context/ValueContext.test.ts b/packages/backend-common/src/deprecated/context/ValueContext.test.ts similarity index 100% rename from packages/backend-common/src/context/ValueContext.test.ts rename to packages/backend-common/src/deprecated/context/ValueContext.test.ts diff --git a/packages/backend-common/src/context/ValueContext.ts b/packages/backend-common/src/deprecated/context/ValueContext.ts similarity index 100% rename from packages/backend-common/src/context/ValueContext.ts rename to packages/backend-common/src/deprecated/context/ValueContext.ts diff --git a/packages/backend-common/src/context/index.ts b/packages/backend-common/src/deprecated/context/index.ts similarity index 100% rename from packages/backend-common/src/context/index.ts rename to packages/backend-common/src/deprecated/context/index.ts diff --git a/packages/backend-common/src/context/types.ts b/packages/backend-common/src/deprecated/context/types.ts similarity index 100% rename from packages/backend-common/src/context/types.ts rename to packages/backend-common/src/deprecated/context/types.ts diff --git a/packages/backend-common/src/hot.ts b/packages/backend-common/src/deprecated/hot.ts similarity index 100% rename from packages/backend-common/src/hot.ts rename to packages/backend-common/src/deprecated/hot.ts diff --git a/packages/backend-common/src/deprecated/index.ts b/packages/backend-common/src/deprecated/index.ts index b021e0ba6d..ba8b8e7db2 100644 --- a/packages/backend-common/src/deprecated/index.ts +++ b/packages/backend-common/src/deprecated/index.ts @@ -99,6 +99,8 @@ import { UrlReaderService as _UrlReaderService, } from '@backstage/backend-plugin-api'; +export * from './hot'; +export * from './config'; export * from './scm'; export * from './tokens'; export * from './logging'; diff --git a/packages/backend-common/src/deprecated/service/lib/ServiceBuilderImpl.ts b/packages/backend-common/src/deprecated/service/lib/ServiceBuilderImpl.ts index 1586d7c5c6..9b5891a5bf 100644 --- a/packages/backend-common/src/deprecated/service/lib/ServiceBuilderImpl.ts +++ b/packages/backend-common/src/deprecated/service/lib/ServiceBuilderImpl.ts @@ -22,7 +22,7 @@ import helmet, { HelmetOptions } from 'helmet'; import { ContentSecurityPolicyOptions } from 'helmet/dist/types/middlewares/content-security-policy'; import * as http from 'http'; import { LoggerService } from '@backstage/backend-plugin-api'; -import { useHotCleanup } from '../../../hot'; +import { useHotCleanup } from '../../hot'; import { getRootLogger } from '../../logging'; import { errorHandler as defaultErrorHandler, diff --git a/packages/backend-common/src/index.ts b/packages/backend-common/src/index.ts index b6e53810eb..cb5e236888 100644 --- a/packages/backend-common/src/index.ts +++ b/packages/backend-common/src/index.ts @@ -20,13 +20,7 @@ * @packageDocumentation */ -export { legacyPlugin, makeLegacyPlugin } from './legacy'; -export type { LegacyCreateRouter } from './legacy'; -export { loadBackendConfig } from './config'; export * from './deprecated'; -export * from './auth'; -export * from './cache'; -export * from './hot'; -export * from './logging'; +export * from './compat'; export * from './middleware'; export * from './service'; From 1c2bef7ffb633f949170a0f00cfed94e7e3dc7d6 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Tue, 18 Jun 2024 10:56:14 +0200 Subject: [PATCH 239/387] scaffolder: remove references to containerRunners Signed-off-by: Vincenzo Scamporlino --- plugins/scaffolder-backend-module-cookiecutter/README.md | 1 - plugins/scaffolder-backend-module-gitlab/README.md | 1 - plugins/scaffolder-backend-module-rails/README.md | 2 -- 3 files changed, 4 deletions(-) diff --git a/plugins/scaffolder-backend-module-cookiecutter/README.md b/plugins/scaffolder-backend-module-cookiecutter/README.md index 62c6eede97..643154c826 100644 --- a/plugins/scaffolder-backend-module-cookiecutter/README.md +++ b/plugins/scaffolder-backend-module-cookiecutter/README.md @@ -23,7 +23,6 @@ const actions = [ createFetchCookiecutterAction({ integrations, reader: env.reader, - containerRunner, }), ...createBuiltInActions({ ... diff --git a/plugins/scaffolder-backend-module-gitlab/README.md b/plugins/scaffolder-backend-module-gitlab/README.md index bb31769cef..3aee2b6681 100644 --- a/plugins/scaffolder-backend-module-gitlab/README.md +++ b/plugins/scaffolder-backend-module-gitlab/README.md @@ -47,7 +47,6 @@ const actions = [ // Create Scaffolder Router return await createRouter({ - containerRunner, catalogClient, actions, logger: env.logger, diff --git a/plugins/scaffolder-backend-module-rails/README.md b/plugins/scaffolder-backend-module-rails/README.md index a7afd1429e..18e16a7567 100644 --- a/plugins/scaffolder-backend-module-rails/README.md +++ b/plugins/scaffolder-backend-module-rails/README.md @@ -27,12 +27,10 @@ const actions = [ createFetchRailsAction({ integrations, reader: env.reader, - containerRunner, }), ]; return await createRouter({ - containerRunner, catalogClient, actions, logger: env.logger, From 594037ce9bcbc7ac176faf68be5f2ea7ea1d1610 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Tue, 18 Jun 2024 10:57:00 +0200 Subject: [PATCH 240/387] docs: remove references to containerRunners Signed-off-by: Vincenzo Scamporlino --- docs/features/software-templates/writing-custom-actions.md | 1 - docs/features/techdocs/getting-started.md | 1 - 2 files changed, 2 deletions(-) diff --git a/docs/features/software-templates/writing-custom-actions.md b/docs/features/software-templates/writing-custom-actions.md index e1791af036..e8b354bd45 100644 --- a/docs/features/software-templates/writing-custom-actions.md +++ b/docs/features/software-templates/writing-custom-actions.md @@ -226,7 +226,6 @@ should have something similar to the below in ```ts return await createRouter({ - containerRunner, catalogClient, logger: env.logger, config: env.config, diff --git a/docs/features/techdocs/getting-started.md b/docs/features/techdocs/getting-started.md index 6cbbc83614..7909f8166f 100644 --- a/docs/features/techdocs/getting-started.md +++ b/docs/features/techdocs/getting-started.md @@ -142,7 +142,6 @@ export default async function createPlugin( // Generators are used for generating documentation sites. const generators = await Generators.fromConfig(env.config, { logger: env.logger, - containerRunner, }); // Publisher is used for From 0ac124b58266c8b36867b61aee9a33c7b6dd8b09 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Tue, 18 Jun 2024 10:58:25 +0200 Subject: [PATCH 241/387] scaffolder: docs changeset Signed-off-by: Vincenzo Scamporlino --- .changeset/fair-pillows-know.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changeset/fair-pillows-know.md diff --git a/.changeset/fair-pillows-know.md b/.changeset/fair-pillows-know.md new file mode 100644 index 0000000000..f0e5034393 --- /dev/null +++ b/.changeset/fair-pillows-know.md @@ -0,0 +1,7 @@ +--- +'@backstage/plugin-scaffolder-backend-module-cookiecutter': patch +'@backstage/plugin-scaffolder-backend-module-gitlab': patch +'@backstage/plugin-scaffolder-backend-module-rails': patch +--- + +Updated configuration instructions From cb86c2419f0c0afb05d496080c81bc6fba903e50 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 09:08:30 +0000 Subject: [PATCH 242/387] fix(deps): update dependency ws to v8.17.1 [security] Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index d69450fae8..08c4010281 100644 --- a/yarn.lock +++ b/yarn.lock @@ -44432,8 +44432,8 @@ __metadata: linkType: hard "ws@npm:*, ws@npm:^8.11.0, ws@npm:^8.12.0, ws@npm:^8.13.0, ws@npm:^8.14.2, ws@npm:^8.16.0, ws@npm:^8.17.0, ws@npm:^8.8.0": - version: 8.17.0 - resolution: "ws@npm:8.17.0" + version: 8.17.1 + resolution: "ws@npm:8.17.1" peerDependencies: bufferutil: ^4.0.1 utf-8-validate: ">=5.0.2" @@ -44442,7 +44442,7 @@ __metadata: optional: true utf-8-validate: optional: true - checksum: 147ef9eab0251364e1d2c55338ad0efb15e6913923ccbfdf20f7a8a6cb8f88432bcd7f4d8f66977135bfad35575644f9983201c1a361019594a4e53977bf6d4e + checksum: 442badcce1f1178ec87a0b5372ae2e9771e07c4929a3180321901f226127f252441e8689d765aa5cfba5f50ac60dd830954afc5aeae81609aefa11d3ddf5cecf languageName: node linkType: hard @@ -44462,8 +44462,8 @@ __metadata: linkType: hard "ws@npm:^7, ws@npm:^7.4.6, ws@npm:^7.5.5": - version: 7.5.9 - resolution: "ws@npm:7.5.9" + version: 7.5.10 + resolution: "ws@npm:7.5.10" peerDependencies: bufferutil: ^4.0.1 utf-8-validate: ^5.0.2 @@ -44472,7 +44472,7 @@ __metadata: optional: true utf-8-validate: optional: true - checksum: c3c100a181b731f40b7f2fddf004aa023f79d64f489706a28bc23ff88e87f6a64b3c6651fbec3a84a53960b75159574d7a7385709847a62ddb7ad6af76f49138 + checksum: f9bb062abf54cc8f02d94ca86dcd349c3945d63851f5d07a3a61c2fcb755b15a88e943a63cf580cbdb5b74436d67ef6b67f745b8f7c0814e411379138e1863cb languageName: node linkType: hard From 1237e7642cc9c7e93942c0d4e3269f66892757fb Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Tue, 18 Jun 2024 11:32:07 +0200 Subject: [PATCH 243/387] changesets cleanup Signed-off-by: Vincenzo Scamporlino --- .changeset/honest-pandas-chew.md | 2 +- .changeset/late-students-live.md | 2 +- .changeset/slimy-fans-raise.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.changeset/honest-pandas-chew.md b/.changeset/honest-pandas-chew.md index d5ae9e8cea..5da5f16045 100644 --- a/.changeset/honest-pandas-chew.md +++ b/.changeset/honest-pandas-chew.md @@ -2,4 +2,4 @@ '@backstage/core-plugin-api': patch --- -Added a new `defaultTarget` option to `createExternalRouteRef`. I lets you specify a default target of the route by name, for example `'catalog.catalogIndex'`, which will be used if the target route is present in the app and there is no explicit route binding. +A new `defaultTarget` option has been added to `createExternalRouteRef`. This allows one to specify a default target of the route by name, for example `'catalog.catalogIndex'`, which will be used if the target route is present in the app and there is no explicit route binding. diff --git a/.changeset/late-students-live.md b/.changeset/late-students-live.md index 6a7c203e9e..576dfa22cb 100644 --- a/.changeset/late-students-live.md +++ b/.changeset/late-students-live.md @@ -2,4 +2,4 @@ '@backstage/plugin-techdocs': patch --- -Fixed bug in CopyToClipboardButton component where positioning of the "Copy to clipboard" button in techdocs code snippets was broken in some cases +Fixed bug in `CopyToClipboardButton` component where positioning of the "Copy to clipboard" button in techdocs code snippets was broken in some cases. diff --git a/.changeset/slimy-fans-raise.md b/.changeset/slimy-fans-raise.md index 782ef4bc82..6d84b2f34f 100644 --- a/.changeset/slimy-fans-raise.md +++ b/.changeset/slimy-fans-raise.md @@ -2,4 +2,4 @@ '@backstage/plugin-techdocs': patch --- -Fix weird opening behaviour of the component. +Fixed an issue preventing the `TechDocsSearchBar` component from opening when clicking on the arrow icon. From 6c11f6e7e77542a8d9969f0f2fc9b1ffc48eab6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 18 Jun 2024 10:27:04 +0200 Subject: [PATCH 244/387] [NBS 1.0] move more implementations from app-api to defaults MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/tiny-peas-shop.md | 5 + package.json | 2 +- packages/backend-app-api/api-report.md | 215 +++++++----------- packages/backend-app-api/package.json | 1 + packages/backend-app-api/src/config/config.ts | 46 +--- packages/backend-app-api/src/http/index.ts | 78 +++++-- .../src/logging/WinstonLogger.ts | 140 ++---------- .../services/implementations/deprecated.ts | 4 + .../discovery/HostDiscovery.ts | 74 +----- .../httpRouter/createLifecycleMiddleware.ts | 79 +------ .../httpRouter/httpRouterServiceFactory.ts | 78 +------ .../src/services/implementations/index.ts | 4 - .../logger/loggerServiceFactory.ts | 18 +- .../rootHttpRouter/DefaultRootHttpRouter.ts | 87 ++----- .../rootHttpRouterServiceFactory.ts | 101 ++------ .../rootLogger/rootLoggerServiceFactory.ts | 36 +-- .../src/wiring/BackendInitializer.test.ts | 9 +- .../src/deprecated/middleware/errorHandler.ts | 2 +- .../deprecated/middleware/notFoundHandler.ts | 2 +- .../middleware/requestLoggingHandler.ts | 2 +- .../service/lib/ServiceBuilderImpl.ts | 2 +- .../backend-defaults/api-report-httpRouter.md | 35 +++ .../backend-defaults/api-report-logger.md | 16 ++ .../backend-defaults/api-report-rootConfig.md | 10 + .../api-report-rootHttpRouter.md | 147 ++++++++++++ .../backend-defaults/api-report-rootLogger.md | 54 +++++ packages/backend-defaults/package.json | 40 ++++ .../backend-defaults/src/CreateBackend.ts | 8 +- .../entrypoints/discovery/HostDiscovery.ts | 2 +- .../httpRouter/createAuthIntegrationRouter.ts | 1 + .../createCookieAuthRefreshMiddleware.test.ts | 0 .../createCookieAuthRefreshMiddleware.ts | 0 .../createCredentialsBarrier.test.ts | 2 +- .../httpRouter/createCredentialsBarrier.ts | 0 .../createLifecycleMiddleware.test.ts | 0 .../httpRouter/createLifecycleMiddleware.ts | 106 +++++++++ .../httpRouterServiceFactory.test.ts | 0 .../httpRouter/httpRouterServiceFactory.ts | 101 ++++++++ .../src/entrypoints/httpRouter/index.ts | 20 ++ .../src/entrypoints/logger/index.ts | 17 ++ .../logger/loggerServiceFactory.ts | 40 ++++ .../createConfigSecretEnumerator.test.ts | 74 ++++++ .../createConfigSecretEnumerator.ts | 54 +++++ .../src/entrypoints/rootConfig/index.ts | 7 +- .../DefaultRootHttpRouter.test.ts | 124 ++++++++++ .../rootHttpRouter/DefaultRootHttpRouter.ts | 115 ++++++++++ .../http/MiddlewareFactory.test.ts | 0 .../rootHttpRouter}/http/MiddlewareFactory.ts | 0 .../http/applyInternalErrorFilter.ts | 0 .../rootHttpRouter}/http/config.test.ts | 0 .../rootHttpRouter}/http/config.ts | 0 .../rootHttpRouter}/http/createHttpServer.ts | 0 .../http/getGeneratedCertificate.ts | 0 .../entrypoints/rootHttpRouter/http/index.ts | 30 +++ .../http/readCorsOptions.test.ts | 0 .../rootHttpRouter}/http/readCorsOptions.ts | 0 .../http/readHelmetOptions.test.ts | 0 .../rootHttpRouter}/http/readHelmetOptions.ts | 0 .../entrypoints/rootHttpRouter}/http/types.ts | 0 .../src/entrypoints/rootHttpRouter/index.ts | 26 +++ .../rootHttpRouterServiceFactory.ts | 119 ++++++++++ .../rootLogger}/WinstonLogger.test.ts | 0 .../entrypoints/rootLogger/WinstonLogger.ts | 192 ++++++++++++++++ .../src/entrypoints/rootLogger/index.ts | 18 ++ .../rootLogger/rootLoggerServiceFactory.ts | 58 +++++ .../src/lib/escapeRegExp.test.ts | 0 .../src/lib/escapeRegExp.ts | 0 .../backend-defaults/src/lib/urls.test.ts | 34 +++ packages/backend-defaults/src/lib/urls.ts | 25 ++ packages/backend-test-utils/api-report.md | 4 +- packages/backend-test-utils/package.json | 1 + .../src/next/services/mockServices.ts | 58 ++--- yarn.lock | 26 +++ 73 files changed, 1775 insertions(+), 774 deletions(-) create mode 100644 .changeset/tiny-peas-shop.md create mode 100644 packages/backend-defaults/api-report-httpRouter.md create mode 100644 packages/backend-defaults/api-report-logger.md create mode 100644 packages/backend-defaults/api-report-rootHttpRouter.md create mode 100644 packages/backend-defaults/api-report-rootLogger.md rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/httpRouter/createAuthIntegrationRouter.ts (99%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/httpRouter/createCookieAuthRefreshMiddleware.test.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/httpRouter/createCookieAuthRefreshMiddleware.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/httpRouter/createCredentialsBarrier.test.ts (98%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/httpRouter/createCredentialsBarrier.ts (100%) rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/httpRouter/createLifecycleMiddleware.test.ts (100%) create mode 100644 packages/backend-defaults/src/entrypoints/httpRouter/createLifecycleMiddleware.ts rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/httpRouter/httpRouterServiceFactory.test.ts (100%) create mode 100644 packages/backend-defaults/src/entrypoints/httpRouter/httpRouterServiceFactory.ts create mode 100644 packages/backend-defaults/src/entrypoints/httpRouter/index.ts create mode 100644 packages/backend-defaults/src/entrypoints/logger/index.ts create mode 100644 packages/backend-defaults/src/entrypoints/logger/loggerServiceFactory.ts create mode 100644 packages/backend-defaults/src/entrypoints/rootConfig/createConfigSecretEnumerator.test.ts create mode 100644 packages/backend-defaults/src/entrypoints/rootConfig/createConfigSecretEnumerator.ts create mode 100644 packages/backend-defaults/src/entrypoints/rootHttpRouter/DefaultRootHttpRouter.test.ts create mode 100644 packages/backend-defaults/src/entrypoints/rootHttpRouter/DefaultRootHttpRouter.ts rename packages/{backend-app-api/src => backend-defaults/src/entrypoints/rootHttpRouter}/http/MiddlewareFactory.test.ts (100%) rename packages/{backend-app-api/src => backend-defaults/src/entrypoints/rootHttpRouter}/http/MiddlewareFactory.ts (100%) rename packages/{backend-app-api/src => backend-defaults/src/entrypoints/rootHttpRouter}/http/applyInternalErrorFilter.ts (100%) rename packages/{backend-app-api/src => backend-defaults/src/entrypoints/rootHttpRouter}/http/config.test.ts (100%) rename packages/{backend-app-api/src => backend-defaults/src/entrypoints/rootHttpRouter}/http/config.ts (100%) rename packages/{backend-app-api/src => backend-defaults/src/entrypoints/rootHttpRouter}/http/createHttpServer.ts (100%) rename packages/{backend-app-api/src => backend-defaults/src/entrypoints/rootHttpRouter}/http/getGeneratedCertificate.ts (100%) create mode 100644 packages/backend-defaults/src/entrypoints/rootHttpRouter/http/index.ts rename packages/{backend-app-api/src => backend-defaults/src/entrypoints/rootHttpRouter}/http/readCorsOptions.test.ts (100%) rename packages/{backend-app-api/src => backend-defaults/src/entrypoints/rootHttpRouter}/http/readCorsOptions.ts (100%) rename packages/{backend-app-api/src => backend-defaults/src/entrypoints/rootHttpRouter}/http/readHelmetOptions.test.ts (100%) rename packages/{backend-app-api/src => backend-defaults/src/entrypoints/rootHttpRouter}/http/readHelmetOptions.ts (100%) rename packages/{backend-app-api/src => backend-defaults/src/entrypoints/rootHttpRouter}/http/types.ts (100%) create mode 100644 packages/backend-defaults/src/entrypoints/rootHttpRouter/index.ts create mode 100644 packages/backend-defaults/src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.ts rename packages/{backend-app-api/src/logging => backend-defaults/src/entrypoints/rootLogger}/WinstonLogger.test.ts (100%) create mode 100644 packages/backend-defaults/src/entrypoints/rootLogger/WinstonLogger.ts create mode 100644 packages/backend-defaults/src/entrypoints/rootLogger/index.ts create mode 100644 packages/backend-defaults/src/entrypoints/rootLogger/rootLoggerServiceFactory.ts rename packages/{backend-app-api => backend-defaults}/src/lib/escapeRegExp.test.ts (100%) rename packages/{backend-app-api => backend-defaults}/src/lib/escapeRegExp.ts (100%) create mode 100644 packages/backend-defaults/src/lib/urls.test.ts create mode 100644 packages/backend-defaults/src/lib/urls.ts diff --git a/.changeset/tiny-peas-shop.md b/.changeset/tiny-peas-shop.md new file mode 100644 index 0000000000..7b1ea5dba1 --- /dev/null +++ b/.changeset/tiny-peas-shop.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-test-utils': patch +--- + +Use imports from backend-defaults instead of the deprecated ones from backend-app-api diff --git a/package.json b/package.json index 03b152d1e6..0f9107afc4 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "build:all": "backstage-cli repo build --all", "build:api-docs": "LANG=en_EN yarn build:api-reports --docs --exclude 'plugins/@(adr|adr-backend|adr-common|airbrake|airbrake-backend|allure|analytics-module-ga|analytics-module-ga4|analytics-module-newrelic-browser|apache-airflow|api-docs|api-docs-module-protoc-gen-doc|apollo-explorer|app-visualizer|azure-devops|azure-devops-backend|azure-devops-common|azure-sites|azure-sites-backend|azure-sites-common|badges|badges-backend|bazaar|bazaar-backend|bitbucket-cloud-common|bitrise|catalog-graph|catalog-graphql|catalog-import|catalog-unprocessed-entities|cicd-statistics|cicd-statistics-module-gitlab|circleci|cloudbuild|code-climate|code-coverage|code-coverage-backend|codescene|config-schema|cost-insights|cost-insights-common|dynatrace|entity-feedback|entity-feedback-backend|entity-feedback-common|entity-validation|example-todo-list|example-todo-list-backend|example-todo-list-common|firehydrant|fossa|gcalendar|gcp-projects|git-release-manager|github-actions|github-deployments|github-issues|github-pull-requests-board|gitops-profiles|gocd|graphiql|graphql-backend|graphql-voyager|ilert|jenkins|jenkins-backend|jenkins-common|kafka|kafka-backend|lighthouse|lighthouse-backend|lighthouse-common|linguist|linguist-backend|linguist-common|microsoft-calendar|newrelic|newrelic-dashboard|nomad|nomad-backend|octopus-deploy|opencost|pagerduty|periskop|periskop-backend|playlist|playlist-backend|playlist-common|proxy-backend|puppetdb|rollbar|rollbar-backend|sentry|shortcuts|splunk-on-call|stack-overflow|stack-overflow-backend|stackstorm|tech-radar|tech-radar-2|todo|todo-backend|xcmetrics)'", "build:api-reports": "yarn build:api-reports:only --tsc", - "build:api-reports:only": "NODE_OPTIONS=--max-old-space-size=8192 backstage-repo-tools api-reports --allow-warnings 'packages/backend-common,packages/core-components,plugins/+(catalog|catalog-import|git-release-manager|jenkins|kubernetes)' -o ae-wrong-input-file-type --validate-release-tags", + "build:api-reports:only": "NODE_OPTIONS=--max-old-space-size=8192 backstage-repo-tools api-reports --allow-warnings 'packages/backend-app-api,packages/backend-common,packages/core-components,plugins/+(catalog|catalog-import|git-release-manager|jenkins|kubernetes)' -o ae-wrong-input-file-type --validate-release-tags", "build:backend": "yarn workspace example-backend build", "build:knip-reports": "backstage-repo-tools knip-reports", "build:plugins-report": "node ./scripts/build-plugins-report", diff --git a/packages/backend-app-api/api-report.md b/packages/backend-app-api/api-report.md index 565757eac4..071fd6c1d3 100644 --- a/packages/backend-app-api/api-report.md +++ b/packages/backend-app-api/api-report.md @@ -68,26 +68,20 @@ export interface Backend { // @public @deprecated (undocumented) export const cacheServiceFactory: () => ServiceFactory; -// @public (undocumented) -export function createConfigSecretEnumerator(options: { - logger: LoggerService; - dir?: string; - schema?: ConfigSchema; -}): Promise<(config: Config) => Iterable>; +// Warning: (ae-forgotten-export) The symbol "createConfigSecretEnumerator_2" needs to be exported by the entry point index.d.ts +// +// @public @deprecated (undocumented) +export const createConfigSecretEnumerator: typeof createConfigSecretEnumerator_2; -// @public -export function createHttpServer( - listener: RequestListener, - options: HttpServerOptions, - deps: { - logger: LoggerService; - }, -): Promise; +// Warning: (ae-forgotten-export) The symbol "createHttpServer_2" needs to be exported by the entry point index.d.ts +// +// @public @deprecated (undocumented) +export const createHttpServer: typeof createHttpServer_2; -// @public -export function createLifecycleMiddleware( - options: LifecycleMiddlewareOptions, -): RequestHandler; +// Warning: (ae-forgotten-export) The symbol "createLifecycleMiddleware_2" needs to be exported by the entry point index.d.ts +// +// @public @deprecated +export const createLifecycleMiddleware: typeof createLifecycleMiddleware_2; // @public (undocumented) export function createSpecializedBackend( @@ -106,7 +100,7 @@ export const databaseServiceFactory: () => ServiceFactory< 'plugin' >; -// @public +// @public @deprecated export class DefaultRootHttpRouter implements RootHttpRouterService { // (undocumented) static create(options?: DefaultRootHttpRouterOptions): DefaultRootHttpRouter; @@ -116,10 +110,10 @@ export class DefaultRootHttpRouter implements RootHttpRouterService { use(path: string, handler: Handler): void; } -// @public -export interface DefaultRootHttpRouterOptions { - indexPath?: string | false; -} +// Warning: (ae-forgotten-export) The symbol "DefaultRootHttpRouterOptions_2" needs to be exported by the entry point index.d.ts +// +// @public @deprecated +export type DefaultRootHttpRouterOptions = DefaultRootHttpRouterOptions_2; // @public @deprecated (undocumented) export const discoveryServiceFactory: () => ServiceFactory< @@ -127,15 +121,10 @@ export const discoveryServiceFactory: () => ServiceFactory< 'plugin' >; -// @public -export interface ExtendedHttpServer extends http.Server { - // (undocumented) - port(): number; - // (undocumented) - start(): Promise; - // (undocumented) - stop(): Promise; -} +// Warning: (ae-forgotten-export) The symbol "ExtendedHttpServer_2" needs to be exported by the entry point index.d.ts +// +// @public @deprecated (undocumented) +export type ExtendedHttpServer = ExtendedHttpServer_2; // @public @deprecated export class HostDiscovery implements DiscoveryService { @@ -157,38 +146,25 @@ export const httpAuthServiceFactory: () => ServiceFactory< 'plugin' >; -// @public (undocumented) -export interface HttpRouterFactoryOptions { - getPath?(pluginId: string): string; -} +// Warning: (ae-forgotten-export) The symbol "HttpRouterFactoryOptions_2" needs to be exported by the entry point index.d.ts +// +// @public @deprecated (undocumented) +export type HttpRouterFactoryOptions = HttpRouterFactoryOptions_2; -// @public +// @public @deprecated export const httpRouterServiceFactory: ( - options?: HttpRouterFactoryOptions | undefined, + options?: HttpRouterFactoryOptions_2 | undefined, ) => ServiceFactory; -// @public -export type HttpServerCertificateOptions = - | { - type: 'pem'; - key: string; - cert: string; - } - | { - type: 'generated'; - hostname: string; - }; +// Warning: (ae-forgotten-export) The symbol "HttpServerCertificateOptions_2" needs to be exported by the entry point index.d.ts +// +// @public @deprecated (undocumented) +export type HttpServerCertificateOptions = HttpServerCertificateOptions_2; -// @public -export type HttpServerOptions = { - listen: { - port: number; - host: string; - }; - https?: { - certificate: HttpServerCertificateOptions; - }; -}; +// Warning: (ae-forgotten-export) The symbol "HttpServerOptions_2" needs to be exported by the entry point index.d.ts +// +// @public @deprecated (undocumented) +export type HttpServerOptions = HttpServerOptions_2; // @public @deprecated export type IdentityFactoryOptions = { @@ -201,12 +177,10 @@ export const identityServiceFactory: ( options?: IdentityFactoryOptions | undefined, ) => ServiceFactory; -// @public -export interface LifecycleMiddlewareOptions { - // (undocumented) - lifecycle: LifecycleService; - startupRequestPauseTimeout?: HumanDuration; -} +// Warning: (ae-forgotten-export) The symbol "LifecycleMiddlewareOptions_2" needs to be exported by the entry point index.d.ts +// +// @public @deprecated +export type LifecycleMiddlewareOptions = LifecycleMiddlewareOptions_2; // @public @deprecated export const lifecycleServiceFactory: () => ServiceFactory< @@ -214,7 +188,7 @@ export const lifecycleServiceFactory: () => ServiceFactory< 'plugin' >; -// @public +// @public @deprecated export function loadBackendConfig(options: { remote?: LoadConfigOptionsRemote; argv: string[]; @@ -224,36 +198,26 @@ export function loadBackendConfig(options: { config: Config; }>; -// @public +// @public @deprecated export const loggerServiceFactory: () => ServiceFactory< LoggerService, 'plugin' >; -// @public -export class MiddlewareFactory { - compression(): RequestHandler; - cors(): RequestHandler; - static create(options: MiddlewareFactoryOptions): MiddlewareFactory; - error(options?: MiddlewareFactoryErrorOptions): ErrorRequestHandler; - helmet(): RequestHandler; - logging(): RequestHandler; - notFound(): RequestHandler; -} +// Warning: (ae-forgotten-export) The symbol "MiddlewareFactory_2" needs to be exported by the entry point index.d.ts +// +// @public @deprecated (undocumented) +export const MiddlewareFactory: typeof MiddlewareFactory_2; -// @public -export interface MiddlewareFactoryErrorOptions { - logAllErrors?: boolean; - showStackTraces?: boolean; -} +// Warning: (ae-forgotten-export) The symbol "MiddlewareFactoryErrorOptions_2" needs to be exported by the entry point index.d.ts +// +// @public @deprecated (undocumented) +export type MiddlewareFactoryErrorOptions = MiddlewareFactoryErrorOptions_2; -// @public -export interface MiddlewareFactoryOptions { - // (undocumented) - config: RootConfigService; - // (undocumented) - logger: LoggerService; -} +// Warning: (ae-forgotten-export) The symbol "MiddlewareFactoryOptions_2" needs to be exported by the entry point index.d.ts +// +// @public @deprecated (undocumented) +export type MiddlewareFactoryOptions = MiddlewareFactoryOptions_2; // @public @deprecated (undocumented) export const permissionsServiceFactory: () => ServiceFactory< @@ -261,14 +225,20 @@ export const permissionsServiceFactory: () => ServiceFactory< 'plugin' >; -// @public -export function readCorsOptions(config?: Config): CorsOptions; +// Warning: (ae-forgotten-export) The symbol "readCorsOptions_2" needs to be exported by the entry point index.d.ts +// +// @public @deprecated (undocumented) +export const readCorsOptions: typeof readCorsOptions_2; -// @public -export function readHelmetOptions(config?: Config): HelmetOptions; +// Warning: (ae-forgotten-export) The symbol "readHelmetOptions_2" needs to be exported by the entry point index.d.ts +// +// @public @deprecated (undocumented) +export const readHelmetOptions: typeof readHelmetOptions_2; -// @public -export function readHttpServerOptions(config?: Config): HttpServerOptions; +// Warning: (ae-forgotten-export) The symbol "readHttpServerOptions_2" needs to be exported by the entry point index.d.ts +// +// @public @deprecated (undocumented) +export const readHttpServerOptions: typeof readHttpServerOptions_2; // @public @deprecated (undocumented) export interface RootConfigFactoryOptions { @@ -283,35 +253,19 @@ export const rootConfigServiceFactory: ( options?: RootConfigFactoryOptions | undefined, ) => ServiceFactory; -// @public (undocumented) -export interface RootHttpRouterConfigureContext { - // (undocumented) - app: Express_2; - // (undocumented) - applyDefaults: () => void; - // (undocumented) - config: RootConfigService; - // (undocumented) - lifecycle: LifecycleService; - // (undocumented) - logger: LoggerService; - // (undocumented) - middleware: MiddlewareFactory; - // (undocumented) - routes: RequestHandler; - // (undocumented) - server: Server; -} +// Warning: (ae-forgotten-export) The symbol "RootHttpRouterConfigureContext_2" needs to be exported by the entry point index.d.ts +// +// @public @deprecated (undocumented) +export type RootHttpRouterConfigureContext = RootHttpRouterConfigureContext_2; -// @public -export type RootHttpRouterFactoryOptions = { - indexPath?: string | false; - configure?(context: RootHttpRouterConfigureContext): void; -}; +// Warning: (ae-forgotten-export) The symbol "RootHttpRouterFactoryOptions_2" needs to be exported by the entry point index.d.ts +// +// @public @deprecated +export type RootHttpRouterFactoryOptions = RootHttpRouterFactoryOptions_2; -// @public (undocumented) +// @public @deprecated (undocumented) export const rootHttpRouterServiceFactory: ( - options?: RootHttpRouterFactoryOptions | undefined, + options?: RootHttpRouterFactoryOptions_2 | undefined, ) => ServiceFactory; // @public @deprecated @@ -320,7 +274,7 @@ export const rootLifecycleServiceFactory: () => ServiceFactory< 'root' >; -// @public +// @public @deprecated export const rootLoggerServiceFactory: () => ServiceFactory< RootLoggerService, 'root' @@ -350,7 +304,7 @@ export const userInfoServiceFactory: () => ServiceFactory< 'plugin' >; -// @public +// @public @deprecated export class WinstonLogger implements RootLoggerService { // (undocumented) addRedactions(redactions: Iterable): void; @@ -372,15 +326,8 @@ export class WinstonLogger implements RootLoggerService { warn(message: string, meta?: JsonObject): void; } -// @public (undocumented) -export interface WinstonLoggerOptions { - // (undocumented) - format?: Format; - // (undocumented) - level?: string; - // (undocumented) - meta?: JsonObject; - // (undocumented) - transports?: transport[]; -} +// Warning: (ae-forgotten-export) The symbol "WinstonLoggerOptions_2" needs to be exported by the entry point index.d.ts +// +// @public @deprecated (undocumented) +export type WinstonLoggerOptions = WinstonLoggerOptions_2; ``` diff --git a/packages/backend-app-api/package.json b/packages/backend-app-api/package.json index 15227aaf71..c1a0c742ea 100644 --- a/packages/backend-app-api/package.json +++ b/packages/backend-app-api/package.json @@ -90,6 +90,7 @@ "winston-transport": "^4.5.0" }, "devDependencies": { + "@backstage/backend-defaults": "workspace:^", "@backstage/backend-test-utils": "workspace:^", "@backstage/cli": "workspace:^", "@types/compression": "^1.7.0", diff --git a/packages/backend-app-api/src/config/config.ts b/packages/backend-app-api/src/config/config.ts index 60d1e46e90..957997849e 100644 --- a/packages/backend-app-api/src/config/config.ts +++ b/packages/backend-app-api/src/config/config.ts @@ -14,56 +14,27 @@ * limitations under the License. */ +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { createConfigSecretEnumerator as _createConfigSecretEnumerator } from '../../../backend-defaults/src/entrypoints/rootConfig/createConfigSecretEnumerator'; + import { resolve as resolvePath } from 'path'; import parseArgs from 'minimist'; -import { LoggerService } from '@backstage/backend-plugin-api'; import { findPaths } from '@backstage/cli-common'; import { - loadConfigSchema, loadConfig, ConfigTarget, LoadConfigOptionsRemote, - ConfigSchema, } from '@backstage/config-loader'; import { ConfigReader } from '@backstage/config'; import type { Config, AppConfig } from '@backstage/config'; -import { getPackages } from '@manypkg/get-packages'; import { ObservableConfigProxy } from './ObservableConfigProxy'; import { isValidUrl } from '../lib/urls'; -/** @public */ -export async function createConfigSecretEnumerator(options: { - logger: LoggerService; - dir?: string; - schema?: ConfigSchema; -}): Promise<(config: Config) => Iterable> { - const { logger, dir = process.cwd() } = options; - const { packages } = await getPackages(dir); - const schema = - options.schema ?? - (await loadConfigSchema({ - dependencies: packages.map(p => p.packageJson.name), - })); - - return (config: Config) => { - const [secretsData] = schema.process( - [{ data: config.getOptional() ?? {}, context: 'schema-enumerator' }], - { - visibility: ['secret'], - ignoreSchemaErrors: true, - }, - ); - const secrets = new Set(); - JSON.parse( - JSON.stringify(secretsData.data), - (_, v) => typeof v === 'string' && secrets.add(v), - ); - logger.info( - `Found ${secrets.size} new secrets in config that will be redacted`, - ); - return secrets; - }; -} +/** + * @public + * @deprecated Please import from `@backstage/backend-defaults/rootConfig` instead. + */ +export const createConfigSecretEnumerator = _createConfigSecretEnumerator; /** * Load configuration for a Backend. @@ -71,6 +42,7 @@ export async function createConfigSecretEnumerator(options: { * This function should only be called once, during the initialization of the backend. * * @public + * @deprecated Please migrate to the new backend system and use `coreServices.rootConfig` instead, or the {@link @backstage/config-loader#ConfigSources} facilities if required. */ export async function loadBackendConfig(options: { remote?: LoadConfigOptionsRemote; diff --git a/packages/backend-app-api/src/http/index.ts b/packages/backend-app-api/src/http/index.ts index 4a9ec14cf8..ab1d134688 100644 --- a/packages/backend-app-api/src/http/index.ts +++ b/packages/backend-app-api/src/http/index.ts @@ -14,17 +14,67 @@ * limitations under the License. */ -export { readHttpServerOptions } from './config'; -export { createHttpServer } from './createHttpServer'; -export { MiddlewareFactory } from './MiddlewareFactory'; -export type { - MiddlewareFactoryErrorOptions, - MiddlewareFactoryOptions, -} from './MiddlewareFactory'; -export { readCorsOptions } from './readCorsOptions'; -export { readHelmetOptions } from './readHelmetOptions'; -export type { - ExtendedHttpServer, - HttpServerCertificateOptions, - HttpServerOptions, -} from './types'; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { + readHttpServerOptions as _readHttpServerOptions, + createHttpServer as _createHttpServer, + MiddlewareFactory as _MiddlewareFactory, + readCorsOptions as _readCorsOptions, + readHelmetOptions as _readHelmetOptions, + type MiddlewareFactoryErrorOptions as _MiddlewareFactoryErrorOptions, + type MiddlewareFactoryOptions as _MiddlewareFactoryOptions, + type ExtendedHttpServer as _ExtendedHttpServer, + type HttpServerCertificateOptions as _HttpServerCertificateOptions, + type HttpServerOptions as _HttpServerOptions, +} from '../../../backend-defaults/src/entrypoints/rootHttpRouter/http'; + +/** + * @public + * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead. + */ +export const readHttpServerOptions = _readHttpServerOptions; +/** + * @public + * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead. + */ +export const createHttpServer = _createHttpServer; +/** + * @public + * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead. + */ +export const readCorsOptions = _readCorsOptions; +/** + * @public + * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead. + */ +export const readHelmetOptions = _readHelmetOptions; +/** + * @public + * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead. + */ +export const MiddlewareFactory = _MiddlewareFactory; +/** + * @public + * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead. + */ +export type MiddlewareFactoryErrorOptions = _MiddlewareFactoryErrorOptions; +/** + * @public + * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead. + */ +export type MiddlewareFactoryOptions = _MiddlewareFactoryOptions; +/** + * @public + * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead. + */ +export type ExtendedHttpServer = _ExtendedHttpServer; +/** + * @public + * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead. + */ +export type HttpServerCertificateOptions = _HttpServerCertificateOptions; +/** + * @public + * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead. + */ +export type HttpServerOptions = _HttpServerOptions; diff --git a/packages/backend-app-api/src/logging/WinstonLogger.ts b/packages/backend-app-api/src/logging/WinstonLogger.ts index 64e97b230c..e5403906ce 100644 --- a/packages/backend-app-api/src/logging/WinstonLogger.ts +++ b/packages/backend-app-api/src/logging/WinstonLogger.ts @@ -14,65 +14,37 @@ * limitations under the License. */ +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { + WinstonLogger as _WinstonLogger, + type WinstonLoggerOptions as _WinstonLoggerOptions, +} from '../../../backend-defaults/src/entrypoints/rootLogger'; + import { LoggerService, RootLoggerService, } from '@backstage/backend-plugin-api'; import { JsonObject } from '@backstage/types'; -import { Format, TransformableInfo } from 'logform'; -import { - Logger, - format, - createLogger, - transports, - transport as Transport, -} from 'winston'; -import { MESSAGE } from 'triple-beam'; -import { escapeRegExp } from '../lib/escapeRegExp'; +import { Format } from 'logform'; /** * @public + * @deprecated Please import from `@backstage/backend-defaults/rootLogger` instead. */ -export interface WinstonLoggerOptions { - meta?: JsonObject; - level?: string; - format?: Format; - transports?: Transport[]; -} +export type WinstonLoggerOptions = _WinstonLoggerOptions; /** * A {@link @backstage/backend-plugin-api#LoggerService} implementation based on winston. * * @public + * @deprecated Please import from `@backstage/backend-defaults/rootLogger` instead. */ export class WinstonLogger implements RootLoggerService { - #winston: Logger; - #addRedactions?: (redactions: Iterable) => void; - /** * Creates a {@link WinstonLogger} instance. */ static create(options: WinstonLoggerOptions): WinstonLogger { - const redacter = WinstonLogger.redacter(); - const defaultFormatter = - process.env.NODE_ENV === 'production' - ? format.json() - : WinstonLogger.colorFormat(); - - let logger = createLogger({ - level: process.env.LOG_LEVEL || options.level || 'info', - format: format.combine( - options.format ?? defaultFormatter, - redacter.format, - ), - transports: options.transports ?? new transports.Console(), - }); - - if (options.meta) { - logger = logger.child(options.meta); - } - - return new WinstonLogger(logger, redacter.add); + return new WinstonLogger(_WinstonLogger.create(options)); } /** @@ -82,111 +54,39 @@ export class WinstonLogger implements RootLoggerService { format: Format; add: (redactions: Iterable) => void; } { - const redactionSet = new Set(); - - let redactionPattern: RegExp | undefined = undefined; - - return { - format: format((obj: TransformableInfo) => { - if (!redactionPattern || !obj) { - return obj; - } - - obj[MESSAGE] = obj[MESSAGE]?.replace?.(redactionPattern, '***'); - - return obj; - })(), - add(newRedactions) { - let added = 0; - for (const redactionToTrim of newRedactions) { - // Trimming the string ensures that we don't accdentally get extra - // newlines or other whitespace interfering with the redaction; this - // can happen for example when using string literals in yaml - const redaction = redactionToTrim.trim(); - // Exclude secrets that are empty or just one character in length. These - // typically mean that you are running local dev or tests, or using the - // --lax flag which sets things to just 'x'. - if (redaction.length <= 1) { - continue; - } - if (!redactionSet.has(redaction)) { - redactionSet.add(redaction); - added += 1; - } - } - if (added > 0) { - const redactions = Array.from(redactionSet) - .map(r => escapeRegExp(r)) - .join('|'); - redactionPattern = new RegExp(`(${redactions})`, 'g'); - } - }, - }; + return _WinstonLogger.redacter(); } /** * Creates a pretty printed winston log formatter. */ static colorFormat(): Format { - const colorizer = format.colorize(); - - return format.combine( - format.timestamp(), - format.colorize({ - colors: { - timestamp: 'dim', - prefix: 'blue', - field: 'cyan', - debug: 'grey', - }, - }), - format.printf((info: TransformableInfo) => { - const { timestamp, level, message, plugin, service, ...fields } = info; - const prefix = plugin || service; - const timestampColor = colorizer.colorize('timestamp', timestamp); - const prefixColor = colorizer.colorize('prefix', prefix); - - const extraFields = Object.entries(fields) - .map( - ([key, value]) => - `${colorizer.colorize('field', `${key}`)}=${value}`, - ) - .join(' '); - - return `${timestampColor} ${prefixColor} ${level} ${message} ${extraFields}`; - }), - ); + return _WinstonLogger.colorFormat(); } - private constructor( - winston: Logger, - addRedactions?: (redactions: Iterable) => void, - ) { - this.#winston = winston; - this.#addRedactions = addRedactions; - } + private constructor(private readonly impl: _WinstonLogger) {} error(message: string, meta?: JsonObject): void { - this.#winston.error(message, meta); + this.impl.error(message, meta); } warn(message: string, meta?: JsonObject): void { - this.#winston.warn(message, meta); + this.impl.warn(message, meta); } info(message: string, meta?: JsonObject): void { - this.#winston.info(message, meta); + this.impl.info(message, meta); } debug(message: string, meta?: JsonObject): void { - this.#winston.debug(message, meta); + this.impl.debug(message, meta); } child(meta: JsonObject): LoggerService { - return new WinstonLogger(this.#winston.child(meta)); + return this.impl.child(meta); } addRedactions(redactions: Iterable) { - this.#addRedactions?.(redactions); + this.impl.addRedactions(redactions); } } diff --git a/packages/backend-app-api/src/services/implementations/deprecated.ts b/packages/backend-app-api/src/services/implementations/deprecated.ts index 5bf022bb57..347a968bce 100644 --- a/packages/backend-app-api/src/services/implementations/deprecated.ts +++ b/packages/backend-app-api/src/services/implementations/deprecated.ts @@ -16,5 +16,9 @@ export * from './auth'; export * from './httpAuth'; +export * from './httpRouter'; +export * from './logger'; +export * from './rootHttpRouter'; +export * from './rootLogger'; export * from './scheduler'; export * from './userInfo'; diff --git a/packages/backend-app-api/src/services/implementations/discovery/HostDiscovery.ts b/packages/backend-app-api/src/services/implementations/discovery/HostDiscovery.ts index d337da997a..5909dd1ae6 100644 --- a/packages/backend-app-api/src/services/implementations/discovery/HostDiscovery.ts +++ b/packages/backend-app-api/src/services/implementations/discovery/HostDiscovery.ts @@ -15,10 +15,9 @@ */ import { Config } from '@backstage/config'; -import { readHttpServerOptions } from '@backstage/backend-app-api'; import { DiscoveryService } from '@backstage/backend-plugin-api'; - -type Target = string | { internal: string; external: string }; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { HostDiscovery as _HostDiscovery } from '../../../../../backend-defaults/src/entrypoints/discovery'; /** * HostDiscovery is a basic PluginEndpointDiscovery implementation @@ -57,77 +56,16 @@ export class HostDiscovery implements DiscoveryService { * path for the `catalog` plugin will be `http://localhost:7007/api/catalog`. */ static fromConfig(config: Config, options?: { basePath?: string }) { - const basePath = options?.basePath ?? '/api'; - const externalBaseUrl = config - .getString('backend.baseUrl') - .replace(/\/+$/, ''); - - const { - listen: { host: listenHost = '::', port: listenPort }, - } = readHttpServerOptions(config.getConfig('backend')); - const protocol = config.has('backend.https') ? 'https' : 'http'; - - // Translate bind-all to localhost, and support IPv6 - let host = listenHost; - if (host === '::' || host === '') { - // We use localhost instead of ::1, since IPv6-compatible systems should default - // to using IPv6 when they see localhost, but if the system doesn't support IPv6 - // things will still work. - host = 'localhost'; - } else if (host === '0.0.0.0') { - host = '127.0.0.1'; - } - if (host.includes(':')) { - host = `[${host}]`; - } - - const internalBaseUrl = `${protocol}://${host}:${listenPort}`; - - return new HostDiscovery( - internalBaseUrl + basePath, - externalBaseUrl + basePath, - config.getOptionalConfig('discovery'), - ); + return new HostDiscovery(_HostDiscovery.fromConfig(config, options)); } - private constructor( - private readonly internalBaseUrl: string, - private readonly externalBaseUrl: string, - private readonly discoveryConfig: Config | undefined, - ) {} - - private getTargetFromConfig(pluginId: string, type: 'internal' | 'external') { - const endpoints = this.discoveryConfig?.getOptionalConfigArray('endpoints'); - - const target = endpoints - ?.find(endpoint => endpoint.getStringArray('plugins').includes(pluginId)) - ?.get('target'); - - if (!target) { - const baseUrl = - type === 'external' ? this.externalBaseUrl : this.internalBaseUrl; - - return `${baseUrl}/${encodeURIComponent(pluginId)}`; - } - - if (typeof target === 'string') { - return target.replace( - /\{\{\s*pluginId\s*\}\}/g, - encodeURIComponent(pluginId), - ); - } - - return target[type].replace( - /\{\{\s*pluginId\s*\}\}/g, - encodeURIComponent(pluginId), - ); - } + private constructor(private readonly impl: _HostDiscovery) {} async getBaseUrl(pluginId: string): Promise { - return this.getTargetFromConfig(pluginId, 'internal'); + return this.impl.getBaseUrl(pluginId); } async getExternalBaseUrl(pluginId: string): Promise { - return this.getTargetFromConfig(pluginId, 'external'); + return this.impl.getExternalBaseUrl(pluginId); } } diff --git a/packages/backend-app-api/src/services/implementations/httpRouter/createLifecycleMiddleware.ts b/packages/backend-app-api/src/services/implementations/httpRouter/createLifecycleMiddleware.ts index 3f8ee3ea69..d4864a23a6 100644 --- a/packages/backend-app-api/src/services/implementations/httpRouter/createLifecycleMiddleware.ts +++ b/packages/backend-app-api/src/services/implementations/httpRouter/createLifecycleMiddleware.ts @@ -14,26 +14,18 @@ * limitations under the License. */ -import { LifecycleService } from '@backstage/backend-plugin-api'; -import { ServiceUnavailableError } from '@backstage/errors'; -import { HumanDuration, durationToMilliseconds } from '@backstage/types'; -import { RequestHandler } from 'express'; - -export const DEFAULT_TIMEOUT = { seconds: 5 }; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { + createLifecycleMiddleware as _createLifecycleMiddleware, + type LifecycleMiddlewareOptions as _LifecycleMiddlewareOptions, +} from '../../../../../backend-defaults/src/entrypoints/httpRouter/createLifecycleMiddleware'; /** * Options for {@link createLifecycleMiddleware}. * @public + * @deprecated Please import from `@backstage/backend-defaults/httpRouter` instead. */ -export interface LifecycleMiddlewareOptions { - lifecycle: LifecycleService; - /** - * The maximum time that paused requests will wait for the service to start, before returning an error. - * - * Defaults to 5 seconds. - */ - startupRequestPauseTimeout?: HumanDuration; -} +export type LifecycleMiddlewareOptions = _LifecycleMiddlewareOptions; /** * Creates a middleware that pauses requests until the service has started. @@ -48,59 +40,6 @@ export interface LifecycleMiddlewareOptions { * {@link @backstage/errors#ServiceUnavailableError}. * * @public + * @deprecated Please import from `@backstage/backend-defaults/httpRouter` instead. */ -export function createLifecycleMiddleware( - options: LifecycleMiddlewareOptions, -): RequestHandler { - const { lifecycle, startupRequestPauseTimeout = DEFAULT_TIMEOUT } = options; - - let state: 'init' | 'up' | 'down' = 'init'; - const waiting = new Set<{ - next: (err?: Error) => void; - timeout: NodeJS.Timeout; - }>(); - - lifecycle.addStartupHook(async () => { - if (state === 'init') { - state = 'up'; - for (const item of waiting) { - clearTimeout(item.timeout); - item.next(); - } - waiting.clear(); - } - }); - - lifecycle.addShutdownHook(async () => { - state = 'down'; - - for (const item of waiting) { - clearTimeout(item.timeout); - item.next(new ServiceUnavailableError('Service is shutting down')); - } - waiting.clear(); - }); - - const timeoutMs = durationToMilliseconds(startupRequestPauseTimeout); - - return (_req, _res, next) => { - if (state === 'up') { - next(); - return; - } else if (state === 'down') { - next(new ServiceUnavailableError('Service is shutting down')); - return; - } - - const item = { - next, - timeout: setTimeout(() => { - if (waiting.delete(item)) { - next(new ServiceUnavailableError('Service has not started up yet')); - } - }, timeoutMs), - }; - - waiting.add(item); - }; -} +export const createLifecycleMiddleware = _createLifecycleMiddleware; diff --git a/packages/backend-app-api/src/services/implementations/httpRouter/httpRouterServiceFactory.ts b/packages/backend-app-api/src/services/implementations/httpRouter/httpRouterServiceFactory.ts index 4a0dec49e6..9d2b74fb43 100644 --- a/packages/backend-app-api/src/services/implementations/httpRouter/httpRouterServiceFactory.ts +++ b/packages/backend-app-api/src/services/implementations/httpRouter/httpRouterServiceFactory.ts @@ -14,27 +14,17 @@ * limitations under the License. */ -import { Handler } from 'express'; -import PromiseRouter from 'express-promise-router'; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports import { - coreServices, - createServiceFactory, - HttpRouterServiceAuthPolicy, -} from '@backstage/backend-plugin-api'; -import { createLifecycleMiddleware } from './createLifecycleMiddleware'; -import { createCredentialsBarrier } from './createCredentialsBarrier'; -import { createAuthIntegrationRouter } from './createAuthIntegrationRouter'; -import { createCookieAuthRefreshMiddleware } from './createCookieAuthRefreshMiddleware'; + httpRouterServiceFactory as _httpRouterServiceFactory, + type HttpRouterFactoryOptions as _HttpRouterFactoryOptions, +} from '../../../../../backend-defaults/src/entrypoints/httpRouter/httpRouterServiceFactory'; /** * @public + * @deprecated Please import from `@backstage/backend-defaults/httpRouter` instead. */ -export interface HttpRouterFactoryOptions { - /** - * A callback used to generate the path for each plugin, defaults to `/api/{pluginId}`. - */ - getPath?(pluginId: string): string; -} +export type HttpRouterFactoryOptions = _HttpRouterFactoryOptions; /** * HTTP route registration for plugins. @@ -44,58 +34,6 @@ export interface HttpRouterFactoryOptions { * for more information. * * @public + * @deprecated Please import from `@backstage/backend-defaults/httpRouter` instead. */ -export const httpRouterServiceFactory = createServiceFactory( - (options?: HttpRouterFactoryOptions) => ({ - service: coreServices.httpRouter, - initialization: 'always', - deps: { - plugin: coreServices.pluginMetadata, - config: coreServices.rootConfig, - logger: coreServices.logger, - lifecycle: coreServices.lifecycle, - rootHttpRouter: coreServices.rootHttpRouter, - auth: coreServices.auth, - httpAuth: coreServices.httpAuth, - }, - async factory({ - auth, - httpAuth, - config, - logger, - plugin, - rootHttpRouter, - lifecycle, - }) { - if (options?.getPath) { - logger.warn( - `DEPRECATION WARNING: The 'getPath' option for HttpRouterService is deprecated. The ability to reconfigure the '/api/' path prefix for plugins will be removed in the future.`, - ); - } - const getPath = options?.getPath ?? (id => `/api/${id}`); - const path = getPath(plugin.getId()); - - const router = PromiseRouter(); - rootHttpRouter.use(path, router); - - const credentialsBarrier = createCredentialsBarrier({ - httpAuth, - config, - }); - - router.use(createAuthIntegrationRouter({ auth })); - router.use(createLifecycleMiddleware({ lifecycle })); - router.use(credentialsBarrier.middleware); - router.use(createCookieAuthRefreshMiddleware({ auth, httpAuth })); - - return { - use(handler: Handler): void { - router.use(handler); - }, - addAuthPolicy(policy: HttpRouterServiceAuthPolicy): void { - credentialsBarrier.addAuthPolicy(policy); - }, - }; - }, - }), -); +export const httpRouterServiceFactory = _httpRouterServiceFactory; diff --git a/packages/backend-app-api/src/services/implementations/index.ts b/packages/backend-app-api/src/services/implementations/index.ts index b03031549f..3a2fe819ed 100644 --- a/packages/backend-app-api/src/services/implementations/index.ts +++ b/packages/backend-app-api/src/services/implementations/index.ts @@ -18,14 +18,10 @@ export * from './cache'; export * from './config'; export * from './database'; export * from './discovery'; -export * from './httpRouter'; export * from './identity'; export * from './lifecycle'; -export * from './logger'; export * from './permissions'; -export * from './rootHttpRouter'; export * from './rootLifecycle'; -export * from './rootLogger'; export * from './tokenManager'; export * from './urlReader'; diff --git a/packages/backend-app-api/src/services/implementations/logger/loggerServiceFactory.ts b/packages/backend-app-api/src/services/implementations/logger/loggerServiceFactory.ts index 4eff798e11..7e7b4b98b0 100644 --- a/packages/backend-app-api/src/services/implementations/logger/loggerServiceFactory.ts +++ b/packages/backend-app-api/src/services/implementations/logger/loggerServiceFactory.ts @@ -14,10 +14,8 @@ * limitations under the License. */ -import { - createServiceFactory, - coreServices, -} from '@backstage/backend-plugin-api'; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { loggerServiceFactory as _loggerServiceFactory } from '../../../../../backend-defaults/src/entrypoints/logger/loggerServiceFactory'; /** * Plugin-level logging. @@ -27,14 +25,6 @@ import { * for more information. * * @public + * @deprecated Please import from `@backstage/backend-defaults/logger` instead. */ -export const loggerServiceFactory = createServiceFactory({ - service: coreServices.logger, - deps: { - rootLogger: coreServices.rootLogger, - plugin: coreServices.pluginMetadata, - }, - factory({ rootLogger, plugin }) { - return rootLogger.child({ plugin: plugin.getId() }); - }, -}); +export const loggerServiceFactory = _loggerServiceFactory; diff --git a/packages/backend-app-api/src/services/implementations/rootHttpRouter/DefaultRootHttpRouter.ts b/packages/backend-app-api/src/services/implementations/rootHttpRouter/DefaultRootHttpRouter.ts index 9d7d1de120..617d5055db 100644 --- a/packages/backend-app-api/src/services/implementations/rootHttpRouter/DefaultRootHttpRouter.ts +++ b/packages/backend-app-api/src/services/implementations/rootHttpRouter/DefaultRootHttpRouter.ts @@ -15,101 +15,40 @@ */ import { RootHttpRouterService } from '@backstage/backend-plugin-api'; -import { Handler, Router } from 'express'; -import trimEnd from 'lodash/trimEnd'; - -function normalizePath(path: string): string { - return `${trimEnd(path, '/')}/`; -} +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { + DefaultRootHttpRouter as _DefaultRootHttpRouter, + DefaultRootHttpRouterOptions as _DefaultRootHttpRouterOptions, +} from '../../../../../backend-defaults/src/entrypoints/rootHttpRouter/DefaultRootHttpRouter'; +import { Handler } from 'express'; /** * Options for the {@link DefaultRootHttpRouter} class. * * @public + * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead. */ -export interface DefaultRootHttpRouterOptions { - /** - * The path to forward all unmatched requests to. Defaults to '/api/app' if - * not given. Disables index path behavior if false is given. - */ - indexPath?: string | false; -} +export type DefaultRootHttpRouterOptions = _DefaultRootHttpRouterOptions; /** * The default implementation of the {@link @backstage/backend-plugin-api#RootHttpRouterService} interface for * {@link @backstage/backend-plugin-api#coreServices.rootHttpRouter}. * * @public + * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead. */ export class DefaultRootHttpRouter implements RootHttpRouterService { - #indexPath?: string; - - #router = Router(); - #namedRoutes = Router(); - #indexRouter = Router(); - #existingPaths = new Array(); - static create(options?: DefaultRootHttpRouterOptions) { - let indexPath; - if (options?.indexPath === false) { - indexPath = undefined; - } else if (options?.indexPath === undefined) { - indexPath = '/api/app'; - } else if (options?.indexPath === '') { - throw new Error('indexPath option may not be an empty string'); - } else { - indexPath = options.indexPath; - } - return new DefaultRootHttpRouter(indexPath); + return new DefaultRootHttpRouter(_DefaultRootHttpRouter.create(options)); } - private constructor(indexPath?: string) { - this.#indexPath = indexPath; - this.#router.use(this.#namedRoutes); - - // Any request with a /api/ prefix will skip the index router, even if no named router matches - this.#router.use('/api/', (_req, _res, next) => { - next('router'); - }); - - if (this.#indexPath) { - this.#router.use(this.#indexRouter); - } - } + private constructor(private readonly impl: RootHttpRouterService) {} use(path: string, handler: Handler) { - if (path.match(/^[/\s]*$/)) { - throw new Error(`Root router path may not be empty`); - } - const conflictingPath = this.#findConflictingPath(path); - if (conflictingPath) { - throw new Error( - `Path ${path} conflicts with the existing path ${conflictingPath}`, - ); - } - this.#existingPaths.push(path); - this.#namedRoutes.use(path, handler); - - if (this.#indexPath === path) { - this.#indexRouter.use(handler); - } + this.impl.use(path, handler); } handler(): Handler { - return this.#router; - } - - #findConflictingPath(newPath: string): string | undefined { - const normalizedNewPath = normalizePath(newPath); - for (const path of this.#existingPaths) { - const normalizedPath = normalizePath(path); - if (normalizedPath.startsWith(normalizedNewPath)) { - return path; - } - if (normalizedNewPath.startsWith(normalizedPath)) { - return path; - } - } - return undefined; + return (this.impl as any).handler(); } } diff --git a/packages/backend-app-api/src/services/implementations/rootHttpRouter/rootHttpRouterServiceFactory.ts b/packages/backend-app-api/src/services/implementations/rootHttpRouter/rootHttpRouterServiceFactory.ts index 88cc863374..bef1913645 100644 --- a/packages/backend-app-api/src/services/implementations/rootHttpRouter/rootHttpRouterServiceFactory.ts +++ b/packages/backend-app-api/src/services/implementations/rootHttpRouter/rootHttpRouterServiceFactory.ts @@ -14,35 +14,18 @@ * limitations under the License. */ +// eslint-disable-next-line @backstage/no-relative-monorepo-imports import { - RootConfigService, - coreServices, - createServiceFactory, - LifecycleService, - LoggerService, -} from '@backstage/backend-plugin-api'; -import express, { RequestHandler, Express } from 'express'; -import type { Server } from 'node:http'; -import { - createHttpServer, - MiddlewareFactory, - readHttpServerOptions, -} from '../../../http'; -import { DefaultRootHttpRouter } from './DefaultRootHttpRouter'; + rootHttpRouterServiceFactory as _rootHttpRouterServiceFactory, + RootHttpRouterFactoryOptions as _RootHttpRouterFactoryOptions, + RootHttpRouterConfigureContext as _RootHttpRouterConfigureContext, +} from '../../../../../backend-defaults/src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory'; /** * @public + * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead. */ -export interface RootHttpRouterConfigureContext { - app: Express; - server: Server; - middleware: MiddlewareFactory; - routes: RequestHandler; - config: RootConfigService; - logger: LoggerService; - lifecycle: LifecycleService; - applyDefaults: () => void; -} +export type RootHttpRouterConfigureContext = _RootHttpRouterConfigureContext; /** * HTTP route registration for root services. @@ -52,68 +35,12 @@ export interface RootHttpRouterConfigureContext { * for more information. * * @public + * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead. */ -export type RootHttpRouterFactoryOptions = { - /** - * The path to forward all unmatched requests to. Defaults to '/api/app' if - * not given. Disables index path behavior if false is given. - */ - indexPath?: string | false; +export type RootHttpRouterFactoryOptions = _RootHttpRouterFactoryOptions; - configure?(context: RootHttpRouterConfigureContext): void; -}; - -function defaultConfigure({ applyDefaults }: RootHttpRouterConfigureContext) { - applyDefaults(); -} - -/** @public */ -export const rootHttpRouterServiceFactory = createServiceFactory( - (options?: RootHttpRouterFactoryOptions) => ({ - service: coreServices.rootHttpRouter, - deps: { - config: coreServices.rootConfig, - rootLogger: coreServices.rootLogger, - lifecycle: coreServices.rootLifecycle, - }, - async factory({ config, rootLogger, lifecycle }) { - const { indexPath, configure = defaultConfigure } = options ?? {}; - const logger = rootLogger.child({ service: 'rootHttpRouter' }); - const app = express(); - - const router = DefaultRootHttpRouter.create({ indexPath }); - const middleware = MiddlewareFactory.create({ config, logger }); - const routes = router.handler(); - const server = await createHttpServer( - app, - readHttpServerOptions(config.getOptionalConfig('backend')), - { logger }, - ); - - configure({ - app, - server, - routes, - middleware, - config, - logger, - lifecycle, - applyDefaults() { - app.use(middleware.helmet()); - app.use(middleware.cors()); - app.use(middleware.compression()); - app.use(middleware.logging()); - app.use(routes); - app.use(middleware.notFound()); - app.use(middleware.error()); - }, - }); - - lifecycle.addShutdownHook(() => server.stop()); - - await server.start(); - - return router; - }, - }), -); +/** + * @public + * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead. + */ +export const rootHttpRouterServiceFactory = _rootHttpRouterServiceFactory; diff --git a/packages/backend-app-api/src/services/implementations/rootLogger/rootLoggerServiceFactory.ts b/packages/backend-app-api/src/services/implementations/rootLogger/rootLoggerServiceFactory.ts index e33de09297..af1931c438 100644 --- a/packages/backend-app-api/src/services/implementations/rootLogger/rootLoggerServiceFactory.ts +++ b/packages/backend-app-api/src/services/implementations/rootLogger/rootLoggerServiceFactory.ts @@ -14,13 +14,8 @@ * limitations under the License. */ -import { - createServiceFactory, - coreServices, -} from '@backstage/backend-plugin-api'; -import { WinstonLogger } from '../../../logging'; -import { transports, format } from 'winston'; -import { createConfigSecretEnumerator } from '../../../config'; +// eslint-disable-next-line @backstage/no-relative-monorepo-imports +import { rootLoggerServiceFactory as _rootLoggerServiceFactory } from '../../../../../backend-defaults/src/entrypoints/rootLogger/rootLoggerServiceFactory'; /** * Root-level logging. @@ -30,29 +25,6 @@ import { createConfigSecretEnumerator } from '../../../config'; * for more information. * * @public + * @deprecated Please import from `@backstage/backend-defaults/rootLogger` instead. */ -export const rootLoggerServiceFactory = createServiceFactory({ - service: coreServices.rootLogger, - deps: { - config: coreServices.rootConfig, - }, - async factory({ config }) { - const logger = WinstonLogger.create({ - meta: { - service: 'backstage', - }, - level: process.env.LOG_LEVEL || 'info', - format: - process.env.NODE_ENV === 'production' - ? format.json() - : WinstonLogger.colorFormat(), - transports: [new transports.Console()], - }); - - const secretEnumerator = await createConfigSecretEnumerator({ logger }); - logger.addRedactions(secretEnumerator(config)); - config.subscribe?.(() => logger.addRedactions(secretEnumerator(config))); - - return logger; - }, -}); +export const rootLoggerServiceFactory = _rootLoggerServiceFactory; diff --git a/packages/backend-app-api/src/wiring/BackendInitializer.test.ts b/packages/backend-app-api/src/wiring/BackendInitializer.test.ts index 910ef95bea..3bbef5a4c0 100644 --- a/packages/backend-app-api/src/wiring/BackendInitializer.test.ts +++ b/packages/backend-app-api/src/wiring/BackendInitializer.test.ts @@ -14,6 +14,9 @@ * limitations under the License. */ +import { rootLifecycleServiceFactory } from '@backstage/backend-defaults/rootLifecycle'; +import { lifecycleServiceFactory } from '@backstage/backend-defaults/lifecycle'; +import { loggerServiceFactory } from '@backstage/backend-defaults/logger'; import { createServiceRef, createServiceFactory, @@ -24,12 +27,6 @@ import { } from '@backstage/backend-plugin-api'; import { BackendInitializer } from './BackendInitializer'; -import { - lifecycleServiceFactory, - loggerServiceFactory, - rootLifecycleServiceFactory, -} from '../services/implementations'; - class MockLogger { debug() {} info() {} diff --git a/packages/backend-common/src/deprecated/middleware/errorHandler.ts b/packages/backend-common/src/deprecated/middleware/errorHandler.ts index 618e30ffa1..3664ed0e0a 100644 --- a/packages/backend-common/src/deprecated/middleware/errorHandler.ts +++ b/packages/backend-common/src/deprecated/middleware/errorHandler.ts @@ -18,7 +18,7 @@ import { ErrorRequestHandler } from 'express'; import { LoggerService } from '@backstage/backend-plugin-api'; import { ConfigReader } from '@backstage/config'; // eslint-disable-next-line @backstage/no-relative-monorepo-imports -import { MiddlewareFactory } from '../../../../backend-app-api/src/http/MiddlewareFactory'; +import { MiddlewareFactory } from '../../../../backend-defaults/src/entrypoints/rootHttpRouter/http/MiddlewareFactory'; import { getRootLogger } from '../logging'; /** diff --git a/packages/backend-common/src/deprecated/middleware/notFoundHandler.ts b/packages/backend-common/src/deprecated/middleware/notFoundHandler.ts index f499418dba..bb9504a9ec 100644 --- a/packages/backend-common/src/deprecated/middleware/notFoundHandler.ts +++ b/packages/backend-common/src/deprecated/middleware/notFoundHandler.ts @@ -15,7 +15,7 @@ */ // eslint-disable-next-line @backstage/no-relative-monorepo-imports -import { MiddlewareFactory } from '../../../../backend-app-api/src/http/MiddlewareFactory'; +import { MiddlewareFactory } from '../../../../backend-defaults/src/entrypoints/rootHttpRouter/http/MiddlewareFactory'; import { ConfigReader } from '@backstage/config'; import { RequestHandler } from 'express'; import { getRootLogger } from '../logging'; diff --git a/packages/backend-common/src/deprecated/middleware/requestLoggingHandler.ts b/packages/backend-common/src/deprecated/middleware/requestLoggingHandler.ts index 74859b4741..f30f2de659 100644 --- a/packages/backend-common/src/deprecated/middleware/requestLoggingHandler.ts +++ b/packages/backend-common/src/deprecated/middleware/requestLoggingHandler.ts @@ -15,7 +15,7 @@ */ // eslint-disable-next-line @backstage/no-relative-monorepo-imports -import { MiddlewareFactory } from '../../../../backend-app-api/src/http/MiddlewareFactory'; +import { MiddlewareFactory } from '../../../../backend-defaults/src/entrypoints/rootHttpRouter/http/MiddlewareFactory'; import { RequestHandler } from 'express'; import { ConfigReader } from '@backstage/config'; import { LoggerService } from '@backstage/backend-plugin-api'; diff --git a/packages/backend-common/src/deprecated/service/lib/ServiceBuilderImpl.ts b/packages/backend-common/src/deprecated/service/lib/ServiceBuilderImpl.ts index 9b5891a5bf..b338eb20b1 100644 --- a/packages/backend-common/src/deprecated/service/lib/ServiceBuilderImpl.ts +++ b/packages/backend-common/src/deprecated/service/lib/ServiceBuilderImpl.ts @@ -37,7 +37,7 @@ import { readHttpServerOptions, HttpServerOptions, createHttpServer, -} from '../../../../../backend-app-api/src/http'; +} from '../../../../../backend-defaults/src/entrypoints/rootHttpRouter/http'; export type CspOptions = Record; diff --git a/packages/backend-defaults/api-report-httpRouter.md b/packages/backend-defaults/api-report-httpRouter.md new file mode 100644 index 0000000000..a7ca2c8dd3 --- /dev/null +++ b/packages/backend-defaults/api-report-httpRouter.md @@ -0,0 +1,35 @@ +## API Report File for "@backstage/backend-defaults" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import { HttpRouterService } from '@backstage/backend-plugin-api'; +import { HumanDuration } from '@backstage/types'; +import { LifecycleService } from '@backstage/backend-plugin-api'; +import { RequestHandler } from 'express'; +import { ServiceFactory } from '@backstage/backend-plugin-api'; + +// @public +export function createLifecycleMiddleware( + options: LifecycleMiddlewareOptions, +): RequestHandler; + +// @public (undocumented) +export interface HttpRouterFactoryOptions { + getPath?(pluginId: string): string; +} + +// @public +export const httpRouterServiceFactory: ( + options?: HttpRouterFactoryOptions | undefined, +) => ServiceFactory; + +// @public +export interface LifecycleMiddlewareOptions { + // (undocumented) + lifecycle: LifecycleService; + startupRequestPauseTimeout?: HumanDuration; +} + +// (No @packageDocumentation comment for this package) +``` diff --git a/packages/backend-defaults/api-report-logger.md b/packages/backend-defaults/api-report-logger.md new file mode 100644 index 0000000000..fa9018a40c --- /dev/null +++ b/packages/backend-defaults/api-report-logger.md @@ -0,0 +1,16 @@ +## API Report File for "@backstage/backend-defaults" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import { LoggerService } from '@backstage/backend-plugin-api'; +import { ServiceFactory } from '@backstage/backend-plugin-api'; + +// @public +export const loggerServiceFactory: () => ServiceFactory< + LoggerService, + 'plugin' +>; + +// (No @packageDocumentation comment for this package) +``` diff --git a/packages/backend-defaults/api-report-rootConfig.md b/packages/backend-defaults/api-report-rootConfig.md index 2d46370c27..317c451e1b 100644 --- a/packages/backend-defaults/api-report-rootConfig.md +++ b/packages/backend-defaults/api-report-rootConfig.md @@ -3,10 +3,20 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +import type { Config } from '@backstage/config'; +import { ConfigSchema } from '@backstage/config-loader'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { RemoteConfigSourceOptions } from '@backstage/config-loader'; import { RootConfigService } from '@backstage/backend-plugin-api'; import { ServiceFactory } from '@backstage/backend-plugin-api'; +// @public (undocumented) +export function createConfigSecretEnumerator(options: { + logger: LoggerService; + dir?: string; + schema?: ConfigSchema; +}): Promise<(config: Config) => Iterable>; + // @public export interface RootConfigFactoryOptions { argv?: string[]; diff --git a/packages/backend-defaults/api-report-rootHttpRouter.md b/packages/backend-defaults/api-report-rootHttpRouter.md new file mode 100644 index 0000000000..b753406202 --- /dev/null +++ b/packages/backend-defaults/api-report-rootHttpRouter.md @@ -0,0 +1,147 @@ +## API Report File for "@backstage/backend-defaults" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +/// + +import { Config } from '@backstage/config'; +import { CorsOptions } from 'cors'; +import { ErrorRequestHandler } from 'express'; +import { Express as Express_2 } from 'express'; +import { Handler } from 'express'; +import { HelmetOptions } from 'helmet'; +import * as http from 'http'; +import { LifecycleService } from '@backstage/backend-plugin-api'; +import { LoggerService } from '@backstage/backend-plugin-api'; +import { RequestHandler } from 'express'; +import { RequestListener } from 'http'; +import { RootConfigService } from '@backstage/backend-plugin-api'; +import { RootHttpRouterService } from '@backstage/backend-plugin-api'; +import type { Server } from 'node:http'; +import { ServiceFactory } from '@backstage/backend-plugin-api'; + +// @public +export function createHttpServer( + listener: RequestListener, + options: HttpServerOptions, + deps: { + logger: LoggerService; + }, +): Promise; + +// @public +export class DefaultRootHttpRouter implements RootHttpRouterService { + // (undocumented) + static create(options?: DefaultRootHttpRouterOptions): DefaultRootHttpRouter; + // (undocumented) + handler(): Handler; + // (undocumented) + use(path: string, handler: Handler): void; +} + +// @public +export interface DefaultRootHttpRouterOptions { + indexPath?: string | false; +} + +// @public +export interface ExtendedHttpServer extends http.Server { + // (undocumented) + port(): number; + // (undocumented) + start(): Promise; + // (undocumented) + stop(): Promise; +} + +// @public +export type HttpServerCertificateOptions = + | { + type: 'pem'; + key: string; + cert: string; + } + | { + type: 'generated'; + hostname: string; + }; + +// @public +export type HttpServerOptions = { + listen: { + port: number; + host: string; + }; + https?: { + certificate: HttpServerCertificateOptions; + }; +}; + +// @public +export class MiddlewareFactory { + compression(): RequestHandler; + cors(): RequestHandler; + static create(options: MiddlewareFactoryOptions): MiddlewareFactory; + error(options?: MiddlewareFactoryErrorOptions): ErrorRequestHandler; + helmet(): RequestHandler; + logging(): RequestHandler; + notFound(): RequestHandler; +} + +// @public +export interface MiddlewareFactoryErrorOptions { + logAllErrors?: boolean; + showStackTraces?: boolean; +} + +// @public +export interface MiddlewareFactoryOptions { + // (undocumented) + config: RootConfigService; + // (undocumented) + logger: LoggerService; +} + +// @public +export function readCorsOptions(config?: Config): CorsOptions; + +// @public +export function readHelmetOptions(config?: Config): HelmetOptions; + +// @public +export function readHttpServerOptions(config?: Config): HttpServerOptions; + +// @public (undocumented) +export interface RootHttpRouterConfigureContext { + // (undocumented) + app: Express_2; + // (undocumented) + applyDefaults: () => void; + // (undocumented) + config: RootConfigService; + // (undocumented) + lifecycle: LifecycleService; + // (undocumented) + logger: LoggerService; + // (undocumented) + middleware: MiddlewareFactory; + // (undocumented) + routes: RequestHandler; + // (undocumented) + server: Server; +} + +// @public +export type RootHttpRouterFactoryOptions = { + indexPath?: string | false; + configure?(context: RootHttpRouterConfigureContext): void; +}; + +// @public (undocumented) +export const rootHttpRouterServiceFactory: ( + options?: RootHttpRouterFactoryOptions | undefined, +) => ServiceFactory; + +// (No @packageDocumentation comment for this package) +``` diff --git a/packages/backend-defaults/api-report-rootLogger.md b/packages/backend-defaults/api-report-rootLogger.md new file mode 100644 index 0000000000..70dc0deee6 --- /dev/null +++ b/packages/backend-defaults/api-report-rootLogger.md @@ -0,0 +1,54 @@ +## API Report File for "@backstage/backend-defaults" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import { Format } from 'logform'; +import { JsonObject } from '@backstage/types'; +import { LoggerService } from '@backstage/backend-plugin-api'; +import { RootLoggerService } from '@backstage/backend-plugin-api'; +import { ServiceFactory } from '@backstage/backend-plugin-api'; +import { transport } from 'winston'; + +// @public +export const rootLoggerServiceFactory: () => ServiceFactory< + RootLoggerService, + 'root' +>; + +// @public +export class WinstonLogger implements RootLoggerService { + // (undocumented) + addRedactions(redactions: Iterable): void; + // (undocumented) + child(meta: JsonObject): LoggerService; + static colorFormat(): Format; + static create(options: WinstonLoggerOptions): WinstonLogger; + // (undocumented) + debug(message: string, meta?: JsonObject): void; + // (undocumented) + error(message: string, meta?: JsonObject): void; + // (undocumented) + info(message: string, meta?: JsonObject): void; + static redacter(): { + format: Format; + add: (redactions: Iterable) => void; + }; + // (undocumented) + warn(message: string, meta?: JsonObject): void; +} + +// @public (undocumented) +export interface WinstonLoggerOptions { + // (undocumented) + format?: Format; + // (undocumented) + level?: string; + // (undocumented) + meta?: JsonObject; + // (undocumented) + transports?: transport[]; +} + +// (No @packageDocumentation comment for this package) +``` diff --git a/packages/backend-defaults/package.json b/packages/backend-defaults/package.json index 06be729126..e3e0f69c62 100644 --- a/packages/backend-defaults/package.json +++ b/packages/backend-defaults/package.json @@ -25,10 +25,14 @@ "./database": "./src/entrypoints/database/index.ts", "./discovery": "./src/entrypoints/discovery/index.ts", "./httpAuth": "./src/entrypoints/httpAuth/index.ts", + "./httpRouter": "./src/entrypoints/httpRouter/index.ts", "./lifecycle": "./src/entrypoints/lifecycle/index.ts", + "./logger": "./src/entrypoints/logger/index.ts", "./permissions": "./src/entrypoints/permissions/index.ts", "./rootConfig": "./src/entrypoints/rootConfig/index.ts", + "./rootHttpRouter": "./src/entrypoints/rootHttpRouter/index.ts", "./rootLifecycle": "./src/entrypoints/rootLifecycle/index.ts", + "./rootLogger": "./src/entrypoints/rootLogger/index.ts", "./scheduler": "./src/entrypoints/scheduler/index.ts", "./urlReader": "./src/entrypoints/urlReader/index.ts", "./userInfo": "./src/entrypoints/userInfo/index.ts", @@ -53,18 +57,30 @@ "httpAuth": [ "src/entrypoints/httpAuth/index.ts" ], + "httpRouter": [ + "src/entrypoints/httpRouter/index.ts" + ], "lifecycle": [ "src/entrypoints/lifecycle/index.ts" ], + "logger": [ + "src/entrypoints/logger/index.ts" + ], "permissions": [ "src/entrypoints/permissions/index.ts" ], "rootConfig": [ "src/entrypoints/rootConfig/index.ts" ], + "rootHttpRouter": [ + "src/entrypoints/rootHttpRouter/index.ts" + ], "rootLifecycle": [ "src/entrypoints/rootLifecycle/index.ts" ], + "rootLogger": [ + "src/entrypoints/rootLogger/index.ts" + ], "scheduler": [ "src/entrypoints/scheduler/index.ts" ], @@ -103,6 +119,7 @@ "@backstage/backend-common": "workspace:^", "@backstage/backend-dev-utils": "workspace:^", "@backstage/backend-plugin-api": "workspace:^", + "@backstage/cli-common": "workspace:^", "@backstage/config": "workspace:^", "@backstage/config-loader": "workspace:^", "@backstage/errors": "workspace:^", @@ -115,32 +132,49 @@ "@google-cloud/storage": "^7.0.0", "@keyv/memcache": "^1.3.5", "@keyv/redis": "^2.5.3", + "@manypkg/get-packages": "^1.1.3", "@octokit/rest": "^19.0.3", "@opentelemetry/api": "^1.3.0", + "@types/cors": "^2.8.6", + "@types/express": "^4.17.6", "archiver": "^6.0.0", "base64-stream": "^1.0.0", "better-sqlite3": "^9.0.0", + "compression": "^1.7.4", "concat-stream": "^2.0.0", "cookie": "^0.6.0", + "cors": "^2.8.5", "cron": "^3.0.0", "express": "^4.17.1", + "express-promise-router": "^4.1.0", "fs-extra": "^11.2.0", "git-url-parse": "^14.0.0", + "helmet": "^6.0.0", "isomorphic-git": "^1.23.0", "jose": "^5.0.0", "keyv": "^4.5.2", "knex": "^3.0.0", "lodash": "^4.17.21", + "logform": "^2.3.2", "luxon": "^3.0.0", "minimatch": "^9.0.0", + "minimist": "^1.2.5", + "morgan": "^1.10.0", "mysql2": "^3.0.0", "node-fetch": "^2.6.7", + "node-forge": "^1.3.1", "p-limit": "^3.1.0", + "path-to-regexp": "^6.2.1", "pg": "^8.11.3", "pg-connection-string": "^2.3.0", "raw-body": "^2.4.1", + "selfsigned": "^2.0.0", + "stoppable": "^1.1.0", "tar": "^6.1.12", + "triple-beam": "^1.4.1", "uuid": "^9.0.0", + "winston": "^3.2.1", + "winston-transport": "^4.5.0", "yauzl": "^3.0.0", "yn": "^4.0.0", "zod": "^3.22.4" @@ -150,8 +184,14 @@ "@backstage/backend-plugin-api": "workspace:^", "@backstage/backend-test-utils": "workspace:^", "@backstage/cli": "workspace:^", + "@types/http-errors": "^2.0.0", + "@types/morgan": "^1.9.0", + "@types/node-forge": "^1.3.0", + "@types/stoppable": "^1.1.0", "aws-sdk-client-mock": "^4.0.0", + "http-errors": "^2.0.0", "msw": "^1.0.0", + "supertest": "^6.1.3", "wait-for-expect": "^3.0.2" }, "configSchema": "config.d.ts" diff --git a/packages/backend-defaults/src/CreateBackend.ts b/packages/backend-defaults/src/CreateBackend.ts index 834d54e9e5..9b3fa5d649 100644 --- a/packages/backend-defaults/src/CreateBackend.ts +++ b/packages/backend-defaults/src/CreateBackend.ts @@ -17,11 +17,7 @@ import { Backend, createSpecializedBackend, - httpRouterServiceFactory, identityServiceFactory, - loggerServiceFactory, - rootHttpRouterServiceFactory, - rootLoggerServiceFactory, tokenManagerServiceFactory, } from '@backstage/backend-app-api'; import { authServiceFactory } from '@backstage/backend-defaults/auth'; @@ -29,10 +25,14 @@ import { cacheServiceFactory } from '@backstage/backend-defaults/cache'; import { databaseServiceFactory } from '@backstage/backend-defaults/database'; import { discoveryServiceFactory } from '@backstage/backend-defaults/discovery'; import { httpAuthServiceFactory } from '@backstage/backend-defaults/httpAuth'; +import { httpRouterServiceFactory } from '@backstage/backend-defaults/httpRouter'; import { lifecycleServiceFactory } from '@backstage/backend-defaults/lifecycle'; +import { loggerServiceFactory } from '@backstage/backend-defaults/logger'; import { permissionsServiceFactory } from '@backstage/backend-defaults/permissions'; import { rootConfigServiceFactory } from '@backstage/backend-defaults/rootConfig'; +import { rootHttpRouterServiceFactory } from '@backstage/backend-defaults/rootHttpRouter'; import { rootLifecycleServiceFactory } from '@backstage/backend-defaults/rootLifecycle'; +import { rootLoggerServiceFactory } from '@backstage/backend-defaults/rootLogger'; import { schedulerServiceFactory } from '@backstage/backend-defaults/scheduler'; import { urlReaderServiceFactory } from '@backstage/backend-defaults/urlReader'; import { userInfoServiceFactory } from '@backstage/backend-defaults/userInfo'; diff --git a/packages/backend-defaults/src/entrypoints/discovery/HostDiscovery.ts b/packages/backend-defaults/src/entrypoints/discovery/HostDiscovery.ts index 180c8706d5..559dda2aa0 100644 --- a/packages/backend-defaults/src/entrypoints/discovery/HostDiscovery.ts +++ b/packages/backend-defaults/src/entrypoints/discovery/HostDiscovery.ts @@ -15,8 +15,8 @@ */ import { Config } from '@backstage/config'; -import { readHttpServerOptions } from '@backstage/backend-app-api'; import { DiscoveryService } from '@backstage/backend-plugin-api'; +import { readHttpServerOptions } from '../rootHttpRouter/http/config'; type Target = string | { internal: string; external: string }; diff --git a/packages/backend-app-api/src/services/implementations/httpRouter/createAuthIntegrationRouter.ts b/packages/backend-defaults/src/entrypoints/httpRouter/createAuthIntegrationRouter.ts similarity index 99% rename from packages/backend-app-api/src/services/implementations/httpRouter/createAuthIntegrationRouter.ts rename to packages/backend-defaults/src/entrypoints/httpRouter/createAuthIntegrationRouter.ts index 94650199f3..ef36e7ba2d 100644 --- a/packages/backend-app-api/src/services/implementations/httpRouter/createAuthIntegrationRouter.ts +++ b/packages/backend-defaults/src/entrypoints/httpRouter/createAuthIntegrationRouter.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { AuthService } from '@backstage/backend-plugin-api'; import express from 'express'; import Router from 'express-promise-router'; diff --git a/packages/backend-app-api/src/services/implementations/httpRouter/createCookieAuthRefreshMiddleware.test.ts b/packages/backend-defaults/src/entrypoints/httpRouter/createCookieAuthRefreshMiddleware.test.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/httpRouter/createCookieAuthRefreshMiddleware.test.ts rename to packages/backend-defaults/src/entrypoints/httpRouter/createCookieAuthRefreshMiddleware.test.ts diff --git a/packages/backend-app-api/src/services/implementations/httpRouter/createCookieAuthRefreshMiddleware.ts b/packages/backend-defaults/src/entrypoints/httpRouter/createCookieAuthRefreshMiddleware.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/httpRouter/createCookieAuthRefreshMiddleware.ts rename to packages/backend-defaults/src/entrypoints/httpRouter/createCookieAuthRefreshMiddleware.ts diff --git a/packages/backend-app-api/src/services/implementations/httpRouter/createCredentialsBarrier.test.ts b/packages/backend-defaults/src/entrypoints/httpRouter/createCredentialsBarrier.test.ts similarity index 98% rename from packages/backend-app-api/src/services/implementations/httpRouter/createCredentialsBarrier.test.ts rename to packages/backend-defaults/src/entrypoints/httpRouter/createCredentialsBarrier.test.ts index a5246c91b2..124acf277b 100644 --- a/packages/backend-app-api/src/services/implementations/httpRouter/createCredentialsBarrier.test.ts +++ b/packages/backend-defaults/src/entrypoints/httpRouter/createCredentialsBarrier.test.ts @@ -20,7 +20,7 @@ import express from 'express'; import request from 'supertest'; import { createCredentialsBarrier } from './createCredentialsBarrier'; import { mockCredentials, mockServices } from '@backstage/backend-test-utils'; -import { MiddlewareFactory } from '../../../http'; +import { MiddlewareFactory } from '../rootHttpRouter/http'; const errorMiddleware = MiddlewareFactory.create({ config: mockServices.rootConfig(), diff --git a/packages/backend-app-api/src/services/implementations/httpRouter/createCredentialsBarrier.ts b/packages/backend-defaults/src/entrypoints/httpRouter/createCredentialsBarrier.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/httpRouter/createCredentialsBarrier.ts rename to packages/backend-defaults/src/entrypoints/httpRouter/createCredentialsBarrier.ts diff --git a/packages/backend-app-api/src/services/implementations/httpRouter/createLifecycleMiddleware.test.ts b/packages/backend-defaults/src/entrypoints/httpRouter/createLifecycleMiddleware.test.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/httpRouter/createLifecycleMiddleware.test.ts rename to packages/backend-defaults/src/entrypoints/httpRouter/createLifecycleMiddleware.test.ts diff --git a/packages/backend-defaults/src/entrypoints/httpRouter/createLifecycleMiddleware.ts b/packages/backend-defaults/src/entrypoints/httpRouter/createLifecycleMiddleware.ts new file mode 100644 index 0000000000..3f8ee3ea69 --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/httpRouter/createLifecycleMiddleware.ts @@ -0,0 +1,106 @@ +/* + * Copyright 2022 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 { LifecycleService } from '@backstage/backend-plugin-api'; +import { ServiceUnavailableError } from '@backstage/errors'; +import { HumanDuration, durationToMilliseconds } from '@backstage/types'; +import { RequestHandler } from 'express'; + +export const DEFAULT_TIMEOUT = { seconds: 5 }; + +/** + * Options for {@link createLifecycleMiddleware}. + * @public + */ +export interface LifecycleMiddlewareOptions { + lifecycle: LifecycleService; + /** + * The maximum time that paused requests will wait for the service to start, before returning an error. + * + * Defaults to 5 seconds. + */ + startupRequestPauseTimeout?: HumanDuration; +} + +/** + * Creates a middleware that pauses requests until the service has started. + * + * @remarks + * + * Requests that arrive before the service has started will be paused until startup is complete. + * If the service does not start within the provided timeout, the request will be rejected with a + * {@link @backstage/errors#ServiceUnavailableError}. + * + * If the service is shutting down, all requests will be rejected with a + * {@link @backstage/errors#ServiceUnavailableError}. + * + * @public + */ +export function createLifecycleMiddleware( + options: LifecycleMiddlewareOptions, +): RequestHandler { + const { lifecycle, startupRequestPauseTimeout = DEFAULT_TIMEOUT } = options; + + let state: 'init' | 'up' | 'down' = 'init'; + const waiting = new Set<{ + next: (err?: Error) => void; + timeout: NodeJS.Timeout; + }>(); + + lifecycle.addStartupHook(async () => { + if (state === 'init') { + state = 'up'; + for (const item of waiting) { + clearTimeout(item.timeout); + item.next(); + } + waiting.clear(); + } + }); + + lifecycle.addShutdownHook(async () => { + state = 'down'; + + for (const item of waiting) { + clearTimeout(item.timeout); + item.next(new ServiceUnavailableError('Service is shutting down')); + } + waiting.clear(); + }); + + const timeoutMs = durationToMilliseconds(startupRequestPauseTimeout); + + return (_req, _res, next) => { + if (state === 'up') { + next(); + return; + } else if (state === 'down') { + next(new ServiceUnavailableError('Service is shutting down')); + return; + } + + const item = { + next, + timeout: setTimeout(() => { + if (waiting.delete(item)) { + next(new ServiceUnavailableError('Service has not started up yet')); + } + }, timeoutMs), + }; + + waiting.add(item); + }; +} diff --git a/packages/backend-app-api/src/services/implementations/httpRouter/httpRouterServiceFactory.test.ts b/packages/backend-defaults/src/entrypoints/httpRouter/httpRouterServiceFactory.test.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/httpRouter/httpRouterServiceFactory.test.ts rename to packages/backend-defaults/src/entrypoints/httpRouter/httpRouterServiceFactory.test.ts diff --git a/packages/backend-defaults/src/entrypoints/httpRouter/httpRouterServiceFactory.ts b/packages/backend-defaults/src/entrypoints/httpRouter/httpRouterServiceFactory.ts new file mode 100644 index 0000000000..4a0dec49e6 --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/httpRouter/httpRouterServiceFactory.ts @@ -0,0 +1,101 @@ +/* + * Copyright 2022 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 { Handler } from 'express'; +import PromiseRouter from 'express-promise-router'; +import { + coreServices, + createServiceFactory, + HttpRouterServiceAuthPolicy, +} from '@backstage/backend-plugin-api'; +import { createLifecycleMiddleware } from './createLifecycleMiddleware'; +import { createCredentialsBarrier } from './createCredentialsBarrier'; +import { createAuthIntegrationRouter } from './createAuthIntegrationRouter'; +import { createCookieAuthRefreshMiddleware } from './createCookieAuthRefreshMiddleware'; + +/** + * @public + */ +export interface HttpRouterFactoryOptions { + /** + * A callback used to generate the path for each plugin, defaults to `/api/{pluginId}`. + */ + getPath?(pluginId: string): string; +} + +/** + * HTTP route registration for plugins. + * + * See {@link @backstage/code-plugin-api#HttpRouterService} + * and {@link https://backstage.io/docs/backend-system/core-services/http-router | the service docs} + * for more information. + * + * @public + */ +export const httpRouterServiceFactory = createServiceFactory( + (options?: HttpRouterFactoryOptions) => ({ + service: coreServices.httpRouter, + initialization: 'always', + deps: { + plugin: coreServices.pluginMetadata, + config: coreServices.rootConfig, + logger: coreServices.logger, + lifecycle: coreServices.lifecycle, + rootHttpRouter: coreServices.rootHttpRouter, + auth: coreServices.auth, + httpAuth: coreServices.httpAuth, + }, + async factory({ + auth, + httpAuth, + config, + logger, + plugin, + rootHttpRouter, + lifecycle, + }) { + if (options?.getPath) { + logger.warn( + `DEPRECATION WARNING: The 'getPath' option for HttpRouterService is deprecated. The ability to reconfigure the '/api/' path prefix for plugins will be removed in the future.`, + ); + } + const getPath = options?.getPath ?? (id => `/api/${id}`); + const path = getPath(plugin.getId()); + + const router = PromiseRouter(); + rootHttpRouter.use(path, router); + + const credentialsBarrier = createCredentialsBarrier({ + httpAuth, + config, + }); + + router.use(createAuthIntegrationRouter({ auth })); + router.use(createLifecycleMiddleware({ lifecycle })); + router.use(credentialsBarrier.middleware); + router.use(createCookieAuthRefreshMiddleware({ auth, httpAuth })); + + return { + use(handler: Handler): void { + router.use(handler); + }, + addAuthPolicy(policy: HttpRouterServiceAuthPolicy): void { + credentialsBarrier.addAuthPolicy(policy); + }, + }; + }, + }), +); diff --git a/packages/backend-defaults/src/entrypoints/httpRouter/index.ts b/packages/backend-defaults/src/entrypoints/httpRouter/index.ts new file mode 100644 index 0000000000..928a232131 --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/httpRouter/index.ts @@ -0,0 +1,20 @@ +/* + * 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. + */ + +export { httpRouterServiceFactory } from './httpRouterServiceFactory'; +export type { HttpRouterFactoryOptions } from './httpRouterServiceFactory'; +export { createLifecycleMiddleware } from './createLifecycleMiddleware'; +export type { LifecycleMiddlewareOptions } from './createLifecycleMiddleware'; diff --git a/packages/backend-defaults/src/entrypoints/logger/index.ts b/packages/backend-defaults/src/entrypoints/logger/index.ts new file mode 100644 index 0000000000..ca52bf5193 --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/logger/index.ts @@ -0,0 +1,17 @@ +/* + * 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. + */ + +export { loggerServiceFactory } from './loggerServiceFactory'; diff --git a/packages/backend-defaults/src/entrypoints/logger/loggerServiceFactory.ts b/packages/backend-defaults/src/entrypoints/logger/loggerServiceFactory.ts new file mode 100644 index 0000000000..4eff798e11 --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/logger/loggerServiceFactory.ts @@ -0,0 +1,40 @@ +/* + * Copyright 2022 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 { + createServiceFactory, + coreServices, +} from '@backstage/backend-plugin-api'; + +/** + * Plugin-level logging. + * + * See {@link @backstage/code-plugin-api#LoggerService} + * and {@link https://backstage.io/docs/backend-system/core-services/logger | the service docs} + * for more information. + * + * @public + */ +export const loggerServiceFactory = createServiceFactory({ + service: coreServices.logger, + deps: { + rootLogger: coreServices.rootLogger, + plugin: coreServices.pluginMetadata, + }, + factory({ rootLogger, plugin }) { + return rootLogger.child({ plugin: plugin.getId() }); + }, +}); diff --git a/packages/backend-defaults/src/entrypoints/rootConfig/createConfigSecretEnumerator.test.ts b/packages/backend-defaults/src/entrypoints/rootConfig/createConfigSecretEnumerator.test.ts new file mode 100644 index 0000000000..1efb12ad03 --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/rootConfig/createConfigSecretEnumerator.test.ts @@ -0,0 +1,74 @@ +/* + * Copyright 2020 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 { loadConfigSchema } from '@backstage/config-loader'; +import { createConfigSecretEnumerator } from './createConfigSecretEnumerator'; +import { mockServices } from '@backstage/backend-test-utils'; + +describe('createConfigSecretEnumerator', () => { + it('should enumerate secrets', async () => { + const logger = mockServices.logger.mock(); + + const enumerate = await createConfigSecretEnumerator({ + logger, + }); + const secrets = enumerate( + mockServices.rootConfig({ + data: { + backend: { auth: { keys: [{ secret: 'my-secret-password' }] } }, + }, + }), + ); + expect(Array.from(secrets)).toEqual(['my-secret-password']); + }, 20_000); // Bit higher timeout since we're loading all config schemas in the repo + + it('should enumerate secrets with explicit schema', async () => { + const logger = mockServices.logger.mock(); + + const enumerate = await createConfigSecretEnumerator({ + logger, + schema: await loadConfigSchema({ + serialized: { + schemas: [ + { + value: { + type: 'object', + properties: { + secret: { + visibility: 'secret', + type: 'string', + }, + }, + }, + path: '/mock', + }, + ], + backstageConfigSchemaVersion: 1, + }, + }), + }); + + const secrets = enumerate( + mockServices.rootConfig({ + data: { + secret: 'my-secret', + other: 'not-secret', + }, + }), + ); + expect(Array.from(secrets)).toEqual(['my-secret']); + }); +}); diff --git a/packages/backend-defaults/src/entrypoints/rootConfig/createConfigSecretEnumerator.ts b/packages/backend-defaults/src/entrypoints/rootConfig/createConfigSecretEnumerator.ts new file mode 100644 index 0000000000..421b07c396 --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/rootConfig/createConfigSecretEnumerator.ts @@ -0,0 +1,54 @@ +/* + * Copyright 2020 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 { LoggerService } from '@backstage/backend-plugin-api'; +import type { Config } from '@backstage/config'; +import { ConfigSchema, loadConfigSchema } from '@backstage/config-loader'; +import { getPackages } from '@manypkg/get-packages'; + +/** @public */ +export async function createConfigSecretEnumerator(options: { + logger: LoggerService; + dir?: string; + schema?: ConfigSchema; +}): Promise<(config: Config) => Iterable> { + const { logger, dir = process.cwd() } = options; + const { packages } = await getPackages(dir); + const schema = + options.schema ?? + (await loadConfigSchema({ + dependencies: packages.map(p => p.packageJson.name), + })); + + return (config: Config) => { + const [secretsData] = schema.process( + [{ data: config.getOptional() ?? {}, context: 'schema-enumerator' }], + { + visibility: ['secret'], + ignoreSchemaErrors: true, + }, + ); + const secrets = new Set(); + JSON.parse( + JSON.stringify(secretsData.data), + (_, v) => typeof v === 'string' && secrets.add(v), + ); + logger.info( + `Found ${secrets.size} new secrets in config that will be redacted`, + ); + return secrets; + }; +} diff --git a/packages/backend-defaults/src/entrypoints/rootConfig/index.ts b/packages/backend-defaults/src/entrypoints/rootConfig/index.ts index 1775ef2efc..66f5e8e15f 100644 --- a/packages/backend-defaults/src/entrypoints/rootConfig/index.ts +++ b/packages/backend-defaults/src/entrypoints/rootConfig/index.ts @@ -14,5 +14,8 @@ * limitations under the License. */ -export { rootConfigServiceFactory } from './rootConfigServiceFactory'; -export type { RootConfigFactoryOptions } from './rootConfigServiceFactory'; +export { createConfigSecretEnumerator } from './createConfigSecretEnumerator'; +export { + rootConfigServiceFactory, + type RootConfigFactoryOptions, +} from './rootConfigServiceFactory'; diff --git a/packages/backend-defaults/src/entrypoints/rootHttpRouter/DefaultRootHttpRouter.test.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/DefaultRootHttpRouter.test.ts new file mode 100644 index 0000000000..fc1de9b205 --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/rootHttpRouter/DefaultRootHttpRouter.test.ts @@ -0,0 +1,124 @@ +/* + * Copyright 2022 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 request from 'supertest'; +import { DefaultRootHttpRouter } from './DefaultRootHttpRouter'; + +describe('DefaultRootHttpRouter', () => { + it.each([ + [['/b'], '/a'], + [['/a'], '/aa/b'], + [['/aa'], '/a/b'], + [['/a/b'], '/aa'], + [['/b/a'], '/a'], + [['/a'], '/aa'], + ])(`with existing paths %s, adds %s without conflict`, (existing, added) => { + const router = DefaultRootHttpRouter.create(); + for (const path of existing) { + router.use(path, () => {}); + } + expect(() => router.use(added, () => {})).not.toThrow(); + }); + + it.each([ + [['/a'], '/a', '/a'], + [['/a'], '/a/b', '/a'], + [['/a/b'], '/a', '/a/b'], + ])( + `find conflict when existing paths %s, adds %s`, + (existing, added, conflict) => { + const router = DefaultRootHttpRouter.create(); + for (const path of existing) { + router.use(path, () => {}); + } + expect(() => router.use(added, () => {})).toThrow( + `Path ${added} conflicts with the existing path ${conflict}`, + ); + }, + ); + + it('should not be possible to supply an empty indexPath', () => { + expect(() => DefaultRootHttpRouter.create({ indexPath: '' })).toThrow( + 'indexPath option may not be an empty string', + ); + }); + + it('will always prioritize non-index paths', async () => { + const router = DefaultRootHttpRouter.create({ indexPath: '/x' }); + const app = express(); + app.use(router.handler()); + + const routerX = express.Router(); + routerX.get('/a', (_req, res) => res.status(201).end()); + + const routerY = express.Router(); + routerY.get('/a', (_req, res) => res.status(202).end()); + + await request(app).get('/').expect(404); + await request(app).get('/a').expect(404); + await request(app).get('/x/a').expect(404); + await request(app).get('/y/a').expect(404); + + router.use('/x', routerX); + + await request(app).get('/').expect(404); + await request(app).get('/a').expect(201); + await request(app).get('/x/a').expect(201); + await request(app).get('/y/a').expect(404); + + router.use('/y', routerY); + + await request(app).get('/').expect(404); + await request(app).get('/a').expect(201); + await request(app).get('/x/a').expect(201); + await request(app).get('/y/a').expect(202); + + expect('test').toBe('test'); + }); + + it('should treat unknown /api/ routes as 404', async () => { + const router = DefaultRootHttpRouter.create(); + const app = express(); + app.use(router.handler()); + + router.use('/api/app', (_req, res) => res.status(201).end()); + router.use('/api/catalog', (_req, res) => res.status(202).end()); + + await request(app).get('/').expect(201); + await request(app).get('/api/catalog').expect(202); + await request(app).get('/unknown').expect(201); + await request(app).get('/api/unknown').expect(404); + + expect('test').toBe('test'); + }); + + it('should treat unknown /api/ routes as 404 without an index path', async () => { + const router = DefaultRootHttpRouter.create({ indexPath: false }); + const app = express(); + app.use(router.handler()); + + router.use('/api/app', (_req, res) => res.status(201).end()); + router.use('/api/catalog', (_req, res) => res.status(202).end()); + + await request(app).get('/').expect(404); + await request(app).get('/api/catalog').expect(202); + await request(app).get('/unknown').expect(404); + await request(app).get('/api/unknown').expect(404); + + expect('test').toBe('test'); + }); +}); diff --git a/packages/backend-defaults/src/entrypoints/rootHttpRouter/DefaultRootHttpRouter.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/DefaultRootHttpRouter.ts new file mode 100644 index 0000000000..9d7d1de120 --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/rootHttpRouter/DefaultRootHttpRouter.ts @@ -0,0 +1,115 @@ +/* + * 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 { RootHttpRouterService } from '@backstage/backend-plugin-api'; +import { Handler, Router } from 'express'; +import trimEnd from 'lodash/trimEnd'; + +function normalizePath(path: string): string { + return `${trimEnd(path, '/')}/`; +} + +/** + * Options for the {@link DefaultRootHttpRouter} class. + * + * @public + */ +export interface DefaultRootHttpRouterOptions { + /** + * The path to forward all unmatched requests to. Defaults to '/api/app' if + * not given. Disables index path behavior if false is given. + */ + indexPath?: string | false; +} + +/** + * The default implementation of the {@link @backstage/backend-plugin-api#RootHttpRouterService} interface for + * {@link @backstage/backend-plugin-api#coreServices.rootHttpRouter}. + * + * @public + */ +export class DefaultRootHttpRouter implements RootHttpRouterService { + #indexPath?: string; + + #router = Router(); + #namedRoutes = Router(); + #indexRouter = Router(); + #existingPaths = new Array(); + + static create(options?: DefaultRootHttpRouterOptions) { + let indexPath; + if (options?.indexPath === false) { + indexPath = undefined; + } else if (options?.indexPath === undefined) { + indexPath = '/api/app'; + } else if (options?.indexPath === '') { + throw new Error('indexPath option may not be an empty string'); + } else { + indexPath = options.indexPath; + } + return new DefaultRootHttpRouter(indexPath); + } + + private constructor(indexPath?: string) { + this.#indexPath = indexPath; + this.#router.use(this.#namedRoutes); + + // Any request with a /api/ prefix will skip the index router, even if no named router matches + this.#router.use('/api/', (_req, _res, next) => { + next('router'); + }); + + if (this.#indexPath) { + this.#router.use(this.#indexRouter); + } + } + + use(path: string, handler: Handler) { + if (path.match(/^[/\s]*$/)) { + throw new Error(`Root router path may not be empty`); + } + const conflictingPath = this.#findConflictingPath(path); + if (conflictingPath) { + throw new Error( + `Path ${path} conflicts with the existing path ${conflictingPath}`, + ); + } + this.#existingPaths.push(path); + this.#namedRoutes.use(path, handler); + + if (this.#indexPath === path) { + this.#indexRouter.use(handler); + } + } + + handler(): Handler { + return this.#router; + } + + #findConflictingPath(newPath: string): string | undefined { + const normalizedNewPath = normalizePath(newPath); + for (const path of this.#existingPaths) { + const normalizedPath = normalizePath(path); + if (normalizedPath.startsWith(normalizedNewPath)) { + return path; + } + if (normalizedNewPath.startsWith(normalizedPath)) { + return path; + } + } + return undefined; + } +} diff --git a/packages/backend-app-api/src/http/MiddlewareFactory.test.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/http/MiddlewareFactory.test.ts similarity index 100% rename from packages/backend-app-api/src/http/MiddlewareFactory.test.ts rename to packages/backend-defaults/src/entrypoints/rootHttpRouter/http/MiddlewareFactory.test.ts diff --git a/packages/backend-app-api/src/http/MiddlewareFactory.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/http/MiddlewareFactory.ts similarity index 100% rename from packages/backend-app-api/src/http/MiddlewareFactory.ts rename to packages/backend-defaults/src/entrypoints/rootHttpRouter/http/MiddlewareFactory.ts diff --git a/packages/backend-app-api/src/http/applyInternalErrorFilter.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/http/applyInternalErrorFilter.ts similarity index 100% rename from packages/backend-app-api/src/http/applyInternalErrorFilter.ts rename to packages/backend-defaults/src/entrypoints/rootHttpRouter/http/applyInternalErrorFilter.ts diff --git a/packages/backend-app-api/src/http/config.test.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/http/config.test.ts similarity index 100% rename from packages/backend-app-api/src/http/config.test.ts rename to packages/backend-defaults/src/entrypoints/rootHttpRouter/http/config.test.ts diff --git a/packages/backend-app-api/src/http/config.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/http/config.ts similarity index 100% rename from packages/backend-app-api/src/http/config.ts rename to packages/backend-defaults/src/entrypoints/rootHttpRouter/http/config.ts diff --git a/packages/backend-app-api/src/http/createHttpServer.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/http/createHttpServer.ts similarity index 100% rename from packages/backend-app-api/src/http/createHttpServer.ts rename to packages/backend-defaults/src/entrypoints/rootHttpRouter/http/createHttpServer.ts diff --git a/packages/backend-app-api/src/http/getGeneratedCertificate.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/http/getGeneratedCertificate.ts similarity index 100% rename from packages/backend-app-api/src/http/getGeneratedCertificate.ts rename to packages/backend-defaults/src/entrypoints/rootHttpRouter/http/getGeneratedCertificate.ts diff --git a/packages/backend-defaults/src/entrypoints/rootHttpRouter/http/index.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/http/index.ts new file mode 100644 index 0000000000..4a9ec14cf8 --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/rootHttpRouter/http/index.ts @@ -0,0 +1,30 @@ +/* + * 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. + */ + +export { readHttpServerOptions } from './config'; +export { createHttpServer } from './createHttpServer'; +export { MiddlewareFactory } from './MiddlewareFactory'; +export type { + MiddlewareFactoryErrorOptions, + MiddlewareFactoryOptions, +} from './MiddlewareFactory'; +export { readCorsOptions } from './readCorsOptions'; +export { readHelmetOptions } from './readHelmetOptions'; +export type { + ExtendedHttpServer, + HttpServerCertificateOptions, + HttpServerOptions, +} from './types'; diff --git a/packages/backend-app-api/src/http/readCorsOptions.test.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/http/readCorsOptions.test.ts similarity index 100% rename from packages/backend-app-api/src/http/readCorsOptions.test.ts rename to packages/backend-defaults/src/entrypoints/rootHttpRouter/http/readCorsOptions.test.ts diff --git a/packages/backend-app-api/src/http/readCorsOptions.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/http/readCorsOptions.ts similarity index 100% rename from packages/backend-app-api/src/http/readCorsOptions.ts rename to packages/backend-defaults/src/entrypoints/rootHttpRouter/http/readCorsOptions.ts diff --git a/packages/backend-app-api/src/http/readHelmetOptions.test.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/http/readHelmetOptions.test.ts similarity index 100% rename from packages/backend-app-api/src/http/readHelmetOptions.test.ts rename to packages/backend-defaults/src/entrypoints/rootHttpRouter/http/readHelmetOptions.test.ts diff --git a/packages/backend-app-api/src/http/readHelmetOptions.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/http/readHelmetOptions.ts similarity index 100% rename from packages/backend-app-api/src/http/readHelmetOptions.ts rename to packages/backend-defaults/src/entrypoints/rootHttpRouter/http/readHelmetOptions.ts diff --git a/packages/backend-app-api/src/http/types.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/http/types.ts similarity index 100% rename from packages/backend-app-api/src/http/types.ts rename to packages/backend-defaults/src/entrypoints/rootHttpRouter/http/types.ts diff --git a/packages/backend-defaults/src/entrypoints/rootHttpRouter/index.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/index.ts new file mode 100644 index 0000000000..9c2d96dab2 --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/rootHttpRouter/index.ts @@ -0,0 +1,26 @@ +/* + * 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. + */ + +export { + DefaultRootHttpRouter, + type DefaultRootHttpRouterOptions, +} from './DefaultRootHttpRouter'; +export * from './http'; +export { + rootHttpRouterServiceFactory, + type RootHttpRouterConfigureContext, + type RootHttpRouterFactoryOptions, +} from './rootHttpRouterServiceFactory'; diff --git a/packages/backend-defaults/src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.ts new file mode 100644 index 0000000000..ea3dc42eb7 --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.ts @@ -0,0 +1,119 @@ +/* + * Copyright 2022 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 { + RootConfigService, + coreServices, + createServiceFactory, + LifecycleService, + LoggerService, +} from '@backstage/backend-plugin-api'; +import express, { RequestHandler, Express } from 'express'; +import type { Server } from 'node:http'; +import { + createHttpServer, + MiddlewareFactory, + readHttpServerOptions, +} from './http'; +import { DefaultRootHttpRouter } from './DefaultRootHttpRouter'; + +/** + * @public + */ +export interface RootHttpRouterConfigureContext { + app: Express; + server: Server; + middleware: MiddlewareFactory; + routes: RequestHandler; + config: RootConfigService; + logger: LoggerService; + lifecycle: LifecycleService; + applyDefaults: () => void; +} + +/** + * HTTP route registration for root services. + * + * See {@link @backstage/code-plugin-api#RootHttpRouterService} + * and {@link https://backstage.io/docs/backend-system/core-services/root-http-router | the service docs} + * for more information. + * + * @public + */ +export type RootHttpRouterFactoryOptions = { + /** + * The path to forward all unmatched requests to. Defaults to '/api/app' if + * not given. Disables index path behavior if false is given. + */ + indexPath?: string | false; + + configure?(context: RootHttpRouterConfigureContext): void; +}; + +function defaultConfigure({ applyDefaults }: RootHttpRouterConfigureContext) { + applyDefaults(); +} + +/** @public */ +export const rootHttpRouterServiceFactory = createServiceFactory( + (options?: RootHttpRouterFactoryOptions) => ({ + service: coreServices.rootHttpRouter, + deps: { + config: coreServices.rootConfig, + rootLogger: coreServices.rootLogger, + lifecycle: coreServices.rootLifecycle, + }, + async factory({ config, rootLogger, lifecycle }) { + const { indexPath, configure = defaultConfigure } = options ?? {}; + const logger = rootLogger.child({ service: 'rootHttpRouter' }); + const app = express(); + + const router = DefaultRootHttpRouter.create({ indexPath }); + const middleware = MiddlewareFactory.create({ config, logger }); + const routes = router.handler(); + const server = await createHttpServer( + app, + readHttpServerOptions(config.getOptionalConfig('backend')), + { logger }, + ); + + configure({ + app, + server, + routes, + middleware, + config, + logger, + lifecycle, + applyDefaults() { + app.use(middleware.helmet()); + app.use(middleware.cors()); + app.use(middleware.compression()); + app.use(middleware.logging()); + app.use(routes); + app.use(middleware.notFound()); + app.use(middleware.error()); + }, + }); + + lifecycle.addShutdownHook(() => server.stop()); + + await server.start(); + + return router; + }, + }), +); diff --git a/packages/backend-app-api/src/logging/WinstonLogger.test.ts b/packages/backend-defaults/src/entrypoints/rootLogger/WinstonLogger.test.ts similarity index 100% rename from packages/backend-app-api/src/logging/WinstonLogger.test.ts rename to packages/backend-defaults/src/entrypoints/rootLogger/WinstonLogger.test.ts diff --git a/packages/backend-defaults/src/entrypoints/rootLogger/WinstonLogger.ts b/packages/backend-defaults/src/entrypoints/rootLogger/WinstonLogger.ts new file mode 100644 index 0000000000..38d05f6511 --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/rootLogger/WinstonLogger.ts @@ -0,0 +1,192 @@ +/* + * 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 { + LoggerService, + RootLoggerService, +} from '@backstage/backend-plugin-api'; +import { JsonObject } from '@backstage/types'; +import { Format, TransformableInfo } from 'logform'; +import { + Logger, + format, + createLogger, + transports, + transport as Transport, +} from 'winston'; +import { MESSAGE } from 'triple-beam'; +import { escapeRegExp } from '../../lib/escapeRegExp'; + +/** + * @public + */ +export interface WinstonLoggerOptions { + meta?: JsonObject; + level?: string; + format?: Format; + transports?: Transport[]; +} + +/** + * A {@link @backstage/backend-plugin-api#LoggerService} implementation based on winston. + * + * @public + */ +export class WinstonLogger implements RootLoggerService { + #winston: Logger; + #addRedactions?: (redactions: Iterable) => void; + + /** + * Creates a {@link WinstonLogger} instance. + */ + static create(options: WinstonLoggerOptions): WinstonLogger { + const redacter = WinstonLogger.redacter(); + const defaultFormatter = + process.env.NODE_ENV === 'production' + ? format.json() + : WinstonLogger.colorFormat(); + + let logger = createLogger({ + level: process.env.LOG_LEVEL || options.level || 'info', + format: format.combine( + options.format ?? defaultFormatter, + redacter.format, + ), + transports: options.transports ?? new transports.Console(), + }); + + if (options.meta) { + logger = logger.child(options.meta); + } + + return new WinstonLogger(logger, redacter.add); + } + + /** + * Creates a winston log formatter for redacting secrets. + */ + static redacter(): { + format: Format; + add: (redactions: Iterable) => void; + } { + const redactionSet = new Set(); + + let redactionPattern: RegExp | undefined = undefined; + + return { + format: format((obj: TransformableInfo) => { + if (!redactionPattern || !obj) { + return obj; + } + + obj[MESSAGE] = obj[MESSAGE]?.replace?.(redactionPattern, '***'); + + return obj; + })(), + add(newRedactions) { + let added = 0; + for (const redactionToTrim of newRedactions) { + // Trimming the string ensures that we don't accdentally get extra + // newlines or other whitespace interfering with the redaction; this + // can happen for example when using string literals in yaml + const redaction = redactionToTrim.trim(); + // Exclude secrets that are empty or just one character in length. These + // typically mean that you are running local dev or tests, or using the + // --lax flag which sets things to just 'x'. + if (redaction.length <= 1) { + continue; + } + if (!redactionSet.has(redaction)) { + redactionSet.add(redaction); + added += 1; + } + } + if (added > 0) { + const redactions = Array.from(redactionSet) + .map(r => escapeRegExp(r)) + .join('|'); + redactionPattern = new RegExp(`(${redactions})`, 'g'); + } + }, + }; + } + + /** + * Creates a pretty printed winston log formatter. + */ + static colorFormat(): Format { + const colorizer = format.colorize(); + + return format.combine( + format.timestamp(), + format.colorize({ + colors: { + timestamp: 'dim', + prefix: 'blue', + field: 'cyan', + debug: 'grey', + }, + }), + format.printf((info: TransformableInfo) => { + const { timestamp, level, message, plugin, service, ...fields } = info; + const prefix = plugin || service; + const timestampColor = colorizer.colorize('timestamp', timestamp); + const prefixColor = colorizer.colorize('prefix', prefix); + + const extraFields = Object.entries(fields) + .map( + ([key, value]) => + `${colorizer.colorize('field', `${key}`)}=${value}`, + ) + .join(' '); + + return `${timestampColor} ${prefixColor} ${level} ${message} ${extraFields}`; + }), + ); + } + + private constructor( + winston: Logger, + addRedactions?: (redactions: Iterable) => void, + ) { + this.#winston = winston; + this.#addRedactions = addRedactions; + } + + error(message: string, meta?: JsonObject): void { + this.#winston.error(message, meta); + } + + warn(message: string, meta?: JsonObject): void { + this.#winston.warn(message, meta); + } + + info(message: string, meta?: JsonObject): void { + this.#winston.info(message, meta); + } + + debug(message: string, meta?: JsonObject): void { + this.#winston.debug(message, meta); + } + + child(meta: JsonObject): LoggerService { + return new WinstonLogger(this.#winston.child(meta)); + } + + addRedactions(redactions: Iterable) { + this.#addRedactions?.(redactions); + } +} diff --git a/packages/backend-defaults/src/entrypoints/rootLogger/index.ts b/packages/backend-defaults/src/entrypoints/rootLogger/index.ts new file mode 100644 index 0000000000..96ed402520 --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/rootLogger/index.ts @@ -0,0 +1,18 @@ +/* + * 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. + */ + +export { rootLoggerServiceFactory } from './rootLoggerServiceFactory'; +export { WinstonLogger, type WinstonLoggerOptions } from './WinstonLogger'; diff --git a/packages/backend-defaults/src/entrypoints/rootLogger/rootLoggerServiceFactory.ts b/packages/backend-defaults/src/entrypoints/rootLogger/rootLoggerServiceFactory.ts new file mode 100644 index 0000000000..8454cf07d3 --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/rootLogger/rootLoggerServiceFactory.ts @@ -0,0 +1,58 @@ +/* + * Copyright 2022 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 { + createServiceFactory, + coreServices, +} from '@backstage/backend-plugin-api'; +import { transports, format } from 'winston'; +import { WinstonLogger } from '../rootLogger/WinstonLogger'; +import { createConfigSecretEnumerator } from '../rootConfig/createConfigSecretEnumerator'; + +/** + * Root-level logging. + * + * See {@link @backstage/code-plugin-api#RootLoggerService} + * and {@link https://backstage.io/docs/backend-system/core-services/root-logger | the service docs} + * for more information. + * + * @public + */ +export const rootLoggerServiceFactory = createServiceFactory({ + service: coreServices.rootLogger, + deps: { + config: coreServices.rootConfig, + }, + async factory({ config }) { + const logger = WinstonLogger.create({ + meta: { + service: 'backstage', + }, + level: process.env.LOG_LEVEL || 'info', + format: + process.env.NODE_ENV === 'production' + ? format.json() + : WinstonLogger.colorFormat(), + transports: [new transports.Console()], + }); + + const secretEnumerator = await createConfigSecretEnumerator({ logger }); + logger.addRedactions(secretEnumerator(config)); + config.subscribe?.(() => logger.addRedactions(secretEnumerator(config))); + + return logger; + }, +}); diff --git a/packages/backend-app-api/src/lib/escapeRegExp.test.ts b/packages/backend-defaults/src/lib/escapeRegExp.test.ts similarity index 100% rename from packages/backend-app-api/src/lib/escapeRegExp.test.ts rename to packages/backend-defaults/src/lib/escapeRegExp.test.ts diff --git a/packages/backend-app-api/src/lib/escapeRegExp.ts b/packages/backend-defaults/src/lib/escapeRegExp.ts similarity index 100% rename from packages/backend-app-api/src/lib/escapeRegExp.ts rename to packages/backend-defaults/src/lib/escapeRegExp.ts diff --git a/packages/backend-defaults/src/lib/urls.test.ts b/packages/backend-defaults/src/lib/urls.test.ts new file mode 100644 index 0000000000..c2a67fb849 --- /dev/null +++ b/packages/backend-defaults/src/lib/urls.test.ts @@ -0,0 +1,34 @@ +/* + * 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 { isValidUrl } from './urls'; + +describe('isValidUrl', () => { + it('should return true for url', () => { + const validUrl = isValidUrl('http://some.valid.url'); + expect(validUrl).toBe(true); + }); + + it('should return false for absolute path', () => { + const validUrl = isValidUrl('/some/absolute/path'); + expect(validUrl).toBe(false); + }); + + it('should return false for relative path', () => { + const validUrl = isValidUrl('../some/relative/path'); + expect(validUrl).toBe(false); + }); +}); diff --git a/packages/backend-defaults/src/lib/urls.ts b/packages/backend-defaults/src/lib/urls.ts new file mode 100644 index 0000000000..848cea25d9 --- /dev/null +++ b/packages/backend-defaults/src/lib/urls.ts @@ -0,0 +1,25 @@ +/* + * 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. + */ + +export function isValidUrl(url: string): boolean { + try { + // eslint-disable-next-line no-new + new URL(url); + return true; + } catch { + return false; + } +} diff --git a/packages/backend-test-utils/api-report.md b/packages/backend-test-utils/api-report.md index cc30dc8f56..019d398ea6 100644 --- a/packages/backend-test-utils/api-report.md +++ b/packages/backend-test-utils/api-report.md @@ -22,7 +22,7 @@ import { EventsService } from '@backstage/plugin-events-node'; import { ExtendedHttpServer } from '@backstage/backend-app-api'; import { ExtensionPoint } from '@backstage/backend-plugin-api'; import { HttpAuthService } from '@backstage/backend-plugin-api'; -import { HttpRouterFactoryOptions } from '@backstage/backend-app-api'; +import { HttpRouterFactoryOptions } from '@backstage/backend-defaults/httpRouter'; import { HttpRouterService } from '@backstage/backend-plugin-api'; import { IdentityService } from '@backstage/backend-plugin-api'; import { JsonObject } from '@backstage/types'; @@ -32,7 +32,7 @@ import { LifecycleService } from '@backstage/backend-plugin-api'; import { LoggerService } from '@backstage/backend-plugin-api'; import { PermissionsService } from '@backstage/backend-plugin-api'; import { RootConfigService } from '@backstage/backend-plugin-api'; -import { RootHttpRouterFactoryOptions } from '@backstage/backend-app-api'; +import { RootHttpRouterFactoryOptions } from '@backstage/backend-defaults/rootHttpRouter'; import { RootHttpRouterService } from '@backstage/backend-plugin-api'; import { RootLifecycleService } from '@backstage/backend-plugin-api'; import { RootLoggerService } from '@backstage/backend-plugin-api'; diff --git a/packages/backend-test-utils/package.json b/packages/backend-test-utils/package.json index 40523b1e04..73390d75d6 100644 --- a/packages/backend-test-utils/package.json +++ b/packages/backend-test-utils/package.json @@ -46,6 +46,7 @@ }, "dependencies": { "@backstage/backend-app-api": "workspace:^", + "@backstage/backend-defaults": "workspace:^", "@backstage/backend-plugin-api": "workspace:^", "@backstage/config": "workspace:^", "@backstage/errors": "workspace:^", diff --git a/packages/backend-test-utils/src/next/services/mockServices.ts b/packages/backend-test-utils/src/next/services/mockServices.ts index 57621a9209..24571b634c 100644 --- a/packages/backend-test-utils/src/next/services/mockServices.ts +++ b/packages/backend-test-utils/src/next/services/mockServices.ts @@ -14,48 +14,48 @@ * limitations under the License. */ +import { cacheServiceFactory } from '@backstage/backend-defaults/cache'; +import { databaseServiceFactory } from '@backstage/backend-defaults/database'; import { - RootConfigService, - coreServices, - createServiceFactory, + HostDiscovery, + discoveryServiceFactory, +} from '@backstage/backend-defaults/discovery'; +import { httpRouterServiceFactory } from '@backstage/backend-defaults/httpRouter'; +import { lifecycleServiceFactory } from '@backstage/backend-defaults/lifecycle'; +import { loggerServiceFactory } from '@backstage/backend-defaults/logger'; +import { permissionsServiceFactory } from '@backstage/backend-defaults/permissions'; +import { rootHttpRouterServiceFactory } from '@backstage/backend-defaults/rootHttpRouter'; +import { rootLifecycleServiceFactory } from '@backstage/backend-defaults/rootLifecycle'; +import { schedulerServiceFactory } from '@backstage/backend-defaults/scheduler'; +import { urlReaderServiceFactory } from '@backstage/backend-defaults/urlReader'; +import { + AuthService, + BackstageCredentials, + BackstageUserInfo, + DiscoveryService, + HttpAuthService, IdentityService, LoggerService, + RootConfigService, ServiceFactory, ServiceRef, TokenManagerService, - AuthService, - DiscoveryService, - HttpAuthService, - BackstageCredentials, - BackstageUserInfo, UserInfoService, + coreServices, + createServiceFactory, } from '@backstage/backend-plugin-api'; -import { - cacheServiceFactory, - databaseServiceFactory, - httpRouterServiceFactory, - lifecycleServiceFactory, - loggerServiceFactory, - permissionsServiceFactory, - rootHttpRouterServiceFactory, - rootLifecycleServiceFactory, - schedulerServiceFactory, - urlReaderServiceFactory, - discoveryServiceFactory, - HostDiscovery, -} from '@backstage/backend-app-api'; import { ConfigReader } from '@backstage/config'; -import { JsonObject } from '@backstage/types'; -import { MockIdentityService } from './MockIdentityService'; -import { MockRootLoggerService } from './MockRootLoggerService'; -import { MockAuthService } from './MockAuthService'; -import { MockHttpAuthService } from './MockHttpAuthService'; -import { mockCredentials } from './mockCredentials'; -import { MockUserInfoService } from './MockUserInfoService'; import { eventsServiceFactory, eventsServiceRef, } from '@backstage/plugin-events-node'; +import { JsonObject } from '@backstage/types'; +import { MockAuthService } from './MockAuthService'; +import { MockHttpAuthService } from './MockHttpAuthService'; +import { MockIdentityService } from './MockIdentityService'; +import { MockRootLoggerService } from './MockRootLoggerService'; +import { MockUserInfoService } from './MockUserInfoService'; +import { mockCredentials } from './mockCredentials'; /** @internal */ function createLoggerMock() { diff --git a/yarn.lock b/yarn.lock index 08c4010281..00817bfb22 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3457,6 +3457,7 @@ __metadata: resolution: "@backstage/backend-app-api@workspace:packages/backend-app-api" dependencies: "@backstage/backend-common": "workspace:^" + "@backstage/backend-defaults": "workspace:^" "@backstage/backend-plugin-api": "workspace:^" "@backstage/backend-tasks": "workspace:^" "@backstage/backend-test-utils": "workspace:^" @@ -3611,6 +3612,7 @@ __metadata: "@backstage/backend-plugin-api": "workspace:^" "@backstage/backend-test-utils": "workspace:^" "@backstage/cli": "workspace:^" + "@backstage/cli-common": "workspace:^" "@backstage/config": "workspace:^" "@backstage/config-loader": "workspace:^" "@backstage/errors": "workspace:^" @@ -3623,35 +3625,58 @@ __metadata: "@google-cloud/storage": ^7.0.0 "@keyv/memcache": ^1.3.5 "@keyv/redis": ^2.5.3 + "@manypkg/get-packages": ^1.1.3 "@octokit/rest": ^19.0.3 "@opentelemetry/api": ^1.3.0 + "@types/cors": ^2.8.6 + "@types/express": ^4.17.6 + "@types/http-errors": ^2.0.0 + "@types/morgan": ^1.9.0 + "@types/node-forge": ^1.3.0 + "@types/stoppable": ^1.1.0 archiver: ^6.0.0 aws-sdk-client-mock: ^4.0.0 base64-stream: ^1.0.0 better-sqlite3: ^9.0.0 + compression: ^1.7.4 concat-stream: ^2.0.0 cookie: ^0.6.0 + cors: ^2.8.5 cron: ^3.0.0 express: ^4.17.1 + express-promise-router: ^4.1.0 fs-extra: ^11.2.0 git-url-parse: ^14.0.0 + helmet: ^6.0.0 + http-errors: ^2.0.0 isomorphic-git: ^1.23.0 jose: ^5.0.0 keyv: ^4.5.2 knex: ^3.0.0 lodash: ^4.17.21 + logform: ^2.3.2 luxon: ^3.0.0 minimatch: ^9.0.0 + minimist: ^1.2.5 + morgan: ^1.10.0 msw: ^1.0.0 mysql2: ^3.0.0 node-fetch: ^2.6.7 + node-forge: ^1.3.1 p-limit: ^3.1.0 + path-to-regexp: ^6.2.1 pg: ^8.11.3 pg-connection-string: ^2.3.0 raw-body: ^2.4.1 + selfsigned: ^2.0.0 + stoppable: ^1.1.0 + supertest: ^6.1.3 tar: ^6.1.12 + triple-beam: ^1.4.1 uuid: ^9.0.0 wait-for-expect: ^3.0.2 + winston: ^3.2.1 + winston-transport: ^4.5.0 yauzl: ^3.0.0 yn: ^4.0.0 zod: ^3.22.4 @@ -3771,6 +3796,7 @@ __metadata: resolution: "@backstage/backend-test-utils@workspace:packages/backend-test-utils" dependencies: "@backstage/backend-app-api": "workspace:^" + "@backstage/backend-defaults": "workspace:^" "@backstage/backend-plugin-api": "workspace:^" "@backstage/cli": "workspace:^" "@backstage/config": "workspace:^" From 18a40424cb8cffe890a49a546fd93ca10e2a3a96 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 18 Jun 2024 12:37:38 +0000 Subject: [PATCH 245/387] Version Packages --- .changeset/beige-eagles-cheat.md | 5 - .changeset/blue-hairs-marry.md | 5 - .changeset/brave-apples-move.md | 5 - .changeset/brave-icons-dream.md | 5 - .changeset/breezy-badgers-train.md | 5 - .changeset/breezy-planets-sparkle.md | 5 - .changeset/brown-bananas-talk.md | 5 - .changeset/brown-eagles-stare.md | 19 - .changeset/calm-cars-serve.md | 5 - .changeset/calm-files-sort.md | 5 - .changeset/calm-plums-wink.md | 5 - .changeset/chilled-planes-sniff.md | 5 - .changeset/chilled-suns-camp.md | 5 - .changeset/chilly-peaches-dress.md | 5 - .changeset/clever-kids-return.md | 13 - .changeset/clever-radios-yawn.md | 5 - .changeset/cold-comics-rush.md | 8 - .changeset/cold-seas-end.md | 5 - .changeset/create-app-1716302437.md | 5 - .changeset/create-app-1716903719.md | 5 - .changeset/cuddly-eggs-sin.md | 6 - .changeset/cuddly-jobs-kick.md | 5 - .changeset/cyan-jobs-visit.md | 5 - .changeset/cyan-paws-beg.md | 5 - .changeset/cyan-snails-peel.md | 12 - .changeset/dull-moose-cough.md | 5 - .changeset/early-donkeys-cheer.md | 5 - .changeset/early-eggs-press.md | 5 - .changeset/eighty-kings-dress.md | 5 - .changeset/eighty-yaks-switch.md | 5 - .changeset/empty-avocados-tease.md | 6 - .changeset/empty-spoons-tell.md | 46 - .changeset/empty-tables-ring.md | 8 - .changeset/fair-hats-sneeze.md | 87 - .changeset/famous-monkeys-count.md | 5 - .changeset/famous-roses-smell.md | 5 - .changeset/fifty-actors-buy.md | 5 - .changeset/forty-adults-roll.md | 5 - .changeset/forty-experts-live.md | 5 - .changeset/forty-rice-visit.md | 5 - .changeset/four-adults-mix.md | 5 - .changeset/friendly-keys-fold.md | 6 - .changeset/gentle-baboons-peel.md | 5 - .changeset/gentle-llamas-cross.md | 5 - .changeset/gold-teachers-wink.md | 5 - .changeset/gorgeous-spiders-fry.md | 5 - .changeset/great-clouds-hang.md | 5 - .changeset/great-cougars-guess.md | 5 - .changeset/green-apricots-invite.md | 5 - .changeset/honest-badgers-ring.md | 5 - .changeset/honest-pandas-chew.md | 5 - .changeset/hungry-cups-jog.md | 5 - .changeset/itchy-spoons-cry.md | 6 - .changeset/large-months-decide.md | 5 - .changeset/late-ants-impress.md | 11 - .changeset/late-badgers-rest.md | 5 - .changeset/late-falcons-sort.md | 7 - .changeset/late-students-live.md | 5 - .changeset/lemon-weeks-lay.md | 5 - .changeset/light-rice-argue.md | 5 - .changeset/little-cooks-approve.md | 5 - .changeset/long-llamas-push-atlassian.md | 5 - .changeset/long-llamas-push-bitbucket.md | 5 - .changeset/long-llamas-push-github.md | 5 - .changeset/long-llamas-push-gitlab.md | 5 - .changeset/long-llamas-push-google.md | 5 - .changeset/long-llamas-push-microsoft.md | 5 - .changeset/long-llamas-push-oauth2.md | 5 - .changeset/long-llamas-push-oidc.md | 5 - .changeset/long-llamas-push-okta.md | 5 - .changeset/long-llamas-push-pinniped.md | 5 - .changeset/long-llamas-push-vmware-cloud.md | 5 - .changeset/loud-pumpkins-bow.md | 5 - .changeset/lovely-hats-pay.md | 5 - .changeset/lucky-taxis-rule.md | 9 - .changeset/many-moles-sing.md | 5 - .changeset/many-windows-attack.md | 5 - .changeset/mean-laws-lay.md | 5 - .changeset/metal-apricots-heal.md | 39 - .changeset/mighty-rocks-join.md | 5 - .changeset/moody-buttons-hope.md | 5 - .changeset/nasty-doors-grab.md | 5 - .changeset/nasty-roses-flash.md | 12 - .changeset/neat-chairs-complain.md | 5 - .changeset/neat-rivers-share.md | 5 - .changeset/nervous-kings-change.md | 15 - .changeset/nervous-queens-fly.md | 5 - .changeset/new-chefs-rescue.md | 5 - .changeset/new-masks-occur.md | 136 - .changeset/new-numbers-hug.md | 5 - .changeset/nice-kangaroos-occur.md | 5 - .changeset/nice-pants-shave.md | 8 - .changeset/nine-hairs-kick.md | 5 - .changeset/nine-ties-type.md | 6 - .changeset/old-trees-check.md | 5 - .changeset/olive-mangos-tickle.md | 5 - .changeset/orange-beans-float.md | 5 - .changeset/orange-chefs-end.md | 5 - .changeset/orange-pianos-eat.md | 6 - .changeset/perfect-bikes-invite.md | 5 - .changeset/plenty-mirrors-laugh.md | 5 - .changeset/polite-emus-invent.md | 8 - .changeset/polite-otters-talk.md | 5 - .changeset/popular-boxes-press.md | 5 - .changeset/popular-carrots-love.md | 5 - .changeset/pre.json | 321 -- .changeset/pretty-berries-live.md | 6 - .changeset/pretty-spoons-knock.md | 6 - .changeset/proud-readers-move.md | 5 - .changeset/purple-mugs-beg.md | 5 - .changeset/rare-frogs-beam.md | 5 - .changeset/real-ghosts-return.md | 5 - .changeset/renovate-7906f3a.md | 11 - .changeset/renovate-c35e5aa.md | 5 - .changeset/rich-teachers-agree.md | 9 - .changeset/rude-buckets-invite.md | 5 - .changeset/rude-kings-press.md | 8 - .changeset/rude-snakes-clap.md | 7 - .changeset/selfish-pugs-lick.md | 5 - .changeset/serious-yaks-sit.md | 29 - .changeset/seven-geese-raise.md | 6 - .changeset/shaggy-jokes-promise.md | 5 - .changeset/shaggy-mugs-kiss.md | 5 - .changeset/shaggy-zebras-mate.md | 6 - .changeset/silver-scissors-fold.md | 5 - .changeset/six-llamas-give.md | 6 - .changeset/sixty-parrots-tan.md | 5 - .changeset/slimy-fans-raise.md | 5 - .changeset/slow-dolls-type.md | 5 - .changeset/smooth-gifts-nail.md | 6 - .changeset/soft-flies-live.md | 5 - .changeset/sour-colts-juggle.md | 5 - .changeset/spicy-brooms-hang.md | 6 - .changeset/spicy-camels-happen.md | 5 - .changeset/spicy-ears-raise.md | 7 - .changeset/spotty-plants-switch.md | 5 - .changeset/spotty-ravens-perform.md | 5 - .changeset/strong-moose-work.md | 5 - .changeset/stupid-tigers-bake.md | 7 - .changeset/swift-islands-leave.md | 5 - .changeset/tall-bananas-reflect.md | 5 - .changeset/tall-lies-fetch.md | 5 - .changeset/tall-pumas-teach.md | 5 - .changeset/tasty-forks-compare.md | 5 - .changeset/tasty-horses-breathe.md | 5 - .changeset/tender-seas-listen.md | 11 - .changeset/thirty-gorillas-train.md | 5 - .changeset/thirty-plums-shout.md | 5 - .changeset/three-lies-explode.md | 5 - .changeset/tiny-pandas-return.md | 5 - .changeset/tiny-peas-shop.md | 5 - .changeset/tricky-jobs-clap.md | 34 - .changeset/twelve-pumpkins-fold.md | 5 - .changeset/twenty-masks-dance.md | 5 - .changeset/twenty-seals-guess.md | 5 - .changeset/violet-ducks-care.md | 5 - .changeset/warm-bees-hope.md | 5 - .changeset/warm-mayflies-yell.md | 8 - .changeset/weak-gifts-occur.md | 10 - .changeset/wet-crabs-guess.md | 6 - .changeset/wicked-dingos-heal.md | 7 - .changeset/wild-coats-doubt.md | 5 - .changeset/wild-doors-cheat.md | 5 - .changeset/wild-ears-walk.md | 5 - .changeset/wild-eyes-grab.md | 14 - .changeset/wise-beers-doubt.md | 5 - .changeset/wise-vans-sin.md | 5 - .changeset/wise-wasps-look.md | 5 - .changeset/witty-avocados-pump.md | 5 - .changeset/witty-parents-give.md | 5 - .changeset/young-apes-thank.md | 5 - .changeset/young-camels-return.md | 5 - docs/releases/v1.28.0-changelog.md | 2982 +++++++++++++++++ package.json | 2 +- packages/app-defaults/CHANGELOG.md | 11 + packages/app-defaults/package.json | 2 +- packages/app-next-example-plugin/CHANGELOG.md | 8 + packages/app-next-example-plugin/package.json | 2 +- packages/app-next/CHANGELOG.md | 43 + packages/app-next/package.json | 2 +- packages/app/CHANGELOG.md | 41 + packages/app/package.json | 2 +- packages/backend-app-api/CHANGELOG.md | 69 + packages/backend-app-api/package.json | 2 +- packages/backend-common/CHANGELOG.md | 39 + packages/backend-common/package.json | 2 +- packages/backend-defaults/CHANGELOG.md | 41 + packages/backend-defaults/package.json | 2 +- .../CHANGELOG.md | 27 + .../package.json | 2 +- packages/backend-legacy/CHANGELOG.md | 42 + packages/backend-legacy/package.json | 2 +- packages/backend-openapi-utils/CHANGELOG.md | 8 + packages/backend-openapi-utils/package.json | 2 +- packages/backend-plugin-api/CHANGELOG.md | 47 + packages/backend-plugin-api/package.json | 2 +- packages/backend-tasks/CHANGELOG.md | 15 + packages/backend-tasks/package.json | 2 +- packages/backend-test-utils/CHANGELOG.md | 24 + packages/backend-test-utils/package.json | 2 +- packages/backend/CHANGELOG.md | 37 + packages/backend/package.json | 2 +- packages/cli-common/CHANGELOG.md | 6 + packages/cli-common/package.json | 2 +- packages/cli-node/CHANGELOG.md | 12 + packages/cli-node/package.json | 2 +- packages/cli/CHANGELOG.md | 24 + packages/cli/package.json | 2 +- packages/codemods/CHANGELOG.md | 7 + packages/codemods/package.json | 2 +- packages/config-loader/CHANGELOG.md | 10 + packages/config-loader/package.json | 2 +- packages/core-app-api/CHANGELOG.md | 36 + packages/core-app-api/package.json | 2 +- packages/core-compat-api/CHANGELOG.md | 10 + packages/core-compat-api/package.json | 2 +- packages/core-components/CHANGELOG.md | 18 + packages/core-components/package.json | 2 +- packages/core-plugin-api/CHANGELOG.md | 11 + packages/core-plugin-api/package.json | 2 +- packages/create-app/CHANGELOG.md | 14 + packages/create-app/package.json | 2 +- packages/dev-utils/CHANGELOG.md | 14 + packages/dev-utils/package.json | 2 +- packages/e2e-test/CHANGELOG.md | 9 + packages/e2e-test/package.json | 2 +- packages/frontend-app-api/CHANGELOG.md | 15 + packages/frontend-app-api/package.json | 2 +- packages/frontend-plugin-api/CHANGELOG.md | 10 + packages/frontend-plugin-api/package.json | 2 +- packages/frontend-test-utils/CHANGELOG.md | 10 + packages/frontend-test-utils/package.json | 2 +- packages/integration-react/CHANGELOG.md | 10 + packages/integration-react/package.json | 2 +- packages/integration/CHANGELOG.md | 26 + packages/integration/package.json | 2 +- packages/repo-tools/CHANGELOG.md | 13 + packages/repo-tools/package.json | 2 +- .../techdocs-cli-embedded-app/CHANGELOG.md | 19 + .../techdocs-cli-embedded-app/package.json | 2 +- packages/techdocs-cli/CHANGELOG.md | 12 + packages/techdocs-cli/package.json | 2 +- packages/test-utils/CHANGELOG.md | 13 + packages/test-utils/package.json | 2 +- packages/theme/CHANGELOG.md | 6 + packages/theme/package.json | 2 +- packages/yarn-plugin/CHANGELOG.md | 8 + packages/yarn-plugin/package.json | 2 +- .../CHANGELOG.md | 6 + .../package.json | 2 +- plugins/api-docs/CHANGELOG.md | 19 + plugins/api-docs/package.json | 2 +- plugins/app-backend/CHANGELOG.md | 19 + plugins/app-backend/package.json | 2 +- plugins/app-node/CHANGELOG.md | 9 + plugins/app-node/package.json | 2 +- plugins/app-visualizer/CHANGELOG.md | 10 + plugins/app-visualizer/package.json | 2 +- .../CHANGELOG.md | 14 + .../package.json | 2 +- .../CHANGELOG.md | 13 + .../package.json | 2 +- .../CHANGELOG.md | 12 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 13 + .../package.json | 2 +- .../CHANGELOG.md | 12 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 13 + .../package.json | 2 +- .../CHANGELOG.md | 12 + .../package.json | 2 +- .../CHANGELOG.md | 14 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 17 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 14 + .../package.json | 2 +- .../CHANGELOG.md | 12 + .../package.json | 2 +- .../CHANGELOG.md | 15 + .../package.json | 2 +- plugins/auth-backend/CHANGELOG.md | 38 + plugins/auth-backend/package.json | 2 +- plugins/auth-node/CHANGELOG.md | 24 + plugins/auth-node/package.json | 2 +- plugins/auth-react/CHANGELOG.md | 10 + plugins/auth-react/package.json | 2 +- plugins/bitbucket-cloud-common/CHANGELOG.md | 8 + plugins/bitbucket-cloud-common/package.json | 2 +- .../catalog-backend-module-aws/CHANGELOG.md | 19 + .../catalog-backend-module-aws/package.json | 2 +- .../catalog-backend-module-azure/CHANGELOG.md | 15 + .../catalog-backend-module-azure/package.json | 2 +- .../CHANGELOG.md | 15 + .../package.json | 2 +- .../CHANGELOG.md | 21 + .../package.json | 2 +- .../CHANGELOG.md | 16 + .../package.json | 2 +- .../catalog-backend-module-gcp/CHANGELOG.md | 15 + .../catalog-backend-module-gcp/package.json | 2 +- .../CHANGELOG.md | 15 + .../package.json | 2 +- .../CHANGELOG.md | 15 + .../package.json | 2 +- .../CHANGELOG.md | 20 + .../package.json | 2 +- .../CHANGELOG.md | 13 + .../package.json | 2 +- .../CHANGELOG.md | 19 + .../package.json | 2 +- .../CHANGELOG.md | 18 + .../package.json | 2 +- .../catalog-backend-module-ldap/CHANGELOG.md | 20 + .../catalog-backend-module-ldap/package.json | 2 +- .../CHANGELOG.md | 16 + .../package.json | 2 +- .../CHANGELOG.md | 17 + .../package.json | 2 +- .../CHANGELOG.md | 16 + .../package.json | 2 +- .../CHANGELOG.md | 13 + .../package.json | 2 +- .../CHANGELOG.md | 16 + .../package.json | 2 +- plugins/catalog-backend/CHANGELOG.md | 33 + plugins/catalog-backend/package.json | 2 +- plugins/catalog-common/CHANGELOG.md | 10 + plugins/catalog-common/package.json | 2 +- plugins/catalog-graph/CHANGELOG.md | 17 + plugins/catalog-graph/package.json | 2 +- plugins/catalog-import/CHANGELOG.md | 24 + plugins/catalog-import/package.json | 2 +- plugins/catalog-node/CHANGELOG.md | 16 + plugins/catalog-node/package.json | 2 +- plugins/catalog-react/CHANGELOG.md | 20 + plugins/catalog-react/package.json | 2 +- .../CHANGELOG.md | 8 + .../package.json | 2 +- .../catalog-unprocessed-entities/CHANGELOG.md | 11 + .../catalog-unprocessed-entities/package.json | 2 +- plugins/catalog/CHANGELOG.md | 38 + plugins/catalog/package.json | 2 +- plugins/config-schema/CHANGELOG.md | 11 + plugins/config-schema/package.json | 2 +- plugins/devtools-backend/CHANGELOG.md | 19 + plugins/devtools-backend/package.json | 2 +- plugins/devtools-common/CHANGELOG.md | 9 + plugins/devtools-common/package.json | 2 +- plugins/devtools/CHANGELOG.md | 14 + plugins/devtools/package.json | 2 +- .../CHANGELOG.md | 14 + .../package.json | 2 +- .../events-backend-module-azure/CHANGELOG.md | 10 + .../events-backend-module-azure/package.json | 2 +- .../CHANGELOG.md | 10 + .../package.json | 2 +- .../events-backend-module-gerrit/CHANGELOG.md | 10 + .../events-backend-module-gerrit/package.json | 2 +- .../events-backend-module-github/CHANGELOG.md | 11 + .../events-backend-module-github/package.json | 2 +- .../events-backend-module-gitlab/CHANGELOG.md | 11 + .../events-backend-module-gitlab/package.json | 2 +- .../events-backend-test-utils/CHANGELOG.md | 8 + .../events-backend-test-utils/package.json | 2 +- plugins/events-backend/CHANGELOG.md | 12 + plugins/events-backend/package.json | 2 +- plugins/events-node/CHANGELOG.md | 9 + plugins/events-node/package.json | 2 +- .../example-todo-list-backend/CHANGELOG.md | 10 + .../example-todo-list-backend/package.json | 2 +- plugins/example-todo-list-common/CHANGELOG.md | 7 + plugins/example-todo-list-common/package.json | 2 +- plugins/example-todo-list/CHANGELOG.md | 8 + plugins/example-todo-list/package.json | 2 +- plugins/home-react/CHANGELOG.md | 13 + plugins/home-react/package.json | 2 +- plugins/home/CHANGELOG.md | 22 + plugins/home/package.json | 2 +- plugins/kubernetes-backend/CHANGELOG.md | 26 + plugins/kubernetes-backend/package.json | 2 +- plugins/kubernetes-cluster/CHANGELOG.md | 13 + plugins/kubernetes-cluster/package.json | 2 +- plugins/kubernetes-common/CHANGELOG.md | 14 + plugins/kubernetes-common/package.json | 2 +- plugins/kubernetes-node/CHANGELOG.md | 11 + plugins/kubernetes-node/package.json | 2 +- plugins/kubernetes-react/CHANGELOG.md | 18 + plugins/kubernetes-react/package.json | 2 +- plugins/kubernetes/CHANGELOG.md | 14 + plugins/kubernetes/package.json | 2 +- .../CHANGELOG.md | 21 + .../package.json | 2 +- plugins/notifications-backend/CHANGELOG.md | 23 + plugins/notifications-backend/package.json | 2 +- plugins/notifications-common/CHANGELOG.md | 6 + plugins/notifications-common/package.json | 2 +- plugins/notifications-node/CHANGELOG.md | 18 + plugins/notifications-node/package.json | 2 +- plugins/notifications/CHANGELOG.md | 16 + plugins/notifications/package.json | 2 +- plugins/org-react/CHANGELOG.md | 12 + plugins/org-react/package.json | 2 +- plugins/org/CHANGELOG.md | 15 + plugins/org/package.json | 2 +- .../CHANGELOG.md | 12 + .../package.json | 2 +- plugins/permission-backend/CHANGELOG.md | 15 + plugins/permission-backend/package.json | 2 +- plugins/permission-common/CHANGELOG.md | 10 + plugins/permission-common/package.json | 2 +- plugins/permission-node/CHANGELOG.md | 15 + plugins/permission-node/package.json | 2 +- plugins/permission-react/CHANGELOG.md | 10 + plugins/permission-react/package.json | 2 +- plugins/proxy-backend/CHANGELOG.md | 58 + plugins/proxy-backend/package.json | 2 +- .../CHANGELOG.md | 14 + .../package.json | 2 +- .../CHANGELOG.md | 13 + .../package.json | 2 +- .../CHANGELOG.md | 13 + .../package.json | 2 +- .../CHANGELOG.md | 15 + .../package.json | 2 +- .../CHANGELOG.md | 14 + .../package.json | 2 +- .../CHANGELOG.md | 15 + .../package.json | 2 +- .../CHANGELOG.md | 13 + .../package.json | 2 +- .../CHANGELOG.md | 14 + .../package.json | 2 +- .../CHANGELOG.md | 19 + .../package.json | 2 +- .../CHANGELOG.md | 16 + .../package.json | 2 +- .../CHANGELOG.md | 13 + .../package.json | 2 +- .../CHANGELOG.md | 15 + .../package.json | 2 +- .../CHANGELOG.md | 13 + .../package.json | 2 +- .../CHANGELOG.md | 12 + .../package.json | 2 +- plugins/scaffolder-backend/CHANGELOG.md | 42 + plugins/scaffolder-backend/package.json | 2 +- plugins/scaffolder-common/CHANGELOG.md | 16 + plugins/scaffolder-common/package.json | 2 +- .../scaffolder-node-test-utils/CHANGELOG.md | 12 + .../scaffolder-node-test-utils/package.json | 2 +- plugins/scaffolder-node/CHANGELOG.md | 14 + plugins/scaffolder-node/package.json | 2 +- plugins/scaffolder-react/CHANGELOG.md | 2907 ++++++++++++++++ plugins/scaffolder-react/package.json | 2 +- plugins/scaffolder/CHANGELOG.md | 74 + plugins/scaffolder/package.json | 2 +- .../CHANGELOG.md | 20 + .../package.json | 2 +- .../CHANGELOG.md | 28 + .../package.json | 2 +- .../CHANGELOG.md | 14 + .../package.json | 2 +- plugins/search-backend-module-pg/CHANGELOG.md | 15 + plugins/search-backend-module-pg/package.json | 2 +- .../CHANGELOG.md | 14 + .../package.json | 2 +- .../CHANGELOG.md | 20 + .../package.json | 2 +- plugins/search-backend-node/CHANGELOG.md | 16 + plugins/search-backend-node/package.json | 2 +- plugins/search-backend/CHANGELOG.md | 22 + plugins/search-backend/package.json | 2 +- plugins/search-common/CHANGELOG.md | 9 + plugins/search-common/package.json | 2 +- plugins/search-react/CHANGELOG.md | 14 + plugins/search-react/package.json | 2 +- plugins/search/CHANGELOG.md | 18 + plugins/search/package.json | 2 +- plugins/signals-backend/CHANGELOG.md | 16 + plugins/signals-backend/package.json | 2 +- plugins/signals-node/CHANGELOG.md | 13 + plugins/signals-node/package.json | 2 +- plugins/signals-react/CHANGELOG.md | 9 + plugins/signals-react/package.json | 2 +- plugins/signals/CHANGELOG.md | 12 + plugins/signals/package.json | 2 +- .../techdocs-addons-test-utils/CHANGELOG.md | 16 + .../techdocs-addons-test-utils/package.json | 2 +- plugins/techdocs-backend/CHANGELOG.md | 22 + plugins/techdocs-backend/package.json | 2 +- .../CHANGELOG.md | 12 + .../package.json | 2 +- plugins/techdocs-node/CHANGELOG.md | 18 + plugins/techdocs-node/package.json | 2 +- plugins/techdocs-react/CHANGELOG.md | 12 + plugins/techdocs-react/package.json | 2 +- plugins/techdocs/CHANGELOG.md | 27 + plugins/techdocs/package.json | 2 +- plugins/user-settings-backend/CHANGELOG.md | 18 + plugins/user-settings-backend/package.json | 2 +- plugins/user-settings-common/CHANGELOG.md | 7 + plugins/user-settings-common/package.json | 2 +- plugins/user-settings/CHANGELOG.md | 19 + plugins/user-settings/package.json | 2 +- yarn.lock | 330 +- 519 files changed, 9008 insertions(+), 2096 deletions(-) delete mode 100644 .changeset/beige-eagles-cheat.md delete mode 100644 .changeset/blue-hairs-marry.md delete mode 100644 .changeset/brave-apples-move.md delete mode 100644 .changeset/brave-icons-dream.md delete mode 100644 .changeset/breezy-badgers-train.md delete mode 100644 .changeset/breezy-planets-sparkle.md delete mode 100644 .changeset/brown-bananas-talk.md delete mode 100644 .changeset/brown-eagles-stare.md delete mode 100644 .changeset/calm-cars-serve.md delete mode 100644 .changeset/calm-files-sort.md delete mode 100644 .changeset/calm-plums-wink.md delete mode 100644 .changeset/chilled-planes-sniff.md delete mode 100644 .changeset/chilled-suns-camp.md delete mode 100644 .changeset/chilly-peaches-dress.md delete mode 100644 .changeset/clever-kids-return.md delete mode 100644 .changeset/clever-radios-yawn.md delete mode 100644 .changeset/cold-comics-rush.md delete mode 100644 .changeset/cold-seas-end.md delete mode 100644 .changeset/create-app-1716302437.md delete mode 100644 .changeset/create-app-1716903719.md delete mode 100644 .changeset/cuddly-eggs-sin.md delete mode 100644 .changeset/cuddly-jobs-kick.md delete mode 100644 .changeset/cyan-jobs-visit.md delete mode 100644 .changeset/cyan-paws-beg.md delete mode 100644 .changeset/cyan-snails-peel.md delete mode 100644 .changeset/dull-moose-cough.md delete mode 100644 .changeset/early-donkeys-cheer.md delete mode 100644 .changeset/early-eggs-press.md delete mode 100644 .changeset/eighty-kings-dress.md delete mode 100644 .changeset/eighty-yaks-switch.md delete mode 100644 .changeset/empty-avocados-tease.md delete mode 100644 .changeset/empty-spoons-tell.md delete mode 100644 .changeset/empty-tables-ring.md delete mode 100644 .changeset/fair-hats-sneeze.md delete mode 100644 .changeset/famous-monkeys-count.md delete mode 100644 .changeset/famous-roses-smell.md delete mode 100644 .changeset/fifty-actors-buy.md delete mode 100644 .changeset/forty-adults-roll.md delete mode 100644 .changeset/forty-experts-live.md delete mode 100644 .changeset/forty-rice-visit.md delete mode 100644 .changeset/four-adults-mix.md delete mode 100644 .changeset/friendly-keys-fold.md delete mode 100644 .changeset/gentle-baboons-peel.md delete mode 100644 .changeset/gentle-llamas-cross.md delete mode 100644 .changeset/gold-teachers-wink.md delete mode 100644 .changeset/gorgeous-spiders-fry.md delete mode 100644 .changeset/great-clouds-hang.md delete mode 100644 .changeset/great-cougars-guess.md delete mode 100644 .changeset/green-apricots-invite.md delete mode 100644 .changeset/honest-badgers-ring.md delete mode 100644 .changeset/honest-pandas-chew.md delete mode 100644 .changeset/hungry-cups-jog.md delete mode 100644 .changeset/itchy-spoons-cry.md delete mode 100644 .changeset/large-months-decide.md delete mode 100644 .changeset/late-ants-impress.md delete mode 100644 .changeset/late-badgers-rest.md delete mode 100644 .changeset/late-falcons-sort.md delete mode 100644 .changeset/late-students-live.md delete mode 100644 .changeset/lemon-weeks-lay.md delete mode 100644 .changeset/light-rice-argue.md delete mode 100644 .changeset/little-cooks-approve.md delete mode 100644 .changeset/long-llamas-push-atlassian.md delete mode 100644 .changeset/long-llamas-push-bitbucket.md delete mode 100644 .changeset/long-llamas-push-github.md delete mode 100644 .changeset/long-llamas-push-gitlab.md delete mode 100644 .changeset/long-llamas-push-google.md delete mode 100644 .changeset/long-llamas-push-microsoft.md delete mode 100644 .changeset/long-llamas-push-oauth2.md delete mode 100644 .changeset/long-llamas-push-oidc.md delete mode 100644 .changeset/long-llamas-push-okta.md delete mode 100644 .changeset/long-llamas-push-pinniped.md delete mode 100644 .changeset/long-llamas-push-vmware-cloud.md delete mode 100644 .changeset/loud-pumpkins-bow.md delete mode 100644 .changeset/lovely-hats-pay.md delete mode 100644 .changeset/lucky-taxis-rule.md delete mode 100644 .changeset/many-moles-sing.md delete mode 100644 .changeset/many-windows-attack.md delete mode 100644 .changeset/mean-laws-lay.md delete mode 100644 .changeset/metal-apricots-heal.md delete mode 100644 .changeset/mighty-rocks-join.md delete mode 100644 .changeset/moody-buttons-hope.md delete mode 100644 .changeset/nasty-doors-grab.md delete mode 100644 .changeset/nasty-roses-flash.md delete mode 100644 .changeset/neat-chairs-complain.md delete mode 100644 .changeset/neat-rivers-share.md delete mode 100644 .changeset/nervous-kings-change.md delete mode 100644 .changeset/nervous-queens-fly.md delete mode 100644 .changeset/new-chefs-rescue.md delete mode 100644 .changeset/new-masks-occur.md delete mode 100644 .changeset/new-numbers-hug.md delete mode 100644 .changeset/nice-kangaroos-occur.md delete mode 100644 .changeset/nice-pants-shave.md delete mode 100644 .changeset/nine-hairs-kick.md delete mode 100644 .changeset/nine-ties-type.md delete mode 100644 .changeset/old-trees-check.md delete mode 100644 .changeset/olive-mangos-tickle.md delete mode 100644 .changeset/orange-beans-float.md delete mode 100644 .changeset/orange-chefs-end.md delete mode 100644 .changeset/orange-pianos-eat.md delete mode 100644 .changeset/perfect-bikes-invite.md delete mode 100644 .changeset/plenty-mirrors-laugh.md delete mode 100644 .changeset/polite-emus-invent.md delete mode 100644 .changeset/polite-otters-talk.md delete mode 100644 .changeset/popular-boxes-press.md delete mode 100644 .changeset/popular-carrots-love.md delete mode 100644 .changeset/pre.json delete mode 100644 .changeset/pretty-berries-live.md delete mode 100644 .changeset/pretty-spoons-knock.md delete mode 100644 .changeset/proud-readers-move.md delete mode 100644 .changeset/purple-mugs-beg.md delete mode 100644 .changeset/rare-frogs-beam.md delete mode 100644 .changeset/real-ghosts-return.md delete mode 100644 .changeset/renovate-7906f3a.md delete mode 100644 .changeset/renovate-c35e5aa.md delete mode 100644 .changeset/rich-teachers-agree.md delete mode 100644 .changeset/rude-buckets-invite.md delete mode 100644 .changeset/rude-kings-press.md delete mode 100644 .changeset/rude-snakes-clap.md delete mode 100644 .changeset/selfish-pugs-lick.md delete mode 100644 .changeset/serious-yaks-sit.md delete mode 100644 .changeset/seven-geese-raise.md delete mode 100644 .changeset/shaggy-jokes-promise.md delete mode 100644 .changeset/shaggy-mugs-kiss.md delete mode 100644 .changeset/shaggy-zebras-mate.md delete mode 100644 .changeset/silver-scissors-fold.md delete mode 100644 .changeset/six-llamas-give.md delete mode 100644 .changeset/sixty-parrots-tan.md delete mode 100644 .changeset/slimy-fans-raise.md delete mode 100644 .changeset/slow-dolls-type.md delete mode 100644 .changeset/smooth-gifts-nail.md delete mode 100644 .changeset/soft-flies-live.md delete mode 100644 .changeset/sour-colts-juggle.md delete mode 100644 .changeset/spicy-brooms-hang.md delete mode 100644 .changeset/spicy-camels-happen.md delete mode 100644 .changeset/spicy-ears-raise.md delete mode 100644 .changeset/spotty-plants-switch.md delete mode 100644 .changeset/spotty-ravens-perform.md delete mode 100644 .changeset/strong-moose-work.md delete mode 100644 .changeset/stupid-tigers-bake.md delete mode 100644 .changeset/swift-islands-leave.md delete mode 100644 .changeset/tall-bananas-reflect.md delete mode 100644 .changeset/tall-lies-fetch.md delete mode 100644 .changeset/tall-pumas-teach.md delete mode 100644 .changeset/tasty-forks-compare.md delete mode 100644 .changeset/tasty-horses-breathe.md delete mode 100644 .changeset/tender-seas-listen.md delete mode 100644 .changeset/thirty-gorillas-train.md delete mode 100644 .changeset/thirty-plums-shout.md delete mode 100644 .changeset/three-lies-explode.md delete mode 100644 .changeset/tiny-pandas-return.md delete mode 100644 .changeset/tiny-peas-shop.md delete mode 100644 .changeset/tricky-jobs-clap.md delete mode 100644 .changeset/twelve-pumpkins-fold.md delete mode 100644 .changeset/twenty-masks-dance.md delete mode 100644 .changeset/twenty-seals-guess.md delete mode 100644 .changeset/violet-ducks-care.md delete mode 100644 .changeset/warm-bees-hope.md delete mode 100644 .changeset/warm-mayflies-yell.md delete mode 100644 .changeset/weak-gifts-occur.md delete mode 100644 .changeset/wet-crabs-guess.md delete mode 100644 .changeset/wicked-dingos-heal.md delete mode 100644 .changeset/wild-coats-doubt.md delete mode 100644 .changeset/wild-doors-cheat.md delete mode 100644 .changeset/wild-ears-walk.md delete mode 100644 .changeset/wild-eyes-grab.md delete mode 100644 .changeset/wise-beers-doubt.md delete mode 100644 .changeset/wise-vans-sin.md delete mode 100644 .changeset/wise-wasps-look.md delete mode 100644 .changeset/witty-avocados-pump.md delete mode 100644 .changeset/witty-parents-give.md delete mode 100644 .changeset/young-apes-thank.md delete mode 100644 .changeset/young-camels-return.md create mode 100644 docs/releases/v1.28.0-changelog.md diff --git a/.changeset/beige-eagles-cheat.md b/.changeset/beige-eagles-cheat.md deleted file mode 100644 index 5b5081d2ee..0000000000 --- a/.changeset/beige-eagles-cheat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli-node': patch ---- - -Updated doc link. diff --git a/.changeset/blue-hairs-marry.md b/.changeset/blue-hairs-marry.md deleted file mode 100644 index 2ca1a3d47e..0000000000 --- a/.changeset/blue-hairs-marry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli-node': patch ---- - -Added new plugin metadata fields to `BackstagePackageJson` type. diff --git a/.changeset/brave-apples-move.md b/.changeset/brave-apples-move.md deleted file mode 100644 index 7a1fa86a56..0000000000 --- a/.changeset/brave-apples-move.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-app-api': patch ---- - -Fixed a potential crash when passing an object with a `null` prototype as log meta. diff --git a/.changeset/brave-icons-dream.md b/.changeset/brave-icons-dream.md deleted file mode 100644 index 0d73c71f47..0000000000 --- a/.changeset/brave-icons-dream.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-common': patch ---- - -Import utility functions from `backend-defaults` instead of `backend-app-api` diff --git a/.changeset/breezy-badgers-train.md b/.changeset/breezy-badgers-train.md deleted file mode 100644 index 8f747b8602..0000000000 --- a/.changeset/breezy-badgers-train.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli-node': patch ---- - -Upgraded @yarnpkg/parsers to stable 3.0 diff --git a/.changeset/breezy-planets-sparkle.md b/.changeset/breezy-planets-sparkle.md deleted file mode 100644 index eea9e5c6bf..0000000000 --- a/.changeset/breezy-planets-sparkle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-auth-backend-module-onelogin-provider': minor ---- - -Separate out the OneLogin provider into its own module diff --git a/.changeset/brown-bananas-talk.md b/.changeset/brown-bananas-talk.md deleted file mode 100644 index 71020b787a..0000000000 --- a/.changeset/brown-bananas-talk.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/core-components': patch ---- - -Having tooltip inherit font size for consistency in catalog table columns diff --git a/.changeset/brown-eagles-stare.md b/.changeset/brown-eagles-stare.md deleted file mode 100644 index a7bf5f8552..0000000000 --- a/.changeset/brown-eagles-stare.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -'@backstage/backend-plugin-api': patch ---- - -**DEPRECATION**: You should no longer do a function call on backend features when adding them to backends. The support for doing that is deprecated, and you should remove all trailing `()` parentheses after plugins and modules where you add them to your backend or test backends (e.g. when using `startTestBackend`). - -The background for this is that `createBackendPlugin` and `createBackendModule` function now effectively return a `BackendFeature` rather than a `() => BackendFeature`. This is part of the cleanup efforts for New Backend System 1.0. In the short run this is non-breaking because the feature type has been given a callback signature that returns itself. But we strongly recommend that you remove all now-redundant calls made to feature objects, because that callback signature will be removed in a future release. - -Service factories are still callbacks at this point. - -Example change: - -```diff - await startTestBackend({ - features: [ - eventsServiceFactory(), // service - stays unchanged -- catalogModuleBitbucketCloudEntityProvider(), // module - remove parentheses -+ catalogModuleBitbucketCloudEntityProvider, -``` diff --git a/.changeset/calm-cars-serve.md b/.changeset/calm-cars-serve.md deleted file mode 100644 index 5df2a18cd4..0000000000 --- a/.changeset/calm-cars-serve.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-tasks': patch ---- - -Marked all exports as deprecated and pointed at `@backstage/backend-plugin-api` and `@backstage/backend-defaults` diff --git a/.changeset/calm-files-sort.md b/.changeset/calm-files-sort.md deleted file mode 100644 index a487c00eb4..0000000000 --- a/.changeset/calm-files-sort.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-plugin-api': patch ---- - -In tests, return `null` rather than throwing an error when trying to get the `ExtensionPoint.T` property, so that tests asserting the property are not easily broken. diff --git a/.changeset/calm-plums-wink.md b/.changeset/calm-plums-wink.md deleted file mode 100644 index edb991f616..0000000000 --- a/.changeset/calm-plums-wink.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-techdocs': patch ---- - -mkdocs-material have updated their CSS variable template, and a few are unset in Backstage. This patch adds the missing variables to ensure coverage. diff --git a/.changeset/chilled-planes-sniff.md b/.changeset/chilled-planes-sniff.md deleted file mode 100644 index e4084ea561..0000000000 --- a/.changeset/chilled-planes-sniff.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-api-docs': patch ---- - -The `registerComponent` external route will now by default bind to the catalog import page if it is available. diff --git a/.changeset/chilled-suns-camp.md b/.changeset/chilled-suns-camp.md deleted file mode 100644 index 1ab603abfa..0000000000 --- a/.changeset/chilled-suns-camp.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-common': patch ---- - -Removed accents on deprecation note diff --git a/.changeset/chilly-peaches-dress.md b/.changeset/chilly-peaches-dress.md deleted file mode 100644 index e97588c5d8..0000000000 --- a/.changeset/chilly-peaches-dress.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-app-api': patch ---- - -Deprecated `authServiceFactory`, `httpAuthServiceFactory`, and `userInfoServiceFactory`. Please import them from `@backstage/backend-defaults/auth`, `@backstage/backend-defaults/httpAuth`, and `@backstage/backend-defaults/userInfo` respectively instead. diff --git a/.changeset/clever-kids-return.md b/.changeset/clever-kids-return.md deleted file mode 100644 index a6cab79f2b..0000000000 --- a/.changeset/clever-kids-return.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -'@backstage/plugin-auth-node': patch ---- - -Updated scope management for OAuth providers, where the `createOAuthAuthenticator` now accepts a new collection of `scopes` options: - -- `scopes.persist` - Whether scopes should be persisted, replaces the `shouldPersistScopes` option. -- `scopes.required` - A list of required scopes that will always be requested. -- `scopes.transform` - A function that can be used to transform the scopes before they are requested. - -The `createOAuthProviderFactory` has also received a new `additionalScopes` option, and will also read `additionalScopes` from the auth provider configuration. Both of these can be used to add additional scopes that should always be requested. - -A significant change under the hood that this new scope management brings is that providers that persist scopes will now always merge the already granted scopes with the requested ones. The previous behavior was that the full authorization flow would not include existing scopes, while the refresh flow would only include the existing scopes. diff --git a/.changeset/clever-radios-yawn.md b/.changeset/clever-radios-yawn.md deleted file mode 100644 index e5600183f5..0000000000 --- a/.changeset/clever-radios-yawn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-api-docs': patch ---- - -Make sure that the toggle button state is properly reflected in API cards diff --git a/.changeset/cold-comics-rush.md b/.changeset/cold-comics-rush.md deleted file mode 100644 index 4bd9a4de22..0000000000 --- a/.changeset/cold-comics-rush.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@backstage/backend-app-api': patch -'@backstage/plugin-auth-backend': patch ---- - -Limited user tokens will no longer include the `ent` field in its payload. Ownership claims will now be fetched from the user info service. - -NOTE: Limited tokens issued prior to this change will no longer be valid. Users may have to clear their browser cookies in order to refresh their auth tokens. diff --git a/.changeset/cold-seas-end.md b/.changeset/cold-seas-end.md deleted file mode 100644 index 96fa048fbd..0000000000 --- a/.changeset/cold-seas-end.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-common': patch ---- - -Updated configuration schema to include the `useRedisSets` cache config option. diff --git a/.changeset/create-app-1716302437.md b/.changeset/create-app-1716302437.md deleted file mode 100644 index b50d431d4b..0000000000 --- a/.changeset/create-app-1716302437.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/create-app': patch ---- - -Bumped create-app version. diff --git a/.changeset/create-app-1716903719.md b/.changeset/create-app-1716903719.md deleted file mode 100644 index b50d431d4b..0000000000 --- a/.changeset/create-app-1716903719.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/create-app': patch ---- - -Bumped create-app version. diff --git a/.changeset/cuddly-eggs-sin.md b/.changeset/cuddly-eggs-sin.md deleted file mode 100644 index bfe7de9680..0000000000 --- a/.changeset/cuddly-eggs-sin.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/plugin-techdocs-backend': patch -'@backstage/plugin-techdocs-node': patch ---- - -Allow defining custom build log transport for techdocs builder diff --git a/.changeset/cuddly-jobs-kick.md b/.changeset/cuddly-jobs-kick.md deleted file mode 100644 index aa62efb88b..0000000000 --- a/.changeset/cuddly-jobs-kick.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/core-compat-api': patch ---- - -Add support for forwarding default target from legacy external route refs. diff --git a/.changeset/cyan-jobs-visit.md b/.changeset/cyan-jobs-visit.md deleted file mode 100644 index ccc8c90adf..0000000000 --- a/.changeset/cyan-jobs-visit.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-test-utils': minor ---- - -Added `TestCaches` that functions just like `TestDatabases` diff --git a/.changeset/cyan-paws-beg.md b/.changeset/cyan-paws-beg.md deleted file mode 100644 index 87c2b746a4..0000000000 --- a/.changeset/cyan-paws-beg.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend-module-github': patch ---- - -Added handling for dry run to githubPullRequest and githubWebhook and added tests for this functionality diff --git a/.changeset/cyan-snails-peel.md b/.changeset/cyan-snails-peel.md deleted file mode 100644 index 4da79258fb..0000000000 --- a/.changeset/cyan-snails-peel.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -'@backstage/plugin-user-settings-backend': patch -'@backstage/plugin-devtools-backend': patch -'@backstage/plugin-techdocs-backend': patch -'@backstage/plugin-catalog-backend': patch -'@backstage/plugin-search-backend': patch -'@backstage/plugin-proxy-backend': patch -'@backstage/plugin-auth-backend': patch -'@backstage/plugin-app-backend': patch ---- - -Updated local development setup. diff --git a/.changeset/dull-moose-cough.md b/.changeset/dull-moose-cough.md deleted file mode 100644 index 4de43fb35f..0000000000 --- a/.changeset/dull-moose-cough.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/integration': patch ---- - -Updated function for getHarnessEditContentsUrl diff --git a/.changeset/early-donkeys-cheer.md b/.changeset/early-donkeys-cheer.md deleted file mode 100644 index f5f4623acf..0000000000 --- a/.changeset/early-donkeys-cheer.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-common': patch ---- - -The `database` types, helpers and implementations were moved to the package `@backstage/backend-defaults` and deprecated from the package `@backstage/backend-commons`. diff --git a/.changeset/early-eggs-press.md b/.changeset/early-eggs-press.md deleted file mode 100644 index ff6658f7ca..0000000000 --- a/.changeset/early-eggs-press.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-common': patch ---- - -The `TokenManager` has been deprecated in preparation for the [stable release of the New Backend System](https://github.com/backstage/backstage/issues/24493). Please [migrate](https://backstage.io/docs/tutorials/auth-service-migration) to the new `coreServices.auth`, `coreServices.httpAuth`, and `coreServices.userInfo` services as needed instead. diff --git a/.changeset/eighty-kings-dress.md b/.changeset/eighty-kings-dress.md deleted file mode 100644 index 52aab627ab..0000000000 --- a/.changeset/eighty-kings-dress.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-common': patch ---- - -In preparation to the new backend system stable release, the `isDatabaseConflictError` helper have been moved to the `@backstage/backend-plugin-api` package and deprecated from `@backstage/backend-common`. diff --git a/.changeset/eighty-yaks-switch.md b/.changeset/eighty-yaks-switch.md deleted file mode 100644 index 30e3374d70..0000000000 --- a/.changeset/eighty-yaks-switch.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -Fix readme for new plugins created using cli diff --git a/.changeset/empty-avocados-tease.md b/.changeset/empty-avocados-tease.md deleted file mode 100644 index f202af2b82..0000000000 --- a/.changeset/empty-avocados-tease.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/plugin-scaffolder': patch -'@backstage/plugin-techdocs': patch ---- - -Internal updates to allow reusing Backstage's `fetchApi` implementation for event source requests. This allows you to for example, override the `Authorization` header. diff --git a/.changeset/empty-spoons-tell.md b/.changeset/empty-spoons-tell.md deleted file mode 100644 index 44e3dceb6f..0000000000 --- a/.changeset/empty-spoons-tell.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -'@backstage/plugin-proxy-backend': minor ---- - -**BREAKING**: The proxy backend plugin is now protected by Backstage auth, by -default. Unless specifically configured (see below), all proxy endpoints will -reject requests immediately unless a valid Backstage user or service token is -passed along with the request. This aligns the proxy with how other Backstage -backends behave out of the box, and serves to protect your upstreams from -unauthorized access. - -A proxy configuration section can now look as follows: - -```yaml -proxy: - endpoints: - '/pagerduty': - target: https://api.pagerduty.com - credentials: require # NEW! - headers: - Authorization: Token token=${PAGERDUTY_TOKEN} -``` - -There are three possible `credentials` settings at this point: - -- `require`: Callers must provide Backstage user or service credentials with - each request. The credentials are not forwarded to the proxy target. -- `forward`: Callers must provide Backstage user or service credentials with - each request, and those credentials are forwarded to the proxy target. -- `dangerously-allow-unauthenticated`: No Backstage credentials are required to - access this proxy target. The target can still apply its own credentials - checks, but the proxy will not help block non-Backstage-blessed callers. If - you also add `allowedHeaders: ['Authorization']` to an endpoint configuration, - then the Backstage token (if provided) WILL be forwarded. - -The value `dangerously-allow-unauthenticated` was the old default. - -The value `require` is the new default, so requests that were previously -permitted may now start resulting in `401 Unauthorized` responses. If you have -`backend.auth.dangerouslyDisableDefaultAuthPolicy` set to `true`, this does not -apply; the proxy will behave as if all endpoints were set to -`dangerously-allow-unauthenticated`. - -If you have proxy endpoints that require unauthenticated access still, please -add `credentials: dangerously-allow-unauthenticated` to their declarations in -your app-config. diff --git a/.changeset/empty-tables-ring.md b/.changeset/empty-tables-ring.md deleted file mode 100644 index c83a987228..0000000000 --- a/.changeset/empty-tables-ring.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@backstage/plugin-kubernetes-react': minor -'@backstage/plugin-catalog-import': minor -'@backstage/plugin-kubernetes': patch -'@backstage/plugin-search': patch ---- - -Migrate from identityApi to fetchApi in frontend plugins. diff --git a/.changeset/fair-hats-sneeze.md b/.changeset/fair-hats-sneeze.md deleted file mode 100644 index 200b9b75e1..0000000000 --- a/.changeset/fair-hats-sneeze.md +++ /dev/null @@ -1,87 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend-module-confluence-to-markdown': patch -'@backstage/plugin-auth-backend-module-cloudflare-access-provider': patch -'@backstage/plugin-catalog-backend-module-scaffolder-entity-model': patch -'@backstage/plugin-search-backend-module-stack-overflow-collator': patch -'@backstage/plugin-catalog-backend-module-incremental-ingestion': patch -'@backstage/plugin-auth-backend-module-azure-easyauth-provider': patch -'@backstage/plugin-permission-backend-module-allow-all-policy': patch -'@backstage/plugin-scaffolder-backend-module-bitbucket-server': patch -'@backstage/plugin-auth-backend-module-oauth2-proxy-provider': patch -'@backstage/plugin-auth-backend-module-vmware-cloud-provider': patch -'@backstage/plugin-scaffolder-backend-module-bitbucket-cloud': patch -'@backstage/plugin-catalog-backend-module-backstage-openapi': patch -'@backstage/plugin-catalog-backend-module-bitbucket-server': patch -'@backstage/plugin-scaffolder-backend-module-notifications': patch -'@backstage/plugin-auth-backend-module-atlassian-provider': patch -'@backstage/plugin-auth-backend-module-bitbucket-provider': patch -'@backstage/plugin-auth-backend-module-microsoft-provider': patch -'@backstage/plugin-catalog-backend-module-bitbucket-cloud': patch -'@backstage/plugin-scaffolder-backend-module-cookiecutter': patch -'@backstage/plugin-auth-backend-module-onelogin-provider': patch -'@backstage/plugin-auth-backend-module-pinniped-provider': patch -'@backstage/plugin-events-backend-module-bitbucket-cloud': patch -'@backstage/plugin-auth-backend-module-aws-alb-provider': patch -'@backstage/plugin-auth-backend-module-gcp-iap-provider': patch -'@backstage/plugin-auth-backend-module-github-provider': patch -'@backstage/plugin-auth-backend-module-gitlab-provider': patch -'@backstage/plugin-auth-backend-module-google-provider': patch -'@backstage/plugin-auth-backend-module-oauth2-provider': patch -'@backstage/plugin-scaffolder-backend-module-bitbucket': patch -'@backstage/plugin-search-backend-module-elasticsearch': patch -'@backstage/plugin-auth-backend-module-guest-provider': patch -'@backstage/plugin-catalog-backend-module-unprocessed': patch -'@backstage/plugin-notifications-backend-module-email': patch -'@backstage/plugin-auth-backend-module-oidc-provider': patch -'@backstage/plugin-auth-backend-module-okta-provider': patch -'@backstage/plugin-catalog-backend-module-github-org': patch -'@backstage/plugin-catalog-backend-module-gitlab-org': patch -'@backstage/backend-dynamic-feature-service': patch -'@backstage/plugin-scaffolder-backend-module-gerrit': patch -'@backstage/plugin-scaffolder-backend-module-github': patch -'@backstage/plugin-scaffolder-backend-module-gitlab': patch -'@backstage/plugin-scaffolder-backend-module-sentry': patch -'@backstage/plugin-scaffolder-backend-module-yeoman': patch -'@backstage/plugin-catalog-backend-module-puppetdb': patch -'@backstage/plugin-scaffolder-backend-module-azure': patch -'@backstage/plugin-scaffolder-backend-module-gitea': patch -'@backstage/plugin-scaffolder-backend-module-rails': patch -'@backstage/plugin-catalog-backend-module-msgraph': patch -'@backstage/plugin-catalog-backend-module-openapi': patch -'@backstage/plugin-search-backend-module-techdocs': patch -'@backstage/plugin-catalog-backend-module-gerrit': patch -'@backstage/plugin-catalog-backend-module-github': patch -'@backstage/plugin-catalog-backend-module-gitlab': patch -'@backstage/plugin-events-backend-module-aws-sqs': patch -'@backstage/plugin-search-backend-module-catalog': patch -'@backstage/plugin-search-backend-module-explore': patch -'@backstage/plugin-catalog-backend-module-azure': patch -'@backstage/plugin-events-backend-module-gerrit': patch -'@backstage/plugin-events-backend-module-github': patch -'@backstage/plugin-events-backend-module-gitlab': patch -'@backstage/plugin-catalog-backend-module-ldap': patch -'@backstage/plugin-events-backend-module-azure': patch -'@backstage/plugin-catalog-backend-module-aws': patch -'@backstage/plugin-catalog-backend-module-gcp': patch -'@backstage/plugin-search-backend-module-pg': patch -'@backstage/plugin-notifications-backend': patch -'@backstage/plugin-user-settings-backend': patch -'@backstage/backend-test-utils': patch -'@backstage/plugin-kubernetes-backend': patch -'@backstage/plugin-permission-backend': patch -'@backstage/plugin-scaffolder-backend': patch -'@backstage/backend-app-api': patch -'@backstage/plugin-devtools-backend': patch -'@backstage/plugin-techdocs-backend': patch -'@backstage/backend-common': patch -'@backstage/plugin-catalog-backend': patch -'@backstage/plugin-signals-backend': patch -'@backstage/plugin-events-backend': patch -'@backstage/plugin-search-backend': patch -'@backstage/plugin-proxy-backend': patch -'@backstage/plugin-auth-backend': patch -'@backstage/plugin-catalog-node': patch -'@backstage/plugin-app-backend': patch ---- - -Internal refactor to handle `BackendFeature` contract change. diff --git a/.changeset/famous-monkeys-count.md b/.changeset/famous-monkeys-count.md deleted file mode 100644 index c5151b38c3..0000000000 --- a/.changeset/famous-monkeys-count.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-app-api': patch ---- - -Add support for JWKS tokens in ExternalTokenHandler. diff --git a/.changeset/famous-roses-smell.md b/.changeset/famous-roses-smell.md deleted file mode 100644 index a091a6f32e..0000000000 --- a/.changeset/famous-roses-smell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-techdocs-node': patch ---- - -`TechdocsGenerator` won't require a `containerRunner` option anymore for generating TechDocs in docker. diff --git a/.changeset/fifty-actors-buy.md b/.changeset/fifty-actors-buy.md deleted file mode 100644 index 40e6f44154..0000000000 --- a/.changeset/fifty-actors-buy.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -Add `peerDependencies` to `devDependencies` in `package.json.hbs` templates. diff --git a/.changeset/forty-adults-roll.md b/.changeset/forty-adults-roll.md deleted file mode 100644 index 50dd60da9e..0000000000 --- a/.changeset/forty-adults-roll.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-tasks': patch ---- - -Updated the `TaskScheduleDefinitionConfig` deprecated comment to point to `SchedulerServiceTaskScheduleDefinitionConfig` diff --git a/.changeset/forty-experts-live.md b/.changeset/forty-experts-live.md deleted file mode 100644 index 11fc3b688f..0000000000 --- a/.changeset/forty-experts-live.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-graph': patch ---- - -Add function to `EntityRelationsGraph` filter that excludes entities from graph diff --git a/.changeset/forty-rice-visit.md b/.changeset/forty-rice-visit.md deleted file mode 100644 index a7da4b5a1e..0000000000 --- a/.changeset/forty-rice-visit.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-common': patch ---- - -Move `cache` implementation and types to the `@backstage/backend-defaults` package. diff --git a/.changeset/four-adults-mix.md b/.changeset/four-adults-mix.md deleted file mode 100644 index 5013166dc6..0000000000 --- a/.changeset/four-adults-mix.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-notifications': patch ---- - -Do not always show scrollbars in notification description diff --git a/.changeset/friendly-keys-fold.md b/.changeset/friendly-keys-fold.md deleted file mode 100644 index 218abe4efe..0000000000 --- a/.changeset/friendly-keys-fold.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/backend-plugin-api': patch -'@backstage/backend-app-api': patch ---- - -Added an optional `accessRestrictions` to external access service tokens and service principals in general, such that you can limit their access to certain plugins or permissions. diff --git a/.changeset/gentle-baboons-peel.md b/.changeset/gentle-baboons-peel.md deleted file mode 100644 index b51ad77283..0000000000 --- a/.changeset/gentle-baboons-peel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-techdocs': patch ---- - -`TechDocsIndexPage` now accepts an optional `ownerPickerMode` for toggling the behavior of the `EntityOwnerPicker`, exposing a new mode `` particularly suitable for larger catalogs. In this new mode, `EntityOwnerPicker` will display all the users and groups present in the catalog. diff --git a/.changeset/gentle-llamas-cross.md b/.changeset/gentle-llamas-cross.md deleted file mode 100644 index 42a6d70cd6..0000000000 --- a/.changeset/gentle-llamas-cross.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/core-components': patch ---- - -Use `inherit` variant on OverflowTooltip underlying Typography component. diff --git a/.changeset/gold-teachers-wink.md b/.changeset/gold-teachers-wink.md deleted file mode 100644 index 0578e8d02b..0000000000 --- a/.changeset/gold-teachers-wink.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -Fix issue with `esm` loaded dependencies being different from the `cjs` import for Vite dependencies diff --git a/.changeset/gorgeous-spiders-fry.md b/.changeset/gorgeous-spiders-fry.md deleted file mode 100644 index 6a1d4e7296..0000000000 --- a/.changeset/gorgeous-spiders-fry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-common': patch ---- - -`ContainerRunner`, `DockerContainerRunner` and `KubernetesContainerRunner` are now deprecated diff --git a/.changeset/great-clouds-hang.md b/.changeset/great-clouds-hang.md deleted file mode 100644 index 4e8bf28d9d..0000000000 --- a/.changeset/great-clouds-hang.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-defaults': patch ---- - -Exposed `DefaultSchedulerService` diff --git a/.changeset/great-cougars-guess.md b/.changeset/great-cougars-guess.md deleted file mode 100644 index af1de3e8ce..0000000000 --- a/.changeset/great-cougars-guess.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-test-utils': patch ---- - -Made it possible to give access restrictions to `mockCredentials.service` diff --git a/.changeset/green-apricots-invite.md b/.changeset/green-apricots-invite.md deleted file mode 100644 index b5e92021b4..0000000000 --- a/.changeset/green-apricots-invite.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-org': patch ---- - -The `catalogIndex` external route is now optional and will by default bind to the catalog index page if it is available. diff --git a/.changeset/honest-badgers-ring.md b/.changeset/honest-badgers-ring.md deleted file mode 100644 index c1e763e6cb..0000000000 --- a/.changeset/honest-badgers-ring.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-test-utils': patch ---- - -The type `MockDirectoryOptions` was renamed to `CreateMockDirectoryOptions` so that it's clear these options are exclusive to the mock directory factory. diff --git a/.changeset/honest-pandas-chew.md b/.changeset/honest-pandas-chew.md deleted file mode 100644 index 5da5f16045..0000000000 --- a/.changeset/honest-pandas-chew.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/core-plugin-api': patch ---- - -A new `defaultTarget` option has been added to `createExternalRouteRef`. This allows one to specify a default target of the route by name, for example `'catalog.catalogIndex'`, which will be used if the target route is present in the app and there is no explicit route binding. diff --git a/.changeset/hungry-cups-jog.md b/.changeset/hungry-cups-jog.md deleted file mode 100644 index bd15fa92d3..0000000000 --- a/.changeset/hungry-cups-jog.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': patch ---- - -Removed waiting for the workspace and repository fields to be filled in before requesting user credentials diff --git a/.changeset/itchy-spoons-cry.md b/.changeset/itchy-spoons-cry.md deleted file mode 100644 index 20877e8087..0000000000 --- a/.changeset/itchy-spoons-cry.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/plugin-app-backend': patch ---- - -Restore the support of external config schema in the router of the `app-backend` plugin, which was broken in release `1.26.0`. -This support is critical for dynamic frontend plugins to have access to their config values. diff --git a/.changeset/large-months-decide.md b/.changeset/large-months-decide.md deleted file mode 100644 index e9d4c47bbe..0000000000 --- a/.changeset/large-months-decide.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-notifications-node': minor ---- - -add notifications filtering by processors diff --git a/.changeset/late-ants-impress.md b/.changeset/late-ants-impress.md deleted file mode 100644 index 44b2cbefb3..0000000000 --- a/.changeset/late-ants-impress.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'@backstage/plugin-catalog-backend-module-bitbucket-cloud': patch -'@backstage/plugin-scaffolder-node-test-utils': patch -'@backstage/plugin-search-backend-module-elasticsearch': patch -'@backstage/plugin-search-backend-module-pg': patch -'@backstage/plugin-search-backend-node': patch -'@backstage/plugin-signals-backend': patch -'@backstage/plugin-events-node': patch ---- - -Replace the usage of `getVoidLogger` with `mockServices.logger.mock` in order to remove the dependency with the soon-to-be-deprecated `backend-common` package. diff --git a/.changeset/late-badgers-rest.md b/.changeset/late-badgers-rest.md deleted file mode 100644 index 51d37fb45a..0000000000 --- a/.changeset/late-badgers-rest.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-defaults': patch ---- - -Refactor cache manager inline types. diff --git a/.changeset/late-falcons-sort.md b/.changeset/late-falcons-sort.md deleted file mode 100644 index 3f6468e652..0000000000 --- a/.changeset/late-falcons-sort.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@backstage/create-app': patch -'@backstage/plugin-techdocs-backend': patch -'@techdocs/cli': patch ---- - -Removed `dockerode` dependency. diff --git a/.changeset/late-students-live.md b/.changeset/late-students-live.md deleted file mode 100644 index 576dfa22cb..0000000000 --- a/.changeset/late-students-live.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-techdocs': patch ---- - -Fixed bug in `CopyToClipboardButton` component where positioning of the "Copy to clipboard" button in techdocs code snippets was broken in some cases. diff --git a/.changeset/lemon-weeks-lay.md b/.changeset/lemon-weeks-lay.md deleted file mode 100644 index 66d1402882..0000000000 --- a/.changeset/lemon-weeks-lay.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-defaults': patch ---- - -Remove dependency with `@backstage/backend-commons` package. diff --git a/.changeset/light-rice-argue.md b/.changeset/light-rice-argue.md deleted file mode 100644 index 23572b4cdd..0000000000 --- a/.changeset/light-rice-argue.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend-module-gitlab': patch ---- - -Added `gitlab:issue:edit` action to edit existing GitLab issues diff --git a/.changeset/little-cooks-approve.md b/.changeset/little-cooks-approve.md deleted file mode 100644 index d4088208ae..0000000000 --- a/.changeset/little-cooks-approve.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-notifications': patch ---- - -Fixes performance issue with Notifications title counter. diff --git a/.changeset/long-llamas-push-atlassian.md b/.changeset/long-llamas-push-atlassian.md deleted file mode 100644 index 3e0ae5ad14..0000000000 --- a/.changeset/long-llamas-push-atlassian.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-auth-backend-module-atlassian-provider': minor ---- - -**BREAKING**: The `scope` and `scopes` config options have been removed and replaced by the standard `additionalScopes` config. In addition, the `offline_access`, `read:jira-work`, and `read:jira-user` scopes have been set to required and will always be present. diff --git a/.changeset/long-llamas-push-bitbucket.md b/.changeset/long-llamas-push-bitbucket.md deleted file mode 100644 index 36a68219eb..0000000000 --- a/.changeset/long-llamas-push-bitbucket.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-auth-backend-module-bitbucket-provider': patch ---- - -Added support for the new shared `additionalScopes` configuration. In addition, the `account` scope has been set to required and will always be present. diff --git a/.changeset/long-llamas-push-github.md b/.changeset/long-llamas-push-github.md deleted file mode 100644 index c68fb8e925..0000000000 --- a/.changeset/long-llamas-push-github.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-auth-backend-module-github-provider': patch ---- - -Added support for the new shared `additionalScopes` configuration. In addition, the `read:user` scope has been set to required and will always be present. diff --git a/.changeset/long-llamas-push-gitlab.md b/.changeset/long-llamas-push-gitlab.md deleted file mode 100644 index fe5d293723..0000000000 --- a/.changeset/long-llamas-push-gitlab.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-auth-backend-module-gitlab-provider': patch ---- - -Added support for the new shared `additionalScopes` configuration. In addition, the `read_user` scope has been set to required and will always be present. diff --git a/.changeset/long-llamas-push-google.md b/.changeset/long-llamas-push-google.md deleted file mode 100644 index c9de73eb36..0000000000 --- a/.changeset/long-llamas-push-google.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-auth-backend-module-google-provider': patch ---- - -Added support for the new shared `additionalScopes` configuration. In addition, the `openid`, `userinfo.email`, and `userinfo.profile` scopes have been set to required and will always be present. diff --git a/.changeset/long-llamas-push-microsoft.md b/.changeset/long-llamas-push-microsoft.md deleted file mode 100644 index f6509db0f7..0000000000 --- a/.changeset/long-llamas-push-microsoft.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-auth-backend-module-microsoft-provider': patch ---- - -Added support for the new shared `additionalScopes` configuration. diff --git a/.changeset/long-llamas-push-oauth2.md b/.changeset/long-llamas-push-oauth2.md deleted file mode 100644 index 2a233dbb42..0000000000 --- a/.changeset/long-llamas-push-oauth2.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-auth-backend-module-oauth2-provider': minor ---- - -**BREAKING**: The `scope` config option have been removed and replaced by the standard `additionalScopes` config. diff --git a/.changeset/long-llamas-push-oidc.md b/.changeset/long-llamas-push-oidc.md deleted file mode 100644 index 248d762864..0000000000 --- a/.changeset/long-llamas-push-oidc.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-auth-backend-module-oidc-provider': minor ---- - -**BREAKING**: The `scope` config option have been removed and replaced by the standard `additionalScopes` config. In addition, `openid`, `profile`, and `email` scopes have been set to required and will always be present. diff --git a/.changeset/long-llamas-push-okta.md b/.changeset/long-llamas-push-okta.md deleted file mode 100644 index d330746d2e..0000000000 --- a/.changeset/long-llamas-push-okta.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-auth-backend-module-okta-provider': patch ---- - -Added support for the new shared `additionalScopes` configuration, which means it can now also be specified as an array. In addition, the `openid`, `email`, `profile`, and `offline_access` scopes have been set to required and will always be present. diff --git a/.changeset/long-llamas-push-pinniped.md b/.changeset/long-llamas-push-pinniped.md deleted file mode 100644 index a9c6a54cee..0000000000 --- a/.changeset/long-llamas-push-pinniped.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-auth-backend-module-pinniped-provider': patch ---- - -**BREAKING**: The `scope` config option have been removed and replaced by the standard `additionalScopes` config. In addition, the `openid`, `pinniped:request-audience`, `username`, and `offline_access` scopes have been set to required and will always be present. diff --git a/.changeset/long-llamas-push-vmware-cloud.md b/.changeset/long-llamas-push-vmware-cloud.md deleted file mode 100644 index 9edfb01f68..0000000000 --- a/.changeset/long-llamas-push-vmware-cloud.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-auth-backend-module-vmware-cloud-provider': minor ---- - -**BREAKING**: The `scope` config option have been removed and replaced by the standard `additionalScopes` config. In addition, `openid`, and `offline_access` scopes have been set to required and will always be present. diff --git a/.changeset/loud-pumpkins-bow.md b/.changeset/loud-pumpkins-bow.md deleted file mode 100644 index a55c97e19a..0000000000 --- a/.changeset/loud-pumpkins-bow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-react': patch ---- - -Links that are rendered in the markdown in the `ScaffolderField` component are now opened in new tabs. diff --git a/.changeset/lovely-hats-pay.md b/.changeset/lovely-hats-pay.md deleted file mode 100644 index 117f50e5db..0000000000 --- a/.changeset/lovely-hats-pay.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/theme': patch ---- - -Internal refactor to fix an issue where the MUI 5 `v5-` class prefixing gets removed by tree shaking. diff --git a/.changeset/lucky-taxis-rule.md b/.changeset/lucky-taxis-rule.md deleted file mode 100644 index eacbaaefbe..0000000000 --- a/.changeset/lucky-taxis-rule.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@backstage/backend-defaults': patch ---- - -Added core service factories and implementations from -`@backstage/backend-app-api`. They are now available as subpath exports, e.g. -`@backstage/backend-defaults/scheduler` is where the service factory and default -implementation of `coreServices.scheduler` now lives. They have been marked as -deprecated in their old locations. diff --git a/.changeset/many-moles-sing.md b/.changeset/many-moles-sing.md deleted file mode 100644 index 8b49f674c7..0000000000 --- a/.changeset/many-moles-sing.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-common': patch ---- - -We are deprecating the legacy `createServiceBuilder` factory, so if you are still using it, please checkout the migration guide and [migrate](https://backstage.io/docs/backend-system/building-plugins-and-modules/migrating) your plugin to use the new backend system. diff --git a/.changeset/many-windows-attack.md b/.changeset/many-windows-attack.md deleted file mode 100644 index d0516244f4..0000000000 --- a/.changeset/many-windows-attack.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-backend-module-bitbucket-cloud': patch ---- - -Remove debug console logging statement diff --git a/.changeset/mean-laws-lay.md b/.changeset/mean-laws-lay.md deleted file mode 100644 index a7c629a9a5..0000000000 --- a/.changeset/mean-laws-lay.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-backend': minor ---- - -Pass through `EventsService` too in the new backend system diff --git a/.changeset/metal-apricots-heal.md b/.changeset/metal-apricots-heal.md deleted file mode 100644 index 8cfd72a605..0000000000 --- a/.changeset/metal-apricots-heal.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -'@backstage/backend-app-api': patch ---- - -Added a new static key based method for plugin-to-plugin auth. This is useful for example if you are running readonly service nodes that cannot use a database for the default public-key signature scheme outlined in [BEP-0003](https://github.com/backstage/backstage/tree/master/beps/0003-auth-architecture-evolution). Most users should want to stay on the more secure zero-config database signature scheme. - -You can generate a public and private key pair using `openssl`. - -- First 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 - ``` - -After this you have the files `private.key` and `public.key`. Put them in a place where you know their absolute paths, and then set up your app-config accordingly: - -```yaml -backend: - auth: - keyStore: - type: static - static: - keys: - - publicKeyFile: /absolute/path/to/public.key - privateKeyFile: /absolute/path/to/private.key - keyId: some-custom-id -``` diff --git a/.changeset/mighty-rocks-join.md b/.changeset/mighty-rocks-join.md deleted file mode 100644 index 5a859faf8c..0000000000 --- a/.changeset/mighty-rocks-join.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-backend-module-msgraph': patch ---- - -Added missing `userSelect` property in `readMicrosoftGraphOrg` method diff --git a/.changeset/moody-buttons-hope.md b/.changeset/moody-buttons-hope.md deleted file mode 100644 index 0b8f57f9bc..0000000000 --- a/.changeset/moody-buttons-hope.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-plugin-api': patch ---- - -Marked the `TokenManagerService` and `IdentityService` types as deprecated diff --git a/.changeset/nasty-doors-grab.md b/.changeset/nasty-doors-grab.md deleted file mode 100644 index 971843d053..0000000000 --- a/.changeset/nasty-doors-grab.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend-module-azure': patch ---- - -Use `GitRepository.webUrl` instead of `GitRepository.remoteUrl` to set the value of `repoContentsUrl` as `remoteUrl` can sometimes return an URL with the wrong format (e.g. `https://@dev.azure.com///\_git/`). diff --git a/.changeset/nasty-roses-flash.md b/.changeset/nasty-roses-flash.md deleted file mode 100644 index 4c09a7e47f..0000000000 --- a/.changeset/nasty-roses-flash.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -'@backstage/integration': minor ---- - -**BREAKING** Removed deprecated code from when casing was changed from `GitHub` to `Github` nearly two years ago. The following items have been removed: - -- `getGitHubFileFetchUrl` (use `getGithubFileFetchUrl` instead) -- `GitHubIntegrationConfig` (use `GithubIntegrationConfig` instead) -- `GitHubIntegration` (use `GithubIntegration` instead) -- `readGitHubIntegrationConfig` (use `readGithubIntegrationConfig` instead) -- `readGitHubIntegrationConfigs` (use `readGithubIntegrationConfigs` instead) -- `replaceGitHubUrlType` (use `replaceGithubUrlType` instead) diff --git a/.changeset/neat-chairs-complain.md b/.changeset/neat-chairs-complain.md deleted file mode 100644 index 96c0271d81..0000000000 --- a/.changeset/neat-chairs-complain.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend': patch ---- - -Fixing issues with log redaction in the scaffolder logs diff --git a/.changeset/neat-rivers-share.md b/.changeset/neat-rivers-share.md deleted file mode 100644 index 42649de977..0000000000 --- a/.changeset/neat-rivers-share.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-permission-node': patch ---- - -Ensure that service token access restrictions, when present, are taken into account diff --git a/.changeset/nervous-kings-change.md b/.changeset/nervous-kings-change.md deleted file mode 100644 index 9d61d2ea81..0000000000 --- a/.changeset/nervous-kings-change.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -'@backstage/backend-plugin-api': patch ---- - -Deprecated all of the `UrlReader` related type names and replaced them with prefixed versions. Please update your imports. - -- `ReadTreeOptions` was renamed to `UrlReaderServiceReadTreeOptions` -- `ReadTreeResponse` was renamed to `UrlReaderServiceReadTreeResponse` -- `ReadTreeResponseDirOptions` was renamed to `UrlReaderServiceReadTreeResponseDirOptions` -- `ReadTreeResponseFile` was renamed to `UrlReaderServiceReadTreeResponseFile` -- `ReadUrlResponse` was renamed to `UrlReaderServiceReadUrlResponse` -- `ReadUrlOptions` was renamed to `UrlReaderServiceReadUrlOptions` -- `SearchOptions` was renamed to `UrlReaderServiceSearchOptions` -- `SearchResponse` was renamed to `UrlReaderServiceSearchResponse` -- `SearchResponseFile` was renamed to `UrlReaderServiceSearchResponseFile` diff --git a/.changeset/nervous-queens-fly.md b/.changeset/nervous-queens-fly.md deleted file mode 100644 index 802034765c..0000000000 --- a/.changeset/nervous-queens-fly.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-test-utils': patch ---- - -Refactored `TestDatabases` to no longer depend on `backend-common` diff --git a/.changeset/new-chefs-rescue.md b/.changeset/new-chefs-rescue.md deleted file mode 100644 index 7ebb7f4719..0000000000 --- a/.changeset/new-chefs-rescue.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-plugin-api': patch ---- - -Improved `coreServices` doc comments diff --git a/.changeset/new-masks-occur.md b/.changeset/new-masks-occur.md deleted file mode 100644 index b5777b7abe..0000000000 --- a/.changeset/new-masks-occur.md +++ /dev/null @@ -1,136 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend-module-confluence-to-markdown': patch -'@backstage/plugin-auth-backend-module-cloudflare-access-provider': patch -'@backstage/plugin-catalog-backend-module-scaffolder-entity-model': patch -'@backstage/plugin-search-backend-module-stack-overflow-collator': patch -'@backstage/plugin-catalog-backend-module-incremental-ingestion': patch -'@backstage/plugin-auth-backend-module-azure-easyauth-provider': patch -'@backstage/plugin-permission-backend-module-allow-all-policy': patch -'@backstage/plugin-scaffolder-backend-module-bitbucket-server': patch -'@backstage/plugin-auth-backend-module-oauth2-proxy-provider': patch -'@backstage/plugin-auth-backend-module-vmware-cloud-provider': patch -'@backstage/plugin-scaffolder-backend-module-bitbucket-cloud': patch -'@backstage/plugin-catalog-backend-module-backstage-openapi': patch -'@backstage/plugin-catalog-backend-module-bitbucket-server': patch -'@backstage/plugin-scaffolder-backend-module-notifications': patch -'@backstage/plugin-auth-backend-module-atlassian-provider': patch -'@backstage/plugin-auth-backend-module-bitbucket-provider': patch -'@backstage/plugin-auth-backend-module-microsoft-provider': patch -'@backstage/plugin-catalog-backend-module-bitbucket-cloud': patch -'@backstage/plugin-scaffolder-backend-module-cookiecutter': patch -'@backstage/plugin-auth-backend-module-onelogin-provider': patch -'@backstage/plugin-auth-backend-module-pinniped-provider': patch -'@backstage/plugin-events-backend-module-bitbucket-cloud': patch -'@backstage/plugin-auth-backend-module-aws-alb-provider': patch -'@backstage/plugin-auth-backend-module-gcp-iap-provider': patch -'@backstage/plugin-auth-backend-module-github-provider': patch -'@backstage/plugin-auth-backend-module-gitlab-provider': patch -'@backstage/plugin-auth-backend-module-google-provider': patch -'@backstage/plugin-auth-backend-module-oauth2-provider': patch -'@backstage/plugin-catalog-unprocessed-entities-common': patch -'@backstage/plugin-scaffolder-backend-module-bitbucket': patch -'@backstage/plugin-search-backend-module-elasticsearch': patch -'@backstage/plugin-auth-backend-module-guest-provider': patch -'@backstage/plugin-catalog-backend-module-unprocessed': patch -'@backstage/plugin-notifications-backend-module-email': patch -'@backstage/plugin-auth-backend-module-oidc-provider': patch -'@backstage/plugin-auth-backend-module-okta-provider': patch -'@backstage/plugin-catalog-backend-module-github-org': patch -'@backstage/plugin-catalog-backend-module-gitlab-org': patch -'@backstage/plugin-scaffolder-backend-module-gerrit': patch -'@backstage/plugin-scaffolder-backend-module-github': patch -'@backstage/plugin-scaffolder-backend-module-gitlab': patch -'@backstage/plugin-scaffolder-backend-module-sentry': patch -'@backstage/plugin-scaffolder-backend-module-yeoman': patch -'@backstage/plugin-catalog-backend-module-puppetdb': patch -'@backstage/plugin-scaffolder-backend-module-azure': patch -'@backstage/plugin-scaffolder-backend-module-gitea': patch -'@backstage/plugin-scaffolder-backend-module-rails': patch -'@backstage/plugin-api-docs-module-protoc-gen-doc': patch -'@backstage/plugin-catalog-backend-module-msgraph': patch -'@backstage/plugin-catalog-backend-module-openapi': patch -'@backstage/plugin-search-backend-module-techdocs': patch -'@backstage/plugin-techdocs-module-addons-contrib': patch -'@backstage/plugin-catalog-backend-module-gerrit': patch -'@backstage/plugin-catalog-backend-module-github': patch -'@backstage/plugin-catalog-backend-module-gitlab': patch -'@backstage/plugin-events-backend-module-aws-sqs': patch -'@backstage/plugin-search-backend-module-catalog': patch -'@backstage/plugin-search-backend-module-explore': patch -'@backstage/plugin-catalog-backend-module-azure': patch -'@backstage/plugin-catalog-unprocessed-entities': patch -'@backstage/plugin-events-backend-module-gerrit': patch -'@backstage/plugin-events-backend-module-github': patch -'@backstage/plugin-events-backend-module-gitlab': patch -'@backstage/plugin-catalog-backend-module-ldap': patch -'@backstage/plugin-events-backend-module-azure': patch -'@backstage/plugin-catalog-backend-module-aws': patch -'@backstage/plugin-catalog-backend-module-gcp': patch -'@backstage/plugin-scaffolder-node-test-utils': patch -'@backstage/plugin-techdocs-addons-test-utils': patch -'@backstage/plugin-events-backend-test-utils': patch -'@backstage/plugin-search-backend-module-pg': patch -'@backstage/plugin-bitbucket-cloud-common': patch -'@backstage/plugin-notifications-backend': patch -'@backstage/plugin-user-settings-backend': patch -'@backstage/plugin-notifications-common': patch -'@backstage/plugin-user-settings-common': patch -'@backstage/plugin-search-backend-node': patch -'@backstage/plugin-kubernetes-backend': patch -'@backstage/plugin-kubernetes-cluster': patch -'@backstage/plugin-notifications-node': patch -'@backstage/plugin-permission-backend': patch -'@backstage/plugin-scaffolder-backend': patch -'@backstage/plugin-kubernetes-common': patch -'@backstage/plugin-permission-common': patch -'@backstage/plugin-scaffolder-common': patch -'@backstage/plugin-devtools-backend': patch -'@backstage/plugin-kubernetes-react': patch -'@backstage/plugin-permission-react': patch -'@backstage/plugin-scaffolder-react': patch -'@backstage/plugin-techdocs-backend': patch -'@backstage/plugin-catalog-backend': patch -'@backstage/plugin-devtools-common': patch -'@backstage/plugin-kubernetes-node': patch -'@backstage/plugin-permission-node': patch -'@backstage/plugin-scaffolder-node': patch -'@backstage/plugin-signals-backend': patch -'@backstage/plugin-app-visualizer': patch -'@backstage/plugin-catalog-common': patch -'@backstage/plugin-catalog-import': patch -'@backstage/plugin-events-backend': patch -'@backstage/plugin-search-backend': patch -'@backstage/plugin-techdocs-react': patch -'@backstage/plugin-catalog-graph': patch -'@backstage/plugin-catalog-react': patch -'@backstage/plugin-config-schema': patch -'@backstage/plugin-notifications': patch -'@backstage/plugin-proxy-backend': patch -'@backstage/plugin-search-common': patch -'@backstage/plugin-signals-react': patch -'@backstage/plugin-techdocs-node': patch -'@backstage/plugin-user-settings': patch -'@backstage/plugin-auth-backend': patch -'@backstage/plugin-catalog-node': patch -'@backstage/plugin-search-react': patch -'@backstage/plugin-signals-node': patch -'@backstage/plugin-app-backend': patch -'@backstage/plugin-events-node': patch -'@backstage/plugin-auth-react': patch -'@backstage/plugin-home-react': patch -'@backstage/plugin-kubernetes': patch -'@backstage/plugin-scaffolder': patch -'@backstage/plugin-auth-node': patch -'@backstage/plugin-org-react': patch -'@backstage/plugin-api-docs': patch -'@backstage/plugin-app-node': patch -'@backstage/plugin-devtools': patch -'@backstage/plugin-techdocs': patch -'@backstage/plugin-catalog': patch -'@backstage/plugin-signals': patch -'@backstage/plugin-search': patch -'@backstage/plugin-home': patch -'@backstage/plugin-org': patch ---- - -Added additional plugin metadata to `package.json`. diff --git a/.changeset/new-numbers-hug.md b/.changeset/new-numbers-hug.md deleted file mode 100644 index e4e35a2825..0000000000 --- a/.changeset/new-numbers-hug.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-plugin-api': patch ---- - -Moved the declaration of the `SchedulerService` here, along with prefixed versions of all of the types it depends on, from `@backstage/backend-tasks` diff --git a/.changeset/nice-kangaroos-occur.md b/.changeset/nice-kangaroos-occur.md deleted file mode 100644 index 9798885d1a..0000000000 --- a/.changeset/nice-kangaroos-occur.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog': patch ---- - -Fix bug with missing Actions column after adding "pagination" prop to catalog table diff --git a/.changeset/nice-pants-shave.md b/.changeset/nice-pants-shave.md deleted file mode 100644 index 500888a817..0000000000 --- a/.changeset/nice-pants-shave.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@backstage/plugin-auth-backend-module-cloudflare-access-provider': patch -'@backstage/plugin-scaffolder-backend-module-sentry': patch -'@backstage/plugin-scaffolder-backend-module-gitea': patch -'@backstage/plugin-notifications-node': patch ---- - -Use `node-fetch` instead of native fetch, as per https://backstage.io/docs/architecture-decisions/adrs-adr013 diff --git a/.changeset/nine-hairs-kick.md b/.changeset/nine-hairs-kick.md deleted file mode 100644 index e4160640b4..0000000000 --- a/.changeset/nine-hairs-kick.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-backend-module-gitlab': patch ---- - -Fixed an issue in `GitlabOrgDiscoveryEntityProvider` where a missing `orgEnabled` config key was throwing an error. diff --git a/.changeset/nine-ties-type.md b/.changeset/nine-ties-type.md deleted file mode 100644 index abb0661724..0000000000 --- a/.changeset/nine-ties-type.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend': patch -'@backstage/backend-app-api': patch ---- - -Fixing issue with log meta fields possibly being circular refs diff --git a/.changeset/old-trees-check.md b/.changeset/old-trees-check.md deleted file mode 100644 index b4d745ffb5..0000000000 --- a/.changeset/old-trees-check.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-tasks': patch ---- - -Deprecate the legacy `TaskScheduler.fromConfig` method and stop using the `getVoidlogger` in tests files to reduce the dependency on the soon-to-deprecate `backstage-common` package. diff --git a/.changeset/olive-mangos-tickle.md b/.changeset/olive-mangos-tickle.md deleted file mode 100644 index 6033ec3ed6..0000000000 --- a/.changeset/olive-mangos-tickle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-app-api': patch ---- - -Stop using `getVoidLogger` in tests to reduce the dependency on the soon-to-deprecate `backstage-common` package. diff --git a/.changeset/orange-beans-float.md b/.changeset/orange-beans-float.md deleted file mode 100644 index 7e31277890..0000000000 --- a/.changeset/orange-beans-float.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-backend-module-github': patch ---- - -Fix bug in root repo import where catalog-info.yaml.hcl file is found by search and breaks the import diff --git a/.changeset/orange-chefs-end.md b/.changeset/orange-chefs-end.md deleted file mode 100644 index 9ba2a29685..0000000000 --- a/.changeset/orange-chefs-end.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-auth-backend-module-oidc-provider': patch ---- - -if oidc server do not provide revocation_endpoint,we should not call revoke function diff --git a/.changeset/orange-pianos-eat.md b/.changeset/orange-pianos-eat.md deleted file mode 100644 index 5e085a612b..0000000000 --- a/.changeset/orange-pianos-eat.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/backend-common': minor -'@backstage/integration': minor ---- - -Implemented `readTree` for Harness provider to support TechDocs functionality diff --git a/.changeset/perfect-bikes-invite.md b/.changeset/perfect-bikes-invite.md deleted file mode 100644 index 96a4ad5659..0000000000 --- a/.changeset/perfect-bikes-invite.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-backend-module-gitlab': patch ---- - -Fixed an issue in `GitlabDiscoveryEntityProvider` where the fallback branch was taking precedence over the GitLab default branch. diff --git a/.changeset/plenty-mirrors-laugh.md b/.changeset/plenty-mirrors-laugh.md deleted file mode 100644 index f46e3b5937..0000000000 --- a/.changeset/plenty-mirrors-laugh.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-auth-backend-module-microsoft-provider': patch ---- - -Minor internal type updates diff --git a/.changeset/polite-emus-invent.md b/.changeset/polite-emus-invent.md deleted file mode 100644 index a31c04e021..0000000000 --- a/.changeset/polite-emus-invent.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@backstage/backend-defaults': minor ---- - -**BREAKING**: The `workdir` argument have been removed from The `GerritUrlReader` constructor. - -**BREAKING**: The Gerrit `readTree` implementation will now only use the Gitiles api. Support -for using git to clone the repo has been removed. diff --git a/.changeset/polite-otters-talk.md b/.changeset/polite-otters-talk.md deleted file mode 100644 index e56b935c1e..0000000000 --- a/.changeset/polite-otters-talk.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-notifications-backend-module-email': minor ---- - -add notification filters diff --git a/.changeset/popular-boxes-press.md b/.changeset/popular-boxes-press.md deleted file mode 100644 index 44b50d711a..0000000000 --- a/.changeset/popular-boxes-press.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-defaults': patch ---- - -Internal minor refactors of the database connectors diff --git a/.changeset/popular-carrots-love.md b/.changeset/popular-carrots-love.md deleted file mode 100644 index 22490e0b1a..0000000000 --- a/.changeset/popular-carrots-love.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/core-components': patch ---- - -Fixed an issue causing `SidebarSubmenu` text to not follow the theme color diff --git a/.changeset/pre.json b/.changeset/pre.json deleted file mode 100644 index 1f6e3fc9b8..0000000000 --- a/.changeset/pre.json +++ /dev/null @@ -1,321 +0,0 @@ -{ - "mode": "exit", - "tag": "next", - "initialVersions": { - "example-app": "0.2.97", - "@backstage/app-defaults": "1.5.5", - "example-app-next": "0.0.11", - "app-next-example-plugin": "0.0.11", - "example-backend": "0.0.26", - "@backstage/backend-app-api": "0.7.3", - "@backstage/backend-common": "0.22.0", - "@backstage/backend-defaults": "0.2.18", - "@backstage/backend-dev-utils": "0.1.4", - "@backstage/backend-dynamic-feature-service": "0.2.10", - "example-backend-legacy": "0.2.98", - "@backstage/backend-openapi-utils": "0.1.11", - "@backstage/backend-plugin-api": "0.6.18", - "@backstage/backend-tasks": "0.5.23", - "@backstage/backend-test-utils": "0.3.8", - "@backstage/catalog-client": "1.6.5", - "@backstage/catalog-model": "1.5.0", - "@backstage/cli": "0.26.5", - "@backstage/cli-common": "0.1.13", - "@backstage/cli-node": "0.2.5", - "@backstage/codemods": "0.1.48", - "@backstage/config": "1.2.0", - "@backstage/config-loader": "1.8.0", - "@backstage/core-app-api": "1.12.5", - "@backstage/core-compat-api": "0.2.5", - "@backstage/core-components": "0.14.7", - "@backstage/core-plugin-api": "1.9.2", - "@backstage/create-app": "0.5.15", - "@backstage/dev-utils": "1.0.32", - "e2e-test": "0.2.16", - "@backstage/e2e-test-utils": "0.1.1", - "@backstage/errors": "1.2.4", - "@backstage/eslint-plugin": "0.1.8", - "@backstage/frontend-app-api": "0.7.0", - "@backstage/frontend-plugin-api": "0.6.5", - "@backstage/frontend-test-utils": "0.1.7", - "@backstage/integration": "1.11.0", - "@backstage/integration-aws-node": "0.1.12", - "@backstage/integration-react": "1.1.27", - "@backstage/release-manifests": "0.0.11", - "@backstage/repo-tools": "0.9.0", - "@techdocs/cli": "1.8.11", - "techdocs-cli-embedded-app": "0.2.96", - "@backstage/test-utils": "1.5.5", - "@backstage/theme": "0.5.4", - "@backstage/types": "1.1.1", - "@backstage/version-bridge": "1.0.8", - "@backstage/plugin-api-docs": "0.11.5", - "@backstage/plugin-api-docs-module-protoc-gen-doc": "0.1.6", - "@backstage/plugin-app-backend": "0.3.66", - "@backstage/plugin-app-node": "0.1.18", - "@backstage/plugin-app-visualizer": "0.1.6", - "@backstage/plugin-auth-backend": "0.22.5", - "@backstage/plugin-auth-backend-module-atlassian-provider": "0.1.10", - "@backstage/plugin-auth-backend-module-aws-alb-provider": "0.1.10", - "@backstage/plugin-auth-backend-module-azure-easyauth-provider": "0.1.1", - "@backstage/plugin-auth-backend-module-bitbucket-provider": "0.1.1", - "@backstage/plugin-auth-backend-module-cloudflare-access-provider": "0.1.1", - "@backstage/plugin-auth-backend-module-gcp-iap-provider": "0.2.13", - "@backstage/plugin-auth-backend-module-github-provider": "0.1.15", - "@backstage/plugin-auth-backend-module-gitlab-provider": "0.1.15", - "@backstage/plugin-auth-backend-module-google-provider": "0.1.15", - "@backstage/plugin-auth-backend-module-guest-provider": "0.1.4", - "@backstage/plugin-auth-backend-module-microsoft-provider": "0.1.13", - "@backstage/plugin-auth-backend-module-oauth2-provider": "0.1.15", - "@backstage/plugin-auth-backend-module-oauth2-proxy-provider": "0.1.11", - "@backstage/plugin-auth-backend-module-oidc-provider": "0.1.9", - "@backstage/plugin-auth-backend-module-okta-provider": "0.0.11", - "@backstage/plugin-auth-backend-module-pinniped-provider": "0.1.12", - "@backstage/plugin-auth-backend-module-vmware-cloud-provider": "0.1.10", - "@backstage/plugin-auth-node": "0.4.13", - "@backstage/plugin-auth-react": "0.1.2", - "@backstage/plugin-bitbucket-cloud-common": "0.2.19", - "@backstage/plugin-catalog": "1.20.0", - "@backstage/plugin-catalog-backend": "1.22.0", - "@backstage/plugin-catalog-backend-module-aws": "0.3.13", - "@backstage/plugin-catalog-backend-module-azure": "0.1.38", - "@backstage/plugin-catalog-backend-module-backstage-openapi": "0.2.1", - "@backstage/plugin-catalog-backend-module-bitbucket-cloud": "0.2.5", - "@backstage/plugin-catalog-backend-module-bitbucket-server": "0.1.32", - "@backstage/plugin-catalog-backend-module-gcp": "0.1.19", - "@backstage/plugin-catalog-backend-module-gerrit": "0.1.35", - "@backstage/plugin-catalog-backend-module-github": "0.6.1", - "@backstage/plugin-catalog-backend-module-github-org": "0.1.13", - "@backstage/plugin-catalog-backend-module-gitlab": "0.3.16", - "@backstage/plugin-catalog-backend-module-gitlab-org": "0.0.1", - "@backstage/plugin-catalog-backend-module-incremental-ingestion": "0.4.23", - "@backstage/plugin-catalog-backend-module-ldap": "0.5.34", - "@backstage/plugin-catalog-backend-module-msgraph": "0.5.26", - "@backstage/plugin-catalog-backend-module-openapi": "0.1.36", - "@backstage/plugin-catalog-backend-module-puppetdb": "0.1.24", - "@backstage/plugin-catalog-backend-module-scaffolder-entity-model": "0.1.16", - "@backstage/plugin-catalog-backend-module-unprocessed": "0.4.5", - "@backstage/plugin-catalog-common": "1.0.23", - "@backstage/plugin-catalog-graph": "0.4.5", - "@backstage/plugin-catalog-import": "0.11.0", - "@backstage/plugin-catalog-node": "1.12.0", - "@backstage/plugin-catalog-react": "1.12.0", - "@backstage/plugin-catalog-unprocessed-entities": "0.2.4", - "@backstage/plugin-catalog-unprocessed-entities-common": "0.0.1", - "@backstage/plugin-config-schema": "0.1.55", - "@backstage/plugin-devtools": "0.1.14", - "@backstage/plugin-devtools-backend": "0.3.4", - "@backstage/plugin-devtools-common": "0.1.9", - "@backstage/plugin-events-backend": "0.3.5", - "@backstage/plugin-events-backend-module-aws-sqs": "0.3.4", - "@backstage/plugin-events-backend-module-azure": "0.2.4", - "@backstage/plugin-events-backend-module-bitbucket-cloud": "0.2.4", - "@backstage/plugin-events-backend-module-gerrit": "0.2.4", - "@backstage/plugin-events-backend-module-github": "0.2.4", - "@backstage/plugin-events-backend-module-gitlab": "0.2.4", - "@backstage/plugin-events-backend-test-utils": "0.1.28", - "@backstage/plugin-events-node": "0.3.4", - "@internal/plugin-todo-list": "1.0.27", - "@internal/plugin-todo-list-backend": "1.0.27", - "@internal/plugin-todo-list-common": "1.0.18", - "@backstage/plugin-home": "0.7.4", - "@backstage/plugin-home-react": "0.1.13", - "@backstage/plugin-kubernetes": "0.11.10", - "@backstage/plugin-kubernetes-backend": "0.17.1", - "@backstage/plugin-kubernetes-cluster": "0.0.11", - "@backstage/plugin-kubernetes-common": "0.7.6", - "@backstage/plugin-kubernetes-node": "0.1.12", - "@backstage/plugin-kubernetes-react": "0.3.5", - "@backstage/plugin-notifications": "0.2.1", - "@backstage/plugin-notifications-backend": "0.2.1", - "@backstage/plugin-notifications-backend-module-email": "0.0.1", - "@backstage/plugin-notifications-common": "0.0.3", - "@backstage/plugin-notifications-node": "0.1.4", - "@backstage/plugin-org": "0.6.25", - "@backstage/plugin-org-react": "0.1.24", - "@backstage/plugin-permission-backend": "0.5.42", - "@backstage/plugin-permission-backend-module-allow-all-policy": "0.1.15", - "@backstage/plugin-permission-common": "0.7.13", - "@backstage/plugin-permission-node": "0.7.29", - "@backstage/plugin-permission-react": "0.4.22", - "@backstage/plugin-proxy-backend": "0.4.16", - "@backstage/plugin-scaffolder": "1.20.0", - "@backstage/plugin-scaffolder-backend": "1.22.6", - "@backstage/plugin-scaffolder-backend-module-azure": "0.1.10", - "@backstage/plugin-scaffolder-backend-module-bitbucket": "0.2.8", - "@backstage/plugin-scaffolder-backend-module-bitbucket-cloud": "0.1.8", - "@backstage/plugin-scaffolder-backend-module-bitbucket-server": "0.1.8", - "@backstage/plugin-scaffolder-backend-module-confluence-to-markdown": "0.2.19", - "@backstage/plugin-scaffolder-backend-module-cookiecutter": "0.2.42", - "@backstage/plugin-scaffolder-backend-module-gerrit": "0.1.10", - "@backstage/plugin-scaffolder-backend-module-gitea": "0.1.8", - "@backstage/plugin-scaffolder-backend-module-github": "0.2.8", - "@backstage/plugin-scaffolder-backend-module-gitlab": "0.4.0", - "@backstage/plugin-scaffolder-backend-module-notifications": "0.0.1", - "@backstage/plugin-scaffolder-backend-module-rails": "0.4.35", - "@backstage/plugin-scaffolder-backend-module-sentry": "0.1.26", - "@backstage/plugin-scaffolder-backend-module-yeoman": "0.3.1", - "@backstage/plugin-scaffolder-common": "1.5.2", - "@backstage/plugin-scaffolder-node": "0.4.4", - "@backstage/plugin-scaffolder-node-test-utils": "0.1.4", - "@backstage/plugin-scaffolder-react": "1.8.5", - "@backstage/plugin-search": "1.4.11", - "@backstage/plugin-search-backend": "1.5.8", - "@backstage/plugin-search-backend-module-catalog": "0.1.24", - "@backstage/plugin-search-backend-module-elasticsearch": "1.4.1", - "@backstage/plugin-search-backend-module-explore": "0.1.24", - "@backstage/plugin-search-backend-module-pg": "0.5.27", - "@backstage/plugin-search-backend-module-stack-overflow-collator": "0.1.11", - "@backstage/plugin-search-backend-module-techdocs": "0.1.23", - "@backstage/plugin-search-backend-node": "1.2.22", - "@backstage/plugin-search-common": "1.2.11", - "@backstage/plugin-search-react": "1.7.11", - "@backstage/plugin-signals": "0.0.6", - "@backstage/plugin-signals-backend": "0.1.4", - "@backstage/plugin-signals-node": "0.1.4", - "@backstage/plugin-signals-react": "0.0.3", - "@backstage/plugin-techdocs": "1.10.5", - "@backstage/plugin-techdocs-addons-test-utils": "1.0.32", - "@backstage/plugin-techdocs-backend": "1.10.5", - "@backstage/plugin-techdocs-module-addons-contrib": "1.1.10", - "@backstage/plugin-techdocs-node": "1.12.4", - "@backstage/plugin-techdocs-react": "1.2.4", - "@backstage/plugin-user-settings": "0.8.6", - "@backstage/plugin-user-settings-backend": "0.2.17", - "yarn-plugin-backstage": "0.0.0", - "@backstage/plugin-auth-backend-module-onelogin-provider": "0.0.0", - "@backstage/plugin-user-settings-common": "0.0.0" - }, - "changesets": [ - "beige-eagles-cheat", - "blue-hairs-marry", - "brave-apples-move", - "breezy-badgers-train", - "breezy-planets-sparkle", - "brown-bananas-talk", - "calm-cars-serve", - "calm-files-sort", - "calm-plums-wink", - "chilled-planes-sniff", - "clever-kids-return", - "clever-radios-yawn", - "cold-seas-end", - "create-app-1716302437", - "create-app-1716903719", - "cuddly-eggs-sin", - "cuddly-jobs-kick", - "cyan-jobs-visit", - "cyan-paws-beg", - "cyan-snails-peel", - "eighty-kings-dress", - "eighty-yaks-switch", - "empty-avocados-tease", - "empty-spoons-tell", - "empty-tables-ring", - "famous-monkeys-count", - "forty-adults-roll", - "forty-experts-live", - "four-adults-mix", - "friendly-keys-fold", - "gentle-baboons-peel", - "gentle-llamas-cross", - "gold-teachers-wink", - "great-clouds-hang", - "great-cougars-guess", - "green-apricots-invite", - "honest-badgers-ring", - "honest-pandas-chew", - "itchy-spoons-cry", - "large-months-decide", - "late-ants-impress", - "late-students-live", - "light-rice-argue", - "little-cooks-approve", - "long-llamas-push-atlassian", - "long-llamas-push-bitbucket", - "long-llamas-push-github", - "long-llamas-push-gitlab", - "long-llamas-push-google", - "long-llamas-push-microsoft", - "long-llamas-push-oauth2", - "long-llamas-push-oidc", - "long-llamas-push-okta", - "long-llamas-push-pinniped", - "long-llamas-push-vmware-cloud", - "loud-pumpkins-bow", - "lovely-hats-pay", - "lucky-taxis-rule", - "many-moles-sing", - "many-windows-attack", - "mean-laws-lay", - "moody-buttons-hope", - "nasty-roses-flash", - "neat-rivers-share", - "nervous-kings-change", - "nervous-queens-fly", - "new-masks-occur", - "new-numbers-hug", - "nice-kangaroos-occur", - "nice-pants-shave", - "nine-hairs-kick", - "nine-ties-type", - "old-trees-check", - "olive-mangos-tickle", - "orange-chefs-end", - "orange-pianos-eat", - "perfect-bikes-invite", - "polite-otters-talk", - "popular-boxes-press", - "popular-carrots-love", - "pretty-berries-live", - "pretty-spoons-knock", - "proud-readers-move", - "purple-mugs-beg", - "rare-frogs-beam", - "real-ghosts-return", - "rich-teachers-agree", - "rude-kings-press", - "rude-snakes-clap", - "selfish-pugs-lick", - "serious-yaks-sit", - "seven-geese-raise", - "shaggy-jokes-promise", - "shaggy-mugs-kiss", - "shaggy-zebras-mate", - "six-llamas-give", - "slimy-fans-raise", - "slow-dolls-type", - "smooth-gifts-nail", - "soft-flies-live", - "sour-colts-juggle", - "spicy-brooms-hang", - "spicy-camels-happen", - "spicy-ears-raise", - "spotty-plants-switch", - "spotty-ravens-perform", - "strong-moose-work", - "stupid-tigers-bake", - "swift-islands-leave", - "tall-bananas-reflect", - "tall-lies-fetch", - "tall-pumas-teach", - "tasty-horses-breathe", - "tender-seas-listen", - "thirty-plums-shout", - "tiny-pandas-return", - "twelve-pumpkins-fold", - "twenty-masks-dance", - "warm-bees-hope", - "warm-mayflies-yell", - "weak-gifts-occur", - "wet-crabs-guess", - "wild-coats-doubt", - "wild-doors-cheat", - "wild-ears-walk", - "wise-beers-doubt", - "wise-vans-sin", - "wise-wasps-look", - "young-apes-thank", - "young-camels-return" - ] -} diff --git a/.changeset/pretty-berries-live.md b/.changeset/pretty-berries-live.md deleted file mode 100644 index e83ebeef13..0000000000 --- a/.changeset/pretty-berries-live.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/backend-defaults': patch -'@backstage/backend-common': patch ---- - -Deprecated `dropDatabase` diff --git a/.changeset/pretty-spoons-knock.md b/.changeset/pretty-spoons-knock.md deleted file mode 100644 index 5eddce54d9..0000000000 --- a/.changeset/pretty-spoons-knock.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/plugin-scaffolder-react': patch -'@backstage/plugin-catalog-react': patch ---- - -Prevents Autocomplete dropdown from overlapping sidebar on hovering it diff --git a/.changeset/proud-readers-move.md b/.changeset/proud-readers-move.md deleted file mode 100644 index 70d94b2e6d..0000000000 --- a/.changeset/proud-readers-move.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-graph': patch ---- - -The `catalogEntity` external route will now by default bind to the catalog entity page if it is available. diff --git a/.changeset/purple-mugs-beg.md b/.changeset/purple-mugs-beg.md deleted file mode 100644 index 2507b5d706..0000000000 --- a/.changeset/purple-mugs-beg.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli-common': patch ---- - -The monorepo root check in `findPaths` will now accept a shorthand `workspaces` config in `package.json`, no longer requiring `workspaces.packages`. diff --git a/.changeset/rare-frogs-beam.md b/.changeset/rare-frogs-beam.md deleted file mode 100644 index 981c0c00ce..0000000000 --- a/.changeset/rare-frogs-beam.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/create-app': patch ---- - -Fixed a broken link to the node-postgres documentation diff --git a/.changeset/real-ghosts-return.md b/.changeset/real-ghosts-return.md deleted file mode 100644 index 9f81649254..0000000000 --- a/.changeset/real-ghosts-return.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/create-app': patch ---- - -Bumped TypeScript to version `5.4`. diff --git a/.changeset/renovate-7906f3a.md b/.changeset/renovate-7906f3a.md deleted file mode 100644 index 2584e64e5f..0000000000 --- a/.changeset/renovate-7906f3a.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'@backstage/plugin-home-react': patch -'@backstage/plugin-home': patch -'@backstage/plugin-scaffolder-react': patch -'@backstage/plugin-scaffolder': patch ---- - -Updated dependency `@rjsf/utils` to `5.18.4`. -Updated dependency `@rjsf/core` to `5.18.4`. -Updated dependency `@rjsf/material-ui` to `5.18.4`. -Updated dependency `@rjsf/validator-ajv8` to `5.18.4`. diff --git a/.changeset/renovate-c35e5aa.md b/.changeset/renovate-c35e5aa.md deleted file mode 100644 index bf87f7570a..0000000000 --- a/.changeset/renovate-c35e5aa.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -Updated dependency `vite-plugin-node-polyfills` to `^0.22.0`. diff --git a/.changeset/rich-teachers-agree.md b/.changeset/rich-teachers-agree.md deleted file mode 100644 index eed8517619..0000000000 --- a/.changeset/rich-teachers-agree.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@backstage/plugin-catalog': minor ---- - -Added the following default targets for external routes: - -- `createComponent` binds to the Scaffolder page. -- `viewTechDoc` binds to the TechDocs entity documentation page. -- `createFromTemplate` binds to the Scaffolder selected template page. diff --git a/.changeset/rude-buckets-invite.md b/.changeset/rude-buckets-invite.md deleted file mode 100644 index 03a9c1b8fd..0000000000 --- a/.changeset/rude-buckets-invite.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-import': patch ---- - -Integrated Azure DevOps as a catalog import source. This enables Backstage to create Pull Requests to Azure DevOps repositories as it does with GitHub repositories diff --git a/.changeset/rude-kings-press.md b/.changeset/rude-kings-press.md deleted file mode 100644 index 5c10753f8a..0000000000 --- a/.changeset/rude-kings-press.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@backstage/backend-app-api': patch ---- - -Deprecated core service factories and implementations and moved them over to -subpath exports on `@backstage/backend-defaults` instead. E.g. -`@backstage/backend-defaults/scheduler` is where the service factory and default -implementation of `coreServices.scheduler` now lives. diff --git a/.changeset/rude-snakes-clap.md b/.changeset/rude-snakes-clap.md deleted file mode 100644 index 6292730c4c..0000000000 --- a/.changeset/rude-snakes-clap.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@backstage/plugin-user-settings-backend': patch -'@backstage/plugin-user-settings-common': patch -'@backstage/plugin-user-settings': patch ---- - -Use signals to update user settings across sessions diff --git a/.changeset/selfish-pugs-lick.md b/.changeset/selfish-pugs-lick.md deleted file mode 100644 index 1ac7ac7321..0000000000 --- a/.changeset/selfish-pugs-lick.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-permission-node': patch ---- - -Import `tokenManager` definition from `@backstage/backend-plugin-api` diff --git a/.changeset/serious-yaks-sit.md b/.changeset/serious-yaks-sit.md deleted file mode 100644 index 5afc74f955..0000000000 --- a/.changeset/serious-yaks-sit.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -'@backstage/core-app-api': patch ---- - -Added support for configuration of route bindings through static configuration, and default targets for external route refs. - -In addition to configuring route bindings through code, it is now also possible to configure route bindings under the `app.routes.bindings` key, for example: - -```yaml -app: - routes: - bindings: - catalog.createComponent: catalog-import.importPage -``` - -Each key in the route binding object is of the form `.`, where the route name is key used in the `externalRoutes` object passed to `createPlugin`. The value is of the same form, but with the name taken from the plugin `routes` option instead. - -The equivalent of the above configuration in code is the following: - -```ts -const app = createApp({ - // ... - bindRoutes({ bind }) { - bind(catalogPlugin.externalRoutes, { - createComponent: catalogImportPlugin.routes.importPage, - }); - }, -}); -``` diff --git a/.changeset/seven-geese-raise.md b/.changeset/seven-geese-raise.md deleted file mode 100644 index 3d6e2347b9..0000000000 --- a/.changeset/seven-geese-raise.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/plugin-search-backend-node': patch -'@backstage/plugin-search-backend': patch ---- - -Split backend search plugin startup into "init" and "start" stages to ensure necessary initialization has happened before startup diff --git a/.changeset/shaggy-jokes-promise.md b/.changeset/shaggy-jokes-promise.md deleted file mode 100644 index e7788b69f4..0000000000 --- a/.changeset/shaggy-jokes-promise.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-search-backend': patch ---- - -Move @backstage/repo-tools to devDependencies diff --git a/.changeset/shaggy-mugs-kiss.md b/.changeset/shaggy-mugs-kiss.md deleted file mode 100644 index 8f0e800acd..0000000000 --- a/.changeset/shaggy-mugs-kiss.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-tasks': patch ---- - -More detailed deprecation messages diff --git a/.changeset/shaggy-zebras-mate.md b/.changeset/shaggy-zebras-mate.md deleted file mode 100644 index c66a92d1e9..0000000000 --- a/.changeset/shaggy-zebras-mate.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/backend-defaults': patch -'@backstage/backend-common': patch ---- - -Moved over all URL reader functionality from `@backstage/backend-common` to `@backstage/backend-defaults/urlReader`. Please update your imports. diff --git a/.changeset/silver-scissors-fold.md b/.changeset/silver-scissors-fold.md deleted file mode 100644 index d562b35d3c..0000000000 --- a/.changeset/silver-scissors-fold.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-common': patch ---- - -Removed the circular dependency on `@backstage/backend-app-api` diff --git a/.changeset/six-llamas-give.md b/.changeset/six-llamas-give.md deleted file mode 100644 index 9bfbf52625..0000000000 --- a/.changeset/six-llamas-give.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/backend-defaults': minor -'@backstage/backend-common': minor ---- - -Deprecated and moved over core services to `@backstage/backend-defaults` diff --git a/.changeset/sixty-parrots-tan.md b/.changeset/sixty-parrots-tan.md deleted file mode 100644 index 88436391eb..0000000000 --- a/.changeset/sixty-parrots-tan.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/core-components': patch ---- - -Make number of decimal digits in Gauge configurable via the `decimalDigits` property diff --git a/.changeset/slimy-fans-raise.md b/.changeset/slimy-fans-raise.md deleted file mode 100644 index 6d84b2f34f..0000000000 --- a/.changeset/slimy-fans-raise.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-techdocs': patch ---- - -Fixed an issue preventing the `TechDocsSearchBar` component from opening when clicking on the arrow icon. diff --git a/.changeset/slow-dolls-type.md b/.changeset/slow-dolls-type.md deleted file mode 100644 index d2626f3ab3..0000000000 --- a/.changeset/slow-dolls-type.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': minor ---- - -Changed the way to display entities in EntityPicker to use entityPresentationApi instead of humanizeEntityRef diff --git a/.changeset/smooth-gifts-nail.md b/.changeset/smooth-gifts-nail.md deleted file mode 100644 index aa2585bc4f..0000000000 --- a/.changeset/smooth-gifts-nail.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend': patch -'@backstage/backend-app-api': patch ---- - -Updating the logger redaction message to something less dramatic diff --git a/.changeset/soft-flies-live.md b/.changeset/soft-flies-live.md deleted file mode 100644 index b331269647..0000000000 --- a/.changeset/soft-flies-live.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend-module-gitlab': patch ---- - -Add new `gitlab:pipeline:trigger` action to trigger GitLab pipelines. diff --git a/.changeset/sour-colts-juggle.md b/.changeset/sour-colts-juggle.md deleted file mode 100644 index 35dc79452a..0000000000 --- a/.changeset/sour-colts-juggle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-test-utils': patch ---- - -Fix the logger service mock to prevent returning `undefined` from the `child` method. diff --git a/.changeset/spicy-brooms-hang.md b/.changeset/spicy-brooms-hang.md deleted file mode 100644 index 23f7da309b..0000000000 --- a/.changeset/spicy-brooms-hang.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/plugin-scaffolder-react': patch -'@backstage/plugin-scaffolder': patch ---- - -Fixing bug in `formData` type as it should be `optional` as it's possibly undefined diff --git a/.changeset/spicy-camels-happen.md b/.changeset/spicy-camels-happen.md deleted file mode 100644 index 1017f042ad..0000000000 --- a/.changeset/spicy-camels-happen.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-common': patch ---- - -We are deprecating the legacy router handlers and contexts in preparation for the new backend system stable release. diff --git a/.changeset/spicy-ears-raise.md b/.changeset/spicy-ears-raise.md deleted file mode 100644 index a53ed9c721..0000000000 --- a/.changeset/spicy-ears-raise.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@backstage/integration-react': patch -'@backstage/backend-common': patch -'@backstage/integration': patch ---- - -Fix AWS CodeCommit integration by allowing to change the host diff --git a/.changeset/spotty-plants-switch.md b/.changeset/spotty-plants-switch.md deleted file mode 100644 index a5951de05d..0000000000 --- a/.changeset/spotty-plants-switch.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-backend-module-ldap': minor ---- - -Migrate LDAP catalog module to the new backend system. diff --git a/.changeset/spotty-ravens-perform.md b/.changeset/spotty-ravens-perform.md deleted file mode 100644 index 507561c11c..0000000000 --- a/.changeset/spotty-ravens-perform.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/core-components': patch ---- - -Adds icons to status component diff --git a/.changeset/strong-moose-work.md b/.changeset/strong-moose-work.md deleted file mode 100644 index 443b708e51..0000000000 --- a/.changeset/strong-moose-work.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/repo-tools': patch ---- - -Add `--client-additional-properties` option to `openapi generate` command diff --git a/.changeset/stupid-tigers-bake.md b/.changeset/stupid-tigers-bake.md deleted file mode 100644 index a4579ab05a..0000000000 --- a/.changeset/stupid-tigers-bake.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@backstage/plugin-kubernetes-backend': minor -'@backstage/plugin-kubernetes-common': minor -'@backstage/plugin-kubernetes-react': minor ---- - -Update kubernetes plugins to use autoscaling/v2 diff --git a/.changeset/swift-islands-leave.md b/.changeset/swift-islands-leave.md deleted file mode 100644 index 3b0b460733..0000000000 --- a/.changeset/swift-islands-leave.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/core-components': patch ---- - -Removed max width from `Select` component. diff --git a/.changeset/tall-bananas-reflect.md b/.changeset/tall-bananas-reflect.md deleted file mode 100644 index 00e8fd8b43..0000000000 --- a/.changeset/tall-bananas-reflect.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/create-app': patch ---- - -Remove Tech Radar menu item from sidebar of scaffolded app to align with removal of tech-radar plugin from backend diff --git a/.changeset/tall-lies-fetch.md b/.changeset/tall-lies-fetch.md deleted file mode 100644 index a4484a5687..0000000000 --- a/.changeset/tall-lies-fetch.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog': patch ---- - -Export `catalogTranslationRef` under `/alpha` diff --git a/.changeset/tall-pumas-teach.md b/.changeset/tall-pumas-teach.md deleted file mode 100644 index 39e7c06297..0000000000 --- a/.changeset/tall-pumas-teach.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-react': patch ---- - -Fixed a typo '$' in the review step label diff --git a/.changeset/tasty-forks-compare.md b/.changeset/tasty-forks-compare.md deleted file mode 100644 index 2b525ed51a..0000000000 --- a/.changeset/tasty-forks-compare.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-techdocs-node': patch ---- - -Updated `getRepoUrlFromLocationAnnotation` to check for Harness SCM integration diff --git a/.changeset/tasty-horses-breathe.md b/.changeset/tasty-horses-breathe.md deleted file mode 100644 index afd20e6c4a..0000000000 --- a/.changeset/tasty-horses-breathe.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -Added a new `--publish` flag to the `repo fix` command. This command will validate and if possible generate the metadata required for publishing packages with the Backstage CLI. In addition, a check has been added that the `backstage.pluginId` and `backstage.pluginPackage(s)` fields are present when packing a package for publishing. diff --git a/.changeset/tender-seas-listen.md b/.changeset/tender-seas-listen.md deleted file mode 100644 index 86b0bf4618..0000000000 --- a/.changeset/tender-seas-listen.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'@backstage/plugin-scaffolder-react': patch -'@backstage/plugin-scaffolder': patch -'@backstage/plugin-catalog': patch ---- - -updated the ContextMenu, ActionsPage, OngoingTask and TemplateCard frontend components to support the new scaffolder permissions: - -- `scaffolder.task.create` -- `scaffolder.task.cancel` -- `scaffolder.task.read` diff --git a/.changeset/thirty-gorillas-train.md b/.changeset/thirty-gorillas-train.md deleted file mode 100644 index 79214e457b..0000000000 --- a/.changeset/thirty-gorillas-train.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -Export default module for `scaffolder-action` cli template diff --git a/.changeset/thirty-plums-shout.md b/.changeset/thirty-plums-shout.md deleted file mode 100644 index 56ac640326..0000000000 --- a/.changeset/thirty-plums-shout.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-backend': patch ---- - -Added a regex test to check commit hash. If url is from git commit branch ignore the edit url. diff --git a/.changeset/three-lies-explode.md b/.changeset/three-lies-explode.md deleted file mode 100644 index df3556d0ba..0000000000 --- a/.changeset/three-lies-explode.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-backend': patch ---- - -Fix bug in `getLocationByEntity` diff --git a/.changeset/tiny-pandas-return.md b/.changeset/tiny-pandas-return.md deleted file mode 100644 index cc9210a368..0000000000 --- a/.changeset/tiny-pandas-return.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-api-docs': patch ---- - -`DefaultApiExplorerPage` now accepts an optional `ownerPickerMode` for toggling the behavior of the `EntityOwnerPicker`, exposing a new mode `` particularly suitable for larger catalogs. In this new mode, `EntityOwnerPicker` will display all the users and groups present in the catalog. diff --git a/.changeset/tiny-peas-shop.md b/.changeset/tiny-peas-shop.md deleted file mode 100644 index 7b1ea5dba1..0000000000 --- a/.changeset/tiny-peas-shop.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-test-utils': patch ---- - -Use imports from backend-defaults instead of the deprecated ones from backend-app-api diff --git a/.changeset/tricky-jobs-clap.md b/.changeset/tricky-jobs-clap.md deleted file mode 100644 index e773a888c7..0000000000 --- a/.changeset/tricky-jobs-clap.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -'@backstage/plugin-scaffolder-react': minor -'@backstage/plugin-scaffolder': minor ---- - -Replace `ui:widget: password` with the a warning message stating that it's not secure and to use the build in `SecretField`. - -You can do this by updating your `template.yaml` files that have the reference `ui:widget: password` to `ui:field: Secret` instead. - -```diff -apiVersion: backstage.io/v1alpha1 -kind: Template -metadata: - ... - -spec: - parameters: - - title: collect some information - schema: - type: object - properties: - password: - title: Password - type: string -- ui:widget: password -+ ui:field: Secret - steps: - - id: collect-info - name: Collect some information - action: acme:do:something - input: -- password: ${{ parameters.password }} -+ password: ${{ secrets.password }} -``` diff --git a/.changeset/twelve-pumpkins-fold.md b/.changeset/twelve-pumpkins-fold.md deleted file mode 100644 index ae63a8fce2..0000000000 --- a/.changeset/twelve-pumpkins-fold.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend': patch ---- - -Increase max wait time in debug:wait action to 10 minutes diff --git a/.changeset/twenty-masks-dance.md b/.changeset/twenty-masks-dance.md deleted file mode 100644 index f08e6301c9..0000000000 --- a/.changeset/twenty-masks-dance.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/core-components': patch ---- - -Fixed a bug in `SupportButton` where the title was rendered with the characteristics of a button. diff --git a/.changeset/twenty-seals-guess.md b/.changeset/twenty-seals-guess.md deleted file mode 100644 index a206105b46..0000000000 --- a/.changeset/twenty-seals-guess.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-common': patch ---- - -Finalizes the deprecation of legacy backend utilities. Deprecated utilities include the `ServiceBuilder` type, `notFoundHandler` and `redactWintonLogLine` functions. diff --git a/.changeset/violet-ducks-care.md b/.changeset/violet-ducks-care.md deleted file mode 100644 index 6ba59fd2b5..0000000000 --- a/.changeset/violet-ducks-care.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-backend': patch ---- - -Ensure name and title are both indexed by the DefaultCatalogCollator diff --git a/.changeset/warm-bees-hope.md b/.changeset/warm-bees-hope.md deleted file mode 100644 index 2a3de7fda7..0000000000 --- a/.changeset/warm-bees-hope.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-plugin-api': patch ---- - -Renamed `BackendPluginConfig`, `BackendModuleConfig`, and `ExtensionPointConfig` respectively to `CreateBackendPluginOptions`, `CreateBackendModuleOptions`, and `CreateExtensionPointOptions` to standardize frontend and backend factories signatures. diff --git a/.changeset/warm-mayflies-yell.md b/.changeset/warm-mayflies-yell.md deleted file mode 100644 index a2068668f7..0000000000 --- a/.changeset/warm-mayflies-yell.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@backstage/plugin-scaffolder': minor ---- - -Added the following default targets for external routes: - -- `registerComponent` binds to the catalog import page. -- `viewTechDoc` binds to the TechDocs entity documentation page. diff --git a/.changeset/weak-gifts-occur.md b/.changeset/weak-gifts-occur.md deleted file mode 100644 index 7834c0a9d9..0000000000 --- a/.changeset/weak-gifts-occur.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend': patch -'@backstage/plugin-scaffolder-common': patch ---- - -added the following new permissions to the scaffolder backend endpoints: - -- `scaffolder.task.create` -- `scaffolder.task.cancel` -- `scaffolder.task.read` diff --git a/.changeset/wet-crabs-guess.md b/.changeset/wet-crabs-guess.md deleted file mode 100644 index c8a9282a47..0000000000 --- a/.changeset/wet-crabs-guess.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/backend-plugin-api': patch -'@backstage/plugin-catalog-backend': patch ---- - -Start using the `isDatabaseConflictError` helper from the `@backstage/backend-plugin-api` package in order to avoid dependency with the soon to deprecate `@backstage/backend-common` package. diff --git a/.changeset/wicked-dingos-heal.md b/.changeset/wicked-dingos-heal.md deleted file mode 100644 index 367c65e95e..0000000000 --- a/.changeset/wicked-dingos-heal.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@backstage/integration': minor ---- - -**BREAKING**: `gitilesBaseUrl` is now mandatory for the Gerrit integration. The -ability to override this requirement using the `DISABLE_GERRIT_GITILES_REQUIREMENT` -environment variable has been removed. diff --git a/.changeset/wild-coats-doubt.md b/.changeset/wild-coats-doubt.md deleted file mode 100644 index 4e86911127..0000000000 --- a/.changeset/wild-coats-doubt.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-auth-backend': patch ---- - -Updated to use the new `@backstage/plugin-auth-backend-module-onelogin-provider` implementation diff --git a/.changeset/wild-doors-cheat.md b/.changeset/wild-doors-cheat.md deleted file mode 100644 index c302dde467..0000000000 --- a/.changeset/wild-doors-cheat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -Fix `versions:check --fix` when `yarn.lock` has multiple joint versions in the same section diff --git a/.changeset/wild-ears-walk.md b/.changeset/wild-ears-walk.md deleted file mode 100644 index 072c545f1a..0000000000 --- a/.changeset/wild-ears-walk.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-notifications-backend': minor ---- - -adding filtering of notifications by processors diff --git a/.changeset/wild-eyes-grab.md b/.changeset/wild-eyes-grab.md deleted file mode 100644 index f382c406f3..0000000000 --- a/.changeset/wild-eyes-grab.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -'@backstage/plugin-search-backend-module-elasticsearch': minor ---- - -**BREAKING**: The ElasticSearch indexer will now delete stale indices matching the indexer's pattern. -The method `getAliases` of `ElasticSearchClientWrapper` has been deprecated and might be removed in future releases. - -An indexer using the `some-type-index__*` pattern will remove indices matching this pattern after indexation -to prevent stale indices leading to shards exhaustion. - -Before upgrading ensure that the index pattern doesn't match indices that are not managed by Backstage -and thus shouldn't be deleted. - -Note: The ElasticSearch indexer already uses wildcards patterns to remove aliases on these indices. diff --git a/.changeset/wise-beers-doubt.md b/.changeset/wise-beers-doubt.md deleted file mode 100644 index be70f326e0..0000000000 --- a/.changeset/wise-beers-doubt.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/create-app': patch ---- - -Updated `node-gyp` to v10 diff --git a/.changeset/wise-vans-sin.md b/.changeset/wise-vans-sin.md deleted file mode 100644 index 37565c9300..0000000000 --- a/.changeset/wise-vans-sin.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-common': patch ---- - -Deprecate legacy service logger helpers and stop using `getVoidLogger` in tests. diff --git a/.changeset/wise-wasps-look.md b/.changeset/wise-wasps-look.md deleted file mode 100644 index 34f52b3a7b..0000000000 --- a/.changeset/wise-wasps-look.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': patch ---- - -Change owner to project for azure host diff --git a/.changeset/witty-avocados-pump.md b/.changeset/witty-avocados-pump.md deleted file mode 100644 index e3d781c8d3..0000000000 --- a/.changeset/witty-avocados-pump.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-common': patch ---- - -Deprecate the legacy error and request logging handler types, respectively: `ErrorHandlerOptions` and `RequestLoggingHandlerFactory`. diff --git a/.changeset/witty-parents-give.md b/.changeset/witty-parents-give.md deleted file mode 100644 index e169d8160a..0000000000 --- a/.changeset/witty-parents-give.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-defaults': patch ---- - -Added `@backstage/backend-defaults/auth`, `@backstage/backend-defaults/httpAuth`, and `@backstage/backend-defaults/userInfo` to house their respective backend service factories. You should now import these services from those new locations, instead of `@backstage/backend-app-api`. diff --git a/.changeset/young-apes-thank.md b/.changeset/young-apes-thank.md deleted file mode 100644 index 570316b2e2..0000000000 --- a/.changeset/young-apes-thank.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend-module-github': minor ---- - -Allow empty author info in createPullRequest action for Github diff --git a/.changeset/young-camels-return.md b/.changeset/young-camels-return.md deleted file mode 100644 index efdd822788..0000000000 --- a/.changeset/young-camels-return.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -Bump `esbuild` target for package builds to `ES2022`. diff --git a/docs/releases/v1.28.0-changelog.md b/docs/releases/v1.28.0-changelog.md new file mode 100644 index 0000000000..97d2219257 --- /dev/null +++ b/docs/releases/v1.28.0-changelog.md @@ -0,0 +1,2982 @@ +# Release v1.28.0 + +Upgrade Helper: [https://backstage.github.io/upgrade-helper/?to=1.28.0](https://backstage.github.io/upgrade-helper/?to=1.28.0) + +## @backstage/backend-common@0.23.0 + +### Minor Changes + +- 395b973: Implemented `readTree` for Harness provider to support TechDocs functionality +- 02103be: Deprecated and moved over core services to `@backstage/backend-defaults` + +### Patch Changes + +- 9539a0b: Import utility functions from `backend-defaults` instead of `backend-app-api` +- b2c4607: Removed accents on deprecation note +- c6c0919: Updated configuration schema to include the `useRedisSets` cache config option. +- ed3074e: The `database` types, helpers and implementations were moved to the package `@backstage/backend-defaults` and deprecated from the package `@backstage/backend-commons`. +- 9cca724: The `TokenManager` has been deprecated in preparation for the [stable release of the New Backend System](https://github.com/backstage/backstage/issues/24493). Please [migrate](https://backstage.io/docs/tutorials/auth-service-migration) to the new `coreServices.auth`, `coreServices.httpAuth`, and `coreServices.userInfo` services as needed instead. +- 1779188: In preparation to the new backend system stable release, the `isDatabaseConflictError` helper have been moved to the `@backstage/backend-plugin-api` package and deprecated from `@backstage/backend-common`. +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- e171620: Move `cache` implementation and types to the `@backstage/backend-defaults` package. +- 1a6f38a: `ContainerRunner`, `DockerContainerRunner` and `KubernetesContainerRunner` are now deprecated +- 8869b8e: We are deprecating the legacy `createServiceBuilder` factory, so if you are still using it, please checkout the migration guide and [migrate](https://backstage.io/docs/backend-system/building-plugins-and-modules/migrating) your plugin to use the new backend system. +- 0634fdc: Deprecated `dropDatabase` +- b2ee7f3: Moved over all URL reader functionality from `@backstage/backend-common` to `@backstage/backend-defaults/urlReader`. Please update your imports. +- d94a477: Removed the circular dependency on `@backstage/backend-app-api` +- 3bd04bb: We are deprecating the legacy router handlers and contexts in preparation for the new backend system stable release. +- 23ee9ab: Fix AWS CodeCommit integration by allowing to change the host +- e9a03c9: Finalizes the deprecation of legacy backend utilities. Deprecated utilities include the `ServiceBuilder` type, `notFoundHandler` and `redactWintonLogLine` functions. +- 6a576dc: Deprecate legacy service logger helpers and stop using `getVoidLogger` in tests. +- 032a7a6: Deprecate the legacy error and request logging handler types, respectively: `ErrorHandlerOptions` and `RequestLoggingHandlerFactory`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/integration@1.12.0 + - @backstage/cli-common@0.1.14 + - @backstage/config-loader@1.8.1 + - @backstage/backend-dev-utils@0.1.4 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/integration-aws-node@0.1.12 + - @backstage/types@1.1.1 + +## @backstage/backend-defaults@0.3.0 + +### Minor Changes + +- 662dce8: **BREAKING**: The `workdir` argument have been removed from The `GerritUrlReader` constructor. + + **BREAKING**: The Gerrit `readTree` implementation will now only use the Gitiles api. Support + for using git to clone the repo has been removed. + +- 02103be: Deprecated and moved over core services to `@backstage/backend-defaults` + +### Patch Changes + +- 1897169: Exposed `DefaultSchedulerService` +- b5bc997: Refactor cache manager inline types. +- e171620: Remove dependency with `@backstage/backend-commons` package. +- 6551b3d: Added core service factories and implementations from + `@backstage/backend-app-api`. They are now available as subpath exports, e.g. + `@backstage/backend-defaults/scheduler` is where the service factory and default + implementation of `coreServices.scheduler` now lives. They have been marked as + deprecated in their old locations. +- 8aab451: Internal minor refactors of the database connectors +- 0634fdc: Deprecated `dropDatabase` +- b2ee7f3: Moved over all URL reader functionality from `@backstage/backend-common` to `@backstage/backend-defaults/urlReader`. Please update your imports. +- 9539a0b: Added `@backstage/backend-defaults/auth`, `@backstage/backend-defaults/httpAuth`, and `@backstage/backend-defaults/userInfo` to house their respective backend service factories. You should now import these services from those new locations, instead of `@backstage/backend-app-api`. +- Updated dependencies + - @backstage/backend-app-api@0.7.6 + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/integration@1.12.0 + - @backstage/plugin-events-node@0.3.5 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/cli-common@0.1.14 + - @backstage/config-loader@1.8.1 + - @backstage/backend-dev-utils@0.1.4 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/integration-aws-node@0.1.12 + - @backstage/types@1.1.1 + +## @backstage/backend-test-utils@0.4.0 + +### Minor Changes + +- 805cbe7: Added `TestCaches` that functions just like `TestDatabases` + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 9e63318: Made it possible to give access restrictions to `mockCredentials.service` +- 006b3e8: The type `MockDirectoryOptions` was renamed to `CreateMockDirectoryOptions` so that it's clear these options are exclusive to the mock directory factory. +- 0634fdc: Refactored `TestDatabases` to no longer depend on `backend-common` +- 6a576dc: Fix the logger service mock to prevent returning `undefined` from the `child` method. +- 6c11f6e: Use imports from backend-defaults instead of the deprecated ones from backend-app-api +- Updated dependencies + - @backstage/backend-app-api@0.7.6 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/backend-defaults@0.3.0 + - @backstage/plugin-events-node@0.3.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/integration@1.12.0 + +### Minor Changes + +- be1014d: **BREAKING** Removed deprecated code from when casing was changed from `GitHub` to `Github` nearly two years ago. The following items have been removed: + + - `getGitHubFileFetchUrl` (use `getGithubFileFetchUrl` instead) + - `GitHubIntegrationConfig` (use `GithubIntegrationConfig` instead) + - `GitHubIntegration` (use `GithubIntegration` instead) + - `readGitHubIntegrationConfig` (use `readGithubIntegrationConfig` instead) + - `readGitHubIntegrationConfigs` (use `readGithubIntegrationConfigs` instead) + - `replaceGitHubUrlType` (use `replaceGithubUrlType` instead) + +- 395b973: Implemented `readTree` for Harness provider to support TechDocs functionality + +- 662dce8: **BREAKING**: `gitilesBaseUrl` is now mandatory for the Gerrit integration. The + ability to override this requirement using the `DISABLE_GERRIT_GITILES_REQUIREMENT` + environment variable has been removed. + +### Patch Changes + +- 509e08c: Updated function for getHarnessEditContentsUrl +- 23ee9ab: Fix AWS CodeCommit integration by allowing to change the host +- Updated dependencies + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-auth-backend-module-atlassian-provider@0.2.0 + +### Minor Changes + +- 8efc6cf: **BREAKING**: The `scope` and `scopes` config options have been removed and replaced by the standard `additionalScopes` config. In addition, the `offline_access`, `read:jira-work`, and `read:jira-user` scopes have been set to required and will always be present. + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + +## @backstage/plugin-auth-backend-module-oauth2-provider@0.2.0 + +### Minor Changes + +- 8efc6cf: **BREAKING**: The `scope` config option have been removed and replaced by the standard `additionalScopes` config. + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + +## @backstage/plugin-auth-backend-module-oidc-provider@0.2.0 + +### Minor Changes + +- 8efc6cf: **BREAKING**: The `scope` config option have been removed and replaced by the standard `additionalScopes` config. In addition, `openid`, `profile`, and `email` scopes have been set to required and will always be present. + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- 4f21993: if oidc server do not provide revocation_endpoint,we should not call revoke function +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-auth-backend@0.22.6 + +## @backstage/plugin-auth-backend-module-onelogin-provider@0.1.0 + +### Minor Changes + +- 566d7cb: Separate out the OneLogin provider into its own module + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + +## @backstage/plugin-auth-backend-module-vmware-cloud-provider@0.2.0 + +### Minor Changes + +- 8efc6cf: **BREAKING**: The `scope` config option have been removed and replaced by the standard `additionalScopes` config. In addition, `openid`, and `offline_access` scopes have been set to required and will always be present. + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/catalog-model@1.5.0 + +## @backstage/plugin-catalog@1.21.0 + +### Minor Changes + +- 863a800: Added the following default targets for external routes: + + - `createComponent` binds to the Scaffolder page. + - `viewTechDoc` binds to the TechDocs entity documentation page. + - `createFromTemplate` binds to the Scaffolder selected template page. + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. + +- e04e57d: Fix bug with missing Actions column after adding "pagination" prop to catalog table + +- a2d2649: Export `catalogTranslationRef` under `/alpha` + +- bcec60f: updated the ContextMenu, ActionsPage, OngoingTask and TemplateCard frontend components to support the new scaffolder permissions: + + - `scaffolder.task.create` + - `scaffolder.task.cancel` + - `scaffolder.task.read` + +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-compat-api@0.2.6 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-scaffolder-common@1.5.3 + - @backstage/plugin-permission-react@0.4.23 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/plugin-search-common@1.2.12 + - @backstage/plugin-search-react@1.7.12 + - @backstage/integration-react@1.1.28 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/plugin-catalog-backend@1.23.0 + +### Minor Changes + +- c7528b0: Pass through `EventsService` too in the new backend system + +### Patch Changes + +- 8869b8e: Updated local development setup. +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- d779e3b: Added a regex test to check commit hash. If url is from git commit branch ignore the edit url. +- 6c5cab1: Fix bug in `getLocationByEntity` +- 0f55f5c: Ensure name and title are both indexed by the DefaultCatalogCollator +- 1779188: Start using the `isDatabaseConflictError` helper from the `@backstage/backend-plugin-api` package in order to avoid dependency with the soon to deprecate `@backstage/backend-common` package. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/integration@1.12.0 + - @backstage/plugin-search-backend-module-catalog@0.1.25 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-events-node@0.3.5 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/backend-openapi-utils@0.1.12 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/plugin-catalog-backend-module-ldap@0.6.0 + +### Minor Changes + +- debcc8c: Migrate LDAP catalog module to the new backend system. + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/plugin-catalog-import@0.12.0 + +### Minor Changes + +- 4f92394: Migrate from identityApi to fetchApi in frontend plugins. + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- 3daad61: Integrated Azure DevOps as a catalog import source. This enables Backstage to create Pull Requests to Azure DevOps repositories as it does with GitHub repositories +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-compat-api@0.2.6 + - @backstage/integration@1.12.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/integration-react@1.1.28 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-kubernetes-backend@0.18.0 + +### Minor Changes + +- 0177f75: Update kubernetes plugins to use autoscaling/v2 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/plugin-kubernetes-common@0.8.0 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-kubernetes-node@0.1.13 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/integration-aws-node@0.1.12 + - @backstage/types@1.1.1 + +## @backstage/plugin-kubernetes-common@0.8.0 + +### Minor Changes + +- 0177f75: Update kubernetes plugins to use autoscaling/v2 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/plugin-permission-common@0.7.14 + - @backstage/catalog-model@1.5.0 + - @backstage/types@1.1.1 + +## @backstage/plugin-kubernetes-react@0.4.0 + +### Minor Changes + +- 4f92394: Migrate from identityApi to fetchApi in frontend plugins. +- 0177f75: Update kubernetes plugins to use autoscaling/v2 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-kubernetes-common@0.8.0 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/plugin-notifications-backend@0.3.0 + +### Minor Changes + +- 07a789b: adding filtering of notifications by processors + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-notifications-node@0.2.0 + - @backstage/plugin-events-node@0.3.5 + - @backstage/plugin-notifications-common@0.0.4 + - @backstage/plugin-signals-node@0.1.5 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-notifications-backend-module-email@0.1.0 + +### Minor Changes + +- 07a789b: add notification filters + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-notifications-node@0.2.0 + - @backstage/plugin-notifications-common@0.0.4 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/integration-aws-node@0.1.12 + - @backstage/types@1.1.1 + +## @backstage/plugin-notifications-node@0.2.0 + +### Minor Changes + +- 07a789b: add notifications filtering by processors + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- 1354d81: Use `node-fetch` instead of native fetch, as per +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-notifications-common@0.0.4 + - @backstage/plugin-signals-node@0.1.5 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + +## @backstage/plugin-proxy-backend@0.5.0 + +### Minor Changes + +- 88480e4: **BREAKING**: The proxy backend plugin is now protected by Backstage auth, by + default. Unless specifically configured (see below), all proxy endpoints will + reject requests immediately unless a valid Backstage user or service token is + passed along with the request. This aligns the proxy with how other Backstage + backends behave out of the box, and serves to protect your upstreams from + unauthorized access. + + A proxy configuration section can now look as follows: + + ```yaml + proxy: + endpoints: + '/pagerduty': + target: https://api.pagerduty.com + credentials: require # NEW! + headers: + Authorization: Token token=${PAGERDUTY_TOKEN} + ``` + + There are three possible `credentials` settings at this point: + + - `require`: Callers must provide Backstage user or service credentials with + each request. The credentials are not forwarded to the proxy target. + - `forward`: Callers must provide Backstage user or service credentials with + each request, and those credentials are forwarded to the proxy target. + - `dangerously-allow-unauthenticated`: No Backstage credentials are required to + access this proxy target. The target can still apply its own credentials + checks, but the proxy will not help block non-Backstage-blessed callers. If + you also add `allowedHeaders: ['Authorization']` to an endpoint configuration, + then the Backstage token (if provided) WILL be forwarded. + + The value `dangerously-allow-unauthenticated` was the old default. + + The value `require` is the new default, so requests that were previously + permitted may now start resulting in `401 Unauthorized` responses. If you have + `backend.auth.dangerouslyDisableDefaultAuthPolicy` set to `true`, this does not + apply; the proxy will behave as if all endpoints were set to + `dangerously-allow-unauthenticated`. + + If you have proxy endpoints that require unauthenticated access still, please + add `credentials: dangerously-allow-unauthenticated` to their declarations in + your app-config. + +### Patch Changes + +- 8869b8e: Updated local development setup. +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/config@1.2.0 + - @backstage/types@1.1.1 + +## @backstage/plugin-scaffolder@1.21.0 + +### Minor Changes + +- d57ebbc: Changed the way to display entities in EntityPicker to use entityPresentationApi instead of humanizeEntityRef + +- 62bd9eb: Replace `ui:widget: password` with the a warning message stating that it's not secure and to use the build in `SecretField`. + + You can do this by updating your `template.yaml` files that have the reference `ui:widget: password` to `ui:field: Secret` instead. + + ```diff + apiVersion: backstage.io/v1alpha1 + kind: Template + metadata: + ... + + spec: + parameters: + - title: collect some information + schema: + type: object + properties: + password: + title: Password + type: string + - ui:widget: password + + ui:field: Secret + steps: + - id: collect-info + name: Collect some information + action: acme:do:something + input: + - password: ${{ parameters.password }} + + password: ${{ secrets.password }} + ``` + +- 60085dd: Added the following default targets for external routes: + + - `registerComponent` binds to the catalog import page. + - `viewTechDoc` binds to the TechDocs entity documentation page. + +### Patch Changes + +- cbebad1: Internal updates to allow reusing Backstage's `fetchApi` implementation for event source requests. This allows you to for example, override the `Authorization` header. + +- 1ea7679: Removed waiting for the workspace and repository fields to be filled in before requesting user credentials + +- d44a20a: Added additional plugin metadata to `package.json`. + +- 6cb4886: Updated dependency `@rjsf/utils` to `5.18.4`. + Updated dependency `@rjsf/core` to `5.18.4`. + Updated dependency `@rjsf/material-ui` to `5.18.4`. + Updated dependency `@rjsf/validator-ajv8` to `5.18.4`. + +- 75dcd7e: Fixing bug in `formData` type as it should be `optional` as it's possibly undefined + +- bcec60f: updated the ContextMenu, ActionsPage, OngoingTask and TemplateCard frontend components to support the new scaffolder permissions: + + - `scaffolder.task.create` + - `scaffolder.task.cancel` + - `scaffolder.task.read` + +- 612a453: Change owner to project for azure host + +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-compat-api@0.2.6 + - @backstage/integration@1.12.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-scaffolder-react@1.9.0 + - @backstage/plugin-scaffolder-common@1.5.3 + - @backstage/plugin-permission-react@0.4.23 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/integration-react@1.1.28 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/plugin-scaffolder-backend-module-github@0.3.0 + +### Minor Changes + +- 403394a: Allow empty author info in createPullRequest action for Github + +### Patch Changes + +- f145a04: Added handling for dry run to githubPullRequest and githubWebhook and added tests for this functionality +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-scaffolder-react@1.9.0 + +### Minor Changes + +- 62bd9eb: Replace `ui:widget: password` with the a warning message stating that it's not secure and to use the build in `SecretField`. + + You can do this by updating your `template.yaml` files that have the reference `ui:widget: password` to `ui:field: Secret` instead. + + ```diff + apiVersion: backstage.io/v1alpha1 + kind: Template + metadata: + ... + + spec: + parameters: + - title: collect some information + schema: + type: object + properties: + password: + title: Password + type: string + - ui:widget: password + + ui:field: Secret + steps: + - id: collect-info + name: Collect some information + action: acme:do:something + input: + - password: ${{ parameters.password }} + + password: ${{ secrets.password }} + ``` + +### Patch Changes + +- 86dc29d: Links that are rendered in the markdown in the `ScaffolderField` component are now opened in new tabs. +- d44a20a: Added additional plugin metadata to `package.json`. +- fa8560e: Prevents Autocomplete dropdown from overlapping sidebar on hovering it +- 6cb4886: Updated dependency `@rjsf/utils` to `5.18.4`. + Updated dependency `@rjsf/core` to `5.18.4`. + Updated dependency `@rjsf/material-ui` to `5.18.4`. + Updated dependency `@rjsf/validator-ajv8` to `5.18.4`. +- 75dcd7e: Fixing bug in `formData` type as it should be `optional` as it's possibly undefined +- 928cfa0: Fixed a typo ' + +## @backstage/plugin-search-backend-module-elasticsearch@1.5.0 + +### Minor Changes + +- b186701: **BREAKING**: The ElasticSearch indexer will now delete stale indices matching the indexer's pattern. + The method `getAliases` of `ElasticSearchClientWrapper` has been deprecated and might be removed in future releases. + + An indexer using the `some-type-index__*` pattern will remove indices matching this pattern after indexation + to prevent stale indices leading to shards exhaustion. + + Before upgrading ensure that the index pattern doesn't match indices that are not managed by Backstage + and thus shouldn't be deleted. + + Note: The ElasticSearch indexer already uses wildcards patterns to remove aliases on these indices. + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 6a576dc: Replace the usage of `getVoidLogger` with `mockServices.logger.mock` in order to remove the dependency with the soon-to-be-deprecated `backend-common` package. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-search-backend-node@1.2.24 + - @backstage/plugin-search-common@1.2.12 + - @backstage/config@1.2.0 + - @backstage/integration-aws-node@0.1.12 + +## @backstage/app-defaults@1.5.6 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/plugin-permission-react@0.4.23 + - @backstage/core-app-api@1.12.6 + +## @backstage/backend-app-api@0.7.6 + +### Patch Changes + +- b7de623: Fixed a potential crash when passing an object with a `null` prototype as log meta. + +- 9539a0b: Deprecated `authServiceFactory`, `httpAuthServiceFactory`, and `userInfoServiceFactory`. Please import them from `@backstage/backend-defaults/auth`, `@backstage/backend-defaults/httpAuth`, and `@backstage/backend-defaults/userInfo` respectively instead. + +- 3e823d3: Limited user tokens will no longer include the `ent` field in its payload. Ownership claims will now be fetched from the user info service. + + NOTE: Limited tokens issued prior to this change will no longer be valid. Users may have to clear their browser cookies in order to refresh their auth tokens. + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. + +- 398b82a: Add support for JWKS tokens in ExternalTokenHandler. + +- 9e63318: Added an optional `accessRestrictions` to external access service tokens and service principals in general, such that you can limit their access to certain plugins or permissions. + +- e25e467: Added a new static key based method for plugin-to-plugin auth. This is useful for example if you are running readonly service nodes that cannot use a database for the default public-key signature scheme outlined in [BEP-0003](https://github.com/backstage/backstage/tree/master/beps/0003-auth-architecture-evolution). Most users should want to stay on the more secure zero-config database signature scheme. + + You can generate a public and private key pair using `openssl`. + + - First 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 + ``` + + After this you have the files `private.key` and `public.key`. Put them in a place where you know their absolute paths, and then set up your app-config accordingly: + + ```yaml + backend: + auth: + keyStore: + type: static + static: + keys: + - publicKeyFile: /absolute/path/to/public.key + privateKeyFile: /absolute/path/to/private.key + keyId: some-custom-id + ``` + +- 7d30d95: Fixing issue with log meta fields possibly being circular refs + +- 6a576dc: Stop using `getVoidLogger` in tests to reduce the dependency on the soon-to-deprecate `backstage-common` package. + +- 6551b3d: Deprecated core service factories and implementations and moved them over to + subpath exports on `@backstage/backend-defaults` instead. E.g. + `@backstage/backend-defaults/scheduler` is where the service factory and default + implementation of `coreServices.scheduler` now lives. + +- d617103: Updating the logger redaction message to something less dramatic + +- Updated dependencies + - @backstage/cli-node@0.2.6 + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/cli-common@0.1.14 + - @backstage/config-loader@1.8.1 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/backend-dynamic-feature-service@0.2.11 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- Updated dependencies + - @backstage/cli-node@0.2.6 + - @backstage/backend-app-api@0.7.6 + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-catalog-backend@1.23.0 + - @backstage/plugin-events-backend@0.3.6 + - @backstage/plugin-search-backend-node@1.2.24 + - @backstage/plugin-events-node@0.3.5 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/plugin-search-common@1.2.12 + - @backstage/plugin-app-node@0.1.19 + - @backstage/cli-common@0.1.14 + - @backstage/config-loader@1.8.1 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/backend-openapi-utils@0.1.12 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/errors@1.2.4 + +## @backstage/backend-plugin-api@0.6.19 + +### Patch Changes + +- 78a0b08: **DEPRECATION**: You should no longer do a function call on backend features when adding them to backends. The support for doing that is deprecated, and you should remove all trailing `()` parentheses after plugins and modules where you add them to your backend or test backends (e.g. when using `startTestBackend`). + + The background for this is that `createBackendPlugin` and `createBackendModule` function now effectively return a `BackendFeature` rather than a `() => BackendFeature`. This is part of the cleanup efforts for New Backend System 1.0. In the short run this is non-breaking because the feature type has been given a callback signature that returns itself. But we strongly recommend that you remove all now-redundant calls made to feature objects, because that callback signature will be removed in a future release. + + Service factories are still callbacks at this point. + + Example change: + + ```diff + await startTestBackend({ + features: [ + eventsServiceFactory(), // service - stays unchanged + - catalogModuleBitbucketCloudEntityProvider(), // module - remove parentheses + + catalogModuleBitbucketCloudEntityProvider, + ``` + +- 9bdc3e8: In tests, return `null` rather than throwing an error when trying to get the `ExtensionPoint.T` property, so that tests asserting the property are not easily broken. + +- 9e63318: Added an optional `accessRestrictions` to external access service tokens and service principals in general, such that you can limit their access to certain plugins or permissions. + +- 3aa3fc7: Marked the `TokenManagerService` and `IdentityService` types as deprecated + +- b2ee7f3: Deprecated all of the `UrlReader` related type names and replaced them with prefixed versions. Please update your imports. + + - `ReadTreeOptions` was renamed to `UrlReaderServiceReadTreeOptions` + - `ReadTreeResponse` was renamed to `UrlReaderServiceReadTreeResponse` + - `ReadTreeResponseDirOptions` was renamed to `UrlReaderServiceReadTreeResponseDirOptions` + - `ReadTreeResponseFile` was renamed to `UrlReaderServiceReadTreeResponseFile` + - `ReadUrlResponse` was renamed to `UrlReaderServiceReadUrlResponse` + - `ReadUrlOptions` was renamed to `UrlReaderServiceReadUrlOptions` + - `SearchOptions` was renamed to `UrlReaderServiceSearchOptions` + - `SearchResponse` was renamed to `UrlReaderServiceSearchResponse` + - `SearchResponseFile` was renamed to `UrlReaderServiceSearchResponseFile` + +- 9539a0b: Improved `coreServices` doc comments + +- 6551b3d: Moved the declaration of the `SchedulerService` here, along with prefixed versions of all of the types it depends on, from `@backstage/backend-tasks` + +- 0665b7e: Renamed `BackendPluginConfig`, `BackendModuleConfig`, and `ExtensionPointConfig` respectively to `CreateBackendPluginOptions`, `CreateBackendModuleOptions`, and `CreateExtensionPointOptions` to standardize frontend and backend factories signatures. + +- 1779188: Start using the `isDatabaseConflictError` helper from the `@backstage/backend-plugin-api` package in order to avoid dependency with the soon to deprecate `@backstage/backend-common` package. + +- Updated dependencies + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/cli-common@0.1.14 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/backend-tasks@0.5.24 + +### Patch Changes + +- 736bc3c: Marked all exports as deprecated and pointed at `@backstage/backend-plugin-api` and `@backstage/backend-defaults` +- ed473cd: Updated the `TaskScheduleDefinitionConfig` deprecated comment to point to `SchedulerServiceTaskScheduleDefinitionConfig` +- 6a576dc: Deprecate the legacy `TaskScheduler.fromConfig` method and stop using the `getVoidlogger` in tests files to reduce the dependency on the soon-to-deprecate `backstage-common` package. +- 1897169: More detailed deprecation messages +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/cli@0.26.7 + +### Patch Changes + +- 788eca7: Fix readme for new plugins created using cli +- 90c5268: Add `peerDependencies` to `devDependencies` in `package.json.hbs` templates. +- c00f7ee: Fix issue with `esm` loaded dependencies being different from the `cjs` import for Vite dependencies +- b0f66e9: Updated dependency `vite-plugin-node-polyfills` to `^0.22.0`. +- c328131: Added a new `--publish` flag to the `repo fix` command. This command will validate and if possible generate the metadata required for publishing packages with the Backstage CLI. In addition, a check has been added that the `backstage.pluginId` and `backstage.pluginPackage(s)` fields are present when packing a package for publishing. +- 5afbe1d: Export default module for `scaffolder-action` cli template +- 009da47: Fix `versions:check --fix` when `yarn.lock` has multiple joint versions in the same section +- 9ee948a: Bump `esbuild` target for package builds to `ES2022`. +- Updated dependencies + - @backstage/cli-node@0.2.6 + - @backstage/integration@1.12.0 + - @backstage/cli-common@0.1.14 + - @backstage/config-loader@1.8.1 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/eslint-plugin@0.1.8 + - @backstage/release-manifests@0.0.11 + - @backstage/types@1.1.1 + +## @backstage/cli-common@0.1.14 + +### Patch Changes + +- 142abb0: The monorepo root check in `findPaths` will now accept a shorthand `workspaces` config in `package.json`, no longer requiring `workspaces.packages`. + +## @backstage/cli-node@0.2.6 + +### Patch Changes + +- a1ae9cc: Updated doc link. +- c328131: Added new plugin metadata fields to `BackstagePackageJson` type. +- 93be042: Upgraded @yarnpkg/parsers to stable 3.0 +- Updated dependencies + - @backstage/cli-common@0.1.14 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/codemods@0.1.49 + +### Patch Changes + +- Updated dependencies + - @backstage/cli-common@0.1.14 + +## @backstage/config-loader@1.8.1 + +### Patch Changes + +- Updated dependencies + - @backstage/cli-common@0.1.14 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/core-app-api@1.12.6 + +### Patch Changes + +- 35fbe09: Added support for configuration of route bindings through static configuration, and default targets for external route refs. + + In addition to configuring route bindings through code, it is now also possible to configure route bindings under the `app.routes.bindings` key, for example: + + ```yaml + app: + routes: + bindings: + catalog.createComponent: catalog-import.importPage + ``` + + Each key in the route binding object is of the form `.`, where the route name is key used in the `externalRoutes` object passed to `createPlugin`. The value is of the same form, but with the name taken from the plugin `routes` option instead. + + The equivalent of the above configuration in code is the following: + + ```ts + const app = createApp({ + // ... + bindRoutes({ bind }) { + bind(catalogPlugin.externalRoutes, { + createComponent: catalogImportPlugin.routes.importPage, + }); + }, + }); + ``` + +- Updated dependencies + - @backstage/core-plugin-api@1.9.3 + - @backstage/config@1.2.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + +## @backstage/core-compat-api@0.2.6 + +### Patch Changes + +- 35fbe09: Add support for forwarding default target from legacy external route refs. +- Updated dependencies + - @backstage/core-plugin-api@1.9.3 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/version-bridge@1.0.8 + +## @backstage/core-components@0.14.8 + +### Patch Changes + +- a0b46f6: Having tooltip inherit font size for consistency in catalog table columns +- 59cee81: Use `inherit` variant on OverflowTooltip underlying Typography component. +- eae0e4d: Fixed an issue causing `SidebarSubmenu` text to not follow the theme color +- e4811ec: Make number of decimal digits in Gauge configurable via the `decimalDigits` property +- 83c4251: Adds icons to status component +- 3e175c8: Removed max width from `Select` component. +- 57d7582: Fixed a bug in `SupportButton` where the title was rendered with the characteristics of a button. +- Updated dependencies + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/version-bridge@1.0.8 + +## @backstage/core-plugin-api@1.9.3 + +### Patch Changes + +- 35fbe09: A new `defaultTarget` option has been added to `createExternalRouteRef`. This allows one to specify a default target of the route by name, for example `'catalog.catalogIndex'`, which will be used if the target route is present in the app and there is no explicit route binding. +- Updated dependencies + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + +## @backstage/create-app@0.5.16 + +### Patch Changes + +- cce0495: Bumped create-app version. +- 77da22e: Bumped create-app version. +- 2110d76: Removed `dockerode` dependency. +- 34daaea: Fixed a broken link to the node-postgres documentation +- 78363f6: Bumped TypeScript to version `5.4`. +- 1a212f9: Remove Tech Radar menu item from sidebar of scaffolded app to align with removal of tech-radar plugin from backend +- 81507c8: Updated `node-gyp` to v10 +- Updated dependencies + - @backstage/cli-common@0.1.14 + +## @backstage/dev-utils@1.0.33 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/core-app-api@1.12.6 + - @backstage/integration-react@1.1.28 + - @backstage/app-defaults@1.5.6 + - @backstage/catalog-model@1.5.0 + +## @backstage/frontend-app-api@0.7.1 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/core-app-api@1.12.6 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + +## @backstage/frontend-plugin-api@0.6.6 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + +## @backstage/frontend-test-utils@0.1.8 + +### Patch Changes + +- Updated dependencies + - @backstage/frontend-app-api@0.7.1 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/test-utils@1.5.6 + - @backstage/types@1.1.1 + +## @backstage/integration-react@1.1.28 + +### Patch Changes + +- 23ee9ab: Fix AWS CodeCommit integration by allowing to change the host +- Updated dependencies + - @backstage/integration@1.12.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/config@1.2.0 + +## @backstage/repo-tools@0.9.1 + +### Patch Changes + +- 8721a02: Add `--client-additional-properties` option to `openapi generate` command +- Updated dependencies + - @backstage/cli-node@0.2.6 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/cli-common@0.1.14 + - @backstage/config-loader@1.8.1 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + +## @techdocs/cli@1.8.12 + +### Patch Changes + +- 2110d76: Removed `dockerode` dependency. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/plugin-techdocs-node@1.12.5 + - @backstage/cli-common@0.1.14 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + +## @backstage/test-utils@1.5.6 + +### Patch Changes + +- Updated dependencies + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-permission-react@0.4.23 + - @backstage/core-app-api@1.12.6 + - @backstage/config@1.2.0 + - @backstage/types@1.1.1 + +## @backstage/theme@0.5.6 + +### Patch Changes + +- 702fa7d: Internal refactor to fix an issue where the MUI 5 `v5-` class prefixing gets removed by tree shaking. + +## @backstage/plugin-api-docs@0.11.6 + +### Patch Changes + +- 7f84039: The `registerComponent` external route will now by default bind to the catalog import page if it is available. +- 9cdc651: Make sure that the toggle button state is properly reflected in API cards +- d44a20a: Added additional plugin metadata to `package.json`. +- 96cd13e: `DefaultApiExplorerPage` now accepts an optional `ownerPickerMode` for toggling the behavior of the `EntityOwnerPicker`, exposing a new mode `` particularly suitable for larger catalogs. In this new mode, `EntityOwnerPicker` will display all the users and groups present in the catalog. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-compat-api@0.2.6 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-permission-react@0.4.23 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/plugin-catalog@1.21.0 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/catalog-model@1.5.0 + +## @backstage/plugin-api-docs-module-protoc-gen-doc@0.1.7 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. + +## @backstage/plugin-app-backend@0.3.68 + +### Patch Changes + +- 8869b8e: Updated local development setup. +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 82c2b90: Restore the support of external config schema in the router of the `app-backend` plugin, which was broken in release `1.26.0`. + This support is critical for dynamic frontend plugins to have access to their config values. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-app-node@0.1.19 + - @backstage/config-loader@1.8.1 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/plugin-app-node@0.1.19 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/config-loader@1.8.1 + +## @backstage/plugin-app-visualizer@0.1.7 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/frontend-plugin-api@0.6.6 + +## @backstage/plugin-auth-backend@0.22.6 + +### Patch Changes + +- 3e823d3: Limited user tokens will no longer include the `ent` field in its payload. Ownership claims will now be fetched from the user info service. + + NOTE: Limited tokens issued prior to this change will no longer be valid. Users may have to clear their browser cookies in order to refresh their auth tokens. + +- 8869b8e: Updated local development setup. + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. + +- d44a20a: Added additional plugin metadata to `package.json`. + +- 3e1bb15: Updated to use the new `@backstage/plugin-auth-backend-module-onelogin-provider` implementation + +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/plugin-auth-backend-module-onelogin-provider@0.1.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-auth-backend-module-cloudflare-access-provider@0.1.2 + - @backstage/plugin-auth-backend-module-azure-easyauth-provider@0.1.2 + - @backstage/plugin-auth-backend-module-oauth2-proxy-provider@0.1.12 + - @backstage/plugin-auth-backend-module-atlassian-provider@0.2.0 + - @backstage/plugin-auth-backend-module-bitbucket-provider@0.1.2 + - @backstage/plugin-auth-backend-module-microsoft-provider@0.1.14 + - @backstage/plugin-auth-backend-module-aws-alb-provider@0.1.11 + - @backstage/plugin-auth-backend-module-gcp-iap-provider@0.2.14 + - @backstage/plugin-auth-backend-module-github-provider@0.1.16 + - @backstage/plugin-auth-backend-module-gitlab-provider@0.1.16 + - @backstage/plugin-auth-backend-module-google-provider@0.1.16 + - @backstage/plugin-auth-backend-module-oauth2-provider@0.2.0 + - @backstage/plugin-auth-backend-module-oidc-provider@0.2.0 + - @backstage/plugin-auth-backend-module-okta-provider@0.0.12 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/plugin-auth-backend-module-aws-alb-provider@0.1.11 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-auth-backend@0.22.6 + - @backstage/errors@1.2.4 + +## @backstage/plugin-auth-backend-module-azure-easyauth-provider@0.1.2 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-auth-backend-module-bitbucket-provider@0.1.2 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 8efc6cf: Added support for the new shared `additionalScopes` configuration. In addition, the `account` scope has been set to required and will always be present. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + +## @backstage/plugin-auth-backend-module-cloudflare-access-provider@0.1.2 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- 1354d81: Use `node-fetch` instead of native fetch, as per +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-auth-backend-module-gcp-iap-provider@0.2.14 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/plugin-auth-backend-module-github-provider@0.1.16 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 8efc6cf: Added support for the new shared `additionalScopes` configuration. In addition, the `read:user` scope has been set to required and will always be present. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + +## @backstage/plugin-auth-backend-module-gitlab-provider@0.1.16 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 8efc6cf: Added support for the new shared `additionalScopes` configuration. In addition, the `read_user` scope has been set to required and will always be present. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + +## @backstage/plugin-auth-backend-module-google-provider@0.1.16 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 8efc6cf: Added support for the new shared `additionalScopes` configuration. In addition, the `openid`, `userinfo.email`, and `userinfo.profile` scopes have been set to required and will always be present. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + +## @backstage/plugin-auth-backend-module-guest-provider@0.1.5 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-auth-backend-module-microsoft-provider@0.1.14 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 8efc6cf: Added support for the new shared `additionalScopes` configuration. +- d44a20a: Added additional plugin metadata to `package.json`. +- c187a9c: Minor internal type updates +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + +## @backstage/plugin-auth-backend-module-oauth2-proxy-provider@0.1.12 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/errors@1.2.4 + +## @backstage/plugin-auth-backend-module-okta-provider@0.0.12 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 8efc6cf: Added support for the new shared `additionalScopes` configuration, which means it can now also be specified as an array. In addition, the `openid`, `email`, `profile`, and `offline_access` scopes have been set to required and will always be present. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + +## @backstage/plugin-auth-backend-module-pinniped-provider@0.1.13 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 8efc6cf: **BREAKING**: The `scope` config option have been removed and replaced by the standard `additionalScopes` config. In addition, the `openid`, `pinniped:request-audience`, `username`, and `offline_access` scopes have been set to required and will always be present. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/config@1.2.0 + +## @backstage/plugin-auth-node@0.4.14 + +### Patch Changes + +- 798ec37: Updated scope management for OAuth providers, where the `createOAuthAuthenticator` now accepts a new collection of `scopes` options: + + - `scopes.persist` - Whether scopes should be persisted, replaces the `shouldPersistScopes` option. + - `scopes.required` - A list of required scopes that will always be requested. + - `scopes.transform` - A function that can be used to transform the scopes before they are requested. + + The `createOAuthProviderFactory` has also received a new `additionalScopes` option, and will also read `additionalScopes` from the auth provider configuration. Both of these can be used to add additional scopes that should always be requested. + + A significant change under the hood that this new scope management brings is that providers that persist scopes will now always merge the already granted scopes with the requested ones. The previous behavior was that the full authorization flow would not include existing scopes, while the refresh flow would only include the existing scopes. + +- d44a20a: Added additional plugin metadata to `package.json`. + +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/plugin-auth-react@0.1.3 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/errors@1.2.4 + +## @backstage/plugin-bitbucket-cloud-common@0.2.20 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/integration@1.12.0 + +## @backstage/plugin-catalog-backend-module-aws@0.3.14 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/integration@1.12.0 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-kubernetes-common@0.8.0 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/integration-aws-node@0.1.12 + +## @backstage/plugin-catalog-backend-module-azure@0.1.39 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/integration@1.12.0 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/config@1.2.0 + +## @backstage/plugin-catalog-backend-module-backstage-openapi@0.2.2 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/backend-openapi-utils@0.1.12 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-catalog-backend-module-bitbucket-cloud@0.2.6 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 6a576dc: Replace the usage of `getVoidLogger` with `mockServices.logger.mock` in order to remove the dependency with the soon-to-be-deprecated `backend-common` package. +- b51e823: Remove debug console logging statement +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/integration@1.12.0 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-events-node@0.3.5 + - @backstage/plugin-bitbucket-cloud-common@0.2.20 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + +## @backstage/plugin-catalog-backend-module-bitbucket-server@0.1.33 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/integration@1.12.0 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-catalog-backend-module-gcp@0.1.20 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-kubernetes-common@0.8.0 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + +## @backstage/plugin-catalog-backend-module-gerrit@0.1.36 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/integration@1.12.0 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-catalog-backend-module-github@0.6.2 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- 67d0530: Fix bug in root repo import where catalog-info.yaml.hcl file is found by search and breaks the import +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-catalog-backend@1.23.0 + - @backstage/integration@1.12.0 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-events-node@0.3.5 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + +## @backstage/plugin-catalog-backend-module-github-org@0.1.14 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-catalog-backend-module-github@0.6.2 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-events-node@0.3.5 + - @backstage/config@1.2.0 + +## @backstage/plugin-catalog-backend-module-gitlab@0.3.18 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- 150fc77: Fixed an issue in `GitlabOrgDiscoveryEntityProvider` where a missing `orgEnabled` config key was throwing an error. +- f271164: Fixed an issue in `GitlabDiscoveryEntityProvider` where the fallback branch was taking precedence over the GitLab default branch. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/integration@1.12.0 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-events-node@0.3.5 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + +## @backstage/plugin-catalog-backend-module-gitlab-org@0.0.2 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-catalog-backend-module-gitlab@0.3.18 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-events-node@0.3.5 + +## @backstage/plugin-catalog-backend-module-incremental-ingestion@0.4.24 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-catalog-backend@1.23.0 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-events-node@0.3.5 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-catalog-backend-module-msgraph@0.5.27 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- f7be17a: Added missing `userSelect` property in `readMicrosoftGraphOrg` method +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + +## @backstage/plugin-catalog-backend-module-openapi@0.1.37 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-catalog-backend@1.23.0 + - @backstage/integration@1.12.0 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/types@1.1.1 + +## @backstage/plugin-catalog-backend-module-puppetdb@0.1.25 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/plugin-catalog-backend-module-scaffolder-entity-model@0.1.17 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-scaffolder-common@1.5.3 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/catalog-model@1.5.0 + +## @backstage/plugin-catalog-backend-module-unprocessed@0.4.6 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-catalog-unprocessed-entities-common@0.0.2 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-catalog-common@1.0.24 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-search-common@1.2.12 + - @backstage/catalog-model@1.5.0 + +## @backstage/plugin-catalog-graph@0.4.6 + +### Patch Changes + +- 8d474d3: Add function to `EntityRelationsGraph` filter that excludes entities from graph +- d44a20a: Added additional plugin metadata to `package.json`. +- cd6aeea: The `catalogEntity` external route will now by default bind to the catalog entity page if it is available. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-compat-api@0.2.6 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/types@1.1.1 + +## @backstage/plugin-catalog-node@1.12.1 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/plugin-catalog-react@1.12.1 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- fa8560e: Prevents Autocomplete dropdown from overlapping sidebar on hovering it +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-permission-react@0.4.23 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/integration-react@1.1.28 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + +## @backstage/plugin-catalog-unprocessed-entities@0.2.5 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-catalog-unprocessed-entities-common@0.0.2 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/plugin-permission-common@0.7.14 + +## @backstage/plugin-config-schema@0.1.56 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/plugin-devtools@0.1.15 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-compat-api@0.2.6 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-permission-react@0.4.23 + - @backstage/plugin-devtools-common@0.1.10 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/errors@1.2.4 + +## @backstage/plugin-devtools-backend@0.3.5 + +### Patch Changes + +- 8869b8e: Updated local development setup. +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-devtools-common@0.1.10 + - @backstage/cli-common@0.1.14 + - @backstage/config-loader@1.8.1 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/plugin-devtools-common@0.1.10 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/plugin-permission-common@0.7.14 + - @backstage/types@1.1.1 + +## @backstage/plugin-events-backend@0.3.6 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-events-node@0.3.5 + - @backstage/config@1.2.0 + +## @backstage/plugin-events-backend-module-aws-sqs@0.3.5 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-events-node@0.3.5 + - @backstage/config@1.2.0 + - @backstage/types@1.1.1 + +## @backstage/plugin-events-backend-module-azure@0.2.5 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-events-node@0.3.5 + +## @backstage/plugin-events-backend-module-bitbucket-cloud@0.2.5 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-events-node@0.3.5 + +## @backstage/plugin-events-backend-module-gerrit@0.2.5 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-events-node@0.3.5 + +## @backstage/plugin-events-backend-module-github@0.2.5 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-events-node@0.3.5 + - @backstage/config@1.2.0 + +## @backstage/plugin-events-backend-module-gitlab@0.2.5 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-events-node@0.3.5 + - @backstage/config@1.2.0 + +## @backstage/plugin-events-backend-test-utils@0.1.29 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/plugin-events-node@0.3.5 + +## @backstage/plugin-events-node@0.3.5 + +### Patch Changes + +- 6a576dc: Replace the usage of `getVoidLogger` with `mockServices.logger.mock` in order to remove the dependency with the soon-to-be-deprecated `backend-common` package. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + +## @backstage/plugin-home@0.7.5 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- 6cb4886: Updated dependency `@rjsf/utils` to `5.18.4`. + Updated dependency `@rjsf/core` to `5.18.4`. + Updated dependency `@rjsf/material-ui` to `5.18.4`. + Updated dependency `@rjsf/validator-ajv8` to `5.18.4`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-compat-api@0.2.6 + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/plugin-home-react@0.1.14 + - @backstage/core-app-api@1.12.6 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + +## @backstage/plugin-home-react@0.1.14 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- 6cb4886: Updated dependency `@rjsf/utils` to `5.18.4`. + Updated dependency `@rjsf/core` to `5.18.4`. + Updated dependency `@rjsf/material-ui` to `5.18.4`. + Updated dependency `@rjsf/validator-ajv8` to `5.18.4`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + +## @backstage/plugin-kubernetes@0.11.11 + +### Patch Changes + +- 4f92394: Migrate from identityApi to fetchApi in frontend plugins. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/plugin-kubernetes-react@0.4.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-kubernetes-common@0.8.0 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/catalog-model@1.5.0 + +## @backstage/plugin-kubernetes-cluster@0.0.12 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/plugin-kubernetes-react@0.4.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-kubernetes-common@0.8.0 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/catalog-model@1.5.0 + +## @backstage/plugin-kubernetes-node@0.1.13 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-kubernetes-common@0.8.0 + - @backstage/catalog-model@1.5.0 + - @backstage/types@1.1.1 + +## @backstage/plugin-notifications@0.2.2 + +### Patch Changes + +- 7f02684: Do not always show scrollbars in notification description +- 6d196b4: Fixes performance issue with Notifications title counter. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/plugin-notifications-common@0.0.4 + - @backstage/plugin-signals-react@0.0.4 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/plugin-notifications-common@0.0.4 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. + +## @backstage/plugin-org@0.6.26 + +### Patch Changes + +- d8e2f53: The `catalogIndex` external route is now optional and will by default bind to the catalog index page if it is available. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-compat-api@0.2.6 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/catalog-model@1.5.0 + +## @backstage/plugin-org-react@0.1.25 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + +## @backstage/plugin-permission-backend@0.5.43 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-permission-backend-module-allow-all-policy@0.1.16 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/plugin-permission-common@0.7.14 + +## @backstage/plugin-permission-common@0.7.14 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/plugin-permission-node@0.7.30 + +### Patch Changes + +- 9e63318: Ensure that service token access restrictions, when present, are taken into account +- d44a20a: Added additional plugin metadata to `package.json`. +- c7b0dd1: Import `tokenManager` definition from `@backstage/backend-plugin-api` +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-permission-react@0.4.23 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/config@1.2.0 + +## @backstage/plugin-scaffolder-backend@1.22.9 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. + +- 5c65785: Fixing issues with log redaction in the scaffolder logs + +- d44a20a: Added additional plugin metadata to `package.json`. + +- 7d30d95: Fixing issue with log meta fields possibly being circular refs + +- d617103: Updating the logger redaction message to something less dramatic + +- f4c8486: Increase max wait time in debug:wait action to 10 minutes + +- bcec60f: added the following new permissions to the scaffolder backend endpoints: + + - `scaffolder.task.create` + - `scaffolder.task.cancel` + - `scaffolder.task.read` + +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-scaffolder-backend-module-github@0.3.0 + - @backstage/integration@1.12.0 + - @backstage/plugin-catalog-backend-module-scaffolder-entity-model@0.1.17 + - @backstage/plugin-scaffolder-backend-module-bitbucket-server@0.1.9 + - @backstage/plugin-scaffolder-backend-module-bitbucket-cloud@0.1.9 + - @backstage/plugin-scaffolder-backend-module-bitbucket@0.2.9 + - @backstage/plugin-scaffolder-backend-module-gerrit@0.1.11 + - @backstage/plugin-scaffolder-backend-module-gitlab@0.4.1 + - @backstage/plugin-scaffolder-backend-module-azure@0.1.11 + - @backstage/plugin-scaffolder-backend-module-gitea@0.1.9 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-scaffolder-common@1.5.3 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/plugin-scaffolder-backend-module-azure@0.1.11 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- b4169ee: Use `GitRepository.webUrl` instead of `GitRepository.remoteUrl` to set the value of `repoContentsUrl` as `remoteUrl` can sometimes return an URL with the wrong format (e.g. `https://@dev.azure.com///\_git/`). +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-scaffolder-backend-module-bitbucket@0.2.9 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-backend-module-bitbucket-server@0.1.9 + - @backstage/plugin-scaffolder-backend-module-bitbucket-cloud@0.1.9 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-scaffolder-backend-module-bitbucket-cloud@0.1.9 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-scaffolder-backend-module-bitbucket-server@0.1.9 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-scaffolder-backend-module-confluence-to-markdown@0.2.20 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-scaffolder-backend-module-cookiecutter@0.2.43 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/plugin-scaffolder-backend-module-gerrit@0.1.11 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-scaffolder-backend-module-gitea@0.1.9 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- 1354d81: Use `node-fetch` instead of native fetch, as per +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-scaffolder-backend-module-gitlab@0.4.1 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- cf96041: Added `gitlab:issue:edit` action to edit existing GitLab issues +- d44a20a: Added additional plugin metadata to `package.json`. +- 829e0ec: Add new `gitlab:pipeline:trigger` action to trigger GitLab pipelines. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-scaffolder-backend-module-notifications@0.0.2 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-notifications-node@0.2.0 + - @backstage/plugin-notifications-common@0.0.4 + - @backstage/plugin-scaffolder-node@0.4.5 + +## @backstage/plugin-scaffolder-backend-module-rails@0.4.36 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/plugin-scaffolder-backend-module-sentry@0.1.27 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- 1354d81: Use `node-fetch` instead of native fetch, as per +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-scaffolder-backend-module-yeoman@0.3.2 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-scaffolder-node-test-utils@0.1.5 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/types@1.1.1 + +## @backstage/plugin-scaffolder-common@1.5.3 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. + +- bcec60f: added the following new permissions to the scaffolder backend endpoints: + + - `scaffolder.task.create` + - `scaffolder.task.cancel` + - `scaffolder.task.read` + +- Updated dependencies + - @backstage/plugin-permission-common@0.7.14 + - @backstage/catalog-model@1.5.0 + - @backstage/types@1.1.1 + +## @backstage/plugin-scaffolder-node@0.4.5 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-common@1.5.3 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/plugin-scaffolder-node-test-utils@0.1.5 + +### Patch Changes + +- 6a576dc: Replace the usage of `getVoidLogger` with `mockServices.logger.mock` in order to remove the dependency with the soon-to-be-deprecated `backend-common` package. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-test-utils@0.4.0 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/types@1.1.1 + +## @backstage/plugin-search@1.4.12 + +### Patch Changes + +- 4f92394: Migrate from identityApi to fetchApi in frontend plugins. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-compat-api@0.2.6 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/plugin-search-common@1.2.12 + - @backstage/plugin-search-react@1.7.12 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + +## @backstage/plugin-search-backend@1.5.10 + +### Patch Changes + +- 8869b8e: Updated local development setup. +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- 5b6f979: Split backend search plugin startup into "init" and "start" stages to ensure necessary initialization has happened before startup +- 34dc47d: Move @backstage/repo-tools to devDependencies +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-defaults@0.3.0 + - @backstage/plugin-search-backend-node@1.2.24 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-search-common@1.2.12 + - @backstage/backend-openapi-utils@0.1.12 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/plugin-search-backend-module-catalog@0.1.25 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-search-backend-node@1.2.24 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-search-common@1.2.12 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-search-backend-module-explore@0.1.25 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-search-backend-node@1.2.24 + - @backstage/plugin-search-common@1.2.12 + - @backstage/config@1.2.0 + +## @backstage/plugin-search-backend-module-pg@0.5.28 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 6a576dc: Replace the usage of `getVoidLogger` with `mockServices.logger.mock` in order to remove the dependency with the soon-to-be-deprecated `backend-common` package. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-app-api@0.7.6 + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-search-backend-node@1.2.24 + - @backstage/plugin-search-common@1.2.12 + - @backstage/config@1.2.0 + +## @backstage/plugin-search-backend-module-stack-overflow-collator@0.1.12 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-search-backend-node@1.2.24 + - @backstage/plugin-search-common@1.2.12 + - @backstage/config@1.2.0 + +## @backstage/plugin-search-backend-module-techdocs@0.1.24 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-techdocs-node@1.12.5 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-search-backend-node@1.2.24 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-search-common@1.2.12 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + +## @backstage/plugin-search-backend-node@1.2.24 + +### Patch Changes + +- 6a576dc: Replace the usage of `getVoidLogger` with `mockServices.logger.mock` in order to remove the dependency with the soon-to-be-deprecated `backend-common` package. +- d44a20a: Added additional plugin metadata to `package.json`. +- 5b6f979: Split backend search plugin startup into "init" and "start" stages to ensure necessary initialization has happened before startup +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-search-common@1.2.12 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-search-common@1.2.12 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/plugin-permission-common@0.7.14 + - @backstage/types@1.1.1 + +## @backstage/plugin-search-react@1.7.12 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/plugin-search-common@1.2.12 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + +## @backstage/plugin-signals@0.0.7 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/plugin-signals-react@0.0.4 + - @backstage/types@1.1.1 + +## @backstage/plugin-signals-backend@0.1.5 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 6a576dc: Replace the usage of `getVoidLogger` with `mockServices.logger.mock` in order to remove the dependency with the soon-to-be-deprecated `backend-common` package. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-events-node@0.3.5 + - @backstage/plugin-signals-node@0.1.5 + - @backstage/config@1.2.0 + - @backstage/types@1.1.1 + +## @backstage/plugin-signals-node@0.1.5 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-events-node@0.3.5 + - @backstage/config@1.2.0 + - @backstage/types@1.1.1 + +## @backstage/plugin-signals-react@0.0.4 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-plugin-api@1.9.3 + - @backstage/types@1.1.1 + +## @backstage/plugin-techdocs@1.10.6 + +### Patch Changes + +- 654af4a: mkdocs-material have updated their CSS variable template, and a few are unset in Backstage. This patch adds the missing variables to ensure coverage. +- cbebad1: Internal updates to allow reusing Backstage's `fetchApi` implementation for event source requests. This allows you to for example, override the `Authorization` header. +- 96cd13e: `TechDocsIndexPage` now accepts an optional `ownerPickerMode` for toggling the behavior of the `EntityOwnerPicker`, exposing a new mode `` particularly suitable for larger catalogs. In this new mode, `EntityOwnerPicker` will display all the users and groups present in the catalog. +- e40bd9a: Fixed bug in `CopyToClipboardButton` component where positioning of the "Copy to clipboard" button in techdocs code snippets was broken in some cases. +- d44a20a: Added additional plugin metadata to `package.json`. +- 1256d88: Fixed an issue preventing the `TechDocsSearchBar` component from opening when clicking on the arrow icon. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-compat-api@0.2.6 + - @backstage/integration@1.12.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/plugin-techdocs-react@1.2.5 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/plugin-search-common@1.2.12 + - @backstage/plugin-search-react@1.7.12 + - @backstage/plugin-auth-react@0.1.3 + - @backstage/integration-react@1.1.28 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-techdocs-addons-test-utils@1.0.33 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/plugin-techdocs@1.10.6 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-techdocs-react@1.2.5 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/plugin-search-react@1.7.12 + - @backstage/plugin-catalog@1.21.0 + - @backstage/core-app-api@1.12.6 + - @backstage/integration-react@1.1.28 + - @backstage/test-utils@1.5.6 + +## @backstage/plugin-techdocs-backend@1.10.6 + +### Patch Changes + +- e64bfb2: Allow defining custom build log transport for techdocs builder +- 8869b8e: Updated local development setup. +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 2110d76: Removed `dockerode` dependency. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-techdocs-node@1.12.5 + - @backstage/integration@1.12.0 + - @backstage/plugin-search-backend-module-techdocs@0.1.24 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-techdocs-module-addons-contrib@1.1.11 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/integration@1.12.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-techdocs-react@1.2.5 + - @backstage/integration-react@1.1.28 + +## @backstage/plugin-techdocs-node@1.12.5 + +### Patch Changes + +- e64bfb2: Allow defining custom build log transport for techdocs builder +- 48c38f0: `TechdocsGenerator` won't require a `containerRunner` option anymore for generating TechDocs in docker. +- d44a20a: Added additional plugin metadata to `package.json`. +- 5db7536: Updated `getRepoUrlFromLocationAnnotation` to check for Harness SCM integration +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-search-common@1.2.12 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/integration-aws-node@0.1.12 + +## @backstage/plugin-techdocs-react@1.2.5 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/version-bridge@1.0.8 + +## @backstage/plugin-user-settings@0.8.7 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- e6ec179: Use signals to update user settings across sessions +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-compat-api@0.2.6 + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/plugin-user-settings-common@0.0.1 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/plugin-signals-react@0.0.4 + - @backstage/core-app-api@1.12.6 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/plugin-user-settings-backend@0.2.18 + +### Patch Changes + +- 8869b8e: Updated local development setup. +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- e6ec179: Use signals to update user settings across sessions +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-user-settings-common@0.0.1 + - @backstage/plugin-signals-node@0.1.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/plugin-user-settings-common@0.0.1 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- e6ec179: Use signals to update user settings across sessions + +## example-app@0.2.98 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/plugin-techdocs@1.10.6 + - @backstage/plugin-api-docs@0.11.6 + - @backstage/cli@0.26.7 + - @backstage/plugin-scaffolder@1.21.0 + - @backstage/plugin-catalog-import@0.12.0 + - @backstage/plugin-kubernetes@0.11.11 + - @backstage/plugin-search@1.4.12 + - @backstage/plugin-catalog-graph@0.4.6 + - @backstage/plugin-notifications@0.2.2 + - @backstage/plugin-org@0.6.26 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-scaffolder-react@1.9.0 + - @backstage/theme@0.5.6 + - @backstage/plugin-techdocs-module-addons-contrib@1.1.11 + - @backstage/plugin-catalog-unprocessed-entities@0.2.5 + - @backstage/plugin-kubernetes-cluster@0.0.12 + - @backstage/plugin-permission-react@0.4.23 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-techdocs-react@1.2.5 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/plugin-search-common@1.2.12 + - @backstage/plugin-user-settings@0.8.7 + - @backstage/plugin-search-react@1.7.12 + - @backstage/plugin-auth-react@0.1.3 + - @backstage/plugin-devtools@0.1.15 + - @backstage/plugin-catalog@1.21.0 + - @backstage/plugin-signals@0.0.7 + - @backstage/plugin-home@0.7.5 + - @backstage/core-app-api@1.12.6 + - @backstage/integration-react@1.1.28 + - @backstage/app-defaults@1.5.6 + - @backstage/frontend-app-api@0.7.1 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + +## example-app-next@0.0.12 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/plugin-techdocs@1.10.6 + - @backstage/plugin-api-docs@0.11.6 + - @backstage/core-compat-api@0.2.6 + - @backstage/cli@0.26.7 + - @backstage/plugin-scaffolder@1.21.0 + - @backstage/plugin-catalog-import@0.12.0 + - @backstage/plugin-kubernetes@0.11.11 + - @backstage/plugin-search@1.4.12 + - @backstage/plugin-catalog-graph@0.4.6 + - @backstage/plugin-notifications@0.2.2 + - @backstage/plugin-org@0.6.26 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-scaffolder-react@1.9.0 + - @backstage/theme@0.5.6 + - @backstage/plugin-techdocs-module-addons-contrib@1.1.11 + - @backstage/plugin-catalog-unprocessed-entities@0.2.5 + - @backstage/plugin-kubernetes-cluster@0.0.12 + - @backstage/plugin-permission-react@0.4.23 + - @backstage/plugin-app-visualizer@0.1.7 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-techdocs-react@1.2.5 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/plugin-search-common@1.2.12 + - @backstage/plugin-user-settings@0.8.7 + - @backstage/plugin-search-react@1.7.12 + - @backstage/plugin-auth-react@0.1.3 + - @backstage/plugin-catalog@1.21.0 + - @backstage/plugin-signals@0.0.7 + - @backstage/plugin-home@0.7.5 + - @backstage/core-app-api@1.12.6 + - @backstage/integration-react@1.1.28 + - @backstage/app-defaults@1.5.6 + - @backstage/frontend-app-api@0.7.1 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + +## app-next-example-plugin@0.0.12 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/frontend-plugin-api@0.6.6 + +## example-backend@0.0.27 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-auth-backend@0.22.6 + - @backstage/plugin-techdocs-backend@1.10.6 + - @backstage/plugin-scaffolder-backend-module-github@0.3.0 + - @backstage/plugin-devtools-backend@0.3.5 + - @backstage/plugin-catalog-backend@1.23.0 + - @backstage/plugin-search-backend@1.5.10 + - @backstage/plugin-proxy-backend@0.5.0 + - @backstage/plugin-app-backend@0.3.68 + - @backstage/plugin-catalog-backend-module-scaffolder-entity-model@0.1.17 + - @backstage/plugin-permission-backend-module-allow-all-policy@0.1.16 + - @backstage/plugin-catalog-backend-module-backstage-openapi@0.2.2 + - @backstage/plugin-auth-backend-module-github-provider@0.1.16 + - @backstage/plugin-auth-backend-module-guest-provider@0.1.5 + - @backstage/plugin-catalog-backend-module-unprocessed@0.4.6 + - @backstage/plugin-catalog-backend-module-openapi@0.1.37 + - @backstage/plugin-search-backend-module-techdocs@0.1.24 + - @backstage/plugin-search-backend-module-catalog@0.1.25 + - @backstage/plugin-search-backend-module-explore@0.1.25 + - @backstage/plugin-notifications-backend@0.3.0 + - @backstage/plugin-kubernetes-backend@0.18.0 + - @backstage/plugin-permission-backend@0.5.43 + - @backstage/plugin-scaffolder-backend@1.22.9 + - @backstage/plugin-signals-backend@0.1.5 + - @backstage/backend-defaults@0.3.0 + - @backstage/plugin-search-backend-node@1.2.24 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/catalog-model@1.5.0 + +## example-backend-legacy@0.2.99 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-auth-backend@0.22.6 + - @backstage/plugin-techdocs-backend@1.10.6 + - @backstage/plugin-devtools-backend@0.3.5 + - @backstage/plugin-catalog-backend@1.23.0 + - @backstage/plugin-search-backend@1.5.10 + - @backstage/plugin-proxy-backend@0.5.0 + - @backstage/plugin-app-backend@0.3.68 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-backend-module-confluence-to-markdown@0.2.20 + - @backstage/plugin-catalog-backend-module-scaffolder-entity-model@0.1.17 + - @backstage/plugin-search-backend-module-elasticsearch@1.5.0 + - @backstage/plugin-catalog-backend-module-unprocessed@0.4.6 + - @backstage/plugin-scaffolder-backend-module-gitlab@0.4.1 + - @backstage/plugin-scaffolder-backend-module-rails@0.4.36 + - @backstage/plugin-search-backend-module-techdocs@0.1.24 + - @backstage/plugin-search-backend-module-catalog@0.1.25 + - @backstage/plugin-search-backend-module-explore@0.1.25 + - @backstage/plugin-search-backend-module-pg@0.5.28 + - @backstage/plugin-kubernetes-backend@0.18.0 + - @backstage/plugin-permission-backend@0.5.43 + - @backstage/plugin-scaffolder-backend@1.22.9 + - @backstage/plugin-signals-backend@0.1.5 + - @backstage/plugin-events-backend@0.3.6 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-search-backend-node@1.2.24 + - @backstage/plugin-events-node@0.3.5 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-signals-node@0.1.5 + - example-app@0.2.98 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + +## e2e-test@0.2.17 + +### Patch Changes + +- Updated dependencies + - @backstage/create-app@0.5.16 + - @backstage/cli-common@0.1.14 + - @backstage/errors@1.2.4 + +## techdocs-cli-embedded-app@0.2.97 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/plugin-techdocs@1.10.6 + - @backstage/cli@0.26.7 + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/plugin-techdocs-react@1.2.5 + - @backstage/plugin-catalog@1.21.0 + - @backstage/core-app-api@1.12.6 + - @backstage/integration-react@1.1.28 + - @backstage/app-defaults@1.5.6 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/test-utils@1.5.6 + +## yarn-plugin-backstage@0.0.1 + +### Patch Changes + +- Updated dependencies + - @backstage/cli-common@0.1.14 + - @backstage/release-manifests@0.0.11 + +## @internal/plugin-todo-list@1.0.28 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + +## @internal/plugin-todo-list-backend@1.0.28 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/errors@1.2.4 + +## @internal/plugin-todo-list-common@1.0.19 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-permission-common@0.7.14 diff --git a/package.json b/package.json index 0f9107afc4..39c5d021c1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "root", - "version": "1.28.0-next.3", + "version": "1.28.0", "private": true, "repository": { "type": "git", diff --git a/packages/app-defaults/CHANGELOG.md b/packages/app-defaults/CHANGELOG.md index dc03f00faf..dc43bdf646 100644 --- a/packages/app-defaults/CHANGELOG.md +++ b/packages/app-defaults/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/app-defaults +## 1.5.6 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/plugin-permission-react@0.4.23 + - @backstage/core-app-api@1.12.6 + ## 1.5.6-next.2 ### Patch Changes diff --git a/packages/app-defaults/package.json b/packages/app-defaults/package.json index df20b60bf9..f7ed1ab5ea 100644 --- a/packages/app-defaults/package.json +++ b/packages/app-defaults/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/app-defaults", - "version": "1.5.6-next.2", + "version": "1.5.6", "description": "Provides the default wiring of a Backstage App", "backstage": { "role": "web-library" diff --git a/packages/app-next-example-plugin/CHANGELOG.md b/packages/app-next-example-plugin/CHANGELOG.md index c915ed8ff9..9b9603769f 100644 --- a/packages/app-next-example-plugin/CHANGELOG.md +++ b/packages/app-next-example-plugin/CHANGELOG.md @@ -1,5 +1,13 @@ # app-next-example-plugin +## 0.0.12 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/frontend-plugin-api@0.6.6 + ## 0.0.12-next.2 ### Patch Changes diff --git a/packages/app-next-example-plugin/package.json b/packages/app-next-example-plugin/package.json index c17e398482..c806e32620 100644 --- a/packages/app-next-example-plugin/package.json +++ b/packages/app-next-example-plugin/package.json @@ -1,6 +1,6 @@ { "name": "app-next-example-plugin", - "version": "0.0.12-next.2", + "version": "0.0.12", "description": "Backstage internal example plugin", "backstage": { "role": "frontend-plugin", diff --git a/packages/app-next/CHANGELOG.md b/packages/app-next/CHANGELOG.md index 1f0ae7b5e4..9f1eb9d444 100644 --- a/packages/app-next/CHANGELOG.md +++ b/packages/app-next/CHANGELOG.md @@ -1,5 +1,48 @@ # example-app-next +## 0.0.12 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/plugin-techdocs@1.10.6 + - @backstage/plugin-api-docs@0.11.6 + - @backstage/core-compat-api@0.2.6 + - @backstage/cli@0.26.7 + - @backstage/plugin-scaffolder@1.21.0 + - @backstage/plugin-catalog-import@0.12.0 + - @backstage/plugin-kubernetes@0.11.11 + - @backstage/plugin-search@1.4.12 + - @backstage/plugin-catalog-graph@0.4.6 + - @backstage/plugin-notifications@0.2.2 + - @backstage/plugin-org@0.6.26 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-scaffolder-react@1.9.0 + - @backstage/theme@0.5.6 + - @backstage/plugin-techdocs-module-addons-contrib@1.1.11 + - @backstage/plugin-catalog-unprocessed-entities@0.2.5 + - @backstage/plugin-kubernetes-cluster@0.0.12 + - @backstage/plugin-permission-react@0.4.23 + - @backstage/plugin-app-visualizer@0.1.7 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-techdocs-react@1.2.5 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/plugin-search-common@1.2.12 + - @backstage/plugin-user-settings@0.8.7 + - @backstage/plugin-search-react@1.7.12 + - @backstage/plugin-auth-react@0.1.3 + - @backstage/plugin-catalog@1.21.0 + - @backstage/plugin-signals@0.0.7 + - @backstage/plugin-home@0.7.5 + - @backstage/core-app-api@1.12.6 + - @backstage/integration-react@1.1.28 + - @backstage/app-defaults@1.5.6 + - @backstage/frontend-app-api@0.7.1 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + ## 0.0.12-next.3 ### Patch Changes diff --git a/packages/app-next/package.json b/packages/app-next/package.json index dc2cd1e0d3..1959f9430c 100644 --- a/packages/app-next/package.json +++ b/packages/app-next/package.json @@ -1,6 +1,6 @@ { "name": "example-app-next", - "version": "0.0.12-next.3", + "version": "0.0.12", "private": true, "repository": { "type": "git", diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index 50e0487a21..3088708cf2 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,46 @@ # example-app +## 0.2.98 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/plugin-techdocs@1.10.6 + - @backstage/plugin-api-docs@0.11.6 + - @backstage/cli@0.26.7 + - @backstage/plugin-scaffolder@1.21.0 + - @backstage/plugin-catalog-import@0.12.0 + - @backstage/plugin-kubernetes@0.11.11 + - @backstage/plugin-search@1.4.12 + - @backstage/plugin-catalog-graph@0.4.6 + - @backstage/plugin-notifications@0.2.2 + - @backstage/plugin-org@0.6.26 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-scaffolder-react@1.9.0 + - @backstage/theme@0.5.6 + - @backstage/plugin-techdocs-module-addons-contrib@1.1.11 + - @backstage/plugin-catalog-unprocessed-entities@0.2.5 + - @backstage/plugin-kubernetes-cluster@0.0.12 + - @backstage/plugin-permission-react@0.4.23 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-techdocs-react@1.2.5 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/plugin-search-common@1.2.12 + - @backstage/plugin-user-settings@0.8.7 + - @backstage/plugin-search-react@1.7.12 + - @backstage/plugin-auth-react@0.1.3 + - @backstage/plugin-devtools@0.1.15 + - @backstage/plugin-catalog@1.21.0 + - @backstage/plugin-signals@0.0.7 + - @backstage/plugin-home@0.7.5 + - @backstage/core-app-api@1.12.6 + - @backstage/integration-react@1.1.28 + - @backstage/app-defaults@1.5.6 + - @backstage/frontend-app-api@0.7.1 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + ## 0.2.98-next.3 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index 405a015e50..6bbdd1f9ec 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "example-app", - "version": "0.2.98-next.3", + "version": "0.2.98", "backstage": { "role": "frontend" }, diff --git a/packages/backend-app-api/CHANGELOG.md b/packages/backend-app-api/CHANGELOG.md index 1d23c727bc..a7804fc74e 100644 --- a/packages/backend-app-api/CHANGELOG.md +++ b/packages/backend-app-api/CHANGELOG.md @@ -1,5 +1,74 @@ # @backstage/backend-app-api +## 0.7.6 + +### Patch Changes + +- b7de623: Fixed a potential crash when passing an object with a `null` prototype as log meta. +- 9539a0b: Deprecated `authServiceFactory`, `httpAuthServiceFactory`, and `userInfoServiceFactory`. Please import them from `@backstage/backend-defaults/auth`, `@backstage/backend-defaults/httpAuth`, and `@backstage/backend-defaults/userInfo` respectively instead. +- 3e823d3: Limited user tokens will no longer include the `ent` field in its payload. Ownership claims will now be fetched from the user info service. + + NOTE: Limited tokens issued prior to this change will no longer be valid. Users may have to clear their browser cookies in order to refresh their auth tokens. + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 398b82a: Add support for JWKS tokens in ExternalTokenHandler. +- 9e63318: Added an optional `accessRestrictions` to external access service tokens and service principals in general, such that you can limit their access to certain plugins or permissions. +- e25e467: Added a new static key based method for plugin-to-plugin auth. This is useful for example if you are running readonly service nodes that cannot use a database for the default public-key signature scheme outlined in [BEP-0003](https://github.com/backstage/backstage/tree/master/beps/0003-auth-architecture-evolution). Most users should want to stay on the more secure zero-config database signature scheme. + + You can generate a public and private key pair using `openssl`. + + - First 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 + ``` + + After this you have the files `private.key` and `public.key`. Put them in a place where you know their absolute paths, and then set up your app-config accordingly: + + ```yaml + backend: + auth: + keyStore: + type: static + static: + keys: + - publicKeyFile: /absolute/path/to/public.key + privateKeyFile: /absolute/path/to/private.key + keyId: some-custom-id + ``` + +- 7d30d95: Fixing issue with log meta fields possibly being circular refs +- 6a576dc: Stop using `getVoidLogger` in tests to reduce the dependency on the soon-to-deprecate `backstage-common` package. +- 6551b3d: Deprecated core service factories and implementations and moved them over to + subpath exports on `@backstage/backend-defaults` instead. E.g. + `@backstage/backend-defaults/scheduler` is where the service factory and default + implementation of `coreServices.scheduler` now lives. +- d617103: Updating the logger redaction message to something less dramatic +- Updated dependencies + - @backstage/cli-node@0.2.6 + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/cli-common@0.1.14 + - @backstage/config-loader@1.8.1 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.7.6-next.3 ### Patch Changes diff --git a/packages/backend-app-api/package.json b/packages/backend-app-api/package.json index c1a0c742ea..0c1c23d23d 100644 --- a/packages/backend-app-api/package.json +++ b/packages/backend-app-api/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/backend-app-api", - "version": "0.7.6-next.3", + "version": "0.7.6", "description": "Core API used by Backstage backend apps", "backstage": { "role": "node-library" diff --git a/packages/backend-common/CHANGELOG.md b/packages/backend-common/CHANGELOG.md index 35cfab0d74..8d0ab8984c 100644 --- a/packages/backend-common/CHANGELOG.md +++ b/packages/backend-common/CHANGELOG.md @@ -1,5 +1,44 @@ # @backstage/backend-common +## 0.23.0 + +### Minor Changes + +- 395b973: Implemented `readTree` for Harness provider to support TechDocs functionality +- 02103be: Deprecated and moved over core services to `@backstage/backend-defaults` + +### Patch Changes + +- 9539a0b: Import utility functions from `backend-defaults` instead of `backend-app-api` +- b2c4607: Removed accents on deprecation note +- c6c0919: Updated configuration schema to include the `useRedisSets` cache config option. +- ed3074e: The `database` types, helpers and implementations were moved to the package `@backstage/backend-defaults` and deprecated from the package `@backstage/backend-commons`. +- 9cca724: The `TokenManager` has been deprecated in preparation for the [stable release of the New Backend System](https://github.com/backstage/backstage/issues/24493). Please [migrate](https://backstage.io/docs/tutorials/auth-service-migration) to the new `coreServices.auth`, `coreServices.httpAuth`, and `coreServices.userInfo` services as needed instead. +- 1779188: In preparation to the new backend system stable release, the `isDatabaseConflictError` helper have been moved to the `@backstage/backend-plugin-api` package and deprecated from `@backstage/backend-common`. +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- e171620: Move `cache` implementation and types to the `@backstage/backend-defaults` package. +- 1a6f38a: `ContainerRunner`, `DockerContainerRunner` and `KubernetesContainerRunner` are now deprecated +- 8869b8e: We are deprecating the legacy `createServiceBuilder` factory, so if you are still using it, please checkout the migration guide and [migrate](https://backstage.io/docs/backend-system/building-plugins-and-modules/migrating) your plugin to use the new backend system. +- 0634fdc: Deprecated `dropDatabase` +- b2ee7f3: Moved over all URL reader functionality from `@backstage/backend-common` to `@backstage/backend-defaults/urlReader`. Please update your imports. +- d94a477: Removed the circular dependency on `@backstage/backend-app-api` +- 3bd04bb: We are deprecating the legacy router handlers and contexts in preparation for the new backend system stable release. +- 23ee9ab: Fix AWS CodeCommit integration by allowing to change the host +- e9a03c9: Finalizes the deprecation of legacy backend utilities. Deprecated utilities include the `ServiceBuilder` type, `notFoundHandler` and `redactWintonLogLine` functions. +- 6a576dc: Deprecate legacy service logger helpers and stop using `getVoidLogger` in tests. +- 032a7a6: Deprecate the legacy error and request logging handler types, respectively: `ErrorHandlerOptions` and `RequestLoggingHandlerFactory`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/integration@1.12.0 + - @backstage/cli-common@0.1.14 + - @backstage/config-loader@1.8.1 + - @backstage/backend-dev-utils@0.1.4 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/integration-aws-node@0.1.12 + - @backstage/types@1.1.1 + ## 0.23.0-next.3 ### Patch Changes diff --git a/packages/backend-common/package.json b/packages/backend-common/package.json index 847fefa697..fc09a6e125 100644 --- a/packages/backend-common/package.json +++ b/packages/backend-common/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/backend-common", - "version": "0.23.0-next.3", + "version": "0.23.0", "description": "Common functionality library for Backstage backends", "backstage": { "role": "node-library" diff --git a/packages/backend-defaults/CHANGELOG.md b/packages/backend-defaults/CHANGELOG.md index c88dc8f587..b6cb827e8b 100644 --- a/packages/backend-defaults/CHANGELOG.md +++ b/packages/backend-defaults/CHANGELOG.md @@ -1,5 +1,46 @@ # @backstage/backend-defaults +## 0.3.0 + +### Minor Changes + +- 662dce8: **BREAKING**: The `workdir` argument have been removed from The `GerritUrlReader` constructor. + + **BREAKING**: The Gerrit `readTree` implementation will now only use the Gitiles api. Support + for using git to clone the repo has been removed. + +- 02103be: Deprecated and moved over core services to `@backstage/backend-defaults` + +### Patch Changes + +- 1897169: Exposed `DefaultSchedulerService` +- b5bc997: Refactor cache manager inline types. +- e171620: Remove dependency with `@backstage/backend-commons` package. +- 6551b3d: Added core service factories and implementations from + `@backstage/backend-app-api`. They are now available as subpath exports, e.g. + `@backstage/backend-defaults/scheduler` is where the service factory and default + implementation of `coreServices.scheduler` now lives. They have been marked as + deprecated in their old locations. +- 8aab451: Internal minor refactors of the database connectors +- 0634fdc: Deprecated `dropDatabase` +- b2ee7f3: Moved over all URL reader functionality from `@backstage/backend-common` to `@backstage/backend-defaults/urlReader`. Please update your imports. +- 9539a0b: Added `@backstage/backend-defaults/auth`, `@backstage/backend-defaults/httpAuth`, and `@backstage/backend-defaults/userInfo` to house their respective backend service factories. You should now import these services from those new locations, instead of `@backstage/backend-app-api`. +- Updated dependencies + - @backstage/backend-app-api@0.7.6 + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/integration@1.12.0 + - @backstage/plugin-events-node@0.3.5 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/cli-common@0.1.14 + - @backstage/config-loader@1.8.1 + - @backstage/backend-dev-utils@0.1.4 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/integration-aws-node@0.1.12 + - @backstage/types@1.1.1 + ## 0.3.0-next.3 ### Patch Changes diff --git a/packages/backend-defaults/package.json b/packages/backend-defaults/package.json index e3e0f69c62..4c34c7f317 100644 --- a/packages/backend-defaults/package.json +++ b/packages/backend-defaults/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/backend-defaults", - "version": "0.3.0-next.3", + "version": "0.3.0", "description": "Backend defaults used by Backstage backend apps", "backstage": { "role": "node-library" diff --git a/packages/backend-dynamic-feature-service/CHANGELOG.md b/packages/backend-dynamic-feature-service/CHANGELOG.md index 51943e952d..4363805410 100644 --- a/packages/backend-dynamic-feature-service/CHANGELOG.md +++ b/packages/backend-dynamic-feature-service/CHANGELOG.md @@ -1,5 +1,32 @@ # @backstage/backend-dynamic-feature-service +## 0.2.11 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- Updated dependencies + - @backstage/cli-node@0.2.6 + - @backstage/backend-app-api@0.7.6 + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-catalog-backend@1.23.0 + - @backstage/plugin-events-backend@0.3.6 + - @backstage/plugin-search-backend-node@1.2.24 + - @backstage/plugin-events-node@0.3.5 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/plugin-search-common@1.2.12 + - @backstage/plugin-app-node@0.1.19 + - @backstage/cli-common@0.1.14 + - @backstage/config-loader@1.8.1 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.2.11-next.3 ### Patch Changes diff --git a/packages/backend-dynamic-feature-service/package.json b/packages/backend-dynamic-feature-service/package.json index fb2646f59b..91a7d96ce1 100644 --- a/packages/backend-dynamic-feature-service/package.json +++ b/packages/backend-dynamic-feature-service/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/backend-dynamic-feature-service", "description": "Backstage dynamic feature service", - "version": "0.2.11-next.3", + "version": "0.2.11", "main": "src/index.ts", "types": "src/index.ts", "publishConfig": { diff --git a/packages/backend-legacy/CHANGELOG.md b/packages/backend-legacy/CHANGELOG.md index 64a7e372db..cfe705fcad 100644 --- a/packages/backend-legacy/CHANGELOG.md +++ b/packages/backend-legacy/CHANGELOG.md @@ -1,5 +1,47 @@ # example-backend-legacy +## 0.2.99 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-auth-backend@0.22.6 + - @backstage/plugin-techdocs-backend@1.10.6 + - @backstage/plugin-devtools-backend@0.3.5 + - @backstage/plugin-catalog-backend@1.23.0 + - @backstage/plugin-search-backend@1.5.10 + - @backstage/plugin-proxy-backend@0.5.0 + - @backstage/plugin-app-backend@0.3.68 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-backend-module-confluence-to-markdown@0.2.20 + - @backstage/plugin-catalog-backend-module-scaffolder-entity-model@0.1.17 + - @backstage/plugin-search-backend-module-elasticsearch@1.5.0 + - @backstage/plugin-catalog-backend-module-unprocessed@0.4.6 + - @backstage/plugin-scaffolder-backend-module-gitlab@0.4.1 + - @backstage/plugin-scaffolder-backend-module-rails@0.4.36 + - @backstage/plugin-search-backend-module-techdocs@0.1.24 + - @backstage/plugin-search-backend-module-catalog@0.1.25 + - @backstage/plugin-search-backend-module-explore@0.1.25 + - @backstage/plugin-search-backend-module-pg@0.5.28 + - @backstage/plugin-kubernetes-backend@0.18.0 + - @backstage/plugin-permission-backend@0.5.43 + - @backstage/plugin-scaffolder-backend@1.22.9 + - @backstage/plugin-signals-backend@0.1.5 + - @backstage/plugin-events-backend@0.3.6 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-search-backend-node@1.2.24 + - @backstage/plugin-events-node@0.3.5 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-signals-node@0.1.5 + - example-app@0.2.98 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + ## 0.2.99-next.3 ### Patch Changes diff --git a/packages/backend-legacy/package.json b/packages/backend-legacy/package.json index f19b5205ae..1ee3a9bb31 100644 --- a/packages/backend-legacy/package.json +++ b/packages/backend-legacy/package.json @@ -1,6 +1,6 @@ { "name": "example-backend-legacy", - "version": "0.2.99-next.3", + "version": "0.2.99", "backstage": { "role": "backend" }, diff --git a/packages/backend-openapi-utils/CHANGELOG.md b/packages/backend-openapi-utils/CHANGELOG.md index f7a6b90d54..d490618301 100644 --- a/packages/backend-openapi-utils/CHANGELOG.md +++ b/packages/backend-openapi-utils/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/backend-openapi-utils +## 0.1.12 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/errors@1.2.4 + ## 0.1.12-next.2 ### Patch Changes diff --git a/packages/backend-openapi-utils/package.json b/packages/backend-openapi-utils/package.json index 38121282c8..8d4130c95d 100644 --- a/packages/backend-openapi-utils/package.json +++ b/packages/backend-openapi-utils/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/backend-openapi-utils", "description": "OpenAPI typescript support.", - "version": "0.1.12-next.2", + "version": "0.1.12", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", diff --git a/packages/backend-plugin-api/CHANGELOG.md b/packages/backend-plugin-api/CHANGELOG.md index c947a9627d..bbe2fb68e1 100644 --- a/packages/backend-plugin-api/CHANGELOG.md +++ b/packages/backend-plugin-api/CHANGELOG.md @@ -1,5 +1,52 @@ # @backstage/backend-plugin-api +## 0.6.19 + +### Patch Changes + +- 78a0b08: **DEPRECATION**: You should no longer do a function call on backend features when adding them to backends. The support for doing that is deprecated, and you should remove all trailing `()` parentheses after plugins and modules where you add them to your backend or test backends (e.g. when using `startTestBackend`). + + The background for this is that `createBackendPlugin` and `createBackendModule` function now effectively return a `BackendFeature` rather than a `() => BackendFeature`. This is part of the cleanup efforts for New Backend System 1.0. In the short run this is non-breaking because the feature type has been given a callback signature that returns itself. But we strongly recommend that you remove all now-redundant calls made to feature objects, because that callback signature will be removed in a future release. + + Service factories are still callbacks at this point. + + Example change: + + ```diff + await startTestBackend({ + features: [ + eventsServiceFactory(), // service - stays unchanged + - catalogModuleBitbucketCloudEntityProvider(), // module - remove parentheses + + catalogModuleBitbucketCloudEntityProvider, + ``` + +- 9bdc3e8: In tests, return `null` rather than throwing an error when trying to get the `ExtensionPoint.T` property, so that tests asserting the property are not easily broken. +- 9e63318: Added an optional `accessRestrictions` to external access service tokens and service principals in general, such that you can limit their access to certain plugins or permissions. +- 3aa3fc7: Marked the `TokenManagerService` and `IdentityService` types as deprecated +- b2ee7f3: Deprecated all of the `UrlReader` related type names and replaced them with prefixed versions. Please update your imports. + + - `ReadTreeOptions` was renamed to `UrlReaderServiceReadTreeOptions` + - `ReadTreeResponse` was renamed to `UrlReaderServiceReadTreeResponse` + - `ReadTreeResponseDirOptions` was renamed to `UrlReaderServiceReadTreeResponseDirOptions` + - `ReadTreeResponseFile` was renamed to `UrlReaderServiceReadTreeResponseFile` + - `ReadUrlResponse` was renamed to `UrlReaderServiceReadUrlResponse` + - `ReadUrlOptions` was renamed to `UrlReaderServiceReadUrlOptions` + - `SearchOptions` was renamed to `UrlReaderServiceSearchOptions` + - `SearchResponse` was renamed to `UrlReaderServiceSearchResponse` + - `SearchResponseFile` was renamed to `UrlReaderServiceSearchResponseFile` + +- 9539a0b: Improved `coreServices` doc comments +- 6551b3d: Moved the declaration of the `SchedulerService` here, along with prefixed versions of all of the types it depends on, from `@backstage/backend-tasks` +- 0665b7e: Renamed `BackendPluginConfig`, `BackendModuleConfig`, and `ExtensionPointConfig` respectively to `CreateBackendPluginOptions`, `CreateBackendModuleOptions`, and `CreateExtensionPointOptions` to standardize frontend and backend factories signatures. +- 1779188: Start using the `isDatabaseConflictError` helper from the `@backstage/backend-plugin-api` package in order to avoid dependency with the soon to deprecate `@backstage/backend-common` package. +- Updated dependencies + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/cli-common@0.1.14 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.6.19-next.3 ### Patch Changes diff --git a/packages/backend-plugin-api/package.json b/packages/backend-plugin-api/package.json index 6e3ad58fb5..e8538cece7 100644 --- a/packages/backend-plugin-api/package.json +++ b/packages/backend-plugin-api/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/backend-plugin-api", - "version": "0.6.19-next.3", + "version": "0.6.19", "description": "Core API used by Backstage backend plugins", "backstage": { "role": "node-library" diff --git a/packages/backend-tasks/CHANGELOG.md b/packages/backend-tasks/CHANGELOG.md index aa4c786b65..9624df483b 100644 --- a/packages/backend-tasks/CHANGELOG.md +++ b/packages/backend-tasks/CHANGELOG.md @@ -1,5 +1,20 @@ # @backstage/backend-tasks +## 0.5.24 + +### Patch Changes + +- 736bc3c: Marked all exports as deprecated and pointed at `@backstage/backend-plugin-api` and `@backstage/backend-defaults` +- ed473cd: Updated the `TaskScheduleDefinitionConfig` deprecated comment to point to `SchedulerServiceTaskScheduleDefinitionConfig` +- 6a576dc: Deprecate the legacy `TaskScheduler.fromConfig` method and stop using the `getVoidlogger` in tests files to reduce the dependency on the soon-to-deprecate `backstage-common` package. +- 1897169: More detailed deprecation messages +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.5.24-next.3 ### Patch Changes diff --git a/packages/backend-tasks/package.json b/packages/backend-tasks/package.json index f11d0c7788..843a78706d 100644 --- a/packages/backend-tasks/package.json +++ b/packages/backend-tasks/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/backend-tasks", "description": "Common distributed task management library for Backstage backends", - "version": "0.5.24-next.3", + "version": "0.5.24", "main": "src/index.ts", "types": "src/index.ts", "publishConfig": { diff --git a/packages/backend-test-utils/CHANGELOG.md b/packages/backend-test-utils/CHANGELOG.md index 2e3051b85e..4bc1108ead 100644 --- a/packages/backend-test-utils/CHANGELOG.md +++ b/packages/backend-test-utils/CHANGELOG.md @@ -1,5 +1,29 @@ # @backstage/backend-test-utils +## 0.4.0 + +### Minor Changes + +- 805cbe7: Added `TestCaches` that functions just like `TestDatabases` + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 9e63318: Made it possible to give access restrictions to `mockCredentials.service` +- 006b3e8: The type `MockDirectoryOptions` was renamed to `CreateMockDirectoryOptions` so that it's clear these options are exclusive to the mock directory factory. +- 0634fdc: Refactored `TestDatabases` to no longer depend on `backend-common` +- 6a576dc: Fix the logger service mock to prevent returning `undefined` from the `child` method. +- 6c11f6e: Use imports from backend-defaults instead of the deprecated ones from backend-app-api +- Updated dependencies + - @backstage/backend-app-api@0.7.6 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/backend-defaults@0.3.0 + - @backstage/plugin-events-node@0.3.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.4.0-next.3 ### Patch Changes diff --git a/packages/backend-test-utils/package.json b/packages/backend-test-utils/package.json index 73390d75d6..9db94acc3e 100644 --- a/packages/backend-test-utils/package.json +++ b/packages/backend-test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/backend-test-utils", - "version": "0.4.0-next.3", + "version": "0.4.0", "description": "Test helpers library for Backstage backends", "backstage": { "role": "node-library" diff --git a/packages/backend/CHANGELOG.md b/packages/backend/CHANGELOG.md index 2a070cd28a..a606e77894 100644 --- a/packages/backend/CHANGELOG.md +++ b/packages/backend/CHANGELOG.md @@ -1,5 +1,42 @@ # example-backend +## 0.0.27 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-auth-backend@0.22.6 + - @backstage/plugin-techdocs-backend@1.10.6 + - @backstage/plugin-scaffolder-backend-module-github@0.3.0 + - @backstage/plugin-devtools-backend@0.3.5 + - @backstage/plugin-catalog-backend@1.23.0 + - @backstage/plugin-search-backend@1.5.10 + - @backstage/plugin-proxy-backend@0.5.0 + - @backstage/plugin-app-backend@0.3.68 + - @backstage/plugin-catalog-backend-module-scaffolder-entity-model@0.1.17 + - @backstage/plugin-permission-backend-module-allow-all-policy@0.1.16 + - @backstage/plugin-catalog-backend-module-backstage-openapi@0.2.2 + - @backstage/plugin-auth-backend-module-github-provider@0.1.16 + - @backstage/plugin-auth-backend-module-guest-provider@0.1.5 + - @backstage/plugin-catalog-backend-module-unprocessed@0.4.6 + - @backstage/plugin-catalog-backend-module-openapi@0.1.37 + - @backstage/plugin-search-backend-module-techdocs@0.1.24 + - @backstage/plugin-search-backend-module-catalog@0.1.25 + - @backstage/plugin-search-backend-module-explore@0.1.25 + - @backstage/plugin-notifications-backend@0.3.0 + - @backstage/plugin-kubernetes-backend@0.18.0 + - @backstage/plugin-permission-backend@0.5.43 + - @backstage/plugin-scaffolder-backend@1.22.9 + - @backstage/plugin-signals-backend@0.1.5 + - @backstage/backend-defaults@0.3.0 + - @backstage/plugin-search-backend-node@1.2.24 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/catalog-model@1.5.0 + ## 0.0.27-next.3 ### Patch Changes diff --git a/packages/backend/package.json b/packages/backend/package.json index 80a5f5b614..1a0c493a38 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -1,6 +1,6 @@ { "name": "example-backend", - "version": "0.0.27-next.3", + "version": "0.0.27", "main": "dist/index.cjs.js", "types": "src/index.ts", "license": "Apache-2.0", diff --git a/packages/cli-common/CHANGELOG.md b/packages/cli-common/CHANGELOG.md index 7eb1b29e29..29ffc4984c 100644 --- a/packages/cli-common/CHANGELOG.md +++ b/packages/cli-common/CHANGELOG.md @@ -1,5 +1,11 @@ # @backstage/cli-common +## 0.1.14 + +### Patch Changes + +- 142abb0: The monorepo root check in `findPaths` will now accept a shorthand `workspaces` config in `package.json`, no longer requiring `workspaces.packages`. + ## 0.1.14-next.0 ### Patch Changes diff --git a/packages/cli-common/package.json b/packages/cli-common/package.json index 63b7d56d03..c316f15322 100644 --- a/packages/cli-common/package.json +++ b/packages/cli-common/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/cli-common", - "version": "0.1.14-next.0", + "version": "0.1.14", "description": "Common functionality used by cli, backend, and create-app", "backstage": { "role": "node-library" diff --git a/packages/cli-node/CHANGELOG.md b/packages/cli-node/CHANGELOG.md index 72608fb4c4..dcf9073277 100644 --- a/packages/cli-node/CHANGELOG.md +++ b/packages/cli-node/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/cli-node +## 0.2.6 + +### Patch Changes + +- a1ae9cc: Updated doc link. +- c328131: Added new plugin metadata fields to `BackstagePackageJson` type. +- 93be042: Upgraded @yarnpkg/parsers to stable 3.0 +- Updated dependencies + - @backstage/cli-common@0.1.14 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.2.6-next.2 ### Patch Changes diff --git a/packages/cli-node/package.json b/packages/cli-node/package.json index 38525c9854..56cf50a096 100644 --- a/packages/cli-node/package.json +++ b/packages/cli-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/cli-node", - "version": "0.2.6-next.2", + "version": "0.2.6", "description": "Node.js library for Backstage CLIs", "backstage": { "role": "node-library" diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 4d769a6772..ecbed0abdc 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,29 @@ # @backstage/cli +## 0.26.7 + +### Patch Changes + +- 788eca7: Fix readme for new plugins created using cli +- 90c5268: Add `peerDependencies` to `devDependencies` in `package.json.hbs` templates. +- c00f7ee: Fix issue with `esm` loaded dependencies being different from the `cjs` import for Vite dependencies +- b0f66e9: Updated dependency `vite-plugin-node-polyfills` to `^0.22.0`. +- c328131: Added a new `--publish` flag to the `repo fix` command. This command will validate and if possible generate the metadata required for publishing packages with the Backstage CLI. In addition, a check has been added that the `backstage.pluginId` and `backstage.pluginPackage(s)` fields are present when packing a package for publishing. +- 5afbe1d: Export default module for `scaffolder-action` cli template +- 009da47: Fix `versions:check --fix` when `yarn.lock` has multiple joint versions in the same section +- 9ee948a: Bump `esbuild` target for package builds to `ES2022`. +- Updated dependencies + - @backstage/cli-node@0.2.6 + - @backstage/integration@1.12.0 + - @backstage/cli-common@0.1.14 + - @backstage/config-loader@1.8.1 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/eslint-plugin@0.1.8 + - @backstage/release-manifests@0.0.11 + - @backstage/types@1.1.1 + ## 0.26.7-next.3 ### Patch Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index 7408d4c0bf..573a3ae030 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/cli", - "version": "0.26.7-next.3", + "version": "0.26.7", "description": "CLI for developing Backstage plugins and apps", "backstage": { "role": "cli" diff --git a/packages/codemods/CHANGELOG.md b/packages/codemods/CHANGELOG.md index 968fd850d3..2a47e34b54 100644 --- a/packages/codemods/CHANGELOG.md +++ b/packages/codemods/CHANGELOG.md @@ -1,5 +1,12 @@ # @backstage/codemods +## 0.1.49 + +### Patch Changes + +- Updated dependencies + - @backstage/cli-common@0.1.14 + ## 0.1.49-next.0 ### Patch Changes diff --git a/packages/codemods/package.json b/packages/codemods/package.json index a490369468..6bab6f3df8 100644 --- a/packages/codemods/package.json +++ b/packages/codemods/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/codemods", - "version": "0.1.49-next.0", + "version": "0.1.49", "description": "A collection of codemods for Backstage projects", "backstage": { "role": "cli" diff --git a/packages/config-loader/CHANGELOG.md b/packages/config-loader/CHANGELOG.md index dc11c1f793..fb048e7237 100644 --- a/packages/config-loader/CHANGELOG.md +++ b/packages/config-loader/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/config-loader +## 1.8.1 + +### Patch Changes + +- Updated dependencies + - @backstage/cli-common@0.1.14 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 1.8.1-next.0 ### Patch Changes diff --git a/packages/config-loader/package.json b/packages/config-loader/package.json index 1b8c25f14e..28718b8290 100644 --- a/packages/config-loader/package.json +++ b/packages/config-loader/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/config-loader", - "version": "1.8.1-next.0", + "version": "1.8.1", "description": "Config loading functionality used by Backstage backend, and CLI", "backstage": { "role": "node-library" diff --git a/packages/core-app-api/CHANGELOG.md b/packages/core-app-api/CHANGELOG.md index 53a9807c61..7d65065bf5 100644 --- a/packages/core-app-api/CHANGELOG.md +++ b/packages/core-app-api/CHANGELOG.md @@ -1,5 +1,41 @@ # @backstage/core-app-api +## 1.12.6 + +### Patch Changes + +- 35fbe09: Added support for configuration of route bindings through static configuration, and default targets for external route refs. + + In addition to configuring route bindings through code, it is now also possible to configure route bindings under the `app.routes.bindings` key, for example: + + ```yaml + app: + routes: + bindings: + catalog.createComponent: catalog-import.importPage + ``` + + Each key in the route binding object is of the form `.`, where the route name is key used in the `externalRoutes` object passed to `createPlugin`. The value is of the same form, but with the name taken from the plugin `routes` option instead. + + The equivalent of the above configuration in code is the following: + + ```ts + const app = createApp({ + // ... + bindRoutes({ bind }) { + bind(catalogPlugin.externalRoutes, { + createComponent: catalogImportPlugin.routes.importPage, + }); + }, + }); + ``` + +- Updated dependencies + - @backstage/core-plugin-api@1.9.3 + - @backstage/config@1.2.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + ## 1.12.6-next.0 ### Patch Changes diff --git a/packages/core-app-api/package.json b/packages/core-app-api/package.json index 8c9c31946d..ea953c4ebe 100644 --- a/packages/core-app-api/package.json +++ b/packages/core-app-api/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/core-app-api", "description": "Core app API used by Backstage apps", - "version": "1.12.6-next.0", + "version": "1.12.6", "publishConfig": { "access": "public" }, diff --git a/packages/core-compat-api/CHANGELOG.md b/packages/core-compat-api/CHANGELOG.md index 3c307d7a3b..b51c51eed4 100644 --- a/packages/core-compat-api/CHANGELOG.md +++ b/packages/core-compat-api/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/core-compat-api +## 0.2.6 + +### Patch Changes + +- 35fbe09: Add support for forwarding default target from legacy external route refs. +- Updated dependencies + - @backstage/core-plugin-api@1.9.3 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/version-bridge@1.0.8 + ## 0.2.6-next.2 ### Patch Changes diff --git a/packages/core-compat-api/package.json b/packages/core-compat-api/package.json index a145668efd..d275332f0b 100644 --- a/packages/core-compat-api/package.json +++ b/packages/core-compat-api/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/core-compat-api", - "version": "0.2.6-next.2", + "version": "0.2.6", "backstage": { "role": "web-library" }, diff --git a/packages/core-components/CHANGELOG.md b/packages/core-components/CHANGELOG.md index e10d4f3a1f..af800e77a8 100644 --- a/packages/core-components/CHANGELOG.md +++ b/packages/core-components/CHANGELOG.md @@ -1,5 +1,23 @@ # @backstage/core-components +## 0.14.8 + +### Patch Changes + +- a0b46f6: Having tooltip inherit font size for consistency in catalog table columns +- 59cee81: Use `inherit` variant on OverflowTooltip underlying Typography component. +- eae0e4d: Fixed an issue causing `SidebarSubmenu` text to not follow the theme color +- e4811ec: Make number of decimal digits in Gauge configurable via the `decimalDigits` property +- 83c4251: Adds icons to status component +- 3e175c8: Removed max width from `Select` component. +- 57d7582: Fixed a bug in `SupportButton` where the title was rendered with the characteristics of a button. +- Updated dependencies + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/version-bridge@1.0.8 + ## 0.14.8-next.2 ### Patch Changes diff --git a/packages/core-components/package.json b/packages/core-components/package.json index 34470eca79..74cb0d7fbb 100644 --- a/packages/core-components/package.json +++ b/packages/core-components/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/core-components", "description": "Core components used by Backstage plugins and apps", - "version": "0.14.8-next.2", + "version": "0.14.8", "publishConfig": { "access": "public" }, diff --git a/packages/core-plugin-api/CHANGELOG.md b/packages/core-plugin-api/CHANGELOG.md index 80e969d40c..9546a747ca 100644 --- a/packages/core-plugin-api/CHANGELOG.md +++ b/packages/core-plugin-api/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/core-plugin-api +## 1.9.3 + +### Patch Changes + +- 35fbe09: A new `defaultTarget` option has been added to `createExternalRouteRef`. This allows one to specify a default target of the route by name, for example `'catalog.catalogIndex'`, which will be used if the target route is present in the app and there is no explicit route binding. +- Updated dependencies + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + ## 1.9.3-next.0 ### Patch Changes diff --git a/packages/core-plugin-api/package.json b/packages/core-plugin-api/package.json index 9cb5dca728..34d626afd9 100644 --- a/packages/core-plugin-api/package.json +++ b/packages/core-plugin-api/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/core-plugin-api", "description": "Core API used by Backstage plugins", - "version": "1.9.3-next.0", + "version": "1.9.3", "publishConfig": { "access": "public" }, diff --git a/packages/create-app/CHANGELOG.md b/packages/create-app/CHANGELOG.md index a4f3109722..6ab3cb0882 100644 --- a/packages/create-app/CHANGELOG.md +++ b/packages/create-app/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/create-app +## 0.5.16 + +### Patch Changes + +- cce0495: Bumped create-app version. +- 77da22e: Bumped create-app version. +- 2110d76: Removed `dockerode` dependency. +- 34daaea: Fixed a broken link to the node-postgres documentation +- 78363f6: Bumped TypeScript to version `5.4`. +- 1a212f9: Remove Tech Radar menu item from sidebar of scaffolded app to align with removal of tech-radar plugin from backend +- 81507c8: Updated `node-gyp` to v10 +- Updated dependencies + - @backstage/cli-common@0.1.14 + ## 0.5.16-next.3 ### Patch Changes diff --git a/packages/create-app/package.json b/packages/create-app/package.json index 68420fb52b..066dad2b57 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/create-app", "description": "A CLI that helps you create your own Backstage app", - "version": "0.5.16-next.3", + "version": "0.5.16", "publishConfig": { "access": "public" }, diff --git a/packages/dev-utils/CHANGELOG.md b/packages/dev-utils/CHANGELOG.md index fda76c1623..b28267c160 100644 --- a/packages/dev-utils/CHANGELOG.md +++ b/packages/dev-utils/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/dev-utils +## 1.0.33 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/core-app-api@1.12.6 + - @backstage/integration-react@1.1.28 + - @backstage/app-defaults@1.5.6 + - @backstage/catalog-model@1.5.0 + ## 1.0.33-next.2 ### Patch Changes diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json index fe58a79069..ed887bce11 100644 --- a/packages/dev-utils/package.json +++ b/packages/dev-utils/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/dev-utils", - "version": "1.0.33-next.2", + "version": "1.0.33", "description": "Utilities for developing Backstage plugins.", "backstage": { "role": "web-library" diff --git a/packages/e2e-test/CHANGELOG.md b/packages/e2e-test/CHANGELOG.md index fe9af03e43..4a4edf005e 100644 --- a/packages/e2e-test/CHANGELOG.md +++ b/packages/e2e-test/CHANGELOG.md @@ -1,5 +1,14 @@ # e2e-test +## 0.2.17 + +### Patch Changes + +- Updated dependencies + - @backstage/create-app@0.5.16 + - @backstage/cli-common@0.1.14 + - @backstage/errors@1.2.4 + ## 0.2.17-next.2 ### Patch Changes diff --git a/packages/e2e-test/package.json b/packages/e2e-test/package.json index c2740a2830..63536bc4a3 100644 --- a/packages/e2e-test/package.json +++ b/packages/e2e-test/package.json @@ -1,7 +1,7 @@ { "name": "e2e-test", "description": "E2E test for verifying Backstage packages", - "version": "0.2.17-next.2", + "version": "0.2.17", "private": true, "backstage": { "role": "cli" diff --git a/packages/frontend-app-api/CHANGELOG.md b/packages/frontend-app-api/CHANGELOG.md index 65b4e9b0b9..be9eab1863 100644 --- a/packages/frontend-app-api/CHANGELOG.md +++ b/packages/frontend-app-api/CHANGELOG.md @@ -1,5 +1,20 @@ # @backstage/frontend-app-api +## 0.7.1 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/core-app-api@1.12.6 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + ## 0.7.1-next.2 ### Patch Changes diff --git a/packages/frontend-app-api/package.json b/packages/frontend-app-api/package.json index a2db39277a..401fcfc529 100644 --- a/packages/frontend-app-api/package.json +++ b/packages/frontend-app-api/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/frontend-app-api", - "version": "0.7.1-next.2", + "version": "0.7.1", "backstage": { "role": "web-library" }, diff --git a/packages/frontend-plugin-api/CHANGELOG.md b/packages/frontend-plugin-api/CHANGELOG.md index d0336cae85..0ac7968290 100644 --- a/packages/frontend-plugin-api/CHANGELOG.md +++ b/packages/frontend-plugin-api/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/frontend-plugin-api +## 0.6.6 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + ## 0.6.6-next.2 ### Patch Changes diff --git a/packages/frontend-plugin-api/package.json b/packages/frontend-plugin-api/package.json index 9e4e5eac97..ad8cb41ca9 100644 --- a/packages/frontend-plugin-api/package.json +++ b/packages/frontend-plugin-api/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/frontend-plugin-api", - "version": "0.6.6-next.2", + "version": "0.6.6", "backstage": { "role": "web-library" }, diff --git a/packages/frontend-test-utils/CHANGELOG.md b/packages/frontend-test-utils/CHANGELOG.md index 95064be18b..db6adef523 100644 --- a/packages/frontend-test-utils/CHANGELOG.md +++ b/packages/frontend-test-utils/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/frontend-test-utils +## 0.1.8 + +### Patch Changes + +- Updated dependencies + - @backstage/frontend-app-api@0.7.1 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/test-utils@1.5.6 + - @backstage/types@1.1.1 + ## 0.1.8-next.2 ### Patch Changes diff --git a/packages/frontend-test-utils/package.json b/packages/frontend-test-utils/package.json index 2671165b13..f51df52828 100644 --- a/packages/frontend-test-utils/package.json +++ b/packages/frontend-test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/frontend-test-utils", - "version": "0.1.8-next.2", + "version": "0.1.8", "backstage": { "role": "web-library" }, diff --git a/packages/integration-react/CHANGELOG.md b/packages/integration-react/CHANGELOG.md index 703eccbdad..5952b43cbd 100644 --- a/packages/integration-react/CHANGELOG.md +++ b/packages/integration-react/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/integration-react +## 1.1.28 + +### Patch Changes + +- 23ee9ab: Fix AWS CodeCommit integration by allowing to change the host +- Updated dependencies + - @backstage/integration@1.12.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/config@1.2.0 + ## 1.1.28-next.1 ### Patch Changes diff --git a/packages/integration-react/package.json b/packages/integration-react/package.json index 79cf7694fd..34e91e0110 100644 --- a/packages/integration-react/package.json +++ b/packages/integration-react/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/integration-react", - "version": "1.1.28-next.1", + "version": "1.1.28", "description": "Frontend package for managing integrations towards external systems", "backstage": { "role": "web-library" diff --git a/packages/integration/CHANGELOG.md b/packages/integration/CHANGELOG.md index 928e62d67f..f50b992f3c 100644 --- a/packages/integration/CHANGELOG.md +++ b/packages/integration/CHANGELOG.md @@ -1,5 +1,31 @@ # @backstage/integration +## 1.12.0 + +### Minor Changes + +- be1014d: **BREAKING** Removed deprecated code from when casing was changed from `GitHub` to `Github` nearly two years ago. The following items have been removed: + + - `getGitHubFileFetchUrl` (use `getGithubFileFetchUrl` instead) + - `GitHubIntegrationConfig` (use `GithubIntegrationConfig` instead) + - `GitHubIntegration` (use `GithubIntegration` instead) + - `readGitHubIntegrationConfig` (use `readGithubIntegrationConfig` instead) + - `readGitHubIntegrationConfigs` (use `readGithubIntegrationConfigs` instead) + - `replaceGitHubUrlType` (use `replaceGithubUrlType` instead) + +- 395b973: Implemented `readTree` for Harness provider to support TechDocs functionality +- 662dce8: **BREAKING**: `gitilesBaseUrl` is now mandatory for the Gerrit integration. The + ability to override this requirement using the `DISABLE_GERRIT_GITILES_REQUIREMENT` + environment variable has been removed. + +### Patch Changes + +- 509e08c: Updated function for getHarnessEditContentsUrl +- 23ee9ab: Fix AWS CodeCommit integration by allowing to change the host +- Updated dependencies + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 1.12.0-next.1 ### Minor Changes diff --git a/packages/integration/package.json b/packages/integration/package.json index 9adc2519f1..56b7b1bd82 100644 --- a/packages/integration/package.json +++ b/packages/integration/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/integration", - "version": "1.12.0-next.1", + "version": "1.12.0", "description": "Helpers for managing integrations towards external systems", "backstage": { "role": "common-library" diff --git a/packages/repo-tools/CHANGELOG.md b/packages/repo-tools/CHANGELOG.md index 1a303a9c07..aa65b502a0 100644 --- a/packages/repo-tools/CHANGELOG.md +++ b/packages/repo-tools/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/repo-tools +## 0.9.1 + +### Patch Changes + +- 8721a02: Add `--client-additional-properties` option to `openapi generate` command +- Updated dependencies + - @backstage/cli-node@0.2.6 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/cli-common@0.1.14 + - @backstage/config-loader@1.8.1 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + ## 0.9.1-next.3 ### Patch Changes diff --git a/packages/repo-tools/package.json b/packages/repo-tools/package.json index 905d783369..30f003aea5 100644 --- a/packages/repo-tools/package.json +++ b/packages/repo-tools/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/repo-tools", "description": "CLI for Backstage repo tooling ", - "version": "0.9.1-next.3", + "version": "0.9.1", "publishConfig": { "access": "public" }, diff --git a/packages/techdocs-cli-embedded-app/CHANGELOG.md b/packages/techdocs-cli-embedded-app/CHANGELOG.md index f35df3e326..da77dd57ad 100644 --- a/packages/techdocs-cli-embedded-app/CHANGELOG.md +++ b/packages/techdocs-cli-embedded-app/CHANGELOG.md @@ -1,5 +1,24 @@ # techdocs-cli-embedded-app +## 0.2.97 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/plugin-techdocs@1.10.6 + - @backstage/cli@0.26.7 + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/plugin-techdocs-react@1.2.5 + - @backstage/plugin-catalog@1.21.0 + - @backstage/core-app-api@1.12.6 + - @backstage/integration-react@1.1.28 + - @backstage/app-defaults@1.5.6 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/test-utils@1.5.6 + ## 0.2.97-next.2 ### Patch Changes diff --git a/packages/techdocs-cli-embedded-app/package.json b/packages/techdocs-cli-embedded-app/package.json index b19ad856c8..ad2da35606 100644 --- a/packages/techdocs-cli-embedded-app/package.json +++ b/packages/techdocs-cli-embedded-app/package.json @@ -1,6 +1,6 @@ { "name": "techdocs-cli-embedded-app", - "version": "0.2.97-next.2", + "version": "0.2.97", "private": true, "backstage": { "role": "frontend" diff --git a/packages/techdocs-cli/CHANGELOG.md b/packages/techdocs-cli/CHANGELOG.md index 59f4d5f7d3..5ff165c4a9 100644 --- a/packages/techdocs-cli/CHANGELOG.md +++ b/packages/techdocs-cli/CHANGELOG.md @@ -1,5 +1,17 @@ # @techdocs/cli +## 1.8.12 + +### Patch Changes + +- 2110d76: Removed `dockerode` dependency. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/plugin-techdocs-node@1.12.5 + - @backstage/cli-common@0.1.14 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + ## 1.8.12-next.3 ### Patch Changes diff --git a/packages/techdocs-cli/package.json b/packages/techdocs-cli/package.json index 7a20eee17b..7650316962 100644 --- a/packages/techdocs-cli/package.json +++ b/packages/techdocs-cli/package.json @@ -1,7 +1,7 @@ { "name": "@techdocs/cli", "description": "Utility CLI for managing TechDocs sites in Backstage.", - "version": "1.8.12-next.3", + "version": "1.8.12", "publishConfig": { "access": "public" }, diff --git a/packages/test-utils/CHANGELOG.md b/packages/test-utils/CHANGELOG.md index ada9ea4654..893316d288 100644 --- a/packages/test-utils/CHANGELOG.md +++ b/packages/test-utils/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/test-utils +## 1.5.6 + +### Patch Changes + +- Updated dependencies + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-permission-react@0.4.23 + - @backstage/core-app-api@1.12.6 + - @backstage/config@1.2.0 + - @backstage/types@1.1.1 + ## 1.5.6-next.2 ### Patch Changes diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 7ab7a73af7..d2294c27b6 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/test-utils", - "version": "1.5.6-next.2", + "version": "1.5.6", "description": "Utilities to test Backstage plugins and apps.", "backstage": { "role": "web-library" diff --git a/packages/theme/CHANGELOG.md b/packages/theme/CHANGELOG.md index 0cd38f9265..94d85c535a 100644 --- a/packages/theme/CHANGELOG.md +++ b/packages/theme/CHANGELOG.md @@ -1,5 +1,11 @@ # @backstage/theme +## 0.5.6 + +### Patch Changes + +- 702fa7d: Internal refactor to fix an issue where the MUI 5 `v5-` class prefixing gets removed by tree shaking. + ## 0.5.6-next.0 ### Patch Changes diff --git a/packages/theme/package.json b/packages/theme/package.json index 8cdb23c1ec..b199cb3061 100644 --- a/packages/theme/package.json +++ b/packages/theme/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/theme", - "version": "0.5.6-next.0", + "version": "0.5.6", "description": "material-ui theme for use with Backstage.", "backstage": { "role": "web-library" diff --git a/packages/yarn-plugin/CHANGELOG.md b/packages/yarn-plugin/CHANGELOG.md index 6878933d9f..5a2e9f417f 100644 --- a/packages/yarn-plugin/CHANGELOG.md +++ b/packages/yarn-plugin/CHANGELOG.md @@ -1,5 +1,13 @@ # yarn-plugin-backstage +## 0.0.1 + +### Patch Changes + +- Updated dependencies + - @backstage/cli-common@0.1.14 + - @backstage/release-manifests@0.0.11 + ## 0.0.1-next.0 ### Patch Changes diff --git a/packages/yarn-plugin/package.json b/packages/yarn-plugin/package.json index 7ff1b72fd8..ad42bdba23 100644 --- a/packages/yarn-plugin/package.json +++ b/packages/yarn-plugin/package.json @@ -1,6 +1,6 @@ { "name": "yarn-plugin-backstage", - "version": "0.0.1-next.0", + "version": "0.0.1", "description": "Yarn plugin for working with Backstage monorepos", "backstage": { "role": "node-library" diff --git a/plugins/api-docs-module-protoc-gen-doc/CHANGELOG.md b/plugins/api-docs-module-protoc-gen-doc/CHANGELOG.md index 9c0e32964e..7ce6311e1f 100644 --- a/plugins/api-docs-module-protoc-gen-doc/CHANGELOG.md +++ b/plugins/api-docs-module-protoc-gen-doc/CHANGELOG.md @@ -1,5 +1,11 @@ # @backstage/plugin-api-docs-module-protoc-gen-doc +## 0.1.7 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. + ## 0.1.7-next.0 ### Patch Changes diff --git a/plugins/api-docs-module-protoc-gen-doc/package.json b/plugins/api-docs-module-protoc-gen-doc/package.json index 3cab38359d..ce2758e528 100644 --- a/plugins/api-docs-module-protoc-gen-doc/package.json +++ b/plugins/api-docs-module-protoc-gen-doc/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-api-docs-module-protoc-gen-doc", - "version": "0.1.7-next.0", + "version": "0.1.7", "description": "Additional functionalities for the api-docs plugin that renders the output of the protoc-gen-doc", "backstage": { "role": "frontend-plugin-module", diff --git a/plugins/api-docs/CHANGELOG.md b/plugins/api-docs/CHANGELOG.md index b8284e69d7..5b8e039c4e 100644 --- a/plugins/api-docs/CHANGELOG.md +++ b/plugins/api-docs/CHANGELOG.md @@ -1,5 +1,24 @@ # @backstage/plugin-api-docs +## 0.11.6 + +### Patch Changes + +- 7f84039: The `registerComponent` external route will now by default bind to the catalog import page if it is available. +- 9cdc651: Make sure that the toggle button state is properly reflected in API cards +- d44a20a: Added additional plugin metadata to `package.json`. +- 96cd13e: `DefaultApiExplorerPage` now accepts an optional `ownerPickerMode` for toggling the behavior of the `EntityOwnerPicker`, exposing a new mode `` particularly suitable for larger catalogs. In this new mode, `EntityOwnerPicker` will display all the users and groups present in the catalog. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-compat-api@0.2.6 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-permission-react@0.4.23 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/plugin-catalog@1.21.0 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/catalog-model@1.5.0 + ## 0.11.6-next.2 ### Patch Changes diff --git a/plugins/api-docs/package.json b/plugins/api-docs/package.json index 47526fb80d..b8aed9f360 100644 --- a/plugins/api-docs/package.json +++ b/plugins/api-docs/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-api-docs", - "version": "0.11.6-next.2", + "version": "0.11.6", "description": "A Backstage plugin that helps represent API entities in the frontend", "backstage": { "role": "frontend-plugin", diff --git a/plugins/app-backend/CHANGELOG.md b/plugins/app-backend/CHANGELOG.md index 2dc4f3d1ef..90e9a080dd 100644 --- a/plugins/app-backend/CHANGELOG.md +++ b/plugins/app-backend/CHANGELOG.md @@ -1,5 +1,24 @@ # @backstage/plugin-app-backend +## 0.3.68 + +### Patch Changes + +- 8869b8e: Updated local development setup. +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 82c2b90: Restore the support of external config schema in the router of the `app-backend` plugin, which was broken in release `1.26.0`. + This support is critical for dynamic frontend plugins to have access to their config values. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-app-node@0.1.19 + - @backstage/config-loader@1.8.1 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.3.68-next.3 ### Patch Changes diff --git a/plugins/app-backend/package.json b/plugins/app-backend/package.json index dd6a726a00..5071bdaf86 100644 --- a/plugins/app-backend/package.json +++ b/plugins/app-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-app-backend", - "version": "0.3.68-next.3", + "version": "0.3.68", "description": "A Backstage backend plugin that serves the Backstage frontend app", "backstage": { "role": "backend-plugin", diff --git a/plugins/app-node/CHANGELOG.md b/plugins/app-node/CHANGELOG.md index e719fb306e..d16d233b2c 100644 --- a/plugins/app-node/CHANGELOG.md +++ b/plugins/app-node/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-app-node +## 0.1.19 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/config-loader@1.8.1 + ## 0.1.19-next.2 ### Patch Changes diff --git a/plugins/app-node/package.json b/plugins/app-node/package.json index 94566895df..d008a82284 100644 --- a/plugins/app-node/package.json +++ b/plugins/app-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-app-node", - "version": "0.1.19-next.2", + "version": "0.1.19", "description": "Node.js library for the app plugin", "backstage": { "role": "node-library", diff --git a/plugins/app-visualizer/CHANGELOG.md b/plugins/app-visualizer/CHANGELOG.md index 7fb8f46223..d30dbfc0ca 100644 --- a/plugins/app-visualizer/CHANGELOG.md +++ b/plugins/app-visualizer/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-app-visualizer +## 0.1.7 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/frontend-plugin-api@0.6.6 + ## 0.1.7-next.2 ### Patch Changes diff --git a/plugins/app-visualizer/package.json b/plugins/app-visualizer/package.json index 6ab7831e09..5d8f9b2649 100644 --- a/plugins/app-visualizer/package.json +++ b/plugins/app-visualizer/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-app-visualizer", - "version": "0.1.7-next.2", + "version": "0.1.7", "description": "Visualizes the Backstage app structure", "backstage": { "role": "frontend-plugin", diff --git a/plugins/auth-backend-module-atlassian-provider/CHANGELOG.md b/plugins/auth-backend-module-atlassian-provider/CHANGELOG.md index e5cbd93934..ee68bd7df5 100644 --- a/plugins/auth-backend-module-atlassian-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-atlassian-provider/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-auth-backend-module-atlassian-provider +## 0.2.0 + +### Minor Changes + +- 8efc6cf: **BREAKING**: The `scope` and `scopes` config options have been removed and replaced by the standard `additionalScopes` config. In addition, the `offline_access`, `read:jira-work`, and `read:jira-user` scopes have been set to required and will always be present. + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + ## 0.2.0-next.2 ### Minor Changes diff --git a/plugins/auth-backend-module-atlassian-provider/package.json b/plugins/auth-backend-module-atlassian-provider/package.json index f0b847d6b7..c961892674 100644 --- a/plugins/auth-backend-module-atlassian-provider/package.json +++ b/plugins/auth-backend-module-atlassian-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-atlassian-provider", - "version": "0.2.0-next.2", + "version": "0.2.0", "description": "The atlassian-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-aws-alb-provider/CHANGELOG.md b/plugins/auth-backend-module-aws-alb-provider/CHANGELOG.md index ec67f5fa79..f96de94fa6 100644 --- a/plugins/auth-backend-module-aws-alb-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-aws-alb-provider/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-auth-backend-module-aws-alb-provider +## 0.1.11 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-auth-backend@0.22.6 + - @backstage/errors@1.2.4 + ## 0.1.11-next.3 ### Patch Changes diff --git a/plugins/auth-backend-module-aws-alb-provider/package.json b/plugins/auth-backend-module-aws-alb-provider/package.json index faf74b1eb6..c65df9e16e 100644 --- a/plugins/auth-backend-module-aws-alb-provider/package.json +++ b/plugins/auth-backend-module-aws-alb-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-aws-alb-provider", - "version": "0.1.11-next.3", + "version": "0.1.11", "description": "The aws-alb provider module for the Backstage auth backend.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-azure-easyauth-provider/CHANGELOG.md b/plugins/auth-backend-module-azure-easyauth-provider/CHANGELOG.md index 95c70cc6ca..2771262546 100644 --- a/plugins/auth-backend-module-azure-easyauth-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-azure-easyauth-provider/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-auth-backend-module-azure-easyauth-provider +## 0.1.2 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + ## 0.1.2-next.2 ### Patch Changes diff --git a/plugins/auth-backend-module-azure-easyauth-provider/package.json b/plugins/auth-backend-module-azure-easyauth-provider/package.json index 232f80fe1a..8303ada7a9 100644 --- a/plugins/auth-backend-module-azure-easyauth-provider/package.json +++ b/plugins/auth-backend-module-azure-easyauth-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-azure-easyauth-provider", - "version": "0.1.2-next.2", + "version": "0.1.2", "description": "The azure-easyauth-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-bitbucket-provider/CHANGELOG.md b/plugins/auth-backend-module-bitbucket-provider/CHANGELOG.md index f8c3b6390b..3c21cc0498 100644 --- a/plugins/auth-backend-module-bitbucket-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-bitbucket-provider/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/plugin-auth-backend-module-bitbucket-provider +## 0.1.2 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 8efc6cf: Added support for the new shared `additionalScopes` configuration. In addition, the `account` scope has been set to required and will always be present. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + ## 0.1.2-next.2 ### Patch Changes diff --git a/plugins/auth-backend-module-bitbucket-provider/package.json b/plugins/auth-backend-module-bitbucket-provider/package.json index 458f65ae47..21653b691a 100644 --- a/plugins/auth-backend-module-bitbucket-provider/package.json +++ b/plugins/auth-backend-module-bitbucket-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-bitbucket-provider", - "version": "0.1.2-next.2", + "version": "0.1.2", "description": "The bitbucket-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-cloudflare-access-provider/CHANGELOG.md b/plugins/auth-backend-module-cloudflare-access-provider/CHANGELOG.md index bd41ad091d..781c1e2a7d 100644 --- a/plugins/auth-backend-module-cloudflare-access-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-cloudflare-access-provider/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-auth-backend-module-cloudflare-access-provider +## 0.1.2 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- 1354d81: Use `node-fetch` instead of native fetch, as per https://backstage.io/docs/architecture-decisions/adrs-adr013 +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.1.2-next.3 ### Patch Changes diff --git a/plugins/auth-backend-module-cloudflare-access-provider/package.json b/plugins/auth-backend-module-cloudflare-access-provider/package.json index 15e7dfc69d..1d99725963 100644 --- a/plugins/auth-backend-module-cloudflare-access-provider/package.json +++ b/plugins/auth-backend-module-cloudflare-access-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-cloudflare-access-provider", - "version": "0.1.2-next.3", + "version": "0.1.2", "description": "The cloudflare-access-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-gcp-iap-provider/CHANGELOG.md b/plugins/auth-backend-module-gcp-iap-provider/CHANGELOG.md index 2061f04974..f42462e619 100644 --- a/plugins/auth-backend-module-gcp-iap-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-gcp-iap-provider/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-auth-backend-module-gcp-iap-provider +## 0.2.14 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.2.14-next.2 ### Patch Changes diff --git a/plugins/auth-backend-module-gcp-iap-provider/package.json b/plugins/auth-backend-module-gcp-iap-provider/package.json index b390db9cdf..e8932d908c 100644 --- a/plugins/auth-backend-module-gcp-iap-provider/package.json +++ b/plugins/auth-backend-module-gcp-iap-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-gcp-iap-provider", - "version": "0.2.14-next.2", + "version": "0.2.14", "description": "A GCP IAP auth provider module for the Backstage auth backend", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-github-provider/CHANGELOG.md b/plugins/auth-backend-module-github-provider/CHANGELOG.md index b509ec3110..8a050e26c3 100644 --- a/plugins/auth-backend-module-github-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-github-provider/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/plugin-auth-backend-module-github-provider +## 0.1.16 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 8efc6cf: Added support for the new shared `additionalScopes` configuration. In addition, the `read:user` scope has been set to required and will always be present. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + ## 0.1.16-next.2 ### Patch Changes diff --git a/plugins/auth-backend-module-github-provider/package.json b/plugins/auth-backend-module-github-provider/package.json index 226e51c039..d8d115454e 100644 --- a/plugins/auth-backend-module-github-provider/package.json +++ b/plugins/auth-backend-module-github-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-github-provider", - "version": "0.1.16-next.2", + "version": "0.1.16", "description": "The github-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-gitlab-provider/CHANGELOG.md b/plugins/auth-backend-module-gitlab-provider/CHANGELOG.md index da9a38f7dc..e448079c05 100644 --- a/plugins/auth-backend-module-gitlab-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-gitlab-provider/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/plugin-auth-backend-module-gitlab-provider +## 0.1.16 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 8efc6cf: Added support for the new shared `additionalScopes` configuration. In addition, the `read_user` scope has been set to required and will always be present. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + ## 0.1.16-next.2 ### Patch Changes diff --git a/plugins/auth-backend-module-gitlab-provider/package.json b/plugins/auth-backend-module-gitlab-provider/package.json index a90a70ee19..4b7117e863 100644 --- a/plugins/auth-backend-module-gitlab-provider/package.json +++ b/plugins/auth-backend-module-gitlab-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-gitlab-provider", - "version": "0.1.16-next.2", + "version": "0.1.16", "description": "The gitlab-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-google-provider/CHANGELOG.md b/plugins/auth-backend-module-google-provider/CHANGELOG.md index 6cce19a35c..412e50d6aa 100644 --- a/plugins/auth-backend-module-google-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-google-provider/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/plugin-auth-backend-module-google-provider +## 0.1.16 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 8efc6cf: Added support for the new shared `additionalScopes` configuration. In addition, the `openid`, `userinfo.email`, and `userinfo.profile` scopes have been set to required and will always be present. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + ## 0.1.16-next.2 ### Patch Changes diff --git a/plugins/auth-backend-module-google-provider/package.json b/plugins/auth-backend-module-google-provider/package.json index 73bea4510e..48271c34b9 100644 --- a/plugins/auth-backend-module-google-provider/package.json +++ b/plugins/auth-backend-module-google-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-google-provider", - "version": "0.1.16-next.2", + "version": "0.1.16", "description": "A Google auth provider module for the Backstage auth backend", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-guest-provider/CHANGELOG.md b/plugins/auth-backend-module-guest-provider/CHANGELOG.md index a22908f1c4..79f9767571 100644 --- a/plugins/auth-backend-module-guest-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-guest-provider/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-auth-backend-module-guest-provider +## 0.1.5 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + ## 0.1.5-next.3 ### Patch Changes diff --git a/plugins/auth-backend-module-guest-provider/package.json b/plugins/auth-backend-module-guest-provider/package.json index 35ed295f41..cf7491adf4 100644 --- a/plugins/auth-backend-module-guest-provider/package.json +++ b/plugins/auth-backend-module-guest-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-guest-provider", - "version": "0.1.5-next.3", + "version": "0.1.5", "description": "The guest-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-microsoft-provider/CHANGELOG.md b/plugins/auth-backend-module-microsoft-provider/CHANGELOG.md index 8f93dbdf87..2cb76d0866 100644 --- a/plugins/auth-backend-module-microsoft-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-microsoft-provider/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-auth-backend-module-microsoft-provider +## 0.1.14 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 8efc6cf: Added support for the new shared `additionalScopes` configuration. +- d44a20a: Added additional plugin metadata to `package.json`. +- c187a9c: Minor internal type updates +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + ## 0.1.14-next.2 ### Patch Changes diff --git a/plugins/auth-backend-module-microsoft-provider/package.json b/plugins/auth-backend-module-microsoft-provider/package.json index bea5991966..598c69118c 100644 --- a/plugins/auth-backend-module-microsoft-provider/package.json +++ b/plugins/auth-backend-module-microsoft-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-microsoft-provider", - "version": "0.1.14-next.2", + "version": "0.1.14", "description": "The microsoft-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-oauth2-provider/CHANGELOG.md b/plugins/auth-backend-module-oauth2-provider/CHANGELOG.md index 91e5ab6890..acec3a3065 100644 --- a/plugins/auth-backend-module-oauth2-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-oauth2-provider/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-auth-backend-module-oauth2-provider +## 0.2.0 + +### Minor Changes + +- 8efc6cf: **BREAKING**: The `scope` config option have been removed and replaced by the standard `additionalScopes` config. + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + ## 0.2.0-next.2 ### Minor Changes diff --git a/plugins/auth-backend-module-oauth2-provider/package.json b/plugins/auth-backend-module-oauth2-provider/package.json index 959e301038..99a8e04c65 100644 --- a/plugins/auth-backend-module-oauth2-provider/package.json +++ b/plugins/auth-backend-module-oauth2-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-oauth2-provider", - "version": "0.2.0-next.2", + "version": "0.2.0", "description": "The oauth2-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-oauth2-proxy-provider/CHANGELOG.md b/plugins/auth-backend-module-oauth2-proxy-provider/CHANGELOG.md index bb6fc711ba..0223e64d35 100644 --- a/plugins/auth-backend-module-oauth2-proxy-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-oauth2-proxy-provider/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/plugin-auth-backend-module-oauth2-proxy-provider +## 0.1.12 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/errors@1.2.4 + ## 0.1.12-next.2 ### Patch Changes diff --git a/plugins/auth-backend-module-oauth2-proxy-provider/package.json b/plugins/auth-backend-module-oauth2-proxy-provider/package.json index bbc3bb5a7a..c865a15f47 100644 --- a/plugins/auth-backend-module-oauth2-proxy-provider/package.json +++ b/plugins/auth-backend-module-oauth2-proxy-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-oauth2-proxy-provider", - "version": "0.1.12-next.2", + "version": "0.1.12", "description": "The oauth2-proxy-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-oidc-provider/CHANGELOG.md b/plugins/auth-backend-module-oidc-provider/CHANGELOG.md index 33173baf53..0a10e2e98b 100644 --- a/plugins/auth-backend-module-oidc-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-oidc-provider/CHANGELOG.md @@ -1,5 +1,22 @@ # @backstage/plugin-auth-backend-module-oidc-provider +## 0.2.0 + +### Minor Changes + +- 8efc6cf: **BREAKING**: The `scope` config option have been removed and replaced by the standard `additionalScopes` config. In addition, `openid`, `profile`, and `email` scopes have been set to required and will always be present. + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- 4f21993: if oidc server do not provide revocation_endpoint,we should not call revoke function +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-auth-backend@0.22.6 + ## 0.2.0-next.3 ### Minor Changes diff --git a/plugins/auth-backend-module-oidc-provider/package.json b/plugins/auth-backend-module-oidc-provider/package.json index 916b543b28..c42d85652c 100644 --- a/plugins/auth-backend-module-oidc-provider/package.json +++ b/plugins/auth-backend-module-oidc-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-oidc-provider", - "version": "0.2.0-next.3", + "version": "0.2.0", "description": "The oidc-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-okta-provider/CHANGELOG.md b/plugins/auth-backend-module-okta-provider/CHANGELOG.md index c5331c89b0..d1da6db5fa 100644 --- a/plugins/auth-backend-module-okta-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-okta-provider/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/plugin-auth-backend-module-okta-provider +## 0.0.12 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 8efc6cf: Added support for the new shared `additionalScopes` configuration, which means it can now also be specified as an array. In addition, the `openid`, `email`, `profile`, and `offline_access` scopes have been set to required and will always be present. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + ## 0.0.12-next.2 ### Patch Changes diff --git a/plugins/auth-backend-module-okta-provider/package.json b/plugins/auth-backend-module-okta-provider/package.json index 1b2d861ae0..fa9dcf1ee5 100644 --- a/plugins/auth-backend-module-okta-provider/package.json +++ b/plugins/auth-backend-module-okta-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-okta-provider", - "version": "0.0.12-next.2", + "version": "0.0.12", "description": "The okta-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-onelogin-provider/CHANGELOG.md b/plugins/auth-backend-module-onelogin-provider/CHANGELOG.md index 03954ed3ae..685ce0f1ff 100644 --- a/plugins/auth-backend-module-onelogin-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-onelogin-provider/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-auth-backend-module-onelogin-provider +## 0.1.0 + +### Minor Changes + +- 566d7cb: Separate out the OneLogin provider into its own module + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + ## 0.1.0-next.0 ### Minor Changes diff --git a/plugins/auth-backend-module-onelogin-provider/package.json b/plugins/auth-backend-module-onelogin-provider/package.json index c4c2cfa2af..6724e51cb7 100644 --- a/plugins/auth-backend-module-onelogin-provider/package.json +++ b/plugins/auth-backend-module-onelogin-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-onelogin-provider", - "version": "0.1.0-next.0", + "version": "0.1.0", "description": "The onelogin-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-pinniped-provider/CHANGELOG.md b/plugins/auth-backend-module-pinniped-provider/CHANGELOG.md index b43ab255b1..ed5fdd4819 100644 --- a/plugins/auth-backend-module-pinniped-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-pinniped-provider/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-auth-backend-module-pinniped-provider +## 0.1.13 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 8efc6cf: **BREAKING**: The `scope` config option have been removed and replaced by the standard `additionalScopes` config. In addition, the `openid`, `pinniped:request-audience`, `username`, and `offline_access` scopes have been set to required and will always be present. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/config@1.2.0 + ## 0.1.13-next.2 ### Patch Changes diff --git a/plugins/auth-backend-module-pinniped-provider/package.json b/plugins/auth-backend-module-pinniped-provider/package.json index 3416e2f18b..f99d1baabd 100644 --- a/plugins/auth-backend-module-pinniped-provider/package.json +++ b/plugins/auth-backend-module-pinniped-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-pinniped-provider", - "version": "0.1.13-next.2", + "version": "0.1.13", "description": "The pinniped-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-vmware-cloud-provider/CHANGELOG.md b/plugins/auth-backend-module-vmware-cloud-provider/CHANGELOG.md index 8b3fc7e7fa..5d323e0319 100644 --- a/plugins/auth-backend-module-vmware-cloud-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-vmware-cloud-provider/CHANGELOG.md @@ -1,5 +1,20 @@ # @backstage/plugin-auth-backend-module-vmware-cloud-provider +## 0.2.0 + +### Minor Changes + +- 8efc6cf: **BREAKING**: The `scope` config option have been removed and replaced by the standard `additionalScopes` config. In addition, `openid`, and `offline_access` scopes have been set to required and will always be present. + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/catalog-model@1.5.0 + ## 0.2.0-next.2 ### Minor Changes diff --git a/plugins/auth-backend-module-vmware-cloud-provider/package.json b/plugins/auth-backend-module-vmware-cloud-provider/package.json index 6375325cc5..ff29719d22 100644 --- a/plugins/auth-backend-module-vmware-cloud-provider/package.json +++ b/plugins/auth-backend-module-vmware-cloud-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-vmware-cloud-provider", - "version": "0.2.0-next.2", + "version": "0.2.0", "description": "The vmware-cloud-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend/CHANGELOG.md b/plugins/auth-backend/CHANGELOG.md index 46abaeafa2..6900d56b24 100644 --- a/plugins/auth-backend/CHANGELOG.md +++ b/plugins/auth-backend/CHANGELOG.md @@ -1,5 +1,43 @@ # @backstage/plugin-auth-backend +## 0.22.6 + +### Patch Changes + +- 3e823d3: Limited user tokens will no longer include the `ent` field in its payload. Ownership claims will now be fetched from the user info service. + + NOTE: Limited tokens issued prior to this change will no longer be valid. Users may have to clear their browser cookies in order to refresh their auth tokens. + +- 8869b8e: Updated local development setup. +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- 3e1bb15: Updated to use the new `@backstage/plugin-auth-backend-module-onelogin-provider` implementation +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/plugin-auth-backend-module-onelogin-provider@0.1.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-auth-backend-module-cloudflare-access-provider@0.1.2 + - @backstage/plugin-auth-backend-module-azure-easyauth-provider@0.1.2 + - @backstage/plugin-auth-backend-module-oauth2-proxy-provider@0.1.12 + - @backstage/plugin-auth-backend-module-atlassian-provider@0.2.0 + - @backstage/plugin-auth-backend-module-bitbucket-provider@0.1.2 + - @backstage/plugin-auth-backend-module-microsoft-provider@0.1.14 + - @backstage/plugin-auth-backend-module-aws-alb-provider@0.1.11 + - @backstage/plugin-auth-backend-module-gcp-iap-provider@0.2.14 + - @backstage/plugin-auth-backend-module-github-provider@0.1.16 + - @backstage/plugin-auth-backend-module-gitlab-provider@0.1.16 + - @backstage/plugin-auth-backend-module-google-provider@0.1.16 + - @backstage/plugin-auth-backend-module-oauth2-provider@0.2.0 + - @backstage/plugin-auth-backend-module-oidc-provider@0.2.0 + - @backstage/plugin-auth-backend-module-okta-provider@0.0.12 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.22.6-next.3 ### Patch Changes diff --git a/plugins/auth-backend/package.json b/plugins/auth-backend/package.json index 0ea8518a51..85dd17d311 100644 --- a/plugins/auth-backend/package.json +++ b/plugins/auth-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend", - "version": "0.22.6-next.3", + "version": "0.22.6", "description": "A Backstage backend plugin that handles authentication", "backstage": { "role": "backend-plugin", diff --git a/plugins/auth-node/CHANGELOG.md b/plugins/auth-node/CHANGELOG.md index a860deed71..b91ce2141c 100644 --- a/plugins/auth-node/CHANGELOG.md +++ b/plugins/auth-node/CHANGELOG.md @@ -1,5 +1,29 @@ # @backstage/plugin-auth-node +## 0.4.14 + +### Patch Changes + +- 798ec37: Updated scope management for OAuth providers, where the `createOAuthAuthenticator` now accepts a new collection of `scopes` options: + + - `scopes.persist` - Whether scopes should be persisted, replaces the `shouldPersistScopes` option. + - `scopes.required` - A list of required scopes that will always be requested. + - `scopes.transform` - A function that can be used to transform the scopes before they are requested. + + The `createOAuthProviderFactory` has also received a new `additionalScopes` option, and will also read `additionalScopes` from the auth provider configuration. Both of these can be used to add additional scopes that should always be requested. + + A significant change under the hood that this new scope management brings is that providers that persist scopes will now always merge the already granted scopes with the requested ones. The previous behavior was that the full authorization flow would not include existing scopes, while the refresh flow would only include the existing scopes. + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.4.14-next.3 ### Patch Changes diff --git a/plugins/auth-node/package.json b/plugins/auth-node/package.json index 4c62f191cf..4f42e80c92 100644 --- a/plugins/auth-node/package.json +++ b/plugins/auth-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-node", - "version": "0.4.14-next.3", + "version": "0.4.14", "backstage": { "role": "node-library", "pluginId": "auth", diff --git a/plugins/auth-react/CHANGELOG.md b/plugins/auth-react/CHANGELOG.md index f245ac9e50..c36109cb91 100644 --- a/plugins/auth-react/CHANGELOG.md +++ b/plugins/auth-react/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-auth-react +## 0.1.3 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/errors@1.2.4 + ## 0.1.3-next.2 ### Patch Changes diff --git a/plugins/auth-react/package.json b/plugins/auth-react/package.json index 8fd9008028..c48438d465 100644 --- a/plugins/auth-react/package.json +++ b/plugins/auth-react/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-react", - "version": "0.1.3-next.2", + "version": "0.1.3", "description": "Web library for the auth plugin", "backstage": { "role": "web-library", diff --git a/plugins/bitbucket-cloud-common/CHANGELOG.md b/plugins/bitbucket-cloud-common/CHANGELOG.md index 2805e36324..ccd47aa5e4 100644 --- a/plugins/bitbucket-cloud-common/CHANGELOG.md +++ b/plugins/bitbucket-cloud-common/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/plugin-bitbucket-cloud-common +## 0.2.20 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/integration@1.12.0 + ## 0.2.20-next.1 ### Patch Changes diff --git a/plugins/bitbucket-cloud-common/package.json b/plugins/bitbucket-cloud-common/package.json index a43407fd04..a08b0f31bf 100644 --- a/plugins/bitbucket-cloud-common/package.json +++ b/plugins/bitbucket-cloud-common/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-bitbucket-cloud-common", - "version": "0.2.20-next.1", + "version": "0.2.20", "description": "Common functionalities for bitbucket-cloud plugins", "backstage": { "role": "common-library", diff --git a/plugins/catalog-backend-module-aws/CHANGELOG.md b/plugins/catalog-backend-module-aws/CHANGELOG.md index fa3d233b10..e925fa7de3 100644 --- a/plugins/catalog-backend-module-aws/CHANGELOG.md +++ b/plugins/catalog-backend-module-aws/CHANGELOG.md @@ -1,5 +1,24 @@ # @backstage/plugin-catalog-backend-module-aws +## 0.3.14 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/integration@1.12.0 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-kubernetes-common@0.8.0 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/integration-aws-node@0.1.12 + ## 0.3.14-next.3 ### Patch Changes diff --git a/plugins/catalog-backend-module-aws/package.json b/plugins/catalog-backend-module-aws/package.json index ef8f828e3f..299da7d302 100644 --- a/plugins/catalog-backend-module-aws/package.json +++ b/plugins/catalog-backend-module-aws/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-aws", - "version": "0.3.14-next.3", + "version": "0.3.14", "description": "A Backstage catalog backend module that helps integrate towards AWS", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-azure/CHANGELOG.md b/plugins/catalog-backend-module-azure/CHANGELOG.md index 9799f6bb67..dce335f353 100644 --- a/plugins/catalog-backend-module-azure/CHANGELOG.md +++ b/plugins/catalog-backend-module-azure/CHANGELOG.md @@ -1,5 +1,20 @@ # @backstage/plugin-catalog-backend-module-azure +## 0.1.39 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/integration@1.12.0 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/config@1.2.0 + ## 0.1.39-next.3 ### Patch Changes diff --git a/plugins/catalog-backend-module-azure/package.json b/plugins/catalog-backend-module-azure/package.json index 06c048647c..aa66f869a6 100644 --- a/plugins/catalog-backend-module-azure/package.json +++ b/plugins/catalog-backend-module-azure/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-azure", - "version": "0.1.39-next.3", + "version": "0.1.39", "description": "A Backstage catalog backend module that helps integrate towards Azure", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-backstage-openapi/CHANGELOG.md b/plugins/catalog-backend-module-backstage-openapi/CHANGELOG.md index c4e5324788..7081965cc9 100644 --- a/plugins/catalog-backend-module-backstage-openapi/CHANGELOG.md +++ b/plugins/catalog-backend-module-backstage-openapi/CHANGELOG.md @@ -1,5 +1,20 @@ # @backstage/plugin-catalog-backend-module-backstage-openapi +## 0.2.2 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/backend-openapi-utils@0.1.12 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.2.2-next.2 ### Patch Changes diff --git a/plugins/catalog-backend-module-backstage-openapi/package.json b/plugins/catalog-backend-module-backstage-openapi/package.json index 70c1c118c2..b85332a6f0 100644 --- a/plugins/catalog-backend-module-backstage-openapi/package.json +++ b/plugins/catalog-backend-module-backstage-openapi/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-backstage-openapi", - "version": "0.2.2-next.2", + "version": "0.2.2", "backstage": { "role": "backend-plugin-module", "pluginId": "catalog", diff --git a/plugins/catalog-backend-module-bitbucket-cloud/CHANGELOG.md b/plugins/catalog-backend-module-bitbucket-cloud/CHANGELOG.md index 1aa0e7c3c7..89f45366fa 100644 --- a/plugins/catalog-backend-module-bitbucket-cloud/CHANGELOG.md +++ b/plugins/catalog-backend-module-bitbucket-cloud/CHANGELOG.md @@ -1,5 +1,26 @@ # @backstage/plugin-catalog-backend-module-bitbucket-cloud +## 0.2.6 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 6a576dc: Replace the usage of `getVoidLogger` with `mockServices.logger.mock` in order to remove the dependency with the soon-to-be-deprecated `backend-common` package. +- b51e823: Remove debug console logging statement +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/integration@1.12.0 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-events-node@0.3.5 + - @backstage/plugin-bitbucket-cloud-common@0.2.20 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + ## 0.2.6-next.3 ### Patch Changes diff --git a/plugins/catalog-backend-module-bitbucket-cloud/package.json b/plugins/catalog-backend-module-bitbucket-cloud/package.json index 0288bf3d44..41285c1e49 100644 --- a/plugins/catalog-backend-module-bitbucket-cloud/package.json +++ b/plugins/catalog-backend-module-bitbucket-cloud/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-bitbucket-cloud", - "version": "0.2.6-next.3", + "version": "0.2.6", "description": "A Backstage catalog backend module that helps integrate towards Bitbucket Cloud", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-bitbucket-server/CHANGELOG.md b/plugins/catalog-backend-module-bitbucket-server/CHANGELOG.md index e7b67f047e..0724dcffab 100644 --- a/plugins/catalog-backend-module-bitbucket-server/CHANGELOG.md +++ b/plugins/catalog-backend-module-bitbucket-server/CHANGELOG.md @@ -1,5 +1,21 @@ # @backstage/plugin-catalog-backend-module-bitbucket-server +## 0.1.33 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/integration@1.12.0 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.1.33-next.3 ### Patch Changes diff --git a/plugins/catalog-backend-module-bitbucket-server/package.json b/plugins/catalog-backend-module-bitbucket-server/package.json index 7e6f3a919a..bff2adee0a 100644 --- a/plugins/catalog-backend-module-bitbucket-server/package.json +++ b/plugins/catalog-backend-module-bitbucket-server/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-bitbucket-server", - "version": "0.1.33-next.3", + "version": "0.1.33", "backstage": { "role": "backend-plugin-module", "pluginId": "catalog", diff --git a/plugins/catalog-backend-module-gcp/CHANGELOG.md b/plugins/catalog-backend-module-gcp/CHANGELOG.md index 2d8493c2df..756c77cd24 100644 --- a/plugins/catalog-backend-module-gcp/CHANGELOG.md +++ b/plugins/catalog-backend-module-gcp/CHANGELOG.md @@ -1,5 +1,20 @@ # @backstage/plugin-catalog-backend-module-gcp +## 0.1.20 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-kubernetes-common@0.8.0 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + ## 0.1.20-next.3 ### Patch Changes diff --git a/plugins/catalog-backend-module-gcp/package.json b/plugins/catalog-backend-module-gcp/package.json index cd6a65e2c6..3f144c7a9c 100644 --- a/plugins/catalog-backend-module-gcp/package.json +++ b/plugins/catalog-backend-module-gcp/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-gcp", - "version": "0.1.20-next.3", + "version": "0.1.20", "description": "A Backstage catalog backend module that helps integrate towards GCP", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-gerrit/CHANGELOG.md b/plugins/catalog-backend-module-gerrit/CHANGELOG.md index 0ef0bfa206..b241cbe499 100644 --- a/plugins/catalog-backend-module-gerrit/CHANGELOG.md +++ b/plugins/catalog-backend-module-gerrit/CHANGELOG.md @@ -1,5 +1,20 @@ # @backstage/plugin-catalog-backend-module-gerrit +## 0.1.36 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/integration@1.12.0 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.1.36-next.3 ### Patch Changes diff --git a/plugins/catalog-backend-module-gerrit/package.json b/plugins/catalog-backend-module-gerrit/package.json index 84183c1e36..207eefd381 100644 --- a/plugins/catalog-backend-module-gerrit/package.json +++ b/plugins/catalog-backend-module-gerrit/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-gerrit", - "version": "0.1.36-next.3", + "version": "0.1.36", "backstage": { "role": "backend-plugin-module", "pluginId": "catalog", diff --git a/plugins/catalog-backend-module-github-org/CHANGELOG.md b/plugins/catalog-backend-module-github-org/CHANGELOG.md index 844f62c572..bac2b053aa 100644 --- a/plugins/catalog-backend-module-github-org/CHANGELOG.md +++ b/plugins/catalog-backend-module-github-org/CHANGELOG.md @@ -1,5 +1,20 @@ # @backstage/plugin-catalog-backend-module-github-org +## 0.1.14 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-catalog-backend-module-github@0.6.2 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-events-node@0.3.5 + - @backstage/config@1.2.0 + ## 0.1.14-next.3 ### Patch Changes diff --git a/plugins/catalog-backend-module-github-org/package.json b/plugins/catalog-backend-module-github-org/package.json index 45b981e178..3946f1878c 100644 --- a/plugins/catalog-backend-module-github-org/package.json +++ b/plugins/catalog-backend-module-github-org/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-github-org", - "version": "0.1.14-next.3", + "version": "0.1.14", "description": "The github-org backend module for the catalog plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-github/CHANGELOG.md b/plugins/catalog-backend-module-github/CHANGELOG.md index 720ba05101..fb15cb0de4 100644 --- a/plugins/catalog-backend-module-github/CHANGELOG.md +++ b/plugins/catalog-backend-module-github/CHANGELOG.md @@ -1,5 +1,25 @@ # @backstage/plugin-catalog-backend-module-github +## 0.6.2 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- 67d0530: Fix bug in root repo import where catalog-info.yaml.hcl file is found by search and breaks the import +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-catalog-backend@1.23.0 + - @backstage/integration@1.12.0 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-events-node@0.3.5 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + ## 0.6.2-next.3 ### Patch Changes diff --git a/plugins/catalog-backend-module-github/package.json b/plugins/catalog-backend-module-github/package.json index a88a64f59d..7d3bd62281 100644 --- a/plugins/catalog-backend-module-github/package.json +++ b/plugins/catalog-backend-module-github/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-github", - "version": "0.6.2-next.3", + "version": "0.6.2", "description": "A Backstage catalog backend module that helps integrate towards GitHub", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-gitlab-org/CHANGELOG.md b/plugins/catalog-backend-module-gitlab-org/CHANGELOG.md index 78c7ad3e8c..92dc47ec69 100644 --- a/plugins/catalog-backend-module-gitlab-org/CHANGELOG.md +++ b/plugins/catalog-backend-module-gitlab-org/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-catalog-backend-module-gitlab-org +## 0.0.2 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-catalog-backend-module-gitlab@0.3.18 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-events-node@0.3.5 + ## 0.0.2-next.3 ### Patch Changes diff --git a/plugins/catalog-backend-module-gitlab-org/package.json b/plugins/catalog-backend-module-gitlab-org/package.json index 1c7f158277..781dc54706 100644 --- a/plugins/catalog-backend-module-gitlab-org/package.json +++ b/plugins/catalog-backend-module-gitlab-org/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-gitlab-org", - "version": "0.0.2-next.3", + "version": "0.0.2", "description": "The gitlab-org backend module for the catalog plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-gitlab/CHANGELOG.md b/plugins/catalog-backend-module-gitlab/CHANGELOG.md index 2f399995be..ec7bbc1c27 100644 --- a/plugins/catalog-backend-module-gitlab/CHANGELOG.md +++ b/plugins/catalog-backend-module-gitlab/CHANGELOG.md @@ -1,5 +1,24 @@ # @backstage/plugin-catalog-backend-module-gitlab +## 0.3.18 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- 150fc77: Fixed an issue in `GitlabOrgDiscoveryEntityProvider` where a missing `orgEnabled` config key was throwing an error. +- f271164: Fixed an issue in `GitlabDiscoveryEntityProvider` where the fallback branch was taking precedence over the GitLab default branch. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/integration@1.12.0 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-events-node@0.3.5 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + ## 0.3.18-next.3 ### Patch Changes diff --git a/plugins/catalog-backend-module-gitlab/package.json b/plugins/catalog-backend-module-gitlab/package.json index 6d01d225cd..d52b452122 100644 --- a/plugins/catalog-backend-module-gitlab/package.json +++ b/plugins/catalog-backend-module-gitlab/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-gitlab", - "version": "0.3.18-next.3", + "version": "0.3.18", "description": "A Backstage catalog backend module that helps integrate towards GitLab", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-incremental-ingestion/CHANGELOG.md b/plugins/catalog-backend-module-incremental-ingestion/CHANGELOG.md index 51904c8e97..424baa2321 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/CHANGELOG.md +++ b/plugins/catalog-backend-module-incremental-ingestion/CHANGELOG.md @@ -1,5 +1,23 @@ # @backstage/plugin-catalog-backend-module-incremental-ingestion +## 0.4.24 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-catalog-backend@1.23.0 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-events-node@0.3.5 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.4.24-next.3 ### Patch Changes diff --git a/plugins/catalog-backend-module-incremental-ingestion/package.json b/plugins/catalog-backend-module-incremental-ingestion/package.json index 14e8e37ae9..eba5fc86c1 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/package.json +++ b/plugins/catalog-backend-module-incremental-ingestion/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-incremental-ingestion", - "version": "0.4.24-next.3", + "version": "0.4.24", "description": "An entity provider for streaming large asset sources into the catalog", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-ldap/CHANGELOG.md b/plugins/catalog-backend-module-ldap/CHANGELOG.md index 2dd3815850..62b8849ced 100644 --- a/plugins/catalog-backend-module-ldap/CHANGELOG.md +++ b/plugins/catalog-backend-module-ldap/CHANGELOG.md @@ -1,5 +1,25 @@ # @backstage/plugin-catalog-backend-module-ldap +## 0.6.0 + +### Minor Changes + +- debcc8c: Migrate LDAP catalog module to the new backend system. + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.6.0-next.3 ### Patch Changes diff --git a/plugins/catalog-backend-module-ldap/package.json b/plugins/catalog-backend-module-ldap/package.json index dfce5277d2..beacc5e37f 100644 --- a/plugins/catalog-backend-module-ldap/package.json +++ b/plugins/catalog-backend-module-ldap/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-ldap", - "version": "0.6.0-next.3", + "version": "0.6.0", "description": "A Backstage catalog backend module that helps integrate towards LDAP", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-msgraph/CHANGELOG.md b/plugins/catalog-backend-module-msgraph/CHANGELOG.md index cb9acc5380..998f9aacd0 100644 --- a/plugins/catalog-backend-module-msgraph/CHANGELOG.md +++ b/plugins/catalog-backend-module-msgraph/CHANGELOG.md @@ -1,5 +1,21 @@ # @backstage/plugin-catalog-backend-module-msgraph +## 0.5.27 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- f7be17a: Added missing `userSelect` property in `readMicrosoftGraphOrg` method +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + ## 0.5.27-next.3 ### Patch Changes diff --git a/plugins/catalog-backend-module-msgraph/package.json b/plugins/catalog-backend-module-msgraph/package.json index 035093e58c..bdaa470dea 100644 --- a/plugins/catalog-backend-module-msgraph/package.json +++ b/plugins/catalog-backend-module-msgraph/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-msgraph", - "version": "0.5.27-next.3", + "version": "0.5.27", "description": "A Backstage catalog backend module that helps integrate towards Microsoft Graph", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-openapi/CHANGELOG.md b/plugins/catalog-backend-module-openapi/CHANGELOG.md index 876c095e24..f60ec12844 100644 --- a/plugins/catalog-backend-module-openapi/CHANGELOG.md +++ b/plugins/catalog-backend-module-openapi/CHANGELOG.md @@ -1,5 +1,22 @@ # @backstage/plugin-catalog-backend-module-openapi +## 0.1.37 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-catalog-backend@1.23.0 + - @backstage/integration@1.12.0 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/types@1.1.1 + ## 0.1.37-next.3 ### Patch Changes diff --git a/plugins/catalog-backend-module-openapi/package.json b/plugins/catalog-backend-module-openapi/package.json index 3691f1fcb3..c05d8dcec4 100644 --- a/plugins/catalog-backend-module-openapi/package.json +++ b/plugins/catalog-backend-module-openapi/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-openapi", - "version": "0.1.37-next.3", + "version": "0.1.37", "description": "A Backstage catalog backend module that helps with OpenAPI specifications", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-puppetdb/CHANGELOG.md b/plugins/catalog-backend-module-puppetdb/CHANGELOG.md index ef16a4547c..e990331ee9 100644 --- a/plugins/catalog-backend-module-puppetdb/CHANGELOG.md +++ b/plugins/catalog-backend-module-puppetdb/CHANGELOG.md @@ -1,5 +1,21 @@ # @backstage/plugin-catalog-backend-module-puppetdb +## 0.1.25 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.1.25-next.3 ### Patch Changes diff --git a/plugins/catalog-backend-module-puppetdb/package.json b/plugins/catalog-backend-module-puppetdb/package.json index 48997e80a9..3407a6dedd 100644 --- a/plugins/catalog-backend-module-puppetdb/package.json +++ b/plugins/catalog-backend-module-puppetdb/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-puppetdb", - "version": "0.1.25-next.3", + "version": "0.1.25", "description": "A Backstage catalog backend module that helps integrate towards PuppetDB", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-scaffolder-entity-model/CHANGELOG.md b/plugins/catalog-backend-module-scaffolder-entity-model/CHANGELOG.md index e177994807..a73ea9fbaf 100644 --- a/plugins/catalog-backend-module-scaffolder-entity-model/CHANGELOG.md +++ b/plugins/catalog-backend-module-scaffolder-entity-model/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-catalog-backend-module-scaffolder-entity-model +## 0.1.17 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-scaffolder-common@1.5.3 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/catalog-model@1.5.0 + ## 0.1.17-next.3 ### Patch Changes diff --git a/plugins/catalog-backend-module-scaffolder-entity-model/package.json b/plugins/catalog-backend-module-scaffolder-entity-model/package.json index 4b7813d8a3..247dc999db 100644 --- a/plugins/catalog-backend-module-scaffolder-entity-model/package.json +++ b/plugins/catalog-backend-module-scaffolder-entity-model/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-scaffolder-entity-model", - "version": "0.1.17-next.3", + "version": "0.1.17", "description": "Adds support for the scaffolder specific entity model (e.g. the Template kind) to the catalog backend plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-unprocessed/CHANGELOG.md b/plugins/catalog-backend-module-unprocessed/CHANGELOG.md index 93ff11abaa..c07c7ef7a3 100644 --- a/plugins/catalog-backend-module-unprocessed/CHANGELOG.md +++ b/plugins/catalog-backend-module-unprocessed/CHANGELOG.md @@ -1,5 +1,21 @@ # @backstage/plugin-catalog-backend-module-unprocessed +## 0.4.6 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-catalog-unprocessed-entities-common@0.0.2 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + ## 0.4.6-next.3 ### Patch Changes diff --git a/plugins/catalog-backend-module-unprocessed/package.json b/plugins/catalog-backend-module-unprocessed/package.json index 22e6d46649..845f5aa9c6 100644 --- a/plugins/catalog-backend-module-unprocessed/package.json +++ b/plugins/catalog-backend-module-unprocessed/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-unprocessed", - "version": "0.4.6-next.3", + "version": "0.4.6", "description": "Backstage Catalog module to view unprocessed entities", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend/CHANGELOG.md b/plugins/catalog-backend/CHANGELOG.md index e1dc06e78b..7b83c21930 100644 --- a/plugins/catalog-backend/CHANGELOG.md +++ b/plugins/catalog-backend/CHANGELOG.md @@ -1,5 +1,38 @@ # @backstage/plugin-catalog-backend +## 1.23.0 + +### Minor Changes + +- c7528b0: Pass through `EventsService` too in the new backend system + +### Patch Changes + +- 8869b8e: Updated local development setup. +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- d779e3b: Added a regex test to check commit hash. If url is from git commit branch ignore the edit url. +- 6c5cab1: Fix bug in `getLocationByEntity` +- 0f55f5c: Ensure name and title are both indexed by the DefaultCatalogCollator +- 1779188: Start using the `isDatabaseConflictError` helper from the `@backstage/backend-plugin-api` package in order to avoid dependency with the soon to deprecate `@backstage/backend-common` package. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/integration@1.12.0 + - @backstage/plugin-search-backend-module-catalog@0.1.25 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-events-node@0.3.5 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/backend-openapi-utils@0.1.12 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 1.23.0-next.3 ### Patch Changes diff --git a/plugins/catalog-backend/package.json b/plugins/catalog-backend/package.json index f1a22f839a..574e1c99ea 100644 --- a/plugins/catalog-backend/package.json +++ b/plugins/catalog-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend", - "version": "1.23.0-next.3", + "version": "1.23.0", "description": "The Backstage backend plugin that provides the Backstage catalog", "backstage": { "role": "backend-plugin", diff --git a/plugins/catalog-common/CHANGELOG.md b/plugins/catalog-common/CHANGELOG.md index 75b3c0d6d5..fd3c714f97 100644 --- a/plugins/catalog-common/CHANGELOG.md +++ b/plugins/catalog-common/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-catalog-common +## 1.0.24 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-search-common@1.2.12 + - @backstage/catalog-model@1.5.0 + ## 1.0.24-next.0 ### Patch Changes diff --git a/plugins/catalog-common/package.json b/plugins/catalog-common/package.json index 7bdcfc2bc7..0ea4ce5e3e 100644 --- a/plugins/catalog-common/package.json +++ b/plugins/catalog-common/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-common", - "version": "1.0.24-next.0", + "version": "1.0.24", "description": "Common functionalities for the catalog plugin", "backstage": { "role": "common-library", diff --git a/plugins/catalog-graph/CHANGELOG.md b/plugins/catalog-graph/CHANGELOG.md index c7194dcac9..9f39daa276 100644 --- a/plugins/catalog-graph/CHANGELOG.md +++ b/plugins/catalog-graph/CHANGELOG.md @@ -1,5 +1,22 @@ # @backstage/plugin-catalog-graph +## 0.4.6 + +### Patch Changes + +- 8d474d3: Add function to `EntityRelationsGraph` filter that excludes entities from graph +- d44a20a: Added additional plugin metadata to `package.json`. +- cd6aeea: The `catalogEntity` external route will now by default bind to the catalog entity page if it is available. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-compat-api@0.2.6 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/types@1.1.1 + ## 0.4.6-next.2 ### Patch Changes diff --git a/plugins/catalog-graph/package.json b/plugins/catalog-graph/package.json index 5b44c7afa5..17013d199a 100644 --- a/plugins/catalog-graph/package.json +++ b/plugins/catalog-graph/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-graph", - "version": "0.4.6-next.2", + "version": "0.4.6", "backstage": { "role": "frontend-plugin", "pluginId": "catalog-graph", diff --git a/plugins/catalog-import/CHANGELOG.md b/plugins/catalog-import/CHANGELOG.md index ed04b5a0f8..9bee65367a 100644 --- a/plugins/catalog-import/CHANGELOG.md +++ b/plugins/catalog-import/CHANGELOG.md @@ -1,5 +1,29 @@ # @backstage/plugin-catalog-import +## 0.12.0 + +### Minor Changes + +- 4f92394: Migrate from identityApi to fetchApi in frontend plugins. + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- 3daad61: Integrated Azure DevOps as a catalog import source. This enables Backstage to create Pull Requests to Azure DevOps repositories as it does with GitHub repositories +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-compat-api@0.2.6 + - @backstage/integration@1.12.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/integration-react@1.1.28 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.12.0-next.3 ### Patch Changes diff --git a/plugins/catalog-import/package.json b/plugins/catalog-import/package.json index 08c07000d5..2b93e0a7c0 100644 --- a/plugins/catalog-import/package.json +++ b/plugins/catalog-import/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-import", - "version": "0.12.0-next.3", + "version": "0.12.0", "description": "A Backstage plugin the helps you import entities into your catalog", "backstage": { "role": "frontend-plugin", diff --git a/plugins/catalog-node/CHANGELOG.md b/plugins/catalog-node/CHANGELOG.md index 2c4bf5025d..f476ca301a 100644 --- a/plugins/catalog-node/CHANGELOG.md +++ b/plugins/catalog-node/CHANGELOG.md @@ -1,5 +1,21 @@ # @backstage/plugin-catalog-node +## 1.12.1 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 1.12.1-next.2 ### Patch Changes diff --git a/plugins/catalog-node/package.json b/plugins/catalog-node/package.json index e750a32249..c6bb7854b6 100644 --- a/plugins/catalog-node/package.json +++ b/plugins/catalog-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-node", - "version": "1.12.1-next.2", + "version": "1.12.1", "description": "The plugin-catalog-node module for @backstage/plugin-catalog-backend", "backstage": { "role": "node-library", diff --git a/plugins/catalog-react/CHANGELOG.md b/plugins/catalog-react/CHANGELOG.md index a4f2bf8980..f4e0b0c708 100644 --- a/plugins/catalog-react/CHANGELOG.md +++ b/plugins/catalog-react/CHANGELOG.md @@ -1,5 +1,25 @@ # @backstage/plugin-catalog-react +## 1.12.1 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- fa8560e: Prevents Autocomplete dropdown from overlapping sidebar on hovering it +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-permission-react@0.4.23 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/integration-react@1.1.28 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + ## 1.12.1-next.2 ### Patch Changes diff --git a/plugins/catalog-react/package.json b/plugins/catalog-react/package.json index 64cbc27fb1..961dad0e0e 100644 --- a/plugins/catalog-react/package.json +++ b/plugins/catalog-react/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-react", - "version": "1.12.1-next.2", + "version": "1.12.1", "description": "A frontend library that helps other Backstage plugins interact with the catalog", "backstage": { "role": "web-library", diff --git a/plugins/catalog-unprocessed-entities-common/CHANGELOG.md b/plugins/catalog-unprocessed-entities-common/CHANGELOG.md index f399f80bc0..f2f489b6a0 100644 --- a/plugins/catalog-unprocessed-entities-common/CHANGELOG.md +++ b/plugins/catalog-unprocessed-entities-common/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/plugin-catalog-unprocessed-entities-common +## 0.0.2 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/plugin-permission-common@0.7.14 + ## 0.0.2-next.0 ### Patch Changes diff --git a/plugins/catalog-unprocessed-entities-common/package.json b/plugins/catalog-unprocessed-entities-common/package.json index 9367e4d17d..f491d27157 100644 --- a/plugins/catalog-unprocessed-entities-common/package.json +++ b/plugins/catalog-unprocessed-entities-common/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-unprocessed-entities-common", - "version": "0.0.2-next.0", + "version": "0.0.2", "description": "Common functionalities for the catalog-unprocessed-entities plugin", "backstage": { "role": "common-library", diff --git a/plugins/catalog-unprocessed-entities/CHANGELOG.md b/plugins/catalog-unprocessed-entities/CHANGELOG.md index a87b0b1957..8d39848d54 100644 --- a/plugins/catalog-unprocessed-entities/CHANGELOG.md +++ b/plugins/catalog-unprocessed-entities/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/plugin-catalog-unprocessed-entities +## 0.2.5 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + ## 0.2.5-next.2 ### Patch Changes diff --git a/plugins/catalog-unprocessed-entities/package.json b/plugins/catalog-unprocessed-entities/package.json index 7411123c6c..32abaa1bbb 100644 --- a/plugins/catalog-unprocessed-entities/package.json +++ b/plugins/catalog-unprocessed-entities/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-unprocessed-entities", - "version": "0.2.5-next.2", + "version": "0.2.5", "backstage": { "role": "frontend-plugin", "pluginId": "catalog-unprocessed-entities", diff --git a/plugins/catalog/CHANGELOG.md b/plugins/catalog/CHANGELOG.md index 0434b0262b..f74c71e66c 100644 --- a/plugins/catalog/CHANGELOG.md +++ b/plugins/catalog/CHANGELOG.md @@ -1,5 +1,43 @@ # @backstage/plugin-catalog +## 1.21.0 + +### Minor Changes + +- 863a800: Added the following default targets for external routes: + + - `createComponent` binds to the Scaffolder page. + - `viewTechDoc` binds to the TechDocs entity documentation page. + - `createFromTemplate` binds to the Scaffolder selected template page. + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- e04e57d: Fix bug with missing Actions column after adding "pagination" prop to catalog table +- a2d2649: Export `catalogTranslationRef` under `/alpha` +- bcec60f: updated the ContextMenu, ActionsPage, OngoingTask and TemplateCard frontend components to support the new scaffolder permissions: + + - `scaffolder.task.create` + - `scaffolder.task.cancel` + - `scaffolder.task.read` + +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-compat-api@0.2.6 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-scaffolder-common@1.5.3 + - @backstage/plugin-permission-react@0.4.23 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/plugin-search-common@1.2.12 + - @backstage/plugin-search-react@1.7.12 + - @backstage/integration-react@1.1.28 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 1.21.0-next.3 ### Patch Changes diff --git a/plugins/catalog/package.json b/plugins/catalog/package.json index dba938217f..5b7aea1449 100644 --- a/plugins/catalog/package.json +++ b/plugins/catalog/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog", - "version": "1.21.0-next.3", + "version": "1.21.0", "description": "The Backstage plugin for browsing the Backstage catalog", "backstage": { "role": "frontend-plugin", diff --git a/plugins/config-schema/CHANGELOG.md b/plugins/config-schema/CHANGELOG.md index 59430dca35..582368aca4 100644 --- a/plugins/config-schema/CHANGELOG.md +++ b/plugins/config-schema/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/plugin-config-schema +## 0.1.56 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.1.56-next.2 ### Patch Changes diff --git a/plugins/config-schema/package.json b/plugins/config-schema/package.json index 8a0f1fb1c7..0aa4d1dc6c 100644 --- a/plugins/config-schema/package.json +++ b/plugins/config-schema/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-config-schema", - "version": "0.1.56-next.2", + "version": "0.1.56", "description": "A Backstage plugin that lets you browse the configuration schema of your app", "backstage": { "role": "frontend-plugin", diff --git a/plugins/devtools-backend/CHANGELOG.md b/plugins/devtools-backend/CHANGELOG.md index ef2e9801d5..fbcae07d37 100644 --- a/plugins/devtools-backend/CHANGELOG.md +++ b/plugins/devtools-backend/CHANGELOG.md @@ -1,5 +1,24 @@ # @backstage/plugin-devtools-backend +## 0.3.5 + +### Patch Changes + +- 8869b8e: Updated local development setup. +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-devtools-common@0.1.10 + - @backstage/cli-common@0.1.14 + - @backstage/config-loader@1.8.1 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.3.5-next.3 ### Patch Changes diff --git a/plugins/devtools-backend/package.json b/plugins/devtools-backend/package.json index 415199f0f8..106950a4a4 100644 --- a/plugins/devtools-backend/package.json +++ b/plugins/devtools-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-devtools-backend", - "version": "0.3.5-next.3", + "version": "0.3.5", "backstage": { "role": "backend-plugin", "pluginId": "devtools", diff --git a/plugins/devtools-common/CHANGELOG.md b/plugins/devtools-common/CHANGELOG.md index f887a90338..3e060571ad 100644 --- a/plugins/devtools-common/CHANGELOG.md +++ b/plugins/devtools-common/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-devtools-common +## 0.1.10 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/plugin-permission-common@0.7.14 + - @backstage/types@1.1.1 + ## 0.1.10-next.0 ### Patch Changes diff --git a/plugins/devtools-common/package.json b/plugins/devtools-common/package.json index 06577b2c0f..24b17d6742 100644 --- a/plugins/devtools-common/package.json +++ b/plugins/devtools-common/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-devtools-common", - "version": "0.1.10-next.0", + "version": "0.1.10", "description": "Common functionalities for the devtools plugin", "backstage": { "role": "common-library", diff --git a/plugins/devtools/CHANGELOG.md b/plugins/devtools/CHANGELOG.md index 448734d4c8..db8e1701f1 100644 --- a/plugins/devtools/CHANGELOG.md +++ b/plugins/devtools/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-devtools +## 0.1.15 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-compat-api@0.2.6 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-permission-react@0.4.23 + - @backstage/plugin-devtools-common@0.1.10 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/errors@1.2.4 + ## 0.1.15-next.2 ### Patch Changes diff --git a/plugins/devtools/package.json b/plugins/devtools/package.json index fd16205104..3e9d697965 100644 --- a/plugins/devtools/package.json +++ b/plugins/devtools/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-devtools", - "version": "0.1.15-next.2", + "version": "0.1.15", "backstage": { "role": "frontend-plugin", "pluginId": "devtools", diff --git a/plugins/events-backend-module-aws-sqs/CHANGELOG.md b/plugins/events-backend-module-aws-sqs/CHANGELOG.md index 917c613b7a..0c80bac266 100644 --- a/plugins/events-backend-module-aws-sqs/CHANGELOG.md +++ b/plugins/events-backend-module-aws-sqs/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-events-backend-module-aws-sqs +## 0.3.5 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-events-node@0.3.5 + - @backstage/config@1.2.0 + - @backstage/types@1.1.1 + ## 0.3.5-next.3 ### Patch Changes diff --git a/plugins/events-backend-module-aws-sqs/package.json b/plugins/events-backend-module-aws-sqs/package.json index 625dff4e6f..6d58fe4436 100644 --- a/plugins/events-backend-module-aws-sqs/package.json +++ b/plugins/events-backend-module-aws-sqs/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-events-backend-module-aws-sqs", - "version": "0.3.5-next.3", + "version": "0.3.5", "backstage": { "role": "backend-plugin-module", "pluginId": "events", diff --git a/plugins/events-backend-module-azure/CHANGELOG.md b/plugins/events-backend-module-azure/CHANGELOG.md index 9d41baa75c..22171cbd33 100644 --- a/plugins/events-backend-module-azure/CHANGELOG.md +++ b/plugins/events-backend-module-azure/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-events-backend-module-azure +## 0.2.5 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-events-node@0.3.5 + ## 0.2.5-next.2 ### Patch Changes diff --git a/plugins/events-backend-module-azure/package.json b/plugins/events-backend-module-azure/package.json index 6e124a6703..bb0bce7753 100644 --- a/plugins/events-backend-module-azure/package.json +++ b/plugins/events-backend-module-azure/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-events-backend-module-azure", - "version": "0.2.5-next.2", + "version": "0.2.5", "backstage": { "role": "backend-plugin-module", "pluginId": "events", diff --git a/plugins/events-backend-module-bitbucket-cloud/CHANGELOG.md b/plugins/events-backend-module-bitbucket-cloud/CHANGELOG.md index 7b5a3c4e5e..b71ef0dadf 100644 --- a/plugins/events-backend-module-bitbucket-cloud/CHANGELOG.md +++ b/plugins/events-backend-module-bitbucket-cloud/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-events-backend-module-bitbucket-cloud +## 0.2.5 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-events-node@0.3.5 + ## 0.2.5-next.2 ### Patch Changes diff --git a/plugins/events-backend-module-bitbucket-cloud/package.json b/plugins/events-backend-module-bitbucket-cloud/package.json index efb4809dd6..83e5f3528b 100644 --- a/plugins/events-backend-module-bitbucket-cloud/package.json +++ b/plugins/events-backend-module-bitbucket-cloud/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-events-backend-module-bitbucket-cloud", - "version": "0.2.5-next.2", + "version": "0.2.5", "backstage": { "role": "backend-plugin-module", "pluginId": "events", diff --git a/plugins/events-backend-module-gerrit/CHANGELOG.md b/plugins/events-backend-module-gerrit/CHANGELOG.md index ff33bde8ec..4ff865f60b 100644 --- a/plugins/events-backend-module-gerrit/CHANGELOG.md +++ b/plugins/events-backend-module-gerrit/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-events-backend-module-gerrit +## 0.2.5 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-events-node@0.3.5 + ## 0.2.5-next.2 ### Patch Changes diff --git a/plugins/events-backend-module-gerrit/package.json b/plugins/events-backend-module-gerrit/package.json index 7a708a8fe5..5fbc339191 100644 --- a/plugins/events-backend-module-gerrit/package.json +++ b/plugins/events-backend-module-gerrit/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-events-backend-module-gerrit", - "version": "0.2.5-next.2", + "version": "0.2.5", "backstage": { "role": "backend-plugin-module", "pluginId": "events", diff --git a/plugins/events-backend-module-github/CHANGELOG.md b/plugins/events-backend-module-github/CHANGELOG.md index 1447cb2c6d..77882e3711 100644 --- a/plugins/events-backend-module-github/CHANGELOG.md +++ b/plugins/events-backend-module-github/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/plugin-events-backend-module-github +## 0.2.5 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-events-node@0.3.5 + - @backstage/config@1.2.0 + ## 0.2.5-next.2 ### Patch Changes diff --git a/plugins/events-backend-module-github/package.json b/plugins/events-backend-module-github/package.json index 80681a2228..cf1bb2c7a5 100644 --- a/plugins/events-backend-module-github/package.json +++ b/plugins/events-backend-module-github/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-events-backend-module-github", - "version": "0.2.5-next.2", + "version": "0.2.5", "backstage": { "role": "backend-plugin-module", "pluginId": "events", diff --git a/plugins/events-backend-module-gitlab/CHANGELOG.md b/plugins/events-backend-module-gitlab/CHANGELOG.md index 601b6061fa..ec96ba8f73 100644 --- a/plugins/events-backend-module-gitlab/CHANGELOG.md +++ b/plugins/events-backend-module-gitlab/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/plugin-events-backend-module-gitlab +## 0.2.5 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-events-node@0.3.5 + - @backstage/config@1.2.0 + ## 0.2.5-next.2 ### Patch Changes diff --git a/plugins/events-backend-module-gitlab/package.json b/plugins/events-backend-module-gitlab/package.json index 7ee53328ef..e6ed2d9b16 100644 --- a/plugins/events-backend-module-gitlab/package.json +++ b/plugins/events-backend-module-gitlab/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-events-backend-module-gitlab", - "version": "0.2.5-next.2", + "version": "0.2.5", "backstage": { "role": "backend-plugin-module", "pluginId": "events", diff --git a/plugins/events-backend-test-utils/CHANGELOG.md b/plugins/events-backend-test-utils/CHANGELOG.md index 1c72ddb329..4f04a9c277 100644 --- a/plugins/events-backend-test-utils/CHANGELOG.md +++ b/plugins/events-backend-test-utils/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/plugin-events-backend-test-utils +## 0.1.29 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/plugin-events-node@0.3.5 + ## 0.1.29-next.2 ### Patch Changes diff --git a/plugins/events-backend-test-utils/package.json b/plugins/events-backend-test-utils/package.json index 6b97deb195..89dffd2e2c 100644 --- a/plugins/events-backend-test-utils/package.json +++ b/plugins/events-backend-test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-events-backend-test-utils", - "version": "0.1.29-next.2", + "version": "0.1.29", "description": "The plugin-events-backend-test-utils for @backstage/plugin-events-node", "backstage": { "role": "node-library", diff --git a/plugins/events-backend/CHANGELOG.md b/plugins/events-backend/CHANGELOG.md index 0e4baec5bb..a5699c8d9f 100644 --- a/plugins/events-backend/CHANGELOG.md +++ b/plugins/events-backend/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-events-backend +## 0.3.6 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-events-node@0.3.5 + - @backstage/config@1.2.0 + ## 0.3.6-next.3 ### Patch Changes diff --git a/plugins/events-backend/package.json b/plugins/events-backend/package.json index 9aa7f160ff..d3ff69d254 100644 --- a/plugins/events-backend/package.json +++ b/plugins/events-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-events-backend", - "version": "0.3.6-next.3", + "version": "0.3.6", "backstage": { "role": "backend-plugin", "pluginId": "events", diff --git a/plugins/events-node/CHANGELOG.md b/plugins/events-node/CHANGELOG.md index 3c3ecb48ba..18da615383 100644 --- a/plugins/events-node/CHANGELOG.md +++ b/plugins/events-node/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-events-node +## 0.3.5 + +### Patch Changes + +- 6a576dc: Replace the usage of `getVoidLogger` with `mockServices.logger.mock` in order to remove the dependency with the soon-to-be-deprecated `backend-common` package. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + ## 0.3.5-next.2 ### Patch Changes diff --git a/plugins/events-node/package.json b/plugins/events-node/package.json index cd3ed6a8d9..5e0e375d48 100644 --- a/plugins/events-node/package.json +++ b/plugins/events-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-events-node", - "version": "0.3.5-next.2", + "version": "0.3.5", "description": "The plugin-events-node module for @backstage/plugin-events-backend", "backstage": { "role": "node-library", diff --git a/plugins/example-todo-list-backend/CHANGELOG.md b/plugins/example-todo-list-backend/CHANGELOG.md index 303f21317c..c3bb326175 100644 --- a/plugins/example-todo-list-backend/CHANGELOG.md +++ b/plugins/example-todo-list-backend/CHANGELOG.md @@ -1,5 +1,15 @@ # @internal/plugin-todo-list-backend +## 1.0.28 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/errors@1.2.4 + ## 1.0.28-next.3 ### Patch Changes diff --git a/plugins/example-todo-list-backend/package.json b/plugins/example-todo-list-backend/package.json index d562e96e6e..36bd9f86c6 100644 --- a/plugins/example-todo-list-backend/package.json +++ b/plugins/example-todo-list-backend/package.json @@ -1,6 +1,6 @@ { "name": "@internal/plugin-todo-list-backend", - "version": "1.0.28-next.3", + "version": "1.0.28", "backstage": { "role": "backend-plugin", "pluginId": "todo-list", diff --git a/plugins/example-todo-list-common/CHANGELOG.md b/plugins/example-todo-list-common/CHANGELOG.md index a1434bbe2e..3761ead6a3 100644 --- a/plugins/example-todo-list-common/CHANGELOG.md +++ b/plugins/example-todo-list-common/CHANGELOG.md @@ -1,5 +1,12 @@ # @internal/plugin-todo-list-common +## 1.0.19 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-permission-common@0.7.14 + ## 1.0.19-next.0 ### Patch Changes diff --git a/plugins/example-todo-list-common/package.json b/plugins/example-todo-list-common/package.json index ad53bfd0bb..317cfa991d 100644 --- a/plugins/example-todo-list-common/package.json +++ b/plugins/example-todo-list-common/package.json @@ -1,6 +1,6 @@ { "name": "@internal/plugin-todo-list-common", - "version": "1.0.19-next.0", + "version": "1.0.19", "backstage": { "role": "common-library", "pluginId": "todo-list", diff --git a/plugins/example-todo-list/CHANGELOG.md b/plugins/example-todo-list/CHANGELOG.md index 93ea989354..43873757cf 100644 --- a/plugins/example-todo-list/CHANGELOG.md +++ b/plugins/example-todo-list/CHANGELOG.md @@ -1,5 +1,13 @@ # @internal/plugin-todo-list +## 1.0.28 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + ## 1.0.28-next.2 ### Patch Changes diff --git a/plugins/example-todo-list/package.json b/plugins/example-todo-list/package.json index a46216f52f..5e5f76ec6b 100644 --- a/plugins/example-todo-list/package.json +++ b/plugins/example-todo-list/package.json @@ -1,6 +1,6 @@ { "name": "@internal/plugin-todo-list", - "version": "1.0.28-next.2", + "version": "1.0.28", "backstage": { "role": "frontend-plugin", "pluginId": "todo-list", diff --git a/plugins/home-react/CHANGELOG.md b/plugins/home-react/CHANGELOG.md index fb76366dba..4ac5fa4b93 100644 --- a/plugins/home-react/CHANGELOG.md +++ b/plugins/home-react/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-home-react +## 0.1.14 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- 6cb4886: Updated dependency `@rjsf/utils` to `5.18.4`. + Updated dependency `@rjsf/core` to `5.18.4`. + Updated dependency `@rjsf/material-ui` to `5.18.4`. + Updated dependency `@rjsf/validator-ajv8` to `5.18.4`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + ## 0.1.14-next.2 ### Patch Changes diff --git a/plugins/home-react/package.json b/plugins/home-react/package.json index 9a4b1f6d7e..ad2bf6c7b2 100644 --- a/plugins/home-react/package.json +++ b/plugins/home-react/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-home-react", - "version": "0.1.14-next.2", + "version": "0.1.14", "description": "A Backstage plugin that contains react components helps you build a home page", "backstage": { "role": "web-library", diff --git a/plugins/home/CHANGELOG.md b/plugins/home/CHANGELOG.md index 4ef99e645a..fc163b8757 100644 --- a/plugins/home/CHANGELOG.md +++ b/plugins/home/CHANGELOG.md @@ -1,5 +1,27 @@ # @backstage/plugin-home +## 0.7.5 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- 6cb4886: Updated dependency `@rjsf/utils` to `5.18.4`. + Updated dependency `@rjsf/core` to `5.18.4`. + Updated dependency `@rjsf/material-ui` to `5.18.4`. + Updated dependency `@rjsf/validator-ajv8` to `5.18.4`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-compat-api@0.2.6 + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/plugin-home-react@0.1.14 + - @backstage/core-app-api@1.12.6 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + ## 0.7.5-next.2 ### Patch Changes diff --git a/plugins/home/package.json b/plugins/home/package.json index c484ec8132..6dda6cbfc2 100644 --- a/plugins/home/package.json +++ b/plugins/home/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-home", - "version": "0.7.5-next.2", + "version": "0.7.5", "description": "A Backstage plugin that helps you build a home page", "backstage": { "role": "frontend-plugin", diff --git a/plugins/kubernetes-backend/CHANGELOG.md b/plugins/kubernetes-backend/CHANGELOG.md index a1a4d9135b..5d0b4c6f37 100644 --- a/plugins/kubernetes-backend/CHANGELOG.md +++ b/plugins/kubernetes-backend/CHANGELOG.md @@ -1,5 +1,31 @@ # @backstage/plugin-kubernetes-backend +## 0.18.0 + +### Minor Changes + +- 0177f75: Update kubernetes plugins to use autoscaling/v2 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/plugin-kubernetes-common@0.8.0 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-kubernetes-node@0.1.13 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/integration-aws-node@0.1.12 + - @backstage/types@1.1.1 + ## 0.18.0-next.3 ### Patch Changes diff --git a/plugins/kubernetes-backend/package.json b/plugins/kubernetes-backend/package.json index 0df77bfe8b..ad05c481c0 100644 --- a/plugins/kubernetes-backend/package.json +++ b/plugins/kubernetes-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-kubernetes-backend", - "version": "0.18.0-next.3", + "version": "0.18.0", "description": "A Backstage backend plugin that integrates towards Kubernetes", "backstage": { "role": "backend-plugin", diff --git a/plugins/kubernetes-cluster/CHANGELOG.md b/plugins/kubernetes-cluster/CHANGELOG.md index 9f169fbbf2..e27d874ccc 100644 --- a/plugins/kubernetes-cluster/CHANGELOG.md +++ b/plugins/kubernetes-cluster/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-kubernetes-cluster +## 0.0.12 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/plugin-kubernetes-react@0.4.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-kubernetes-common@0.8.0 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/catalog-model@1.5.0 + ## 0.0.12-next.3 ### Patch Changes diff --git a/plugins/kubernetes-cluster/package.json b/plugins/kubernetes-cluster/package.json index 3d8ba47acb..9555fdbf79 100644 --- a/plugins/kubernetes-cluster/package.json +++ b/plugins/kubernetes-cluster/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-kubernetes-cluster", - "version": "0.0.12-next.3", + "version": "0.0.12", "description": "A Backstage plugin that shows details of Kubernetes clusters", "backstage": { "role": "frontend-plugin", diff --git a/plugins/kubernetes-common/CHANGELOG.md b/plugins/kubernetes-common/CHANGELOG.md index c00b9eb41b..e4de39bfd9 100644 --- a/plugins/kubernetes-common/CHANGELOG.md +++ b/plugins/kubernetes-common/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-kubernetes-common +## 0.8.0 + +### Minor Changes + +- 0177f75: Update kubernetes plugins to use autoscaling/v2 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/plugin-permission-common@0.7.14 + - @backstage/catalog-model@1.5.0 + - @backstage/types@1.1.1 + ## 0.8.0-next.1 ### Patch Changes diff --git a/plugins/kubernetes-common/package.json b/plugins/kubernetes-common/package.json index 25160b7bf2..9005c5ffe9 100644 --- a/plugins/kubernetes-common/package.json +++ b/plugins/kubernetes-common/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-kubernetes-common", - "version": "0.8.0-next.1", + "version": "0.8.0", "description": "Common functionalities for kubernetes, to be shared between kubernetes and kubernetes-backend plugin", "backstage": { "role": "common-library", diff --git a/plugins/kubernetes-node/CHANGELOG.md b/plugins/kubernetes-node/CHANGELOG.md index 713a9e64d7..47a7fbba76 100644 --- a/plugins/kubernetes-node/CHANGELOG.md +++ b/plugins/kubernetes-node/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/plugin-kubernetes-node +## 0.1.13 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-kubernetes-common@0.8.0 + - @backstage/catalog-model@1.5.0 + - @backstage/types@1.1.1 + ## 0.1.13-next.3 ### Patch Changes diff --git a/plugins/kubernetes-node/package.json b/plugins/kubernetes-node/package.json index 80f521b699..90fb172405 100644 --- a/plugins/kubernetes-node/package.json +++ b/plugins/kubernetes-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-kubernetes-node", - "version": "0.1.13-next.3", + "version": "0.1.13", "description": "Node.js library for the kubernetes plugin", "backstage": { "role": "node-library", diff --git a/plugins/kubernetes-react/CHANGELOG.md b/plugins/kubernetes-react/CHANGELOG.md index 3aadf6f633..8ebe85459a 100644 --- a/plugins/kubernetes-react/CHANGELOG.md +++ b/plugins/kubernetes-react/CHANGELOG.md @@ -1,5 +1,23 @@ # @backstage/plugin-kubernetes-react +## 0.4.0 + +### Minor Changes + +- 4f92394: Migrate from identityApi to fetchApi in frontend plugins. +- 0177f75: Update kubernetes plugins to use autoscaling/v2 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-kubernetes-common@0.8.0 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.4.0-next.3 ### Patch Changes diff --git a/plugins/kubernetes-react/package.json b/plugins/kubernetes-react/package.json index 645d532c0a..481b264d27 100644 --- a/plugins/kubernetes-react/package.json +++ b/plugins/kubernetes-react/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-kubernetes-react", - "version": "0.4.0-next.3", + "version": "0.4.0", "description": "Web library for the kubernetes-react plugin", "backstage": { "role": "web-library", diff --git a/plugins/kubernetes/CHANGELOG.md b/plugins/kubernetes/CHANGELOG.md index 022a64512d..2320219483 100644 --- a/plugins/kubernetes/CHANGELOG.md +++ b/plugins/kubernetes/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-kubernetes +## 0.11.11 + +### Patch Changes + +- 4f92394: Migrate from identityApi to fetchApi in frontend plugins. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/plugin-kubernetes-react@0.4.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-kubernetes-common@0.8.0 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/catalog-model@1.5.0 + ## 0.11.11-next.3 ### Patch Changes diff --git a/plugins/kubernetes/package.json b/plugins/kubernetes/package.json index be1b61ecf2..339e26a246 100644 --- a/plugins/kubernetes/package.json +++ b/plugins/kubernetes/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-kubernetes", - "version": "0.11.11-next.3", + "version": "0.11.11", "description": "A Backstage plugin that integrates towards Kubernetes", "backstage": { "role": "frontend-plugin", diff --git a/plugins/notifications-backend-module-email/CHANGELOG.md b/plugins/notifications-backend-module-email/CHANGELOG.md index 20de4f3288..30862ed64e 100644 --- a/plugins/notifications-backend-module-email/CHANGELOG.md +++ b/plugins/notifications-backend-module-email/CHANGELOG.md @@ -1,5 +1,26 @@ # @backstage/plugin-notifications-backend-module-email +## 0.1.0 + +### Minor Changes + +- 07a789b: add notification filters + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-notifications-node@0.2.0 + - @backstage/plugin-notifications-common@0.0.4 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/integration-aws-node@0.1.12 + - @backstage/types@1.1.1 + ## 0.1.0-next.3 ### Patch Changes diff --git a/plugins/notifications-backend-module-email/package.json b/plugins/notifications-backend-module-email/package.json index 2b92c78c74..4f2c8a6876 100644 --- a/plugins/notifications-backend-module-email/package.json +++ b/plugins/notifications-backend-module-email/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-notifications-backend-module-email", - "version": "0.1.0-next.3", + "version": "0.1.0", "description": "The email backend module for the notifications plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/notifications-backend/CHANGELOG.md b/plugins/notifications-backend/CHANGELOG.md index 993d75036d..66885a07bd 100644 --- a/plugins/notifications-backend/CHANGELOG.md +++ b/plugins/notifications-backend/CHANGELOG.md @@ -1,5 +1,28 @@ # @backstage/plugin-notifications-backend +## 0.3.0 + +### Minor Changes + +- 07a789b: adding filtering of notifications by processors + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-notifications-node@0.2.0 + - @backstage/plugin-events-node@0.3.5 + - @backstage/plugin-notifications-common@0.0.4 + - @backstage/plugin-signals-node@0.1.5 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.3.0-next.3 ### Patch Changes diff --git a/plugins/notifications-backend/package.json b/plugins/notifications-backend/package.json index 12d2b760ba..34fe472f42 100644 --- a/plugins/notifications-backend/package.json +++ b/plugins/notifications-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-notifications-backend", - "version": "0.3.0-next.3", + "version": "0.3.0", "backstage": { "role": "backend-plugin", "pluginId": "notifications", diff --git a/plugins/notifications-common/CHANGELOG.md b/plugins/notifications-common/CHANGELOG.md index 68d5a816eb..17231f0147 100644 --- a/plugins/notifications-common/CHANGELOG.md +++ b/plugins/notifications-common/CHANGELOG.md @@ -1,5 +1,11 @@ # @backstage/plugin-notifications-common +## 0.0.4 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. + ## 0.0.4-next.0 ### Patch Changes diff --git a/plugins/notifications-common/package.json b/plugins/notifications-common/package.json index 28dcf719b8..744cf52cba 100644 --- a/plugins/notifications-common/package.json +++ b/plugins/notifications-common/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-notifications-common", - "version": "0.0.4-next.0", + "version": "0.0.4", "description": "Common functionalities for the notifications plugin", "backstage": { "role": "common-library", diff --git a/plugins/notifications-node/CHANGELOG.md b/plugins/notifications-node/CHANGELOG.md index 165abf6e62..5611c7c6c4 100644 --- a/plugins/notifications-node/CHANGELOG.md +++ b/plugins/notifications-node/CHANGELOG.md @@ -1,5 +1,23 @@ # @backstage/plugin-notifications-node +## 0.2.0 + +### Minor Changes + +- 07a789b: add notifications filtering by processors + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- 1354d81: Use `node-fetch` instead of native fetch, as per https://backstage.io/docs/architecture-decisions/adrs-adr013 +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-notifications-common@0.0.4 + - @backstage/plugin-signals-node@0.1.5 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + ## 0.2.0-next.3 ### Patch Changes diff --git a/plugins/notifications-node/package.json b/plugins/notifications-node/package.json index 143131b8e7..973182be4e 100644 --- a/plugins/notifications-node/package.json +++ b/plugins/notifications-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-notifications-node", - "version": "0.2.0-next.3", + "version": "0.2.0", "description": "Node.js library for the notifications plugin", "backstage": { "role": "node-library", diff --git a/plugins/notifications/CHANGELOG.md b/plugins/notifications/CHANGELOG.md index c89dbb0e72..3b3def49cc 100644 --- a/plugins/notifications/CHANGELOG.md +++ b/plugins/notifications/CHANGELOG.md @@ -1,5 +1,21 @@ # @backstage/plugin-notifications +## 0.2.2 + +### Patch Changes + +- 7f02684: Do not always show scrollbars in notification description +- 6d196b4: Fixes performance issue with Notifications title counter. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/plugin-notifications-common@0.0.4 + - @backstage/plugin-signals-react@0.0.4 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.2.2-next.3 ### Patch Changes diff --git a/plugins/notifications/package.json b/plugins/notifications/package.json index c1c896db64..f375ae702e 100644 --- a/plugins/notifications/package.json +++ b/plugins/notifications/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-notifications", - "version": "0.2.2-next.3", + "version": "0.2.2", "backstage": { "role": "frontend-plugin", "pluginId": "notifications", diff --git a/plugins/org-react/CHANGELOG.md b/plugins/org-react/CHANGELOG.md index 8c55d3d5d0..9d0ffacd97 100644 --- a/plugins/org-react/CHANGELOG.md +++ b/plugins/org-react/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-org-react +## 0.1.25 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + ## 0.1.25-next.2 ### Patch Changes diff --git a/plugins/org-react/package.json b/plugins/org-react/package.json index 85376bf50e..32d46ef1a3 100644 --- a/plugins/org-react/package.json +++ b/plugins/org-react/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-org-react", - "version": "0.1.25-next.2", + "version": "0.1.25", "backstage": { "role": "web-library", "pluginId": "org", diff --git a/plugins/org/CHANGELOG.md b/plugins/org/CHANGELOG.md index f1d41f42ee..e14b1afcec 100644 --- a/plugins/org/CHANGELOG.md +++ b/plugins/org/CHANGELOG.md @@ -1,5 +1,20 @@ # @backstage/plugin-org +## 0.6.26 + +### Patch Changes + +- d8e2f53: The `catalogIndex` external route is now optional and will by default bind to the catalog index page if it is available. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-compat-api@0.2.6 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/catalog-model@1.5.0 + ## 0.6.26-next.2 ### Patch Changes diff --git a/plugins/org/package.json b/plugins/org/package.json index f86c532595..af3c54f1a2 100644 --- a/plugins/org/package.json +++ b/plugins/org/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-org", - "version": "0.6.26-next.2", + "version": "0.6.26", "description": "A Backstage plugin that helps you create entity pages for your organization", "backstage": { "role": "frontend-plugin", diff --git a/plugins/permission-backend-module-policy-allow-all/CHANGELOG.md b/plugins/permission-backend-module-policy-allow-all/CHANGELOG.md index 6661f22b2b..3c0a8d1bcb 100644 --- a/plugins/permission-backend-module-policy-allow-all/CHANGELOG.md +++ b/plugins/permission-backend-module-policy-allow-all/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-permission-backend-module-allow-all-policy +## 0.1.16 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/plugin-permission-common@0.7.14 + ## 0.1.16-next.2 ### Patch Changes diff --git a/plugins/permission-backend-module-policy-allow-all/package.json b/plugins/permission-backend-module-policy-allow-all/package.json index c41c09094a..e0108c6541 100644 --- a/plugins/permission-backend-module-policy-allow-all/package.json +++ b/plugins/permission-backend-module-policy-allow-all/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-permission-backend-module-allow-all-policy", - "version": "0.1.16-next.2", + "version": "0.1.16", "description": "Allow all policy backend module for the permission plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/permission-backend/CHANGELOG.md b/plugins/permission-backend/CHANGELOG.md index 0517a7d5fb..baaaefef70 100644 --- a/plugins/permission-backend/CHANGELOG.md +++ b/plugins/permission-backend/CHANGELOG.md @@ -1,5 +1,20 @@ # @backstage/plugin-permission-backend +## 0.5.43 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.5.43-next.3 ### Patch Changes diff --git a/plugins/permission-backend/package.json b/plugins/permission-backend/package.json index 8c563caef6..a3020e1dd3 100644 --- a/plugins/permission-backend/package.json +++ b/plugins/permission-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-permission-backend", - "version": "0.5.43-next.3", + "version": "0.5.43", "backstage": { "role": "backend-plugin", "pluginId": "permission", diff --git a/plugins/permission-common/CHANGELOG.md b/plugins/permission-common/CHANGELOG.md index 3eaa31b8d4..e6b637a092 100644 --- a/plugins/permission-common/CHANGELOG.md +++ b/plugins/permission-common/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-permission-common +## 0.7.14 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.7.14-next.0 ### Patch Changes diff --git a/plugins/permission-common/package.json b/plugins/permission-common/package.json index f97ff53aa4..ee54459589 100644 --- a/plugins/permission-common/package.json +++ b/plugins/permission-common/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-permission-common", - "version": "0.7.14-next.0", + "version": "0.7.14", "description": "Isomorphic types and client for Backstage permissions and authorization", "backstage": { "role": "common-library", diff --git a/plugins/permission-node/CHANGELOG.md b/plugins/permission-node/CHANGELOG.md index a42053297e..2e12639437 100644 --- a/plugins/permission-node/CHANGELOG.md +++ b/plugins/permission-node/CHANGELOG.md @@ -1,5 +1,20 @@ # @backstage/plugin-permission-node +## 0.7.30 + +### Patch Changes + +- 9e63318: Ensure that service token access restrictions, when present, are taken into account +- d44a20a: Added additional plugin metadata to `package.json`. +- c7b0dd1: Import `tokenManager` definition from `@backstage/backend-plugin-api` +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.7.30-next.3 ### Patch Changes diff --git a/plugins/permission-node/package.json b/plugins/permission-node/package.json index 072a23e7cc..1c29b97db0 100644 --- a/plugins/permission-node/package.json +++ b/plugins/permission-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-permission-node", - "version": "0.7.30-next.3", + "version": "0.7.30", "description": "Common permission and authorization utilities for backend plugins", "backstage": { "role": "node-library", diff --git a/plugins/permission-react/CHANGELOG.md b/plugins/permission-react/CHANGELOG.md index 38a0f79dcb..1eb951e625 100644 --- a/plugins/permission-react/CHANGELOG.md +++ b/plugins/permission-react/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-permission-react +## 0.4.23 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/config@1.2.0 + ## 0.4.23-next.1 ### Patch Changes diff --git a/plugins/permission-react/package.json b/plugins/permission-react/package.json index 2f7a2060cc..9ebb13e633 100644 --- a/plugins/permission-react/package.json +++ b/plugins/permission-react/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-permission-react", - "version": "0.4.23-next.1", + "version": "0.4.23", "backstage": { "role": "web-library", "pluginId": "permission", diff --git a/plugins/proxy-backend/CHANGELOG.md b/plugins/proxy-backend/CHANGELOG.md index fd64cb957d..deeaf2621b 100644 --- a/plugins/proxy-backend/CHANGELOG.md +++ b/plugins/proxy-backend/CHANGELOG.md @@ -1,5 +1,63 @@ # @backstage/plugin-proxy-backend +## 0.5.0 + +### Minor Changes + +- 88480e4: **BREAKING**: The proxy backend plugin is now protected by Backstage auth, by + default. Unless specifically configured (see below), all proxy endpoints will + reject requests immediately unless a valid Backstage user or service token is + passed along with the request. This aligns the proxy with how other Backstage + backends behave out of the box, and serves to protect your upstreams from + unauthorized access. + + A proxy configuration section can now look as follows: + + ```yaml + proxy: + endpoints: + '/pagerduty': + target: https://api.pagerduty.com + credentials: require # NEW! + headers: + Authorization: Token token=${PAGERDUTY_TOKEN} + ``` + + There are three possible `credentials` settings at this point: + + - `require`: Callers must provide Backstage user or service credentials with + each request. The credentials are not forwarded to the proxy target. + - `forward`: Callers must provide Backstage user or service credentials with + each request, and those credentials are forwarded to the proxy target. + - `dangerously-allow-unauthenticated`: No Backstage credentials are required to + access this proxy target. The target can still apply its own credentials + checks, but the proxy will not help block non-Backstage-blessed callers. If + you also add `allowedHeaders: ['Authorization']` to an endpoint configuration, + then the Backstage token (if provided) WILL be forwarded. + + The value `dangerously-allow-unauthenticated` was the old default. + + The value `require` is the new default, so requests that were previously + permitted may now start resulting in `401 Unauthorized` responses. If you have + `backend.auth.dangerouslyDisableDefaultAuthPolicy` set to `true`, this does not + apply; the proxy will behave as if all endpoints were set to + `dangerously-allow-unauthenticated`. + + If you have proxy endpoints that require unauthenticated access still, please + add `credentials: dangerously-allow-unauthenticated` to their declarations in + your app-config. + +### Patch Changes + +- 8869b8e: Updated local development setup. +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/config@1.2.0 + - @backstage/types@1.1.1 + ## 0.5.0-next.3 ### Patch Changes diff --git a/plugins/proxy-backend/package.json b/plugins/proxy-backend/package.json index 39df8539dc..4b990e57f7 100644 --- a/plugins/proxy-backend/package.json +++ b/plugins/proxy-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-proxy-backend", - "version": "0.5.0-next.3", + "version": "0.5.0", "description": "A Backstage backend plugin that helps you set up proxy endpoints in the backend", "backstage": { "role": "backend-plugin", diff --git a/plugins/scaffolder-backend-module-azure/CHANGELOG.md b/plugins/scaffolder-backend-module-azure/CHANGELOG.md index 06dc87373d..7c1115e7fa 100644 --- a/plugins/scaffolder-backend-module-azure/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-azure/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-scaffolder-backend-module-azure +## 0.1.11 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- b4169ee: Use `GitRepository.webUrl` instead of `GitRepository.remoteUrl` to set the value of `repoContentsUrl` as `remoteUrl` can sometimes return an URL with the wrong format (e.g. `https://@dev.azure.com///\_git/`). +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.1.11-next.2 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-azure/package.json b/plugins/scaffolder-backend-module-azure/package.json index 4bc8f6348e..ece29a8866 100644 --- a/plugins/scaffolder-backend-module-azure/package.json +++ b/plugins/scaffolder-backend-module-azure/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-azure", - "version": "0.1.11-next.2", + "version": "0.1.11", "description": "The azure module for @backstage/plugin-scaffolder-backend", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/scaffolder-backend-module-bitbucket-cloud/CHANGELOG.md b/plugins/scaffolder-backend-module-bitbucket-cloud/CHANGELOG.md index 0510656db6..01bcce124f 100644 --- a/plugins/scaffolder-backend-module-bitbucket-cloud/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-bitbucket-cloud/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-scaffolder-backend-module-bitbucket-cloud +## 0.1.9 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.1.9-next.2 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-bitbucket-cloud/package.json b/plugins/scaffolder-backend-module-bitbucket-cloud/package.json index f846f751cc..8e1fd1facd 100644 --- a/plugins/scaffolder-backend-module-bitbucket-cloud/package.json +++ b/plugins/scaffolder-backend-module-bitbucket-cloud/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-bitbucket-cloud", - "version": "0.1.9-next.2", + "version": "0.1.9", "description": "The Bitbucket Cloud module for @backstage/plugin-scaffolder-backend", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/scaffolder-backend-module-bitbucket-server/CHANGELOG.md b/plugins/scaffolder-backend-module-bitbucket-server/CHANGELOG.md index 445e38129a..3eefd69ab7 100644 --- a/plugins/scaffolder-backend-module-bitbucket-server/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-bitbucket-server/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-scaffolder-backend-module-bitbucket-server +## 0.1.9 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.1.9-next.2 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-bitbucket-server/package.json b/plugins/scaffolder-backend-module-bitbucket-server/package.json index ca5b6a5520..cc321ccd33 100644 --- a/plugins/scaffolder-backend-module-bitbucket-server/package.json +++ b/plugins/scaffolder-backend-module-bitbucket-server/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-bitbucket-server", - "version": "0.1.9-next.2", + "version": "0.1.9", "description": "The Bitbucket Server module for @backstage/plugin-scaffolder-backend", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/scaffolder-backend-module-bitbucket/CHANGELOG.md b/plugins/scaffolder-backend-module-bitbucket/CHANGELOG.md index 7e55079855..97b68baf15 100644 --- a/plugins/scaffolder-backend-module-bitbucket/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-bitbucket/CHANGELOG.md @@ -1,5 +1,20 @@ # @backstage/plugin-scaffolder-backend-module-bitbucket +## 0.2.9 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-backend-module-bitbucket-server@0.1.9 + - @backstage/plugin-scaffolder-backend-module-bitbucket-cloud@0.1.9 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.2.9-next.2 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-bitbucket/package.json b/plugins/scaffolder-backend-module-bitbucket/package.json index 8c4e810190..bc3a578fdb 100644 --- a/plugins/scaffolder-backend-module-bitbucket/package.json +++ b/plugins/scaffolder-backend-module-bitbucket/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-bitbucket", - "version": "0.2.9-next.2", + "version": "0.2.9", "description": "The bitbucket module for @backstage/plugin-scaffolder-backend", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/scaffolder-backend-module-confluence-to-markdown/CHANGELOG.md b/plugins/scaffolder-backend-module-confluence-to-markdown/CHANGELOG.md index dd01e3894c..45cb0bc6fc 100644 --- a/plugins/scaffolder-backend-module-confluence-to-markdown/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-confluence-to-markdown/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-scaffolder-backend-module-confluence-to-markdown +## 0.2.20 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.2.20-next.3 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-confluence-to-markdown/package.json b/plugins/scaffolder-backend-module-confluence-to-markdown/package.json index c161ab1358..02fa559e56 100644 --- a/plugins/scaffolder-backend-module-confluence-to-markdown/package.json +++ b/plugins/scaffolder-backend-module-confluence-to-markdown/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-confluence-to-markdown", - "version": "0.2.20-next.3", + "version": "0.2.20", "description": "The confluence-to-markdown module for @backstage/plugin-scaffolder-backend", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/scaffolder-backend-module-cookiecutter/CHANGELOG.md b/plugins/scaffolder-backend-module-cookiecutter/CHANGELOG.md index cf6a482a0f..8df8ef83e5 100644 --- a/plugins/scaffolder-backend-module-cookiecutter/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-cookiecutter/CHANGELOG.md @@ -1,5 +1,20 @@ # @backstage/plugin-scaffolder-backend-module-cookiecutter +## 0.2.43 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.2.43-next.3 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-cookiecutter/package.json b/plugins/scaffolder-backend-module-cookiecutter/package.json index ab7a49d700..a6e9cfbf66 100644 --- a/plugins/scaffolder-backend-module-cookiecutter/package.json +++ b/plugins/scaffolder-backend-module-cookiecutter/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-cookiecutter", - "version": "0.2.43-next.3", + "version": "0.2.43", "description": "A module for the scaffolder backend that lets you template projects using cookiecutter", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/scaffolder-backend-module-gerrit/CHANGELOG.md b/plugins/scaffolder-backend-module-gerrit/CHANGELOG.md index b815b20b95..2703b15871 100644 --- a/plugins/scaffolder-backend-module-gerrit/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-gerrit/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-scaffolder-backend-module-gerrit +## 0.1.11 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.1.11-next.2 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-gerrit/package.json b/plugins/scaffolder-backend-module-gerrit/package.json index b77c51c6b5..15aac0cceb 100644 --- a/plugins/scaffolder-backend-module-gerrit/package.json +++ b/plugins/scaffolder-backend-module-gerrit/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-gerrit", - "version": "0.1.11-next.2", + "version": "0.1.11", "description": "The gerrit module for @backstage/plugin-scaffolder-backend", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/scaffolder-backend-module-gitea/CHANGELOG.md b/plugins/scaffolder-backend-module-gitea/CHANGELOG.md index 330aaea23b..d2604729c2 100644 --- a/plugins/scaffolder-backend-module-gitea/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-gitea/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-scaffolder-backend-module-gitea +## 0.1.9 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- 1354d81: Use `node-fetch` instead of native fetch, as per https://backstage.io/docs/architecture-decisions/adrs-adr013 +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.1.9-next.3 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-gitea/package.json b/plugins/scaffolder-backend-module-gitea/package.json index f87f8695ec..55f948b87e 100644 --- a/plugins/scaffolder-backend-module-gitea/package.json +++ b/plugins/scaffolder-backend-module-gitea/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-gitea", - "version": "0.1.9-next.3", + "version": "0.1.9", "description": "The gitea module for @backstage/plugin-scaffolder-backend", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/scaffolder-backend-module-github/CHANGELOG.md b/plugins/scaffolder-backend-module-github/CHANGELOG.md index baefd5bddb..16d121113e 100644 --- a/plugins/scaffolder-backend-module-github/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-github/CHANGELOG.md @@ -1,5 +1,24 @@ # @backstage/plugin-scaffolder-backend-module-github +## 0.3.0 + +### Minor Changes + +- 403394a: Allow empty author info in createPullRequest action for Github + +### Patch Changes + +- f145a04: Added handling for dry run to githubPullRequest and githubWebhook and added tests for this functionality +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.3.0-next.3 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-github/package.json b/plugins/scaffolder-backend-module-github/package.json index 800309627c..c86a10fb49 100644 --- a/plugins/scaffolder-backend-module-github/package.json +++ b/plugins/scaffolder-backend-module-github/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-github", - "version": "0.3.0-next.3", + "version": "0.3.0", "description": "The github module for @backstage/plugin-scaffolder-backend", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/scaffolder-backend-module-gitlab/CHANGELOG.md b/plugins/scaffolder-backend-module-gitlab/CHANGELOG.md index f90872bbbb..eb1386679c 100644 --- a/plugins/scaffolder-backend-module-gitlab/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-gitlab/CHANGELOG.md @@ -1,5 +1,21 @@ # @backstage/plugin-scaffolder-backend-module-gitlab +## 0.4.1 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- cf96041: Added `gitlab:issue:edit` action to edit existing GitLab issues +- d44a20a: Added additional plugin metadata to `package.json`. +- 829e0ec: Add new `gitlab:pipeline:trigger` action to trigger GitLab pipelines. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.4.1-next.3 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-gitlab/package.json b/plugins/scaffolder-backend-module-gitlab/package.json index 71cb12c659..096cf9d077 100644 --- a/plugins/scaffolder-backend-module-gitlab/package.json +++ b/plugins/scaffolder-backend-module-gitlab/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-gitlab", - "version": "0.4.1-next.3", + "version": "0.4.1", "backstage": { "role": "backend-plugin-module", "pluginId": "scaffolder", diff --git a/plugins/scaffolder-backend-module-notifications/CHANGELOG.md b/plugins/scaffolder-backend-module-notifications/CHANGELOG.md index e8b308afb2..a1828b9546 100644 --- a/plugins/scaffolder-backend-module-notifications/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-notifications/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-scaffolder-backend-module-notifications +## 0.0.2 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-notifications-node@0.2.0 + - @backstage/plugin-notifications-common@0.0.4 + - @backstage/plugin-scaffolder-node@0.4.5 + ## 0.0.2-next.3 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-notifications/package.json b/plugins/scaffolder-backend-module-notifications/package.json index 57baab7b6f..8f9c150d1b 100644 --- a/plugins/scaffolder-backend-module-notifications/package.json +++ b/plugins/scaffolder-backend-module-notifications/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-notifications", - "version": "0.0.2-next.3", + "version": "0.0.2", "description": "The notifications backend module for the scaffolder plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/scaffolder-backend-module-rails/CHANGELOG.md b/plugins/scaffolder-backend-module-rails/CHANGELOG.md index 1771640389..5bf7ac953b 100644 --- a/plugins/scaffolder-backend-module-rails/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-rails/CHANGELOG.md @@ -1,5 +1,20 @@ # @backstage/plugin-scaffolder-backend-module-rails +## 0.4.36 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.4.36-next.3 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-rails/package.json b/plugins/scaffolder-backend-module-rails/package.json index e2d2d678a5..9da87efa1d 100644 --- a/plugins/scaffolder-backend-module-rails/package.json +++ b/plugins/scaffolder-backend-module-rails/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-rails", - "version": "0.4.36-next.3", + "version": "0.4.36", "description": "A module for the scaffolder backend that lets you template projects using Rails", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/scaffolder-backend-module-sentry/CHANGELOG.md b/plugins/scaffolder-backend-module-sentry/CHANGELOG.md index a02aaab7b6..922b8fd274 100644 --- a/plugins/scaffolder-backend-module-sentry/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-sentry/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-scaffolder-backend-module-sentry +## 0.1.27 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- 1354d81: Use `node-fetch` instead of native fetch, as per https://backstage.io/docs/architecture-decisions/adrs-adr013 +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.1.27-next.3 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-sentry/package.json b/plugins/scaffolder-backend-module-sentry/package.json index 2566c82596..efde9aa2fe 100644 --- a/plugins/scaffolder-backend-module-sentry/package.json +++ b/plugins/scaffolder-backend-module-sentry/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-sentry", - "version": "0.1.27-next.3", + "version": "0.1.27", "backstage": { "role": "backend-plugin-module", "pluginId": "scaffolder", diff --git a/plugins/scaffolder-backend-module-yeoman/CHANGELOG.md b/plugins/scaffolder-backend-module-yeoman/CHANGELOG.md index 80f976c1c0..7be229cdea 100644 --- a/plugins/scaffolder-backend-module-yeoman/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-yeoman/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-scaffolder-backend-module-yeoman +## 0.3.2 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-scaffolder-node-test-utils@0.1.5 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/types@1.1.1 + ## 0.3.2-next.2 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-yeoman/package.json b/plugins/scaffolder-backend-module-yeoman/package.json index 7172b4ae38..be380ac160 100644 --- a/plugins/scaffolder-backend-module-yeoman/package.json +++ b/plugins/scaffolder-backend-module-yeoman/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-yeoman", - "version": "0.3.2-next.2", + "version": "0.3.2", "backstage": { "role": "backend-plugin-module", "pluginId": "scaffolder", diff --git a/plugins/scaffolder-backend/CHANGELOG.md b/plugins/scaffolder-backend/CHANGELOG.md index b920fc7e9c..fa81406ba0 100644 --- a/plugins/scaffolder-backend/CHANGELOG.md +++ b/plugins/scaffolder-backend/CHANGELOG.md @@ -1,5 +1,47 @@ # @backstage/plugin-scaffolder-backend +## 1.22.9 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 5c65785: Fixing issues with log redaction in the scaffolder logs +- d44a20a: Added additional plugin metadata to `package.json`. +- 7d30d95: Fixing issue with log meta fields possibly being circular refs +- d617103: Updating the logger redaction message to something less dramatic +- f4c8486: Increase max wait time in debug:wait action to 10 minutes +- bcec60f: added the following new permissions to the scaffolder backend endpoints: + + - `scaffolder.task.create` + - `scaffolder.task.cancel` + - `scaffolder.task.read` + +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-scaffolder-backend-module-github@0.3.0 + - @backstage/integration@1.12.0 + - @backstage/plugin-catalog-backend-module-scaffolder-entity-model@0.1.17 + - @backstage/plugin-scaffolder-backend-module-bitbucket-server@0.1.9 + - @backstage/plugin-scaffolder-backend-module-bitbucket-cloud@0.1.9 + - @backstage/plugin-scaffolder-backend-module-bitbucket@0.2.9 + - @backstage/plugin-scaffolder-backend-module-gerrit@0.1.11 + - @backstage/plugin-scaffolder-backend-module-gitlab@0.4.1 + - @backstage/plugin-scaffolder-backend-module-azure@0.1.11 + - @backstage/plugin-scaffolder-backend-module-gitea@0.1.9 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-scaffolder-common@1.5.3 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 1.22.8-next.3 ### Patch Changes diff --git a/plugins/scaffolder-backend/package.json b/plugins/scaffolder-backend/package.json index 4060529421..0ca98ed300 100644 --- a/plugins/scaffolder-backend/package.json +++ b/plugins/scaffolder-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend", - "version": "1.22.8-next.3", + "version": "1.22.9", "description": "The Backstage backend plugin that helps you create new things", "backstage": { "role": "backend-plugin", diff --git a/plugins/scaffolder-common/CHANGELOG.md b/plugins/scaffolder-common/CHANGELOG.md index b26c36b793..12f3f9e235 100644 --- a/plugins/scaffolder-common/CHANGELOG.md +++ b/plugins/scaffolder-common/CHANGELOG.md @@ -1,5 +1,21 @@ # @backstage/plugin-scaffolder-common +## 1.5.3 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- bcec60f: added the following new permissions to the scaffolder backend endpoints: + + - `scaffolder.task.create` + - `scaffolder.task.cancel` + - `scaffolder.task.read` + +- Updated dependencies + - @backstage/plugin-permission-common@0.7.14 + - @backstage/catalog-model@1.5.0 + - @backstage/types@1.1.1 + ## 1.5.3-next.1 ### Patch Changes diff --git a/plugins/scaffolder-common/package.json b/plugins/scaffolder-common/package.json index 84aedbf963..3e56510daf 100644 --- a/plugins/scaffolder-common/package.json +++ b/plugins/scaffolder-common/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-common", - "version": "1.5.3-next.1", + "version": "1.5.3", "description": "Common functionalities for the scaffolder, to be shared between scaffolder and scaffolder-backend plugin", "backstage": { "role": "common-library", diff --git a/plugins/scaffolder-node-test-utils/CHANGELOG.md b/plugins/scaffolder-node-test-utils/CHANGELOG.md index ada4c38a67..ebdf3092b7 100644 --- a/plugins/scaffolder-node-test-utils/CHANGELOG.md +++ b/plugins/scaffolder-node-test-utils/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-scaffolder-node-test-utils +## 0.1.5 + +### Patch Changes + +- 6a576dc: Replace the usage of `getVoidLogger` with `mockServices.logger.mock` in order to remove the dependency with the soon-to-be-deprecated `backend-common` package. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-test-utils@0.4.0 + - @backstage/plugin-scaffolder-node@0.4.5 + - @backstage/types@1.1.1 + ## 0.1.5-next.3 ### Patch Changes diff --git a/plugins/scaffolder-node-test-utils/package.json b/plugins/scaffolder-node-test-utils/package.json index 2419074362..e15b33dad3 100644 --- a/plugins/scaffolder-node-test-utils/package.json +++ b/plugins/scaffolder-node-test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-node-test-utils", - "version": "0.1.5-next.3", + "version": "0.1.5", "backstage": { "role": "node-library", "pluginId": "scaffolder", diff --git a/plugins/scaffolder-node/CHANGELOG.md b/plugins/scaffolder-node/CHANGELOG.md index c4e974c297..f5da44ae1e 100644 --- a/plugins/scaffolder-node/CHANGELOG.md +++ b/plugins/scaffolder-node/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-scaffolder-node +## 0.4.5 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-scaffolder-common@1.5.3 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.4.5-next.3 ### Patch Changes diff --git a/plugins/scaffolder-node/package.json b/plugins/scaffolder-node/package.json index 233619ba99..ed3c016257 100644 --- a/plugins/scaffolder-node/package.json +++ b/plugins/scaffolder-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-node", - "version": "0.4.5-next.3", + "version": "0.4.5", "description": "The plugin-scaffolder-node module for @backstage/plugin-scaffolder-backend", "backstage": { "role": "node-library", diff --git a/plugins/scaffolder-react/CHANGELOG.md b/plugins/scaffolder-react/CHANGELOG.md index c33fbc059b..666fe36e24 100644 --- a/plugins/scaffolder-react/CHANGELOG.md +++ b/plugins/scaffolder-react/CHANGELOG.md @@ -1,5 +1,2912 @@ # @backstage/plugin-scaffolder-react +## 1.9.0 + +### Minor Changes + +- 62bd9eb: Replace `ui:widget: password` with the a warning message stating that it's not secure and to use the build in `SecretField`. + + You can do this by updating your `template.yaml` files that have the reference `ui:widget: password` to `ui:field: Secret` instead. + + ```diff + apiVersion: backstage.io/v1alpha1 + kind: Template + metadata: + ... + + spec: + parameters: + - title: collect some information + schema: + type: object + properties: + password: + title: Password + type: string + - ui:widget: password + + ui:field: Secret + steps: + - id: collect-info + name: Collect some information + action: acme:do:something + input: + - password: ${{ parameters.password }} + + password: ${{ secrets.password }} + ``` + +### Patch Changes + +- 86dc29d: Links that are rendered in the markdown in the `ScaffolderField` component are now opened in new tabs. +- d44a20a: Added additional plugin metadata to `package.json`. +- fa8560e: Prevents Autocomplete dropdown from overlapping sidebar on hovering it +- 6cb4886: Updated dependency `@rjsf/utils` to `5.18.4`. + Updated dependency `@rjsf/core` to `5.18.4`. + Updated dependency `@rjsf/material-ui` to `5.18.4`. + Updated dependency `@rjsf/validator-ajv8` to `5.18.4`. +- 75dcd7e: Fixing bug in `formData` type as it should be `optional` as it's possibly undefined +- 928cfa0: Fixed a typo ' + +## 1.8.7-next.3 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- fa8560e: Prevents Autocomplete dropdown from overlapping sidebar on hovering it +- Updated dependencies + - @backstage/core-components@0.14.8-next.2 + - @backstage/plugin-scaffolder-common@1.5.3-next.1 + - @backstage/plugin-permission-react@0.4.23-next.1 + - @backstage/plugin-catalog-react@1.12.1-next.2 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/core-plugin-api@1.9.3-next.0 + - @backstage/theme@0.5.6-next.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + +## 1.8.7-next.2 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.8-next.1 + - @backstage/core-plugin-api@1.9.3-next.0 + - @backstage/plugin-catalog-react@1.12.1-next.1 + - @backstage/plugin-permission-react@0.4.23-next.0 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/theme@0.5.6-next.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + - @backstage/plugin-scaffolder-common@1.5.3-next.0 + +## 1.8.7-next.1 + +### Patch Changes + +- 75dcd7e: Fixing bug in `formData` type as it should be `optional` as it's possibly undefined +- 928cfa0: Fixed a typo ' + +## 1.8.6-next.0 + +### Patch Changes + +- 86dc29d: Links that are rendered in the markdown in the `ScaffolderField` component are now opened in new tabs. +- Updated dependencies + - @backstage/theme@0.5.6-next.0 + - @backstage/core-components@0.14.8-next.0 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/core-plugin-api@1.9.2 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + - @backstage/plugin-catalog-react@1.12.1-next.0 + - @backstage/plugin-scaffolder-common@1.5.2 + +## 1.8.5 + +### Patch Changes + +- 9156654: Capturing more event clicks for scaffolder +- 0040ec2: Updated dependency `@rjsf/utils` to `5.18.2`. + Updated dependency `@rjsf/core` to `5.18.2`. + Updated dependency `@rjsf/material-ui` to `5.18.2`. + Updated dependency `@rjsf/validator-ajv8` to `5.18.2`. +- Updated dependencies + - @backstage/plugin-scaffolder-common@1.5.2 + - @backstage/core-components@0.14.7 + - @backstage/catalog-model@1.5.0 + - @backstage/plugin-catalog-react@1.12.0 + - @backstage/theme@0.5.4 + - @backstage/catalog-client@1.6.5 + +## 1.8.5-next.2 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-catalog-react@1.12.0-next.2 + - @backstage/core-components@0.14.7-next.2 + +## 1.8.5-next.1 + +### Patch Changes + +- 9156654: Capturing more event clicks for scaffolder +- Updated dependencies + - @backstage/plugin-scaffolder-common@1.5.2-next.1 + - @backstage/core-components@0.14.6-next.1 + - @backstage/plugin-catalog-react@1.11.4-next.1 + +## 1.8.5-next.0 + +### Patch Changes + +- 0040ec2: Updated dependency `@rjsf/utils` to `5.18.2`. + Updated dependency `@rjsf/core` to `5.18.2`. + Updated dependency `@rjsf/material-ui` to `5.18.2`. + Updated dependency `@rjsf/validator-ajv8` to `5.18.2`. +- Updated dependencies + - @backstage/catalog-model@1.5.0-next.0 + - @backstage/theme@0.5.4-next.0 + - @backstage/core-components@0.14.5-next.0 + - @backstage/catalog-client@1.6.5-next.0 + - @backstage/plugin-catalog-react@1.11.4-next.0 + - @backstage/plugin-scaffolder-common@1.5.2-next.0 + - @backstage/core-plugin-api@1.9.2 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + +## 1.8.4 + +### Patch Changes + +- abfbcfc: Updated dependency `@testing-library/react` to `^15.0.0`. +- 87d2eb8: Updated dependency `json-schema-library` to `^9.0.0`. +- cb1e3b0: Updated dependency `@testing-library/dom` to `^10.0.0`. +- 0e692cf: Added ESLint rule `no-top-level-material-ui-4-imports` to migrate the Material UI imports. +- df99f62: The `value` sent on the `create` analytics event (fired when a Scaffolder template is executed) is now set to the number of minutes saved by executing the template. This value is derived from the `backstage.io/time-saved` annotation on the template entity, if available. + + Note: the `create` event is now captured in the `` component. If you are directly making use of the alpha-exported `` component, an analytics `create` event will no longer be captured on your behalf. + +- Updated dependencies + - @backstage/plugin-catalog-react@1.11.3 + - @backstage/core-components@0.14.4 + - @backstage/core-plugin-api@1.9.2 + - @backstage/theme@0.5.3 + - @backstage/version-bridge@1.0.8 + - @backstage/catalog-client@1.6.4 + - @backstage/catalog-model@1.4.5 + - @backstage/types@1.1.1 + - @backstage/plugin-scaffolder-common@1.5.1 + +## 1.8.4-next.1 + +### Patch Changes + +- 87d2eb8: Updated dependency `json-schema-library` to `^9.0.0`. +- df99f62: The `value` sent on the `create` analytics event (fired when a Scaffolder template is executed) is now set to the number of minutes saved by executing the template. This value is derived from the `backstage.io/time-saved` annotation on the template entity, if available. + + Note: the `create` event is now captured in the `` component. If you are directly making use of the alpha-exported `` component, an analytics `create` event will no longer be captured on your behalf. + +- Updated dependencies + - @backstage/catalog-client@1.6.4-next.0 + - @backstage/catalog-model@1.4.5 + - @backstage/core-components@0.14.4-next.0 + - @backstage/core-plugin-api@1.9.1 + - @backstage/theme@0.5.2 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-catalog-react@1.11.3-next.1 + - @backstage/plugin-scaffolder-common@1.5.1 + +## 1.8.4-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.4-next.0 + - @backstage/catalog-client@1.6.3 + - @backstage/catalog-model@1.4.5 + - @backstage/core-plugin-api@1.9.1 + - @backstage/theme@0.5.2 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-catalog-react@1.11.3-next.0 + - @backstage/plugin-scaffolder-common@1.5.1 + +## 1.8.3 + +### Patch Changes + +- e8f026a: Use ESM exports of react-use library +- Updated dependencies + - @backstage/catalog-client@1.6.3 + - @backstage/core-components@0.14.3 + - @backstage/plugin-catalog-react@1.11.2 + - @backstage/core-plugin-api@1.9.1 + - @backstage/catalog-model@1.4.5 + - @backstage/theme@0.5.2 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.5.1 + +## 1.8.2 + +### Patch Changes + +- e8f026a: Use ESM exports of react-use library +- Updated dependencies + - @backstage/catalog-client@1.6.2 + - @backstage/core-components@0.14.2 + - @backstage/plugin-catalog-react@1.11.1 + - @backstage/core-plugin-api@1.9.1 + - @backstage/catalog-model@1.4.5 + - @backstage/theme@0.5.2 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.5.1 + +## 1.8.1 + +### Patch Changes + +- 930b5c1: Added 'root' and 'label' class key to TemplateCategoryPicker +- 6d649d2: Updated dependency `flatted` to `3.3.1`. +- 0cecb09: Updated dependency `@rjsf/utils` to `5.17.1`. + Updated dependency `@rjsf/core` to `5.17.1`. + Updated dependency `@rjsf/material-ui` to `5.17.1`. + Updated dependency `@rjsf/validator-ajv8` to `5.17.1`. +- Updated dependencies + - @backstage/core-components@0.14.1 + - @backstage/theme@0.5.2 + - @backstage/plugin-catalog-react@1.11.0 + - @backstage/catalog-client@1.6.1 + - @backstage/catalog-model@1.4.5 + - @backstage/core-plugin-api@1.9.1 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.5.1 + +## 1.8.1-next.2 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.1-next.2 + - @backstage/plugin-catalog-react@1.11.0-next.2 + - @backstage/catalog-client@1.6.1-next.1 + - @backstage/catalog-model@1.4.5-next.0 + - @backstage/core-plugin-api@1.9.1-next.1 + - @backstage/theme@0.5.2-next.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.5.1-next.1 + +## 1.8.1-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.1-next.1 + - @backstage/plugin-catalog-react@1.10.1-next.1 + - @backstage/core-plugin-api@1.9.1-next.1 + - @backstage/catalog-client@1.6.1-next.0 + - @backstage/catalog-model@1.4.5-next.0 + - @backstage/theme@0.5.2-next.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.5.1-next.1 + +## 1.8.1-next.0 + +### Patch Changes + +- 930b5c1: Added 'root' and 'label' class key to TemplateCategoryPicker +- 6d649d2: Updated dependency `flatted` to `3.3.1`. +- 0cecb09: Updated dependency `@rjsf/utils` to `5.17.1`. + Updated dependency `@rjsf/core` to `5.17.1`. + Updated dependency `@rjsf/material-ui` to `5.17.1`. + Updated dependency `@rjsf/validator-ajv8` to `5.17.1`. +- Updated dependencies + - @backstage/theme@0.5.2-next.0 + - @backstage/core-components@0.14.1-next.0 + - @backstage/plugin-catalog-react@1.10.1-next.0 + - @backstage/catalog-client@1.6.1-next.0 + - @backstage/catalog-model@1.4.5-next.0 + - @backstage/core-plugin-api@1.9.1-next.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.5.1-next.0 + +## 1.8.0 + +### Minor Changes + +- c56f1a2: Remove the old legacy exports from `/alpha` +- 11b9a08: Introduced the first version of recoverable tasks. +- b07ec70: Use more distinguishable icons for link (`Link`) and text output (`Description`). + +### Patch Changes + +- 3f60ad5: fix for: converting circular structure to JSON error +- 0b0c6b6: Allow defining default output text to be shown +- 8fe56a8: Widen `@types/react` dependency range to include version 18. +- 31f0a0a: Added `ScaffolderPageContextMenu` to `ActionsPage`, `ListTaskPage`, and `TemplateEditorPage` so that you can more easily navigate between these pages +- 09cedb9: Updated dependency `@react-hookz/web` to `^24.0.0`. +- e6f0831: Updated dependency `@rjsf/utils` to `5.17.0`. + Updated dependency `@rjsf/core` to `5.17.0`. + Updated dependency `@rjsf/material-ui` to `5.17.0`. + Updated dependency `@rjsf/validator-ajv8` to `5.17.0`. +- 6a74ffd: Updated dependency `@rjsf/utils` to `5.16.1`. + Updated dependency `@rjsf/core` to `5.16.1`. + Updated dependency `@rjsf/material-ui` to `5.16.1`. + Updated dependency `@rjsf/validator-ajv8` to `5.16.1`. +- 3dff4b0: Remove unused deps +- 82affc7: Fix issue where `ui:schema` was replaced with an empty object if `dependencies` is defined +- 2985186: Fix bug that erroneously caused a separator or a 0 to render in the TemplateCard for Templates with empty links +- Updated dependencies + - @backstage/plugin-catalog-react@1.10.0 + - @backstage/core-components@0.14.0 + - @backstage/catalog-model@1.4.4 + - @backstage/theme@0.5.1 + - @backstage/core-plugin-api@1.9.0 + - @backstage/catalog-client@1.6.0 + - @backstage/plugin-scaffolder-common@1.5.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + +## 1.8.0-next.3 + +### Patch Changes + +- 09cedb9: Updated dependency `@react-hookz/web` to `^24.0.0`. +- e6f0831: Updated dependency `@rjsf/utils` to `5.17.0`. + Updated dependency `@rjsf/core` to `5.17.0`. + Updated dependency `@rjsf/material-ui` to `5.17.0`. + Updated dependency `@rjsf/validator-ajv8` to `5.17.0`. +- Updated dependencies + - @backstage/theme@0.5.1-next.1 + - @backstage/core-components@0.14.0-next.2 + - @backstage/plugin-catalog-react@1.10.0-next.3 + - @backstage/catalog-client@1.6.0-next.1 + - @backstage/catalog-model@1.4.4-next.0 + - @backstage/core-plugin-api@1.9.0-next.1 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.5.0-next.1 + +## 1.8.0-next.2 + +### Patch Changes + +- 8fe56a8: Widen `@types/react` dependency range to include version 18. +- 2985186: Fix bug that erroneously caused a separator or a 0 to render in the TemplateCard for Templates with empty links +- Updated dependencies + - @backstage/core-components@0.14.0-next.1 + - @backstage/core-plugin-api@1.9.0-next.1 + - @backstage/plugin-catalog-react@1.10.0-next.2 + - @backstage/theme@0.5.1-next.0 + - @backstage/catalog-client@1.6.0-next.1 + - @backstage/catalog-model@1.4.4-next.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.5.0-next.1 + +## 1.8.0-next.1 + +### Minor Changes + +- b07ec70: Use more distinguishable icons for link (`Link`) and text output (`Description`). + +### Patch Changes + +- 3f60ad5: fix for: converting circular structure to JSON error +- 31f0a0a: Added `ScaffolderPageContextMenu` to `ActionsPage`, `ListTaskPage`, and `TemplateEditorPage` so that you can more easily navigate between these pages +- 82affc7: Fix issue where `ui:schema` was replaced with an empty object if `dependencies` is defined +- Updated dependencies + - @backstage/core-components@0.14.0-next.0 + - @backstage/catalog-model@1.4.4-next.0 + - @backstage/catalog-client@1.6.0-next.1 + - @backstage/core-plugin-api@1.8.3-next.0 + - @backstage/plugin-catalog-react@1.9.4-next.1 + - @backstage/theme@0.5.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.5.0-next.1 + +## 1.8.0-next.0 + +### Minor Changes + +- c56f1a2: Remove the old legacy exports from `/alpha` +- 11b9a08: Introduced the first version of recoverable tasks. + +### Patch Changes + +- 0b0c6b6: Allow defining default output text to be shown +- 6a74ffd: Updated dependency `@rjsf/utils` to `5.16.1`. + Updated dependency `@rjsf/core` to `5.16.1`. + Updated dependency `@rjsf/material-ui` to `5.16.1`. + Updated dependency `@rjsf/validator-ajv8` to `5.16.1`. +- Updated dependencies + - @backstage/plugin-catalog-react@1.9.4-next.0 + - @backstage/catalog-client@1.6.0-next.0 + - @backstage/plugin-scaffolder-common@1.5.0-next.0 + - @backstage/core-components@0.13.10 + - @backstage/catalog-model@1.4.3 + - @backstage/core-plugin-api@1.8.2 + - @backstage/theme@0.5.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + +## 1.7.1 + +### Patch Changes + +- c28f281: Scaffolder form now shows a list of errors at the top of the form. +- 0b9ce2b: Fix for a step with no properties +- 98ac5ab: Updated dependency `@rjsf/utils` to `5.15.1`. + Updated dependency `@rjsf/core` to `5.15.1`. + Updated dependency `@rjsf/material-ui` to `5.15.1`. + Updated dependency `@rjsf/validator-ajv8` to `5.15.1`. +- 4016f21: Remove some unused dependencies +- d16f85f: Show first scaffolder output text by default +- Updated dependencies + - @backstage/core-components@0.13.10 + - @backstage/plugin-scaffolder-common@1.4.5 + - @backstage/core-plugin-api@1.8.2 + - @backstage/catalog-client@1.5.2 + - @backstage/plugin-catalog-react@1.9.3 + - @backstage/catalog-model@1.4.3 + - @backstage/theme@0.5.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + +## 1.7.1-next.2 + +### Patch Changes + +- 98ac5ab: Updated dependency `@rjsf/utils` to `5.15.1`. + Updated dependency `@rjsf/core` to `5.15.1`. + Updated dependency `@rjsf/material-ui` to `5.15.1`. + Updated dependency `@rjsf/validator-ajv8` to `5.15.1`. +- Updated dependencies + - @backstage/plugin-catalog-react@1.9.3-next.2 + +## 1.7.1-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/core-plugin-api@1.8.2-next.0 + - @backstage/core-components@0.13.10-next.1 + - @backstage/plugin-catalog-react@1.9.3-next.1 + - @backstage/catalog-client@1.5.2-next.0 + - @backstage/catalog-model@1.4.3 + - @backstage/theme@0.5.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.4.4 + +## 1.7.1-next.0 + +### Patch Changes + +- c28f281: Scaffolder form now shows a list of errors at the top of the form. +- 4016f21: Remove some unused dependencies +- Updated dependencies + - @backstage/core-components@0.13.10-next.0 + - @backstage/catalog-client@1.5.2-next.0 + - @backstage/plugin-catalog-react@1.9.3-next.0 + - @backstage/catalog-model@1.4.3 + - @backstage/core-plugin-api@1.8.1 + - @backstage/theme@0.5.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.4.4 + +## 1.7.0 + +### Minor Changes + +- 33edf50: Added support for dealing with user provided secrets using a new field extension `ui:field: Secret` + +### Patch Changes + +- 670c7cc: Fix bug where `properties` is set to empty object when it should be empty for schema dependencies +- fa66d1b: Fixed bug in `ReviewState` where `enum` value was displayed in step review instead of the corresponding label when using `enumNames` +- e516bf4: Step titles in the Stepper are now clickable and redirect the user to the corresponding step, as an alternative to using the back buttons. +- aaa6fb3: Minor updates for TypeScript 5.2.2+ compatibility +- 2aee53b: Add horizontal slider if stepper overflows +- 2b72591: Updated dependency `@rjsf/utils` to `5.14.3`. + Updated dependency `@rjsf/core` to `5.14.3`. + Updated dependency `@rjsf/material-ui` to `5.14.3`. + Updated dependency `@rjsf/validator-ajv8` to `5.14.3`. +- 6cd12f2: Updated dependency `@rjsf/utils` to `5.14.1`. + Updated dependency `@rjsf/core` to `5.14.1`. + Updated dependency `@rjsf/material-ui` to `5.14.1`. + Updated dependency `@rjsf/validator-ajv8` to `5.14.1`. +- a518c5a: Updated dependency `@react-hookz/web` to `^23.0.0`. +- 64301d3: Updated dependency `@rjsf/utils` to `5.15.0`. + Updated dependency `@rjsf/core` to `5.15.0`. + Updated dependency `@rjsf/material-ui` to `5.15.0`. + Updated dependency `@rjsf/validator-ajv8` to `5.15.0`. +- 63c494e: Updated dependency `@rjsf/utils` to `5.14.2`. + Updated dependency `@rjsf/core` to `5.14.2`. + Updated dependency `@rjsf/material-ui` to `5.14.2`. + Updated dependency `@rjsf/validator-ajv8` to `5.14.2`. +- c8908d4: Use new option from RJSF 5.15 +- 0cbb03b: Fixing regular expression ReDoS with zod packages. Upgrading to latest. ref: https://security.snyk.io/vuln/SNYK-JS-ZOD-5925617 +- 5bb5240: Fixed issue for showing undefined for hidden form items +- Updated dependencies + - @backstage/core-plugin-api@1.8.1 + - @backstage/plugin-catalog-react@1.9.2 + - @backstage/core-components@0.13.9 + - @backstage/theme@0.5.0 + - @backstage/catalog-client@1.5.0 + - @backstage/catalog-model@1.4.3 + - @backstage/errors@1.2.3 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.4.4 + +## 1.6.2-next.3 + +### Patch Changes + +- 64301d3: Updated dependency `@rjsf/utils` to `5.15.0`. + Updated dependency `@rjsf/core` to `5.15.0`. + Updated dependency `@rjsf/material-ui` to `5.15.0`. + Updated dependency `@rjsf/validator-ajv8` to `5.15.0`. +- c8908d4: Use new option from RJSF 5.15 +- Updated dependencies + - @backstage/core-components@0.13.9-next.3 + - @backstage/catalog-client@1.5.0-next.1 + - @backstage/catalog-model@1.4.3 + - @backstage/core-plugin-api@1.8.1-next.1 + - @backstage/errors@1.2.3 + - @backstage/theme@0.5.0-next.1 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-catalog-react@1.9.2-next.3 + - @backstage/plugin-scaffolder-common@1.4.3 + +## 1.6.2-next.2 + +### Patch Changes + +- 5bb5240: Fixed issue for showing undefined for hidden form items +- Updated dependencies + - @backstage/theme@0.5.0-next.1 + - @backstage/plugin-catalog-react@1.9.2-next.2 + - @backstage/catalog-client@1.5.0-next.1 + - @backstage/catalog-model@1.4.3 + - @backstage/core-components@0.13.9-next.2 + - @backstage/core-plugin-api@1.8.1-next.1 + - @backstage/errors@1.2.3 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.4.3 + +## 1.6.2-next.1 + +### Patch Changes + +- fa66d1b5b3: Fixed bug in `ReviewState` where `enum` value was displayed in step review instead of the corresponding label when using `enumNames` +- 2aee53bbeb: Add horizontal slider if stepper overflows +- 2b725913c1: Updated dependency `@rjsf/utils` to `5.14.3`. + Updated dependency `@rjsf/core` to `5.14.3`. + Updated dependency `@rjsf/material-ui` to `5.14.3`. + Updated dependency `@rjsf/validator-ajv8` to `5.14.3`. +- a518c5a25b: Updated dependency `@react-hookz/web` to `^23.0.0`. +- Updated dependencies + - @backstage/core-components@0.13.9-next.1 + - @backstage/core-plugin-api@1.8.1-next.1 + - @backstage/plugin-catalog-react@1.9.2-next.1 + - @backstage/catalog-client@1.5.0-next.0 + - @backstage/catalog-model@1.4.3 + - @backstage/errors@1.2.3 + - @backstage/theme@0.5.0-next.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.4.3 + +## 1.6.2-next.0 + +### Patch Changes + +- e516bf4da8: Step titles in the Stepper are now clickable and redirect the user to the corresponding step, as an alternative to using the back buttons. +- aaa6fb3bc9: Minor updates for TypeScript 5.2.2+ compatibility +- 6cd12f277b: Updated dependency `@rjsf/utils` to `5.14.1`. + Updated dependency `@rjsf/core` to `5.14.1`. + Updated dependency `@rjsf/material-ui` to `5.14.1`. + Updated dependency `@rjsf/validator-ajv8` to `5.14.1`. +- 63c494ef22: Updated dependency `@rjsf/utils` to `5.14.2`. + Updated dependency `@rjsf/core` to `5.14.2`. + Updated dependency `@rjsf/material-ui` to `5.14.2`. + Updated dependency `@rjsf/validator-ajv8` to `5.14.2`. +- Updated dependencies + - @backstage/core-plugin-api@1.8.1-next.0 + - @backstage/plugin-catalog-react@1.9.2-next.0 + - @backstage/core-components@0.13.9-next.0 + - @backstage/theme@0.5.0-next.0 + - @backstage/catalog-client@1.4.6 + - @backstage/catalog-model@1.4.3 + - @backstage/errors@1.2.3 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.4.3 + +## 1.6.0 + +### Minor Changes + +- 3fdffbb699: Release design improvements for the `Scaffolder` plugin and support v5 of `@rjsf/*` libraries. + + This change should be non-breaking. If you're seeing typescript issues after migrating please [open an issue](https://github.com/backstage/backstage/issues/new/choose) + + The `next` versions like `createNextFieldExtension` and `NextScaffolderPage` have been promoted to the public interface under `createScaffolderFieldExtension` and `ScaffolderPage`, so any older imports which are no longer found will need updating from `@backstage/plugin-scaffolder/alpha` or `@backstage/plugin-scaffolder-react/alpha` will need to be imported from `@backstage/plugin-scaffolder` and `@backstage/plugin-scaffolder-react` respectively. + + The legacy versions are now available in `/alpha` under `createLegacyFieldExtension` and `LegacyScaffolderPage` if you're running into issues, but be aware that these will be removed in a next mainline release. + +### Patch Changes + +- 6c2b872153: Add official support for React 18. +- 171a99816b: Fixed `backstage:featureFlag` in `scaffolder/next` by sorting out `manifest.steps`. +- c838da0edd: Updated dependency `@rjsf/utils` to `5.13.6`. + Updated dependency `@rjsf/core` to `5.13.6`. + Updated dependency `@rjsf/material-ui` to `5.13.6`. + Updated dependency `@rjsf/validator-ajv8` to `5.13.6`. +- 69c14904b6: Use `EntityRefLinks` with `hideIcons` property to avoid double icons +- 62b5922916: Internal theme type updates +- dda56ae265: Preserve step's time execution for a non-running task. +- 76d07da66a: Make it possible to define control buttons text (Back, Create, Review) per template +- Updated dependencies + - @backstage/plugin-catalog-react@1.9.0 + - @backstage/core-components@0.13.8 + - @backstage/plugin-scaffolder-common@1.4.3 + - @backstage/core-plugin-api@1.8.0 + - @backstage/version-bridge@1.0.7 + - @backstage/theme@0.4.4 + - @backstage/catalog-client@1.4.6 + - @backstage/catalog-model@1.4.3 + - @backstage/errors@1.2.3 + - @backstage/types@1.1.1 + +## 1.6.0-next.2 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.13.8-next.2 + - @backstage/plugin-catalog-react@1.9.0-next.2 + +## 1.6.0-next.1 + +### Patch Changes + +- 62b5922916: Internal theme type updates +- 76d07da66a: Make it possible to define control buttons text (Back, Create, Review) per template +- Updated dependencies + - @backstage/plugin-catalog-react@1.9.0-next.1 + - @backstage/plugin-scaffolder-common@1.4.3-next.1 + - @backstage/core-components@0.13.8-next.1 + - @backstage/catalog-client@1.4.5 + - @backstage/catalog-model@1.4.3 + - @backstage/core-plugin-api@1.8.0-next.0 + - @backstage/errors@1.2.3 + - @backstage/theme@0.4.4-next.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7-next.0 + +## 1.6.0-next.0 + +### Minor Changes + +- 3fdffbb699: Release design improvements for the `Scaffolder` plugin and support v5 of `@rjsf/*` libraries. + + This change should be non-breaking. If you're seeing typescript issues after migrating please [open an issue](https://github.com/backstage/backstage/issues/new/choose) + + The `next` versions like `createNextFieldExtension` and `NextScaffolderPage` have been promoted to the public interface under `createScaffolderFieldExtension` and `ScaffolderPage`, so any older imports which are no longer found will need updating from `@backstage/plugin-scaffolder/alpha` or `@backstage/plugin-scaffolder-react/alpha` will need to be imported from `@backstage/plugin-scaffolder` and `@backstage/plugin-scaffolder-react` respectively. + + The legacy versions are now available in `/alpha` under `createLegacyFieldExtension` and `LegacyScaffolderPage` if you're running into issues, but be aware that these will be removed in a next mainline release. + +### Patch Changes + +- 6c2b872153: Add official support for React 18. +- Updated dependencies + - @backstage/core-components@0.13.7-next.0 + - @backstage/plugin-scaffolder-common@1.4.3-next.0 + - @backstage/plugin-catalog-react@1.9.0-next.0 + - @backstage/core-plugin-api@1.8.0-next.0 + - @backstage/version-bridge@1.0.7-next.0 + - @backstage/theme@0.4.4-next.0 + - @backstage/catalog-client@1.4.5 + - @backstage/catalog-model@1.4.3 + - @backstage/errors@1.2.3 + - @backstage/types@1.1.1 + +## 1.5.6 + +### Patch Changes + +- 9a1fce352e: Updated dependency `@testing-library/jest-dom` to `^6.0.0`. +- f95af4e540: Updated dependency `@testing-library/dom` to `^9.0.0`. +- Updated dependencies + - @backstage/plugin-catalog-react@1.8.5 + - @backstage/core-plugin-api@1.7.0 + - @backstage/core-components@0.13.6 + - @backstage/catalog-model@1.4.3 + - @backstage/errors@1.2.3 + - @backstage/version-bridge@1.0.6 + - @backstage/theme@0.4.3 + - @backstage/catalog-client@1.4.5 + - @backstage/types@1.1.1 + - @backstage/plugin-scaffolder-common@1.4.2 + +## 1.5.6-next.2 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.13.6-next.2 + - @backstage/core-plugin-api@1.7.0-next.1 + - @backstage/catalog-model@1.4.3-next.0 + - @backstage/plugin-catalog-react@1.8.5-next.2 + - @backstage/errors@1.2.3-next.0 + - @backstage/theme@0.4.3-next.0 + - @backstage/catalog-client@1.4.5-next.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.5 + - @backstage/plugin-scaffolder-common@1.4.2-next.0 + +## 1.5.6-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.13.6-next.1 + - @backstage/plugin-catalog-react@1.8.5-next.1 + - @backstage/core-plugin-api@1.7.0-next.0 + - @backstage/catalog-client@1.4.4 + - @backstage/catalog-model@1.4.2 + - @backstage/errors@1.2.2 + - @backstage/theme@0.4.2 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.5 + - @backstage/plugin-scaffolder-common@1.4.1 + +## 1.5.6-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-catalog-react@1.8.5-next.0 + - @backstage/core-plugin-api@1.7.0-next.0 + - @backstage/core-components@0.13.6-next.0 + - @backstage/catalog-client@1.4.4 + - @backstage/catalog-model@1.4.2 + - @backstage/errors@1.2.2 + - @backstage/theme@0.4.2 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.5 + - @backstage/plugin-scaffolder-common@1.4.1 + +## 1.5.5 + +### Patch Changes + +- 406b786a2a2c: Mark package as being free of side effects, allowing more optimized Webpack builds. +- b16c341ced45: Updated dependency `@rjsf/utils` to `5.13.0`. + Updated dependency `@rjsf/core-v5` to `npm:@rjsf/core@5.13.0`. + Updated dependency `@rjsf/material-ui-v5` to `npm:@rjsf/material-ui@5.13.0`. + Updated dependency `@rjsf/validator-ajv8` to `5.13.0`. +- 27fef07f9229: Updated dependency `use-immer` to `^0.9.0`. +- Updated dependencies + - @backstage/plugin-catalog-react@1.8.4 + - @backstage/core-components@0.13.5 + - @backstage/catalog-client@1.4.4 + - @backstage/catalog-model@1.4.2 + - @backstage/core-plugin-api@1.6.0 + - @backstage/errors@1.2.2 + - @backstage/plugin-scaffolder-common@1.4.1 + - @backstage/theme@0.4.2 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.5 + +## 1.5.5-next.3 + +### Patch Changes + +- 406b786a2a2c: Mark package as being free of side effects, allowing more optimized Webpack builds. +- b16c341ced45: Updated dependency `@rjsf/utils` to `5.13.0`. + Updated dependency `@rjsf/core-v5` to `npm:@rjsf/core@5.13.0`. + Updated dependency `@rjsf/material-ui-v5` to `npm:@rjsf/material-ui@5.13.0`. + Updated dependency `@rjsf/validator-ajv8` to `5.13.0`. +- Updated dependencies + - @backstage/catalog-client@1.4.4-next.2 + - @backstage/catalog-model@1.4.2-next.2 + - @backstage/core-components@0.13.5-next.3 + - @backstage/core-plugin-api@1.6.0-next.3 + - @backstage/errors@1.2.2-next.0 + - @backstage/plugin-catalog-react@1.8.4-next.3 + - @backstage/plugin-scaffolder-common@1.4.1-next.2 + - @backstage/theme@0.4.2-next.0 + - @backstage/types@1.1.1-next.0 + - @backstage/version-bridge@1.0.5-next.0 + +## 1.5.5-next.2 + +### Patch Changes + +- 27fef07f9229: Updated dependency `use-immer` to `^0.9.0`. +- Updated dependencies + - @backstage/core-components@0.13.5-next.2 + - @backstage/core-plugin-api@1.6.0-next.2 + - @backstage/plugin-catalog-react@1.8.4-next.2 + - @backstage/catalog-model@1.4.2-next.1 + - @backstage/catalog-client@1.4.4-next.1 + - @backstage/errors@1.2.1 + - @backstage/theme@0.4.1 + - @backstage/types@1.1.0 + - @backstage/version-bridge@1.0.4 + - @backstage/plugin-scaffolder-common@1.4.1-next.1 + +## 1.5.5-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-catalog-react@1.8.4-next.1 + - @backstage/core-components@0.13.5-next.1 + - @backstage/catalog-model@1.4.2-next.0 + - @backstage/core-plugin-api@1.6.0-next.1 + - @backstage/catalog-client@1.4.4-next.0 + - @backstage/plugin-scaffolder-common@1.4.1-next.0 + - @backstage/errors@1.2.1 + - @backstage/theme@0.4.1 + - @backstage/types@1.1.0 + - @backstage/version-bridge@1.0.4 + +## 1.5.4-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-plugin-api@1.6.0-next.0 + - @backstage/core-components@0.13.5-next.0 + - @backstage/catalog-client@1.4.3 + - @backstage/catalog-model@1.4.1 + - @backstage/errors@1.2.1 + - @backstage/theme@0.4.1 + - @backstage/types@1.1.0 + - @backstage/version-bridge@1.0.4 + - @backstage/plugin-catalog-react@1.8.3-next.0 + - @backstage/plugin-scaffolder-common@1.4.0 + +## 1.5.2 + +### Patch Changes + +- ba9ee98a37bd: Fixed bug in Workflow component by passing a prop `templateName` down to Stepper component. +- Updated dependencies + - @backstage/core-components@0.13.4 + - @backstage/plugin-catalog-react@1.8.1 + - @backstage/plugin-scaffolder-common@1.4.0 + - @backstage/core-plugin-api@1.5.3 + - @backstage/catalog-client@1.4.3 + - @backstage/catalog-model@1.4.1 + - @backstage/errors@1.2.1 + - @backstage/theme@0.4.1 + - @backstage/types@1.1.0 + - @backstage/version-bridge@1.0.4 + +## 1.5.2-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-catalog-react@1.8.1-next.1 + +## 1.5.2-next.0 + +### Patch Changes + +- ba9ee98a37bd: Fixed bug in Workflow component by passing a prop `templateName` down to Stepper component. +- Updated dependencies + - @backstage/core-components@0.13.4-next.0 + - @backstage/core-plugin-api@1.5.3 + - @backstage/plugin-catalog-react@1.8.1-next.0 + - @backstage/catalog-client@1.4.3 + - @backstage/catalog-model@1.4.1 + - @backstage/errors@1.2.1 + - @backstage/theme@0.4.1 + - @backstage/types@1.1.0 + - @backstage/version-bridge@1.0.4 + - @backstage/plugin-scaffolder-common@1.3.2 + +## 1.5.1 + +### Patch Changes + +- f74a27de4d2c: Made markdown description theme-able +- Updated dependencies + - @backstage/theme@0.4.1 + - @backstage/errors@1.2.1 + - @backstage/plugin-catalog-react@1.8.0 + - @backstage/core-components@0.13.3 + - @backstage/core-plugin-api@1.5.3 + - @backstage/catalog-client@1.4.3 + - @backstage/catalog-model@1.4.1 + - @backstage/types@1.1.0 + - @backstage/version-bridge@1.0.4 + - @backstage/plugin-scaffolder-common@1.3.2 + +## 1.5.1-next.2 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-catalog-react@1.8.0-next.2 + - @backstage/theme@0.4.1-next.1 + - @backstage/core-plugin-api@1.5.3-next.1 + - @backstage/core-components@0.13.3-next.2 + - @backstage/catalog-client@1.4.3-next.0 + - @backstage/catalog-model@1.4.1-next.0 + - @backstage/errors@1.2.1-next.0 + - @backstage/types@1.1.0 + - @backstage/version-bridge@1.0.4 + - @backstage/plugin-scaffolder-common@1.3.2-next.0 + +## 1.5.1-next.1 + +### Patch Changes + +- f74a27de4d2c: Made markdown description theme-able +- Updated dependencies + - @backstage/theme@0.4.1-next.0 + - @backstage/core-components@0.13.3-next.1 + - @backstage/core-plugin-api@1.5.3-next.0 + - @backstage/plugin-catalog-react@1.7.1-next.1 + +## 1.5.1-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/errors@1.2.1-next.0 + - @backstage/core-components@0.13.3-next.0 + - @backstage/catalog-client@1.4.3-next.0 + - @backstage/catalog-model@1.4.1-next.0 + - @backstage/core-plugin-api@1.5.2 + - @backstage/theme@0.4.0 + - @backstage/types@1.1.0 + - @backstage/version-bridge@1.0.4 + - @backstage/plugin-catalog-react@1.7.1-next.0 + - @backstage/plugin-scaffolder-common@1.3.2-next.0 + +## 1.5.0 + +### Minor Changes + +- 6b571405f806: `scaffolder/next`: Provide some default template components to `rjsf` to allow for standardization and markdown descriptions +- 4505dc3b4598: `scaffolder/next`: Don't render `TemplateGroups` when there's no results in with search query +- a452bda74d7a: Fixed typescript casting bug for useTemplateParameterSchema hook +- 6b571405f806: `scaffolder/next`: provide a `ScaffolderField` component which is meant to replace some of the `FormControl` components from Material UI, making it easier to write `FieldExtensions`. + +### Patch Changes + +- 84a5c7724c7e: fixed refresh problem when backstage backend disconnects without any feedback to user. Now we send a generic message and try to reconnect after 15 seconds +- cf34311cdbe1: Extract `ui:*` fields from conditional `then` and `else` schema branches. +- 2ff94da135a4: bump `rjsf` dependencies to 5.7.3 +- 74b216ee4e50: Add `PropsWithChildren` to usages of `ComponentType`, in preparation for React 18 where the children are no longer implicit. +- Updated dependencies + - @backstage/core-plugin-api@1.5.2 + - @backstage/catalog-client@1.4.2 + - @backstage/core-components@0.13.2 + - @backstage/types@1.1.0 + - @backstage/theme@0.4.0 + - @backstage/plugin-catalog-react@1.7.0 + - @backstage/catalog-model@1.4.0 + - @backstage/errors@1.2.0 + - @backstage/version-bridge@1.0.4 + - @backstage/plugin-scaffolder-common@1.3.1 + +## 1.5.0-next.3 + +### Minor Changes + +- a452bda74d7a: Fixed typescript casting bug for useTemplateParameterSchema hook + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.13.2-next.3 + - @backstage/catalog-model@1.4.0-next.1 + - @backstage/catalog-client@1.4.2-next.2 + - @backstage/core-plugin-api@1.5.2-next.0 + - @backstage/errors@1.2.0-next.0 + - @backstage/theme@0.4.0-next.1 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.4 + - @backstage/plugin-catalog-react@1.7.0-next.3 + - @backstage/plugin-scaffolder-common@1.3.1-next.1 + +## 1.5.0-next.2 + +### Patch Changes + +- cf34311cdbe1: Extract `ui:*` fields from conditional `then` and `else` schema branches. +- 2ff94da135a4: bump `rjsf` dependencies to 5.7.3 +- Updated dependencies + - @backstage/theme@0.4.0-next.1 + - @backstage/plugin-catalog-react@1.7.0-next.2 + - @backstage/core-components@0.13.2-next.2 + - @backstage/core-plugin-api@1.5.2-next.0 + +## 1.5.0-next.1 + +### Minor Changes + +- 6b571405f806: `scaffolder/next`: Provide some default template components to `rjsf` to allow for standardization and markdown descriptions +- 4505dc3b4598: `scaffolder/next`: Don't render `TemplateGroups` when there's no results in with search query +- 6b571405f806: `scaffolder/next`: provide a `ScaffolderField` component which is meant to replace some of the `FormControl` components from Material UI, making it easier to write `FieldExtensions`. + +### Patch Changes + +- 74b216ee4e50: Add `PropsWithChildren` to usages of `ComponentType`, in preparation for React 18 where the children are no longer implicit. +- Updated dependencies + - @backstage/errors@1.2.0-next.0 + - @backstage/core-components@0.13.2-next.1 + - @backstage/plugin-catalog-react@1.7.0-next.1 + - @backstage/catalog-model@1.4.0-next.0 + - @backstage/core-plugin-api@1.5.2-next.0 + - @backstage/catalog-client@1.4.2-next.1 + - @backstage/plugin-scaffolder-common@1.3.1-next.0 + - @backstage/theme@0.4.0-next.0 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.4 + +## 1.4.1-next.0 + +### Patch Changes + +- 84a5c7724c7e: fixed refresh problem when backstage backend disconnects without any feedback to user. Now we send a generic message and try to reconnect after 15 seconds +- Updated dependencies + - @backstage/catalog-client@1.4.2-next.0 + - @backstage/plugin-catalog-react@1.7.0-next.0 + - @backstage/theme@0.4.0-next.0 + - @backstage/core-components@0.13.2-next.0 + - @backstage/core-plugin-api@1.5.1 + - @backstage/catalog-model@1.3.0 + - @backstage/errors@1.1.5 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.4 + - @backstage/plugin-scaffolder-common@1.3.0 + +## 1.4.0 + +### Minor Changes + +- 82e10a6939c: Add support for Markdown text blob outputs from templates + +### Patch Changes + +- ad1a1429de4: Improvements to the `scaffolder/next` buttons UX: + + - Added padding around the "Create" button in the `Stepper` component + - Added a button bar that includes the "Cancel" and "Start Over" buttons to the `OngoingTask` component. The state of these buttons match their existing counter parts in the Context Menu + - Added a "Show Button Bar"/"Hide Button Bar" item to the `ContextMenu` component + +- Updated dependencies + - @backstage/theme@0.3.0 + - @backstage/plugin-catalog-react@1.6.0 + - @backstage/plugin-scaffolder-common@1.3.0 + - @backstage/core-components@0.13.1 + - @backstage/catalog-client@1.4.1 + - @backstage/catalog-model@1.3.0 + - @backstage/core-plugin-api@1.5.1 + - @backstage/errors@1.1.5 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.4 + +## 1.4.0-next.2 + +### Minor Changes + +- 82e10a6939c: Add support for Markdown text blob outputs from templates + +### Patch Changes + +- Updated dependencies + - @backstage/theme@0.3.0-next.0 + - @backstage/plugin-scaffolder-common@1.3.0-next.0 + - @backstage/core-components@0.13.1-next.1 + - @backstage/plugin-catalog-react@1.6.0-next.2 + - @backstage/core-plugin-api@1.5.1 + +## 1.3.1-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.13.1-next.0 + - @backstage/core-plugin-api@1.5.1 + - @backstage/plugin-catalog-react@1.6.0-next.1 + +## 1.3.1-next.0 + +### Patch Changes + +- ad1a1429de4: Improvements to the `scaffolder/next` buttons UX: + + - Added padding around the "Create" button in the `Stepper` component + - Added a button bar that includes the "Cancel" and "Start Over" buttons to the `OngoingTask` component. The state of these buttons match their existing counter parts in the Context Menu + - Added a "Show Button Bar"/"Hide Button Bar" item to the `ContextMenu` component + +- Updated dependencies + - @backstage/plugin-catalog-react@1.6.0-next.0 + - @backstage/core-components@0.13.0 + - @backstage/core-plugin-api@1.5.1 + - @backstage/catalog-client@1.4.1 + - @backstage/catalog-model@1.3.0 + - @backstage/errors@1.1.5 + - @backstage/theme@0.2.19 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.4 + - @backstage/plugin-scaffolder-common@1.2.7 + +## 1.3.0 + +### Minor Changes + +- 259d3407b9b: Move `CategoryPicker` from `scaffolder` into `scaffolder-react` + Move `ContextMenu` into `scaffolder-react` and rename it to `ScaffolderPageContextMenu` +- 2cfd03d7376: To offer better customization options, `ScaffolderPageContextMenu` takes callbacks as props instead of booleans +- 48da4c46e45: `scaffolder/next`: Export the `TemplateGroupFilter` and `TemplateGroups` and make an extensible component + +### Patch Changes + +- 7e1d900413a: `scaffolder/next`: Bump `@rjsf/*` dependencies to 5.5.2 +- e27ddc36dad: Added a possibility to cancel the running task (executing of a scaffolder template) +- 0435174b06f: Accessibility issues identified using lighthouse fixed. +- 7a6b16cc506: `scaffolder/next`: Bump `@rjsf/*` deps to 5.3.1 +- 90dda42cfd2: bug: Invert `templateFilter` predicate to align with `Array.filter` +- d2488f5e54c: Add an indication that the validators are running when clicking `next` on each step of the form. +- 1e4f5e91b8e: Bump `zod` and `zod-to-json-schema` dependencies. +- 8c40997df44: Updated dependency `@rjsf/core-v5` to `npm:@rjsf/core@5.5.2`. +- f84fc7fd040: Updated dependency `@rjsf/validator-ajv8` to `5.3.0`. +- 8e00acb28db: Small tweaks to remove warnings in the console during development (mainly focusing on techdocs) +- 34dab7ee7f8: `scaffolder/next`: bump `rjsf` dependencies to `5.5.0` +- 2898b6c8d52: Minor type tweaks for TypeScript 5.0 +- e0c6e8b9c3c: Update peer dependencies +- cf71c3744a5: scaffolder/next: Bump `@rjsf/*` dependencies to 5.6.0 +- Updated dependencies + - @backstage/core-components@0.13.0 + - @backstage/plugin-scaffolder-common@1.2.7 + - @backstage/catalog-client@1.4.1 + - @backstage/plugin-catalog-react@1.5.0 + - @backstage/theme@0.2.19 + - @backstage/core-plugin-api@1.5.1 + - @backstage/catalog-model@1.3.0 + - @backstage/version-bridge@1.0.4 + - @backstage/errors@1.1.5 + - @backstage/types@1.0.2 + +## 1.3.0-next.3 + +### Patch Changes + +- d2488f5e54c: Add indication that the validators are running +- 8c40997df44: Updated dependency `@rjsf/core-v5` to `npm:@rjsf/core@5.5.2`. +- Updated dependencies + - @backstage/plugin-catalog-react@1.5.0-next.3 + - @backstage/catalog-model@1.3.0-next.0 + - @backstage/core-components@0.13.0-next.3 + - @backstage/catalog-client@1.4.1-next.1 + - @backstage/core-plugin-api@1.5.1-next.1 + - @backstage/errors@1.1.5 + - @backstage/theme@0.2.19-next.0 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.4-next.0 + - @backstage/plugin-scaffolder-common@1.2.7-next.2 + +## 1.3.0-next.2 + +### Patch Changes + +- 90dda42cfd2: bug: Invert `templateFilter` predicate to align with `Array.filter` +- 34dab7ee7f8: `scaffolder/next`: bump `rjsf` dependencies to `5.5.0` +- 2898b6c8d52: Minor type tweaks for TypeScript 5.0 +- Updated dependencies + - @backstage/catalog-client@1.4.1-next.0 + - @backstage/core-components@0.12.6-next.2 + - @backstage/plugin-catalog-react@1.4.1-next.2 + - @backstage/core-plugin-api@1.5.1-next.1 + - @backstage/catalog-model@1.2.1 + - @backstage/errors@1.1.5 + - @backstage/theme@0.2.19-next.0 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.4-next.0 + - @backstage/plugin-scaffolder-common@1.2.7-next.1 + +## 1.3.0-next.1 + +### Patch Changes + +- 1e4f5e91b8e: Bump `zod` and `zod-to-json-schema` dependencies. +- e0c6e8b9c3c: Update peer dependencies +- Updated dependencies + - @backstage/core-components@0.12.6-next.1 + - @backstage/plugin-scaffolder-common@1.2.7-next.1 + - @backstage/core-plugin-api@1.5.1-next.0 + - @backstage/version-bridge@1.0.4-next.0 + - @backstage/plugin-catalog-react@1.4.1-next.1 + - @backstage/theme@0.2.19-next.0 + - @backstage/catalog-client@1.4.0 + - @backstage/catalog-model@1.2.1 + - @backstage/errors@1.1.5 + - @backstage/types@1.0.2 + +## 1.3.0-next.0 + +### Minor Changes + +- 259d3407b9b: Move `CategoryPicker` from `scaffolder` into `scaffolder-react` + Move `ContextMenu` into `scaffolder-react` and rename it to `ScaffolderPageContextMenu` +- 2cfd03d7376: To offer better customization options, `ScaffolderPageContextMenu` takes callbacks as props instead of booleans +- 48da4c46e45: `scaffolder/next`: Export the `TemplateGroupFilter` and `TemplateGroups` and make an extensible component + +### Patch Changes + +- e27ddc36dad: Added a possibility to cancel the running task (executing of a scaffolder template) +- 7a6b16cc506: `scaffolder/next`: Bump `@rjsf/*` deps to 5.3.1 +- f84fc7fd040: Updated dependency `@rjsf/validator-ajv8` to `5.3.0`. +- 8e00acb28db: Small tweaks to remove warnings in the console during development (mainly focusing on techdocs) +- Updated dependencies + - @backstage/plugin-scaffolder-common@1.2.7-next.0 + - @backstage/core-components@0.12.6-next.0 + - @backstage/plugin-catalog-react@1.4.1-next.0 + - @backstage/core-plugin-api@1.5.0 + - @backstage/catalog-client@1.4.0 + - @backstage/catalog-model@1.2.1 + - @backstage/errors@1.1.5 + - @backstage/theme@0.2.18 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.3 + +## 1.2.0 + +### Minor Changes + +- 8f4d13f21cf: Move `useTaskStream`, `TaskBorder`, `TaskLogStream` and `TaskSteps` into `scaffolder-react`. + +### Patch Changes + +- 65454876fb2: Minor API report tweaks +- 3c96e77b513: Make scaffolder adhere to page themes by using page `fontColor` consistently. If your theme overwrites template list or card headers, review those styles. +- c8d78b9ae9d: fix bug with `hasErrors` returning false when dealing with empty objects +- 9b8c374ace5: Remove timer for skipped steps in Scaffolder Next's TaskSteps +- 44941fc97eb: scaffolder/next: Move the `uiSchema` to its own property in the validation `context` to align with component development and access of `ui:options` +- d9893263ba9: scaffolder/next: Fix for steps without properties +- 928a12a9b3e: Internal refactor of `/alpha` exports. +- cc418d652a7: scaffolder/next: Added the ability to get the fields definition in the schema in the validation function +- d4100d0ec42: Fix alignment bug for owners on `TemplateCard` +- Updated dependencies + - @backstage/catalog-client@1.4.0 + - @backstage/core-components@0.12.5 + - @backstage/plugin-catalog-react@1.4.0 + - @backstage/errors@1.1.5 + - @backstage/core-plugin-api@1.5.0 + - @backstage/catalog-model@1.2.1 + - @backstage/theme@0.2.18 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.3 + - @backstage/plugin-scaffolder-common@1.2.6 + +## 1.2.0-next.2 + +### Patch Changes + +- 65454876fb2: Minor API report tweaks +- 3c96e77b513: Make scaffolder adhere to page themes by using page `fontColor` consistently. If your theme overwrites template list or card headers, review those styles. +- d9893263ba9: scaffolder/next: Fix for steps without properties +- Updated dependencies + - @backstage/core-components@0.12.5-next.2 + - @backstage/plugin-catalog-react@1.4.0-next.2 + - @backstage/core-plugin-api@1.5.0-next.2 + +## 1.2.0-next.1 + +### Minor Changes + +- 8f4d13f21cf: Move `useTaskStream`, `TaskBorder`, `TaskLogStream` and `TaskSteps` into `scaffolder-react`. + +### Patch Changes + +- 44941fc97eb: scaffolder/next: Move the `uiSchema` to its own property in the validation `context` to align with component development and access of `ui:options` +- Updated dependencies + - @backstage/core-components@0.12.5-next.1 + - @backstage/errors@1.1.5-next.0 + - @backstage/catalog-client@1.4.0-next.1 + - @backstage/core-plugin-api@1.4.1-next.1 + - @backstage/theme@0.2.18-next.0 + - @backstage/plugin-catalog-react@1.4.0-next.1 + - @backstage/catalog-model@1.2.1-next.1 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.3 + - @backstage/plugin-scaffolder-common@1.2.6-next.1 + +## 1.1.1-next.0 + +### Patch Changes + +- c8d78b9ae9: fix bug with `hasErrors` returning false when dealing with empty objects +- 928a12a9b3: Internal refactor of `/alpha` exports. +- cc418d652a: scaffolder/next: Added the ability to get the fields definition in the schema in the validation function +- d4100d0ec4: Fix alignment bug for owners on `TemplateCard` +- Updated dependencies + - @backstage/catalog-client@1.4.0-next.0 + - @backstage/plugin-catalog-react@1.4.0-next.0 + - @backstage/core-plugin-api@1.4.1-next.0 + - @backstage/catalog-model@1.2.1-next.0 + - @backstage/core-components@0.12.5-next.0 + - @backstage/errors@1.1.4 + - @backstage/theme@0.2.17 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.3 + - @backstage/plugin-scaffolder-common@1.2.6-next.0 + +## 1.1.0 + +### Minor Changes + +- a07750745b: Added `DescriptionField` field override to the `next/scaffolder` +- a521379688: Migrating the `TemplateEditorPage` to work with the new components from `@backstage/plugin-scaffolder-react` +- 8c2966536b: Embed scaffolder workflow in other components +- 5555e17313: refactor `createAsyncValidators` to be recursive to ensure validators are called in nested schemas. + +### Patch Changes + +- 04f717a8e1: `scaffolder/next`: bump `react-jsonschema-form` libraries to `v5-stable` +- b46f385eff: scaffolder/next: Implementing a simple `OngoingTask` page +- cbab8ac107: lock versions of `@rjsf/*-beta` packages +- 346d6b6630: Upgrade `@rjsf` version 5 dependencies to `beta.18` +- ccbf91051b: bump `@rjsf` `v5` dependencies to 5.1.0 +- d2ddde2108: Add `ScaffolderLayouts` to `NextScaffolderPage` +- Updated dependencies + - @backstage/core-components@0.12.4 + - @backstage/catalog-model@1.2.0 + - @backstage/theme@0.2.17 + - @backstage/core-plugin-api@1.4.0 + - @backstage/plugin-catalog-react@1.3.0 + - @backstage/catalog-client@1.3.1 + - @backstage/errors@1.1.4 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.3 + - @backstage/plugin-scaffolder-common@1.2.5 + +## 1.1.0-next.2 + +### Minor Changes + +- 5555e17313: refactor `createAsyncValidators` to be recursive to ensure validators are called in nested schemas. + +### Patch Changes + +- b46f385eff: scaffolder/next: Implementing a simple `OngoingTask` page +- ccbf91051b: bump `@rjsf` `v5` dependencies to 5.1.0 +- Updated dependencies + - @backstage/catalog-model@1.2.0-next.1 + - @backstage/core-components@0.12.4-next.1 + - @backstage/catalog-client@1.3.1-next.1 + - @backstage/core-plugin-api@1.3.0 + - @backstage/errors@1.1.4 + - @backstage/theme@0.2.16 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.3 + - @backstage/plugin-catalog-react@1.3.0-next.2 + - @backstage/plugin-scaffolder-common@1.2.5-next.1 + +## 1.1.0-next.1 + +### Patch Changes + +- 04f717a8e1: `scaffolder/next`: bump `react-jsonschema-form` libraries to `v5-stable` +- 346d6b6630: Upgrade `@rjsf` version 5 dependencies to `beta.18` +- Updated dependencies + - @backstage/core-components@0.12.4-next.0 + - @backstage/plugin-catalog-react@1.3.0-next.1 + - @backstage/catalog-client@1.3.1-next.0 + - @backstage/catalog-model@1.1.6-next.0 + - @backstage/core-plugin-api@1.3.0 + - @backstage/errors@1.1.4 + - @backstage/theme@0.2.16 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.3 + - @backstage/plugin-scaffolder-common@1.2.5-next.0 + +## 1.1.0-next.0 + +### Minor Changes + +- 8c2966536b: Embed scaffolder workflow in other components + +### Patch Changes + +- cbab8ac107: lock versions of `@rjsf/*-beta` packages +- d2ddde2108: Add `ScaffolderLayouts` to `NextScaffolderPage` +- Updated dependencies + - @backstage/plugin-catalog-react@1.3.0-next.0 + - @backstage/catalog-model@1.1.6-next.0 + - @backstage/catalog-client@1.3.1-next.0 + - @backstage/plugin-scaffolder-common@1.2.5-next.0 + +## 1.0.0 + +### Major Changes + +- b4955ed7b9: Re-home some of the common types, components, hooks and `scaffolderApiRef` for the `@backstage/plugin-scaffolder` to this package for easy re-use across things that want to interact with the `scaffolder`. + +### Patch Changes + +- Updated dependencies + - @backstage/catalog-model@1.1.5 + - @backstage/plugin-scaffolder-common@1.2.4 + - @backstage/catalog-client@1.3.0 + - @backstage/plugin-catalog-react@1.2.4 + - @backstage/core-components@0.12.3 + - @backstage/core-plugin-api@1.3.0 + - @backstage/errors@1.1.4 + - @backstage/theme@0.2.16 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.3 + +## 1.0.0-next.0 + +### Major Changes + +- b4955ed7b9: Re-home some of the common types, components, hooks and `scaffolderApiRef` for the `@backstage/plugin-scaffolder` to this package for easy re-use across things that want to interact with the `scaffolder`. + +### Patch Changes + +- Updated dependencies + - @backstage/core-plugin-api@1.3.0-next.1 + - @backstage/catalog-client@1.3.0-next.2 + - @backstage/plugin-catalog-react@1.2.4-next.2 + - @backstage/catalog-model@1.1.5-next.1 + - @backstage/core-components@0.12.3-next.2 + - @backstage/errors@1.1.4 + - @backstage/theme@0.2.16 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.3 + - @backstage/plugin-scaffolder-common@1.2.4-next.1 + in the review step label +- bcec60f: updated the ContextMenu, ActionsPage, OngoingTask and TemplateCard frontend components to support the new scaffolder permissions: + + - `scaffolder.task.create` + - `scaffolder.task.cancel` + - `scaffolder.task.read` + +- Updated dependencies + - @backstage/plugin-scaffolder-common@1.5.3-next.0 + - @backstage/plugin-catalog-react@1.12.1-next.0 + +## 1.8.6-next.0 + +### Patch Changes + +- 86dc29d: Links that are rendered in the markdown in the `ScaffolderField` component are now opened in new tabs. +- Updated dependencies + - @backstage/theme@0.5.6-next.0 + - @backstage/core-components@0.14.8-next.0 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/core-plugin-api@1.9.2 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + - @backstage/plugin-catalog-react@1.12.1-next.0 + - @backstage/plugin-scaffolder-common@1.5.2 + +## 1.8.5 + +### Patch Changes + +- 9156654: Capturing more event clicks for scaffolder +- 0040ec2: Updated dependency `@rjsf/utils` to `5.18.2`. + Updated dependency `@rjsf/core` to `5.18.2`. + Updated dependency `@rjsf/material-ui` to `5.18.2`. + Updated dependency `@rjsf/validator-ajv8` to `5.18.2`. +- Updated dependencies + - @backstage/plugin-scaffolder-common@1.5.2 + - @backstage/core-components@0.14.7 + - @backstage/catalog-model@1.5.0 + - @backstage/plugin-catalog-react@1.12.0 + - @backstage/theme@0.5.4 + - @backstage/catalog-client@1.6.5 + +## 1.8.5-next.2 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-catalog-react@1.12.0-next.2 + - @backstage/core-components@0.14.7-next.2 + +## 1.8.5-next.1 + +### Patch Changes + +- 9156654: Capturing more event clicks for scaffolder +- Updated dependencies + - @backstage/plugin-scaffolder-common@1.5.2-next.1 + - @backstage/core-components@0.14.6-next.1 + - @backstage/plugin-catalog-react@1.11.4-next.1 + +## 1.8.5-next.0 + +### Patch Changes + +- 0040ec2: Updated dependency `@rjsf/utils` to `5.18.2`. + Updated dependency `@rjsf/core` to `5.18.2`. + Updated dependency `@rjsf/material-ui` to `5.18.2`. + Updated dependency `@rjsf/validator-ajv8` to `5.18.2`. +- Updated dependencies + - @backstage/catalog-model@1.5.0-next.0 + - @backstage/theme@0.5.4-next.0 + - @backstage/core-components@0.14.5-next.0 + - @backstage/catalog-client@1.6.5-next.0 + - @backstage/plugin-catalog-react@1.11.4-next.0 + - @backstage/plugin-scaffolder-common@1.5.2-next.0 + - @backstage/core-plugin-api@1.9.2 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + +## 1.8.4 + +### Patch Changes + +- abfbcfc: Updated dependency `@testing-library/react` to `^15.0.0`. +- 87d2eb8: Updated dependency `json-schema-library` to `^9.0.0`. +- cb1e3b0: Updated dependency `@testing-library/dom` to `^10.0.0`. +- 0e692cf: Added ESLint rule `no-top-level-material-ui-4-imports` to migrate the Material UI imports. +- df99f62: The `value` sent on the `create` analytics event (fired when a Scaffolder template is executed) is now set to the number of minutes saved by executing the template. This value is derived from the `backstage.io/time-saved` annotation on the template entity, if available. + + Note: the `create` event is now captured in the `` component. If you are directly making use of the alpha-exported `` component, an analytics `create` event will no longer be captured on your behalf. + +- Updated dependencies + - @backstage/plugin-catalog-react@1.11.3 + - @backstage/core-components@0.14.4 + - @backstage/core-plugin-api@1.9.2 + - @backstage/theme@0.5.3 + - @backstage/version-bridge@1.0.8 + - @backstage/catalog-client@1.6.4 + - @backstage/catalog-model@1.4.5 + - @backstage/types@1.1.1 + - @backstage/plugin-scaffolder-common@1.5.1 + +## 1.8.4-next.1 + +### Patch Changes + +- 87d2eb8: Updated dependency `json-schema-library` to `^9.0.0`. +- df99f62: The `value` sent on the `create` analytics event (fired when a Scaffolder template is executed) is now set to the number of minutes saved by executing the template. This value is derived from the `backstage.io/time-saved` annotation on the template entity, if available. + + Note: the `create` event is now captured in the `` component. If you are directly making use of the alpha-exported `` component, an analytics `create` event will no longer be captured on your behalf. + +- Updated dependencies + - @backstage/catalog-client@1.6.4-next.0 + - @backstage/catalog-model@1.4.5 + - @backstage/core-components@0.14.4-next.0 + - @backstage/core-plugin-api@1.9.1 + - @backstage/theme@0.5.2 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-catalog-react@1.11.3-next.1 + - @backstage/plugin-scaffolder-common@1.5.1 + +## 1.8.4-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.4-next.0 + - @backstage/catalog-client@1.6.3 + - @backstage/catalog-model@1.4.5 + - @backstage/core-plugin-api@1.9.1 + - @backstage/theme@0.5.2 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-catalog-react@1.11.3-next.0 + - @backstage/plugin-scaffolder-common@1.5.1 + +## 1.8.3 + +### Patch Changes + +- e8f026a: Use ESM exports of react-use library +- Updated dependencies + - @backstage/catalog-client@1.6.3 + - @backstage/core-components@0.14.3 + - @backstage/plugin-catalog-react@1.11.2 + - @backstage/core-plugin-api@1.9.1 + - @backstage/catalog-model@1.4.5 + - @backstage/theme@0.5.2 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.5.1 + +## 1.8.2 + +### Patch Changes + +- e8f026a: Use ESM exports of react-use library +- Updated dependencies + - @backstage/catalog-client@1.6.2 + - @backstage/core-components@0.14.2 + - @backstage/plugin-catalog-react@1.11.1 + - @backstage/core-plugin-api@1.9.1 + - @backstage/catalog-model@1.4.5 + - @backstage/theme@0.5.2 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.5.1 + +## 1.8.1 + +### Patch Changes + +- 930b5c1: Added 'root' and 'label' class key to TemplateCategoryPicker +- 6d649d2: Updated dependency `flatted` to `3.3.1`. +- 0cecb09: Updated dependency `@rjsf/utils` to `5.17.1`. + Updated dependency `@rjsf/core` to `5.17.1`. + Updated dependency `@rjsf/material-ui` to `5.17.1`. + Updated dependency `@rjsf/validator-ajv8` to `5.17.1`. +- Updated dependencies + - @backstage/core-components@0.14.1 + - @backstage/theme@0.5.2 + - @backstage/plugin-catalog-react@1.11.0 + - @backstage/catalog-client@1.6.1 + - @backstage/catalog-model@1.4.5 + - @backstage/core-plugin-api@1.9.1 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.5.1 + +## 1.8.1-next.2 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.1-next.2 + - @backstage/plugin-catalog-react@1.11.0-next.2 + - @backstage/catalog-client@1.6.1-next.1 + - @backstage/catalog-model@1.4.5-next.0 + - @backstage/core-plugin-api@1.9.1-next.1 + - @backstage/theme@0.5.2-next.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.5.1-next.1 + +## 1.8.1-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.1-next.1 + - @backstage/plugin-catalog-react@1.10.1-next.1 + - @backstage/core-plugin-api@1.9.1-next.1 + - @backstage/catalog-client@1.6.1-next.0 + - @backstage/catalog-model@1.4.5-next.0 + - @backstage/theme@0.5.2-next.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.5.1-next.1 + +## 1.8.1-next.0 + +### Patch Changes + +- 930b5c1: Added 'root' and 'label' class key to TemplateCategoryPicker +- 6d649d2: Updated dependency `flatted` to `3.3.1`. +- 0cecb09: Updated dependency `@rjsf/utils` to `5.17.1`. + Updated dependency `@rjsf/core` to `5.17.1`. + Updated dependency `@rjsf/material-ui` to `5.17.1`. + Updated dependency `@rjsf/validator-ajv8` to `5.17.1`. +- Updated dependencies + - @backstage/theme@0.5.2-next.0 + - @backstage/core-components@0.14.1-next.0 + - @backstage/plugin-catalog-react@1.10.1-next.0 + - @backstage/catalog-client@1.6.1-next.0 + - @backstage/catalog-model@1.4.5-next.0 + - @backstage/core-plugin-api@1.9.1-next.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.5.1-next.0 + +## 1.8.0 + +### Minor Changes + +- c56f1a2: Remove the old legacy exports from `/alpha` +- 11b9a08: Introduced the first version of recoverable tasks. +- b07ec70: Use more distinguishable icons for link (`Link`) and text output (`Description`). + +### Patch Changes + +- 3f60ad5: fix for: converting circular structure to JSON error +- 0b0c6b6: Allow defining default output text to be shown +- 8fe56a8: Widen `@types/react` dependency range to include version 18. +- 31f0a0a: Added `ScaffolderPageContextMenu` to `ActionsPage`, `ListTaskPage`, and `TemplateEditorPage` so that you can more easily navigate between these pages +- 09cedb9: Updated dependency `@react-hookz/web` to `^24.0.0`. +- e6f0831: Updated dependency `@rjsf/utils` to `5.17.0`. + Updated dependency `@rjsf/core` to `5.17.0`. + Updated dependency `@rjsf/material-ui` to `5.17.0`. + Updated dependency `@rjsf/validator-ajv8` to `5.17.0`. +- 6a74ffd: Updated dependency `@rjsf/utils` to `5.16.1`. + Updated dependency `@rjsf/core` to `5.16.1`. + Updated dependency `@rjsf/material-ui` to `5.16.1`. + Updated dependency `@rjsf/validator-ajv8` to `5.16.1`. +- 3dff4b0: Remove unused deps +- 82affc7: Fix issue where `ui:schema` was replaced with an empty object if `dependencies` is defined +- 2985186: Fix bug that erroneously caused a separator or a 0 to render in the TemplateCard for Templates with empty links +- Updated dependencies + - @backstage/plugin-catalog-react@1.10.0 + - @backstage/core-components@0.14.0 + - @backstage/catalog-model@1.4.4 + - @backstage/theme@0.5.1 + - @backstage/core-plugin-api@1.9.0 + - @backstage/catalog-client@1.6.0 + - @backstage/plugin-scaffolder-common@1.5.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + +## 1.8.0-next.3 + +### Patch Changes + +- 09cedb9: Updated dependency `@react-hookz/web` to `^24.0.0`. +- e6f0831: Updated dependency `@rjsf/utils` to `5.17.0`. + Updated dependency `@rjsf/core` to `5.17.0`. + Updated dependency `@rjsf/material-ui` to `5.17.0`. + Updated dependency `@rjsf/validator-ajv8` to `5.17.0`. +- Updated dependencies + - @backstage/theme@0.5.1-next.1 + - @backstage/core-components@0.14.0-next.2 + - @backstage/plugin-catalog-react@1.10.0-next.3 + - @backstage/catalog-client@1.6.0-next.1 + - @backstage/catalog-model@1.4.4-next.0 + - @backstage/core-plugin-api@1.9.0-next.1 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.5.0-next.1 + +## 1.8.0-next.2 + +### Patch Changes + +- 8fe56a8: Widen `@types/react` dependency range to include version 18. +- 2985186: Fix bug that erroneously caused a separator or a 0 to render in the TemplateCard for Templates with empty links +- Updated dependencies + - @backstage/core-components@0.14.0-next.1 + - @backstage/core-plugin-api@1.9.0-next.1 + - @backstage/plugin-catalog-react@1.10.0-next.2 + - @backstage/theme@0.5.1-next.0 + - @backstage/catalog-client@1.6.0-next.1 + - @backstage/catalog-model@1.4.4-next.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.5.0-next.1 + +## 1.8.0-next.1 + +### Minor Changes + +- b07ec70: Use more distinguishable icons for link (`Link`) and text output (`Description`). + +### Patch Changes + +- 3f60ad5: fix for: converting circular structure to JSON error +- 31f0a0a: Added `ScaffolderPageContextMenu` to `ActionsPage`, `ListTaskPage`, and `TemplateEditorPage` so that you can more easily navigate between these pages +- 82affc7: Fix issue where `ui:schema` was replaced with an empty object if `dependencies` is defined +- Updated dependencies + - @backstage/core-components@0.14.0-next.0 + - @backstage/catalog-model@1.4.4-next.0 + - @backstage/catalog-client@1.6.0-next.1 + - @backstage/core-plugin-api@1.8.3-next.0 + - @backstage/plugin-catalog-react@1.9.4-next.1 + - @backstage/theme@0.5.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.5.0-next.1 + +## 1.8.0-next.0 + +### Minor Changes + +- c56f1a2: Remove the old legacy exports from `/alpha` +- 11b9a08: Introduced the first version of recoverable tasks. + +### Patch Changes + +- 0b0c6b6: Allow defining default output text to be shown +- 6a74ffd: Updated dependency `@rjsf/utils` to `5.16.1`. + Updated dependency `@rjsf/core` to `5.16.1`. + Updated dependency `@rjsf/material-ui` to `5.16.1`. + Updated dependency `@rjsf/validator-ajv8` to `5.16.1`. +- Updated dependencies + - @backstage/plugin-catalog-react@1.9.4-next.0 + - @backstage/catalog-client@1.6.0-next.0 + - @backstage/plugin-scaffolder-common@1.5.0-next.0 + - @backstage/core-components@0.13.10 + - @backstage/catalog-model@1.4.3 + - @backstage/core-plugin-api@1.8.2 + - @backstage/theme@0.5.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + +## 1.7.1 + +### Patch Changes + +- c28f281: Scaffolder form now shows a list of errors at the top of the form. +- 0b9ce2b: Fix for a step with no properties +- 98ac5ab: Updated dependency `@rjsf/utils` to `5.15.1`. + Updated dependency `@rjsf/core` to `5.15.1`. + Updated dependency `@rjsf/material-ui` to `5.15.1`. + Updated dependency `@rjsf/validator-ajv8` to `5.15.1`. +- 4016f21: Remove some unused dependencies +- d16f85f: Show first scaffolder output text by default +- Updated dependencies + - @backstage/core-components@0.13.10 + - @backstage/plugin-scaffolder-common@1.4.5 + - @backstage/core-plugin-api@1.8.2 + - @backstage/catalog-client@1.5.2 + - @backstage/plugin-catalog-react@1.9.3 + - @backstage/catalog-model@1.4.3 + - @backstage/theme@0.5.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + +## 1.7.1-next.2 + +### Patch Changes + +- 98ac5ab: Updated dependency `@rjsf/utils` to `5.15.1`. + Updated dependency `@rjsf/core` to `5.15.1`. + Updated dependency `@rjsf/material-ui` to `5.15.1`. + Updated dependency `@rjsf/validator-ajv8` to `5.15.1`. +- Updated dependencies + - @backstage/plugin-catalog-react@1.9.3-next.2 + +## 1.7.1-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/core-plugin-api@1.8.2-next.0 + - @backstage/core-components@0.13.10-next.1 + - @backstage/plugin-catalog-react@1.9.3-next.1 + - @backstage/catalog-client@1.5.2-next.0 + - @backstage/catalog-model@1.4.3 + - @backstage/theme@0.5.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.4.4 + +## 1.7.1-next.0 + +### Patch Changes + +- c28f281: Scaffolder form now shows a list of errors at the top of the form. +- 4016f21: Remove some unused dependencies +- Updated dependencies + - @backstage/core-components@0.13.10-next.0 + - @backstage/catalog-client@1.5.2-next.0 + - @backstage/plugin-catalog-react@1.9.3-next.0 + - @backstage/catalog-model@1.4.3 + - @backstage/core-plugin-api@1.8.1 + - @backstage/theme@0.5.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.4.4 + +## 1.7.0 + +### Minor Changes + +- 33edf50: Added support for dealing with user provided secrets using a new field extension `ui:field: Secret` + +### Patch Changes + +- 670c7cc: Fix bug where `properties` is set to empty object when it should be empty for schema dependencies +- fa66d1b: Fixed bug in `ReviewState` where `enum` value was displayed in step review instead of the corresponding label when using `enumNames` +- e516bf4: Step titles in the Stepper are now clickable and redirect the user to the corresponding step, as an alternative to using the back buttons. +- aaa6fb3: Minor updates for TypeScript 5.2.2+ compatibility +- 2aee53b: Add horizontal slider if stepper overflows +- 2b72591: Updated dependency `@rjsf/utils` to `5.14.3`. + Updated dependency `@rjsf/core` to `5.14.3`. + Updated dependency `@rjsf/material-ui` to `5.14.3`. + Updated dependency `@rjsf/validator-ajv8` to `5.14.3`. +- 6cd12f2: Updated dependency `@rjsf/utils` to `5.14.1`. + Updated dependency `@rjsf/core` to `5.14.1`. + Updated dependency `@rjsf/material-ui` to `5.14.1`. + Updated dependency `@rjsf/validator-ajv8` to `5.14.1`. +- a518c5a: Updated dependency `@react-hookz/web` to `^23.0.0`. +- 64301d3: Updated dependency `@rjsf/utils` to `5.15.0`. + Updated dependency `@rjsf/core` to `5.15.0`. + Updated dependency `@rjsf/material-ui` to `5.15.0`. + Updated dependency `@rjsf/validator-ajv8` to `5.15.0`. +- 63c494e: Updated dependency `@rjsf/utils` to `5.14.2`. + Updated dependency `@rjsf/core` to `5.14.2`. + Updated dependency `@rjsf/material-ui` to `5.14.2`. + Updated dependency `@rjsf/validator-ajv8` to `5.14.2`. +- c8908d4: Use new option from RJSF 5.15 +- 0cbb03b: Fixing regular expression ReDoS with zod packages. Upgrading to latest. ref: https://security.snyk.io/vuln/SNYK-JS-ZOD-5925617 +- 5bb5240: Fixed issue for showing undefined for hidden form items +- Updated dependencies + - @backstage/core-plugin-api@1.8.1 + - @backstage/plugin-catalog-react@1.9.2 + - @backstage/core-components@0.13.9 + - @backstage/theme@0.5.0 + - @backstage/catalog-client@1.5.0 + - @backstage/catalog-model@1.4.3 + - @backstage/errors@1.2.3 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.4.4 + +## 1.6.2-next.3 + +### Patch Changes + +- 64301d3: Updated dependency `@rjsf/utils` to `5.15.0`. + Updated dependency `@rjsf/core` to `5.15.0`. + Updated dependency `@rjsf/material-ui` to `5.15.0`. + Updated dependency `@rjsf/validator-ajv8` to `5.15.0`. +- c8908d4: Use new option from RJSF 5.15 +- Updated dependencies + - @backstage/core-components@0.13.9-next.3 + - @backstage/catalog-client@1.5.0-next.1 + - @backstage/catalog-model@1.4.3 + - @backstage/core-plugin-api@1.8.1-next.1 + - @backstage/errors@1.2.3 + - @backstage/theme@0.5.0-next.1 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-catalog-react@1.9.2-next.3 + - @backstage/plugin-scaffolder-common@1.4.3 + +## 1.6.2-next.2 + +### Patch Changes + +- 5bb5240: Fixed issue for showing undefined for hidden form items +- Updated dependencies + - @backstage/theme@0.5.0-next.1 + - @backstage/plugin-catalog-react@1.9.2-next.2 + - @backstage/catalog-client@1.5.0-next.1 + - @backstage/catalog-model@1.4.3 + - @backstage/core-components@0.13.9-next.2 + - @backstage/core-plugin-api@1.8.1-next.1 + - @backstage/errors@1.2.3 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.4.3 + +## 1.6.2-next.1 + +### Patch Changes + +- fa66d1b5b3: Fixed bug in `ReviewState` where `enum` value was displayed in step review instead of the corresponding label when using `enumNames` +- 2aee53bbeb: Add horizontal slider if stepper overflows +- 2b725913c1: Updated dependency `@rjsf/utils` to `5.14.3`. + Updated dependency `@rjsf/core` to `5.14.3`. + Updated dependency `@rjsf/material-ui` to `5.14.3`. + Updated dependency `@rjsf/validator-ajv8` to `5.14.3`. +- a518c5a25b: Updated dependency `@react-hookz/web` to `^23.0.0`. +- Updated dependencies + - @backstage/core-components@0.13.9-next.1 + - @backstage/core-plugin-api@1.8.1-next.1 + - @backstage/plugin-catalog-react@1.9.2-next.1 + - @backstage/catalog-client@1.5.0-next.0 + - @backstage/catalog-model@1.4.3 + - @backstage/errors@1.2.3 + - @backstage/theme@0.5.0-next.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.4.3 + +## 1.6.2-next.0 + +### Patch Changes + +- e516bf4da8: Step titles in the Stepper are now clickable and redirect the user to the corresponding step, as an alternative to using the back buttons. +- aaa6fb3bc9: Minor updates for TypeScript 5.2.2+ compatibility +- 6cd12f277b: Updated dependency `@rjsf/utils` to `5.14.1`. + Updated dependency `@rjsf/core` to `5.14.1`. + Updated dependency `@rjsf/material-ui` to `5.14.1`. + Updated dependency `@rjsf/validator-ajv8` to `5.14.1`. +- 63c494ef22: Updated dependency `@rjsf/utils` to `5.14.2`. + Updated dependency `@rjsf/core` to `5.14.2`. + Updated dependency `@rjsf/material-ui` to `5.14.2`. + Updated dependency `@rjsf/validator-ajv8` to `5.14.2`. +- Updated dependencies + - @backstage/core-plugin-api@1.8.1-next.0 + - @backstage/plugin-catalog-react@1.9.2-next.0 + - @backstage/core-components@0.13.9-next.0 + - @backstage/theme@0.5.0-next.0 + - @backstage/catalog-client@1.4.6 + - @backstage/catalog-model@1.4.3 + - @backstage/errors@1.2.3 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7 + - @backstage/plugin-scaffolder-common@1.4.3 + +## 1.6.0 + +### Minor Changes + +- 3fdffbb699: Release design improvements for the `Scaffolder` plugin and support v5 of `@rjsf/*` libraries. + + This change should be non-breaking. If you're seeing typescript issues after migrating please [open an issue](https://github.com/backstage/backstage/issues/new/choose) + + The `next` versions like `createNextFieldExtension` and `NextScaffolderPage` have been promoted to the public interface under `createScaffolderFieldExtension` and `ScaffolderPage`, so any older imports which are no longer found will need updating from `@backstage/plugin-scaffolder/alpha` or `@backstage/plugin-scaffolder-react/alpha` will need to be imported from `@backstage/plugin-scaffolder` and `@backstage/plugin-scaffolder-react` respectively. + + The legacy versions are now available in `/alpha` under `createLegacyFieldExtension` and `LegacyScaffolderPage` if you're running into issues, but be aware that these will be removed in a next mainline release. + +### Patch Changes + +- 6c2b872153: Add official support for React 18. +- 171a99816b: Fixed `backstage:featureFlag` in `scaffolder/next` by sorting out `manifest.steps`. +- c838da0edd: Updated dependency `@rjsf/utils` to `5.13.6`. + Updated dependency `@rjsf/core` to `5.13.6`. + Updated dependency `@rjsf/material-ui` to `5.13.6`. + Updated dependency `@rjsf/validator-ajv8` to `5.13.6`. +- 69c14904b6: Use `EntityRefLinks` with `hideIcons` property to avoid double icons +- 62b5922916: Internal theme type updates +- dda56ae265: Preserve step's time execution for a non-running task. +- 76d07da66a: Make it possible to define control buttons text (Back, Create, Review) per template +- Updated dependencies + - @backstage/plugin-catalog-react@1.9.0 + - @backstage/core-components@0.13.8 + - @backstage/plugin-scaffolder-common@1.4.3 + - @backstage/core-plugin-api@1.8.0 + - @backstage/version-bridge@1.0.7 + - @backstage/theme@0.4.4 + - @backstage/catalog-client@1.4.6 + - @backstage/catalog-model@1.4.3 + - @backstage/errors@1.2.3 + - @backstage/types@1.1.1 + +## 1.6.0-next.2 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.13.8-next.2 + - @backstage/plugin-catalog-react@1.9.0-next.2 + +## 1.6.0-next.1 + +### Patch Changes + +- 62b5922916: Internal theme type updates +- 76d07da66a: Make it possible to define control buttons text (Back, Create, Review) per template +- Updated dependencies + - @backstage/plugin-catalog-react@1.9.0-next.1 + - @backstage/plugin-scaffolder-common@1.4.3-next.1 + - @backstage/core-components@0.13.8-next.1 + - @backstage/catalog-client@1.4.5 + - @backstage/catalog-model@1.4.3 + - @backstage/core-plugin-api@1.8.0-next.0 + - @backstage/errors@1.2.3 + - @backstage/theme@0.4.4-next.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.7-next.0 + +## 1.6.0-next.0 + +### Minor Changes + +- 3fdffbb699: Release design improvements for the `Scaffolder` plugin and support v5 of `@rjsf/*` libraries. + + This change should be non-breaking. If you're seeing typescript issues after migrating please [open an issue](https://github.com/backstage/backstage/issues/new/choose) + + The `next` versions like `createNextFieldExtension` and `NextScaffolderPage` have been promoted to the public interface under `createScaffolderFieldExtension` and `ScaffolderPage`, so any older imports which are no longer found will need updating from `@backstage/plugin-scaffolder/alpha` or `@backstage/plugin-scaffolder-react/alpha` will need to be imported from `@backstage/plugin-scaffolder` and `@backstage/plugin-scaffolder-react` respectively. + + The legacy versions are now available in `/alpha` under `createLegacyFieldExtension` and `LegacyScaffolderPage` if you're running into issues, but be aware that these will be removed in a next mainline release. + +### Patch Changes + +- 6c2b872153: Add official support for React 18. +- Updated dependencies + - @backstage/core-components@0.13.7-next.0 + - @backstage/plugin-scaffolder-common@1.4.3-next.0 + - @backstage/plugin-catalog-react@1.9.0-next.0 + - @backstage/core-plugin-api@1.8.0-next.0 + - @backstage/version-bridge@1.0.7-next.0 + - @backstage/theme@0.4.4-next.0 + - @backstage/catalog-client@1.4.5 + - @backstage/catalog-model@1.4.3 + - @backstage/errors@1.2.3 + - @backstage/types@1.1.1 + +## 1.5.6 + +### Patch Changes + +- 9a1fce352e: Updated dependency `@testing-library/jest-dom` to `^6.0.0`. +- f95af4e540: Updated dependency `@testing-library/dom` to `^9.0.0`. +- Updated dependencies + - @backstage/plugin-catalog-react@1.8.5 + - @backstage/core-plugin-api@1.7.0 + - @backstage/core-components@0.13.6 + - @backstage/catalog-model@1.4.3 + - @backstage/errors@1.2.3 + - @backstage/version-bridge@1.0.6 + - @backstage/theme@0.4.3 + - @backstage/catalog-client@1.4.5 + - @backstage/types@1.1.1 + - @backstage/plugin-scaffolder-common@1.4.2 + +## 1.5.6-next.2 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.13.6-next.2 + - @backstage/core-plugin-api@1.7.0-next.1 + - @backstage/catalog-model@1.4.3-next.0 + - @backstage/plugin-catalog-react@1.8.5-next.2 + - @backstage/errors@1.2.3-next.0 + - @backstage/theme@0.4.3-next.0 + - @backstage/catalog-client@1.4.5-next.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.5 + - @backstage/plugin-scaffolder-common@1.4.2-next.0 + +## 1.5.6-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.13.6-next.1 + - @backstage/plugin-catalog-react@1.8.5-next.1 + - @backstage/core-plugin-api@1.7.0-next.0 + - @backstage/catalog-client@1.4.4 + - @backstage/catalog-model@1.4.2 + - @backstage/errors@1.2.2 + - @backstage/theme@0.4.2 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.5 + - @backstage/plugin-scaffolder-common@1.4.1 + +## 1.5.6-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-catalog-react@1.8.5-next.0 + - @backstage/core-plugin-api@1.7.0-next.0 + - @backstage/core-components@0.13.6-next.0 + - @backstage/catalog-client@1.4.4 + - @backstage/catalog-model@1.4.2 + - @backstage/errors@1.2.2 + - @backstage/theme@0.4.2 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.5 + - @backstage/plugin-scaffolder-common@1.4.1 + +## 1.5.5 + +### Patch Changes + +- 406b786a2a2c: Mark package as being free of side effects, allowing more optimized Webpack builds. +- b16c341ced45: Updated dependency `@rjsf/utils` to `5.13.0`. + Updated dependency `@rjsf/core-v5` to `npm:@rjsf/core@5.13.0`. + Updated dependency `@rjsf/material-ui-v5` to `npm:@rjsf/material-ui@5.13.0`. + Updated dependency `@rjsf/validator-ajv8` to `5.13.0`. +- 27fef07f9229: Updated dependency `use-immer` to `^0.9.0`. +- Updated dependencies + - @backstage/plugin-catalog-react@1.8.4 + - @backstage/core-components@0.13.5 + - @backstage/catalog-client@1.4.4 + - @backstage/catalog-model@1.4.2 + - @backstage/core-plugin-api@1.6.0 + - @backstage/errors@1.2.2 + - @backstage/plugin-scaffolder-common@1.4.1 + - @backstage/theme@0.4.2 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.5 + +## 1.5.5-next.3 + +### Patch Changes + +- 406b786a2a2c: Mark package as being free of side effects, allowing more optimized Webpack builds. +- b16c341ced45: Updated dependency `@rjsf/utils` to `5.13.0`. + Updated dependency `@rjsf/core-v5` to `npm:@rjsf/core@5.13.0`. + Updated dependency `@rjsf/material-ui-v5` to `npm:@rjsf/material-ui@5.13.0`. + Updated dependency `@rjsf/validator-ajv8` to `5.13.0`. +- Updated dependencies + - @backstage/catalog-client@1.4.4-next.2 + - @backstage/catalog-model@1.4.2-next.2 + - @backstage/core-components@0.13.5-next.3 + - @backstage/core-plugin-api@1.6.0-next.3 + - @backstage/errors@1.2.2-next.0 + - @backstage/plugin-catalog-react@1.8.4-next.3 + - @backstage/plugin-scaffolder-common@1.4.1-next.2 + - @backstage/theme@0.4.2-next.0 + - @backstage/types@1.1.1-next.0 + - @backstage/version-bridge@1.0.5-next.0 + +## 1.5.5-next.2 + +### Patch Changes + +- 27fef07f9229: Updated dependency `use-immer` to `^0.9.0`. +- Updated dependencies + - @backstage/core-components@0.13.5-next.2 + - @backstage/core-plugin-api@1.6.0-next.2 + - @backstage/plugin-catalog-react@1.8.4-next.2 + - @backstage/catalog-model@1.4.2-next.1 + - @backstage/catalog-client@1.4.4-next.1 + - @backstage/errors@1.2.1 + - @backstage/theme@0.4.1 + - @backstage/types@1.1.0 + - @backstage/version-bridge@1.0.4 + - @backstage/plugin-scaffolder-common@1.4.1-next.1 + +## 1.5.5-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-catalog-react@1.8.4-next.1 + - @backstage/core-components@0.13.5-next.1 + - @backstage/catalog-model@1.4.2-next.0 + - @backstage/core-plugin-api@1.6.0-next.1 + - @backstage/catalog-client@1.4.4-next.0 + - @backstage/plugin-scaffolder-common@1.4.1-next.0 + - @backstage/errors@1.2.1 + - @backstage/theme@0.4.1 + - @backstage/types@1.1.0 + - @backstage/version-bridge@1.0.4 + +## 1.5.4-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-plugin-api@1.6.0-next.0 + - @backstage/core-components@0.13.5-next.0 + - @backstage/catalog-client@1.4.3 + - @backstage/catalog-model@1.4.1 + - @backstage/errors@1.2.1 + - @backstage/theme@0.4.1 + - @backstage/types@1.1.0 + - @backstage/version-bridge@1.0.4 + - @backstage/plugin-catalog-react@1.8.3-next.0 + - @backstage/plugin-scaffolder-common@1.4.0 + +## 1.5.2 + +### Patch Changes + +- ba9ee98a37bd: Fixed bug in Workflow component by passing a prop `templateName` down to Stepper component. +- Updated dependencies + - @backstage/core-components@0.13.4 + - @backstage/plugin-catalog-react@1.8.1 + - @backstage/plugin-scaffolder-common@1.4.0 + - @backstage/core-plugin-api@1.5.3 + - @backstage/catalog-client@1.4.3 + - @backstage/catalog-model@1.4.1 + - @backstage/errors@1.2.1 + - @backstage/theme@0.4.1 + - @backstage/types@1.1.0 + - @backstage/version-bridge@1.0.4 + +## 1.5.2-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-catalog-react@1.8.1-next.1 + +## 1.5.2-next.0 + +### Patch Changes + +- ba9ee98a37bd: Fixed bug in Workflow component by passing a prop `templateName` down to Stepper component. +- Updated dependencies + - @backstage/core-components@0.13.4-next.0 + - @backstage/core-plugin-api@1.5.3 + - @backstage/plugin-catalog-react@1.8.1-next.0 + - @backstage/catalog-client@1.4.3 + - @backstage/catalog-model@1.4.1 + - @backstage/errors@1.2.1 + - @backstage/theme@0.4.1 + - @backstage/types@1.1.0 + - @backstage/version-bridge@1.0.4 + - @backstage/plugin-scaffolder-common@1.3.2 + +## 1.5.1 + +### Patch Changes + +- f74a27de4d2c: Made markdown description theme-able +- Updated dependencies + - @backstage/theme@0.4.1 + - @backstage/errors@1.2.1 + - @backstage/plugin-catalog-react@1.8.0 + - @backstage/core-components@0.13.3 + - @backstage/core-plugin-api@1.5.3 + - @backstage/catalog-client@1.4.3 + - @backstage/catalog-model@1.4.1 + - @backstage/types@1.1.0 + - @backstage/version-bridge@1.0.4 + - @backstage/plugin-scaffolder-common@1.3.2 + +## 1.5.1-next.2 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-catalog-react@1.8.0-next.2 + - @backstage/theme@0.4.1-next.1 + - @backstage/core-plugin-api@1.5.3-next.1 + - @backstage/core-components@0.13.3-next.2 + - @backstage/catalog-client@1.4.3-next.0 + - @backstage/catalog-model@1.4.1-next.0 + - @backstage/errors@1.2.1-next.0 + - @backstage/types@1.1.0 + - @backstage/version-bridge@1.0.4 + - @backstage/plugin-scaffolder-common@1.3.2-next.0 + +## 1.5.1-next.1 + +### Patch Changes + +- f74a27de4d2c: Made markdown description theme-able +- Updated dependencies + - @backstage/theme@0.4.1-next.0 + - @backstage/core-components@0.13.3-next.1 + - @backstage/core-plugin-api@1.5.3-next.0 + - @backstage/plugin-catalog-react@1.7.1-next.1 + +## 1.5.1-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/errors@1.2.1-next.0 + - @backstage/core-components@0.13.3-next.0 + - @backstage/catalog-client@1.4.3-next.0 + - @backstage/catalog-model@1.4.1-next.0 + - @backstage/core-plugin-api@1.5.2 + - @backstage/theme@0.4.0 + - @backstage/types@1.1.0 + - @backstage/version-bridge@1.0.4 + - @backstage/plugin-catalog-react@1.7.1-next.0 + - @backstage/plugin-scaffolder-common@1.3.2-next.0 + +## 1.5.0 + +### Minor Changes + +- 6b571405f806: `scaffolder/next`: Provide some default template components to `rjsf` to allow for standardization and markdown descriptions +- 4505dc3b4598: `scaffolder/next`: Don't render `TemplateGroups` when there's no results in with search query +- a452bda74d7a: Fixed typescript casting bug for useTemplateParameterSchema hook +- 6b571405f806: `scaffolder/next`: provide a `ScaffolderField` component which is meant to replace some of the `FormControl` components from Material UI, making it easier to write `FieldExtensions`. + +### Patch Changes + +- 84a5c7724c7e: fixed refresh problem when backstage backend disconnects without any feedback to user. Now we send a generic message and try to reconnect after 15 seconds +- cf34311cdbe1: Extract `ui:*` fields from conditional `then` and `else` schema branches. +- 2ff94da135a4: bump `rjsf` dependencies to 5.7.3 +- 74b216ee4e50: Add `PropsWithChildren` to usages of `ComponentType`, in preparation for React 18 where the children are no longer implicit. +- Updated dependencies + - @backstage/core-plugin-api@1.5.2 + - @backstage/catalog-client@1.4.2 + - @backstage/core-components@0.13.2 + - @backstage/types@1.1.0 + - @backstage/theme@0.4.0 + - @backstage/plugin-catalog-react@1.7.0 + - @backstage/catalog-model@1.4.0 + - @backstage/errors@1.2.0 + - @backstage/version-bridge@1.0.4 + - @backstage/plugin-scaffolder-common@1.3.1 + +## 1.5.0-next.3 + +### Minor Changes + +- a452bda74d7a: Fixed typescript casting bug for useTemplateParameterSchema hook + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.13.2-next.3 + - @backstage/catalog-model@1.4.0-next.1 + - @backstage/catalog-client@1.4.2-next.2 + - @backstage/core-plugin-api@1.5.2-next.0 + - @backstage/errors@1.2.0-next.0 + - @backstage/theme@0.4.0-next.1 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.4 + - @backstage/plugin-catalog-react@1.7.0-next.3 + - @backstage/plugin-scaffolder-common@1.3.1-next.1 + +## 1.5.0-next.2 + +### Patch Changes + +- cf34311cdbe1: Extract `ui:*` fields from conditional `then` and `else` schema branches. +- 2ff94da135a4: bump `rjsf` dependencies to 5.7.3 +- Updated dependencies + - @backstage/theme@0.4.0-next.1 + - @backstage/plugin-catalog-react@1.7.0-next.2 + - @backstage/core-components@0.13.2-next.2 + - @backstage/core-plugin-api@1.5.2-next.0 + +## 1.5.0-next.1 + +### Minor Changes + +- 6b571405f806: `scaffolder/next`: Provide some default template components to `rjsf` to allow for standardization and markdown descriptions +- 4505dc3b4598: `scaffolder/next`: Don't render `TemplateGroups` when there's no results in with search query +- 6b571405f806: `scaffolder/next`: provide a `ScaffolderField` component which is meant to replace some of the `FormControl` components from Material UI, making it easier to write `FieldExtensions`. + +### Patch Changes + +- 74b216ee4e50: Add `PropsWithChildren` to usages of `ComponentType`, in preparation for React 18 where the children are no longer implicit. +- Updated dependencies + - @backstage/errors@1.2.0-next.0 + - @backstage/core-components@0.13.2-next.1 + - @backstage/plugin-catalog-react@1.7.0-next.1 + - @backstage/catalog-model@1.4.0-next.0 + - @backstage/core-plugin-api@1.5.2-next.0 + - @backstage/catalog-client@1.4.2-next.1 + - @backstage/plugin-scaffolder-common@1.3.1-next.0 + - @backstage/theme@0.4.0-next.0 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.4 + +## 1.4.1-next.0 + +### Patch Changes + +- 84a5c7724c7e: fixed refresh problem when backstage backend disconnects without any feedback to user. Now we send a generic message and try to reconnect after 15 seconds +- Updated dependencies + - @backstage/catalog-client@1.4.2-next.0 + - @backstage/plugin-catalog-react@1.7.0-next.0 + - @backstage/theme@0.4.0-next.0 + - @backstage/core-components@0.13.2-next.0 + - @backstage/core-plugin-api@1.5.1 + - @backstage/catalog-model@1.3.0 + - @backstage/errors@1.1.5 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.4 + - @backstage/plugin-scaffolder-common@1.3.0 + +## 1.4.0 + +### Minor Changes + +- 82e10a6939c: Add support for Markdown text blob outputs from templates + +### Patch Changes + +- ad1a1429de4: Improvements to the `scaffolder/next` buttons UX: + + - Added padding around the "Create" button in the `Stepper` component + - Added a button bar that includes the "Cancel" and "Start Over" buttons to the `OngoingTask` component. The state of these buttons match their existing counter parts in the Context Menu + - Added a "Show Button Bar"/"Hide Button Bar" item to the `ContextMenu` component + +- Updated dependencies + - @backstage/theme@0.3.0 + - @backstage/plugin-catalog-react@1.6.0 + - @backstage/plugin-scaffolder-common@1.3.0 + - @backstage/core-components@0.13.1 + - @backstage/catalog-client@1.4.1 + - @backstage/catalog-model@1.3.0 + - @backstage/core-plugin-api@1.5.1 + - @backstage/errors@1.1.5 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.4 + +## 1.4.0-next.2 + +### Minor Changes + +- 82e10a6939c: Add support for Markdown text blob outputs from templates + +### Patch Changes + +- Updated dependencies + - @backstage/theme@0.3.0-next.0 + - @backstage/plugin-scaffolder-common@1.3.0-next.0 + - @backstage/core-components@0.13.1-next.1 + - @backstage/plugin-catalog-react@1.6.0-next.2 + - @backstage/core-plugin-api@1.5.1 + +## 1.3.1-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.13.1-next.0 + - @backstage/core-plugin-api@1.5.1 + - @backstage/plugin-catalog-react@1.6.0-next.1 + +## 1.3.1-next.0 + +### Patch Changes + +- ad1a1429de4: Improvements to the `scaffolder/next` buttons UX: + + - Added padding around the "Create" button in the `Stepper` component + - Added a button bar that includes the "Cancel" and "Start Over" buttons to the `OngoingTask` component. The state of these buttons match their existing counter parts in the Context Menu + - Added a "Show Button Bar"/"Hide Button Bar" item to the `ContextMenu` component + +- Updated dependencies + - @backstage/plugin-catalog-react@1.6.0-next.0 + - @backstage/core-components@0.13.0 + - @backstage/core-plugin-api@1.5.1 + - @backstage/catalog-client@1.4.1 + - @backstage/catalog-model@1.3.0 + - @backstage/errors@1.1.5 + - @backstage/theme@0.2.19 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.4 + - @backstage/plugin-scaffolder-common@1.2.7 + +## 1.3.0 + +### Minor Changes + +- 259d3407b9b: Move `CategoryPicker` from `scaffolder` into `scaffolder-react` + Move `ContextMenu` into `scaffolder-react` and rename it to `ScaffolderPageContextMenu` +- 2cfd03d7376: To offer better customization options, `ScaffolderPageContextMenu` takes callbacks as props instead of booleans +- 48da4c46e45: `scaffolder/next`: Export the `TemplateGroupFilter` and `TemplateGroups` and make an extensible component + +### Patch Changes + +- 7e1d900413a: `scaffolder/next`: Bump `@rjsf/*` dependencies to 5.5.2 +- e27ddc36dad: Added a possibility to cancel the running task (executing of a scaffolder template) +- 0435174b06f: Accessibility issues identified using lighthouse fixed. +- 7a6b16cc506: `scaffolder/next`: Bump `@rjsf/*` deps to 5.3.1 +- 90dda42cfd2: bug: Invert `templateFilter` predicate to align with `Array.filter` +- d2488f5e54c: Add an indication that the validators are running when clicking `next` on each step of the form. +- 1e4f5e91b8e: Bump `zod` and `zod-to-json-schema` dependencies. +- 8c40997df44: Updated dependency `@rjsf/core-v5` to `npm:@rjsf/core@5.5.2`. +- f84fc7fd040: Updated dependency `@rjsf/validator-ajv8` to `5.3.0`. +- 8e00acb28db: Small tweaks to remove warnings in the console during development (mainly focusing on techdocs) +- 34dab7ee7f8: `scaffolder/next`: bump `rjsf` dependencies to `5.5.0` +- 2898b6c8d52: Minor type tweaks for TypeScript 5.0 +- e0c6e8b9c3c: Update peer dependencies +- cf71c3744a5: scaffolder/next: Bump `@rjsf/*` dependencies to 5.6.0 +- Updated dependencies + - @backstage/core-components@0.13.0 + - @backstage/plugin-scaffolder-common@1.2.7 + - @backstage/catalog-client@1.4.1 + - @backstage/plugin-catalog-react@1.5.0 + - @backstage/theme@0.2.19 + - @backstage/core-plugin-api@1.5.1 + - @backstage/catalog-model@1.3.0 + - @backstage/version-bridge@1.0.4 + - @backstage/errors@1.1.5 + - @backstage/types@1.0.2 + +## 1.3.0-next.3 + +### Patch Changes + +- d2488f5e54c: Add indication that the validators are running +- 8c40997df44: Updated dependency `@rjsf/core-v5` to `npm:@rjsf/core@5.5.2`. +- Updated dependencies + - @backstage/plugin-catalog-react@1.5.0-next.3 + - @backstage/catalog-model@1.3.0-next.0 + - @backstage/core-components@0.13.0-next.3 + - @backstage/catalog-client@1.4.1-next.1 + - @backstage/core-plugin-api@1.5.1-next.1 + - @backstage/errors@1.1.5 + - @backstage/theme@0.2.19-next.0 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.4-next.0 + - @backstage/plugin-scaffolder-common@1.2.7-next.2 + +## 1.3.0-next.2 + +### Patch Changes + +- 90dda42cfd2: bug: Invert `templateFilter` predicate to align with `Array.filter` +- 34dab7ee7f8: `scaffolder/next`: bump `rjsf` dependencies to `5.5.0` +- 2898b6c8d52: Minor type tweaks for TypeScript 5.0 +- Updated dependencies + - @backstage/catalog-client@1.4.1-next.0 + - @backstage/core-components@0.12.6-next.2 + - @backstage/plugin-catalog-react@1.4.1-next.2 + - @backstage/core-plugin-api@1.5.1-next.1 + - @backstage/catalog-model@1.2.1 + - @backstage/errors@1.1.5 + - @backstage/theme@0.2.19-next.0 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.4-next.0 + - @backstage/plugin-scaffolder-common@1.2.7-next.1 + +## 1.3.0-next.1 + +### Patch Changes + +- 1e4f5e91b8e: Bump `zod` and `zod-to-json-schema` dependencies. +- e0c6e8b9c3c: Update peer dependencies +- Updated dependencies + - @backstage/core-components@0.12.6-next.1 + - @backstage/plugin-scaffolder-common@1.2.7-next.1 + - @backstage/core-plugin-api@1.5.1-next.0 + - @backstage/version-bridge@1.0.4-next.0 + - @backstage/plugin-catalog-react@1.4.1-next.1 + - @backstage/theme@0.2.19-next.0 + - @backstage/catalog-client@1.4.0 + - @backstage/catalog-model@1.2.1 + - @backstage/errors@1.1.5 + - @backstage/types@1.0.2 + +## 1.3.0-next.0 + +### Minor Changes + +- 259d3407b9b: Move `CategoryPicker` from `scaffolder` into `scaffolder-react` + Move `ContextMenu` into `scaffolder-react` and rename it to `ScaffolderPageContextMenu` +- 2cfd03d7376: To offer better customization options, `ScaffolderPageContextMenu` takes callbacks as props instead of booleans +- 48da4c46e45: `scaffolder/next`: Export the `TemplateGroupFilter` and `TemplateGroups` and make an extensible component + +### Patch Changes + +- e27ddc36dad: Added a possibility to cancel the running task (executing of a scaffolder template) +- 7a6b16cc506: `scaffolder/next`: Bump `@rjsf/*` deps to 5.3.1 +- f84fc7fd040: Updated dependency `@rjsf/validator-ajv8` to `5.3.0`. +- 8e00acb28db: Small tweaks to remove warnings in the console during development (mainly focusing on techdocs) +- Updated dependencies + - @backstage/plugin-scaffolder-common@1.2.7-next.0 + - @backstage/core-components@0.12.6-next.0 + - @backstage/plugin-catalog-react@1.4.1-next.0 + - @backstage/core-plugin-api@1.5.0 + - @backstage/catalog-client@1.4.0 + - @backstage/catalog-model@1.2.1 + - @backstage/errors@1.1.5 + - @backstage/theme@0.2.18 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.3 + +## 1.2.0 + +### Minor Changes + +- 8f4d13f21cf: Move `useTaskStream`, `TaskBorder`, `TaskLogStream` and `TaskSteps` into `scaffolder-react`. + +### Patch Changes + +- 65454876fb2: Minor API report tweaks +- 3c96e77b513: Make scaffolder adhere to page themes by using page `fontColor` consistently. If your theme overwrites template list or card headers, review those styles. +- c8d78b9ae9d: fix bug with `hasErrors` returning false when dealing with empty objects +- 9b8c374ace5: Remove timer for skipped steps in Scaffolder Next's TaskSteps +- 44941fc97eb: scaffolder/next: Move the `uiSchema` to its own property in the validation `context` to align with component development and access of `ui:options` +- d9893263ba9: scaffolder/next: Fix for steps without properties +- 928a12a9b3e: Internal refactor of `/alpha` exports. +- cc418d652a7: scaffolder/next: Added the ability to get the fields definition in the schema in the validation function +- d4100d0ec42: Fix alignment bug for owners on `TemplateCard` +- Updated dependencies + - @backstage/catalog-client@1.4.0 + - @backstage/core-components@0.12.5 + - @backstage/plugin-catalog-react@1.4.0 + - @backstage/errors@1.1.5 + - @backstage/core-plugin-api@1.5.0 + - @backstage/catalog-model@1.2.1 + - @backstage/theme@0.2.18 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.3 + - @backstage/plugin-scaffolder-common@1.2.6 + +## 1.2.0-next.2 + +### Patch Changes + +- 65454876fb2: Minor API report tweaks +- 3c96e77b513: Make scaffolder adhere to page themes by using page `fontColor` consistently. If your theme overwrites template list or card headers, review those styles. +- d9893263ba9: scaffolder/next: Fix for steps without properties +- Updated dependencies + - @backstage/core-components@0.12.5-next.2 + - @backstage/plugin-catalog-react@1.4.0-next.2 + - @backstage/core-plugin-api@1.5.0-next.2 + +## 1.2.0-next.1 + +### Minor Changes + +- 8f4d13f21cf: Move `useTaskStream`, `TaskBorder`, `TaskLogStream` and `TaskSteps` into `scaffolder-react`. + +### Patch Changes + +- 44941fc97eb: scaffolder/next: Move the `uiSchema` to its own property in the validation `context` to align with component development and access of `ui:options` +- Updated dependencies + - @backstage/core-components@0.12.5-next.1 + - @backstage/errors@1.1.5-next.0 + - @backstage/catalog-client@1.4.0-next.1 + - @backstage/core-plugin-api@1.4.1-next.1 + - @backstage/theme@0.2.18-next.0 + - @backstage/plugin-catalog-react@1.4.0-next.1 + - @backstage/catalog-model@1.2.1-next.1 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.3 + - @backstage/plugin-scaffolder-common@1.2.6-next.1 + +## 1.1.1-next.0 + +### Patch Changes + +- c8d78b9ae9: fix bug with `hasErrors` returning false when dealing with empty objects +- 928a12a9b3: Internal refactor of `/alpha` exports. +- cc418d652a: scaffolder/next: Added the ability to get the fields definition in the schema in the validation function +- d4100d0ec4: Fix alignment bug for owners on `TemplateCard` +- Updated dependencies + - @backstage/catalog-client@1.4.0-next.0 + - @backstage/plugin-catalog-react@1.4.0-next.0 + - @backstage/core-plugin-api@1.4.1-next.0 + - @backstage/catalog-model@1.2.1-next.0 + - @backstage/core-components@0.12.5-next.0 + - @backstage/errors@1.1.4 + - @backstage/theme@0.2.17 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.3 + - @backstage/plugin-scaffolder-common@1.2.6-next.0 + +## 1.1.0 + +### Minor Changes + +- a07750745b: Added `DescriptionField` field override to the `next/scaffolder` +- a521379688: Migrating the `TemplateEditorPage` to work with the new components from `@backstage/plugin-scaffolder-react` +- 8c2966536b: Embed scaffolder workflow in other components +- 5555e17313: refactor `createAsyncValidators` to be recursive to ensure validators are called in nested schemas. + +### Patch Changes + +- 04f717a8e1: `scaffolder/next`: bump `react-jsonschema-form` libraries to `v5-stable` +- b46f385eff: scaffolder/next: Implementing a simple `OngoingTask` page +- cbab8ac107: lock versions of `@rjsf/*-beta` packages +- 346d6b6630: Upgrade `@rjsf` version 5 dependencies to `beta.18` +- ccbf91051b: bump `@rjsf` `v5` dependencies to 5.1.0 +- d2ddde2108: Add `ScaffolderLayouts` to `NextScaffolderPage` +- Updated dependencies + - @backstage/core-components@0.12.4 + - @backstage/catalog-model@1.2.0 + - @backstage/theme@0.2.17 + - @backstage/core-plugin-api@1.4.0 + - @backstage/plugin-catalog-react@1.3.0 + - @backstage/catalog-client@1.3.1 + - @backstage/errors@1.1.4 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.3 + - @backstage/plugin-scaffolder-common@1.2.5 + +## 1.1.0-next.2 + +### Minor Changes + +- 5555e17313: refactor `createAsyncValidators` to be recursive to ensure validators are called in nested schemas. + +### Patch Changes + +- b46f385eff: scaffolder/next: Implementing a simple `OngoingTask` page +- ccbf91051b: bump `@rjsf` `v5` dependencies to 5.1.0 +- Updated dependencies + - @backstage/catalog-model@1.2.0-next.1 + - @backstage/core-components@0.12.4-next.1 + - @backstage/catalog-client@1.3.1-next.1 + - @backstage/core-plugin-api@1.3.0 + - @backstage/errors@1.1.4 + - @backstage/theme@0.2.16 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.3 + - @backstage/plugin-catalog-react@1.3.0-next.2 + - @backstage/plugin-scaffolder-common@1.2.5-next.1 + +## 1.1.0-next.1 + +### Patch Changes + +- 04f717a8e1: `scaffolder/next`: bump `react-jsonschema-form` libraries to `v5-stable` +- 346d6b6630: Upgrade `@rjsf` version 5 dependencies to `beta.18` +- Updated dependencies + - @backstage/core-components@0.12.4-next.0 + - @backstage/plugin-catalog-react@1.3.0-next.1 + - @backstage/catalog-client@1.3.1-next.0 + - @backstage/catalog-model@1.1.6-next.0 + - @backstage/core-plugin-api@1.3.0 + - @backstage/errors@1.1.4 + - @backstage/theme@0.2.16 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.3 + - @backstage/plugin-scaffolder-common@1.2.5-next.0 + +## 1.1.0-next.0 + +### Minor Changes + +- 8c2966536b: Embed scaffolder workflow in other components + +### Patch Changes + +- cbab8ac107: lock versions of `@rjsf/*-beta` packages +- d2ddde2108: Add `ScaffolderLayouts` to `NextScaffolderPage` +- Updated dependencies + - @backstage/plugin-catalog-react@1.3.0-next.0 + - @backstage/catalog-model@1.1.6-next.0 + - @backstage/catalog-client@1.3.1-next.0 + - @backstage/plugin-scaffolder-common@1.2.5-next.0 + +## 1.0.0 + +### Major Changes + +- b4955ed7b9: Re-home some of the common types, components, hooks and `scaffolderApiRef` for the `@backstage/plugin-scaffolder` to this package for easy re-use across things that want to interact with the `scaffolder`. + +### Patch Changes + +- Updated dependencies + - @backstage/catalog-model@1.1.5 + - @backstage/plugin-scaffolder-common@1.2.4 + - @backstage/catalog-client@1.3.0 + - @backstage/plugin-catalog-react@1.2.4 + - @backstage/core-components@0.12.3 + - @backstage/core-plugin-api@1.3.0 + - @backstage/errors@1.1.4 + - @backstage/theme@0.2.16 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.3 + +## 1.0.0-next.0 + +### Major Changes + +- b4955ed7b9: Re-home some of the common types, components, hooks and `scaffolderApiRef` for the `@backstage/plugin-scaffolder` to this package for easy re-use across things that want to interact with the `scaffolder`. + +### Patch Changes + +- Updated dependencies + - @backstage/core-plugin-api@1.3.0-next.1 + - @backstage/catalog-client@1.3.0-next.2 + - @backstage/plugin-catalog-react@1.2.4-next.2 + - @backstage/catalog-model@1.1.5-next.1 + - @backstage/core-components@0.12.3-next.2 + - @backstage/errors@1.1.4 + - @backstage/theme@0.2.16 + - @backstage/types@1.0.2 + - @backstage/version-bridge@1.0.3 + - @backstage/plugin-scaffolder-common@1.2.4-next.1 + in the review step label +- bcec60f: updated the ContextMenu, ActionsPage, OngoingTask and TemplateCard frontend components to support the new scaffolder permissions: + + - `scaffolder.task.create` + - `scaffolder.task.cancel` + - `scaffolder.task.read` + +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/plugin-scaffolder-common@1.5.3 + - @backstage/plugin-permission-react@0.4.23 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + ## 1.8.7-next.3 ### Patch Changes diff --git a/plugins/scaffolder-react/package.json b/plugins/scaffolder-react/package.json index 86406fd915..4bb86ca98d 100644 --- a/plugins/scaffolder-react/package.json +++ b/plugins/scaffolder-react/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-react", - "version": "1.8.7-next.3", + "version": "1.9.0", "description": "A frontend library that helps other Backstage plugins interact with the Scaffolder", "backstage": { "role": "web-library", diff --git a/plugins/scaffolder/CHANGELOG.md b/plugins/scaffolder/CHANGELOG.md index f42ddfa0e1..43e1d5eab7 100644 --- a/plugins/scaffolder/CHANGELOG.md +++ b/plugins/scaffolder/CHANGELOG.md @@ -1,5 +1,79 @@ # @backstage/plugin-scaffolder +## 1.21.0 + +### Minor Changes + +- d57ebbc: Changed the way to display entities in EntityPicker to use entityPresentationApi instead of humanizeEntityRef +- 62bd9eb: Replace `ui:widget: password` with the a warning message stating that it's not secure and to use the build in `SecretField`. + + You can do this by updating your `template.yaml` files that have the reference `ui:widget: password` to `ui:field: Secret` instead. + + ```diff + apiVersion: backstage.io/v1alpha1 + kind: Template + metadata: + ... + + spec: + parameters: + - title: collect some information + schema: + type: object + properties: + password: + title: Password + type: string + - ui:widget: password + + ui:field: Secret + steps: + - id: collect-info + name: Collect some information + action: acme:do:something + input: + - password: ${{ parameters.password }} + + password: ${{ secrets.password }} + ``` + +- 60085dd: Added the following default targets for external routes: + + - `registerComponent` binds to the catalog import page. + - `viewTechDoc` binds to the TechDocs entity documentation page. + +### Patch Changes + +- cbebad1: Internal updates to allow reusing Backstage's `fetchApi` implementation for event source requests. This allows you to for example, override the `Authorization` header. +- 1ea7679: Removed waiting for the workspace and repository fields to be filled in before requesting user credentials +- d44a20a: Added additional plugin metadata to `package.json`. +- 6cb4886: Updated dependency `@rjsf/utils` to `5.18.4`. + Updated dependency `@rjsf/core` to `5.18.4`. + Updated dependency `@rjsf/material-ui` to `5.18.4`. + Updated dependency `@rjsf/validator-ajv8` to `5.18.4`. +- 75dcd7e: Fixing bug in `formData` type as it should be `optional` as it's possibly undefined +- bcec60f: updated the ContextMenu, ActionsPage, OngoingTask and TemplateCard frontend components to support the new scaffolder permissions: + + - `scaffolder.task.create` + - `scaffolder.task.cancel` + - `scaffolder.task.read` + +- 612a453: Change owner to project for azure host +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-compat-api@0.2.6 + - @backstage/integration@1.12.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-scaffolder-react@1.9.0 + - @backstage/plugin-scaffolder-common@1.5.3 + - @backstage/plugin-permission-react@0.4.23 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/integration-react@1.1.28 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 1.21.0-next.3 ### Minor Changes diff --git a/plugins/scaffolder/package.json b/plugins/scaffolder/package.json index a209ceb9f3..f2c96eee58 100644 --- a/plugins/scaffolder/package.json +++ b/plugins/scaffolder/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder", - "version": "1.21.0-next.3", + "version": "1.21.0", "description": "The Backstage plugin that helps you create new things", "backstage": { "role": "frontend-plugin", diff --git a/plugins/search-backend-module-catalog/CHANGELOG.md b/plugins/search-backend-module-catalog/CHANGELOG.md index 880053dff5..7e14c40bd6 100644 --- a/plugins/search-backend-module-catalog/CHANGELOG.md +++ b/plugins/search-backend-module-catalog/CHANGELOG.md @@ -1,5 +1,25 @@ # @backstage/plugin-search-backend-module-catalog +## 0.1.25 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-search-backend-node@1.2.24 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-search-common@1.2.12 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.1.25-next.3 ### Patch Changes diff --git a/plugins/search-backend-module-catalog/package.json b/plugins/search-backend-module-catalog/package.json index cf6a9a3e18..7c1d8cb0c0 100644 --- a/plugins/search-backend-module-catalog/package.json +++ b/plugins/search-backend-module-catalog/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-search-backend-module-catalog", - "version": "0.1.25-next.3", + "version": "0.1.25", "description": "A module for the search backend that exports catalog modules", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/search-backend-module-elasticsearch/CHANGELOG.md b/plugins/search-backend-module-elasticsearch/CHANGELOG.md index 81b6dfdeba..5a2d59e43e 100644 --- a/plugins/search-backend-module-elasticsearch/CHANGELOG.md +++ b/plugins/search-backend-module-elasticsearch/CHANGELOG.md @@ -1,5 +1,33 @@ # @backstage/plugin-search-backend-module-elasticsearch +## 1.5.0 + +### Minor Changes + +- b186701: **BREAKING**: The ElasticSearch indexer will now delete stale indices matching the indexer's pattern. + The method `getAliases` of `ElasticSearchClientWrapper` has been deprecated and might be removed in future releases. + + An indexer using the `some-type-index__*` pattern will remove indices matching this pattern after indexation + to prevent stale indices leading to shards exhaustion. + + Before upgrading ensure that the index pattern doesn't match indices that are not managed by Backstage + and thus shouldn't be deleted. + + Note: The ElasticSearch indexer already uses wildcards patterns to remove aliases on these indices. + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 6a576dc: Replace the usage of `getVoidLogger` with `mockServices.logger.mock` in order to remove the dependency with the soon-to-be-deprecated `backend-common` package. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-search-backend-node@1.2.24 + - @backstage/plugin-search-common@1.2.12 + - @backstage/config@1.2.0 + - @backstage/integration-aws-node@0.1.12 + ## 1.4.2-next.3 ### Patch Changes diff --git a/plugins/search-backend-module-elasticsearch/package.json b/plugins/search-backend-module-elasticsearch/package.json index bf6c48910f..6f5d8e3b02 100644 --- a/plugins/search-backend-module-elasticsearch/package.json +++ b/plugins/search-backend-module-elasticsearch/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-search-backend-module-elasticsearch", - "version": "1.4.2-next.3", + "version": "1.5.0", "description": "A module for the search backend that implements search using ElasticSearch", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/search-backend-module-explore/CHANGELOG.md b/plugins/search-backend-module-explore/CHANGELOG.md index 9ce0c3ce31..f16e3019c3 100644 --- a/plugins/search-backend-module-explore/CHANGELOG.md +++ b/plugins/search-backend-module-explore/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-search-backend-module-explore +## 0.1.25 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-search-backend-node@1.2.24 + - @backstage/plugin-search-common@1.2.12 + - @backstage/config@1.2.0 + ## 0.1.25-next.3 ### Patch Changes diff --git a/plugins/search-backend-module-explore/package.json b/plugins/search-backend-module-explore/package.json index 88239e5853..d1960f1f01 100644 --- a/plugins/search-backend-module-explore/package.json +++ b/plugins/search-backend-module-explore/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-search-backend-module-explore", - "version": "0.1.25-next.3", + "version": "0.1.25", "description": "A module for the search backend that exports explore modules", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/search-backend-module-pg/CHANGELOG.md b/plugins/search-backend-module-pg/CHANGELOG.md index f02ea765b4..bd0d338f71 100644 --- a/plugins/search-backend-module-pg/CHANGELOG.md +++ b/plugins/search-backend-module-pg/CHANGELOG.md @@ -1,5 +1,20 @@ # @backstage/plugin-search-backend-module-pg +## 0.5.28 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 6a576dc: Replace the usage of `getVoidLogger` with `mockServices.logger.mock` in order to remove the dependency with the soon-to-be-deprecated `backend-common` package. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-app-api@0.7.6 + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-search-backend-node@1.2.24 + - @backstage/plugin-search-common@1.2.12 + - @backstage/config@1.2.0 + ## 0.5.28-next.3 ### Patch Changes diff --git a/plugins/search-backend-module-pg/package.json b/plugins/search-backend-module-pg/package.json index 236adaac63..114fde5f37 100644 --- a/plugins/search-backend-module-pg/package.json +++ b/plugins/search-backend-module-pg/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-search-backend-module-pg", - "version": "0.5.28-next.3", + "version": "0.5.28", "description": "A module for the search backend that implements search using PostgreSQL", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/search-backend-module-stack-overflow-collator/CHANGELOG.md b/plugins/search-backend-module-stack-overflow-collator/CHANGELOG.md index 10705399e0..a435215096 100644 --- a/plugins/search-backend-module-stack-overflow-collator/CHANGELOG.md +++ b/plugins/search-backend-module-stack-overflow-collator/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-search-backend-module-stack-overflow-collator +## 0.1.12 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-search-backend-node@1.2.24 + - @backstage/plugin-search-common@1.2.12 + - @backstage/config@1.2.0 + ## 0.1.12-next.3 ### Patch Changes diff --git a/plugins/search-backend-module-stack-overflow-collator/package.json b/plugins/search-backend-module-stack-overflow-collator/package.json index b35262a949..c817100356 100644 --- a/plugins/search-backend-module-stack-overflow-collator/package.json +++ b/plugins/search-backend-module-stack-overflow-collator/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-search-backend-module-stack-overflow-collator", - "version": "0.1.12-next.3", + "version": "0.1.12", "description": "A module for the search backend that exports stack overflow modules", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/search-backend-module-techdocs/CHANGELOG.md b/plugins/search-backend-module-techdocs/CHANGELOG.md index d3173bcf2c..e6ec7acec3 100644 --- a/plugins/search-backend-module-techdocs/CHANGELOG.md +++ b/plugins/search-backend-module-techdocs/CHANGELOG.md @@ -1,5 +1,25 @@ # @backstage/plugin-search-backend-module-techdocs +## 0.1.24 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-techdocs-node@1.12.5 + - @backstage/plugin-catalog-node@1.12.1 + - @backstage/plugin-search-backend-node@1.2.24 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-search-common@1.2.12 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + ## 0.1.24-next.3 ### Patch Changes diff --git a/plugins/search-backend-module-techdocs/package.json b/plugins/search-backend-module-techdocs/package.json index 5646ac0b6d..ffb4eb0042 100644 --- a/plugins/search-backend-module-techdocs/package.json +++ b/plugins/search-backend-module-techdocs/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-search-backend-module-techdocs", - "version": "0.1.24-next.3", + "version": "0.1.24", "description": "A module for the search backend that exports techdocs modules", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/search-backend-node/CHANGELOG.md b/plugins/search-backend-node/CHANGELOG.md index 87f7db5616..9ff9f409e7 100644 --- a/plugins/search-backend-node/CHANGELOG.md +++ b/plugins/search-backend-node/CHANGELOG.md @@ -1,5 +1,21 @@ # @backstage/plugin-search-backend-node +## 1.2.24 + +### Patch Changes + +- 6a576dc: Replace the usage of `getVoidLogger` with `mockServices.logger.mock` in order to remove the dependency with the soon-to-be-deprecated `backend-common` package. +- d44a20a: Added additional plugin metadata to `package.json`. +- 5b6f979: Split backend search plugin startup into "init" and "start" stages to ensure necessary initialization has happened before startup +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-tasks@0.5.24 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-search-common@1.2.12 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 1.2.24-next.3 ### Patch Changes diff --git a/plugins/search-backend-node/package.json b/plugins/search-backend-node/package.json index 932404902e..4298ea10ff 100644 --- a/plugins/search-backend-node/package.json +++ b/plugins/search-backend-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-search-backend-node", - "version": "1.2.24-next.3", + "version": "1.2.24", "description": "A library for Backstage backend plugins that want to interact with the search backend plugin", "backstage": { "role": "node-library", diff --git a/plugins/search-backend/CHANGELOG.md b/plugins/search-backend/CHANGELOG.md index f4e94b34b9..56191eb595 100644 --- a/plugins/search-backend/CHANGELOG.md +++ b/plugins/search-backend/CHANGELOG.md @@ -1,5 +1,27 @@ # @backstage/plugin-search-backend +## 1.5.10 + +### Patch Changes + +- 8869b8e: Updated local development setup. +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- 5b6f979: Split backend search plugin startup into "init" and "start" stages to ensure necessary initialization has happened before startup +- 34dc47d: Move @backstage/repo-tools to devDependencies +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/backend-defaults@0.3.0 + - @backstage/plugin-search-backend-node@1.2.24 + - @backstage/plugin-permission-node@0.7.30 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-search-common@1.2.12 + - @backstage/backend-openapi-utils@0.1.12 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 1.5.10-next.3 ### Patch Changes diff --git a/plugins/search-backend/package.json b/plugins/search-backend/package.json index 1f44819562..513446f170 100644 --- a/plugins/search-backend/package.json +++ b/plugins/search-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-search-backend", - "version": "1.5.10-next.3", + "version": "1.5.10", "description": "The Backstage backend plugin that provides your backstage app with search", "backstage": { "role": "backend-plugin", diff --git a/plugins/search-common/CHANGELOG.md b/plugins/search-common/CHANGELOG.md index e0c9991457..e034c62315 100644 --- a/plugins/search-common/CHANGELOG.md +++ b/plugins/search-common/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-search-common +## 1.2.12 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/plugin-permission-common@0.7.14 + - @backstage/types@1.1.1 + ## 1.2.12-next.0 ### Patch Changes diff --git a/plugins/search-common/package.json b/plugins/search-common/package.json index 19657dee23..61edfd13f3 100644 --- a/plugins/search-common/package.json +++ b/plugins/search-common/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-search-common", - "version": "1.2.12-next.0", + "version": "1.2.12", "description": "Common functionalities for Search, to be shared between various search-enabled plugins", "backstage": { "role": "common-library", diff --git a/plugins/search-react/CHANGELOG.md b/plugins/search-react/CHANGELOG.md index d0ca8d04f6..a8e19d9649 100644 --- a/plugins/search-react/CHANGELOG.md +++ b/plugins/search-react/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-search-react +## 1.7.12 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/plugin-search-common@1.2.12 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + ## 1.7.12-next.2 ### Patch Changes diff --git a/plugins/search-react/package.json b/plugins/search-react/package.json index bca09316da..d2496923d3 100644 --- a/plugins/search-react/package.json +++ b/plugins/search-react/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-search-react", - "version": "1.7.12-next.2", + "version": "1.7.12", "backstage": { "role": "web-library", "pluginId": "search", diff --git a/plugins/search/CHANGELOG.md b/plugins/search/CHANGELOG.md index 6d2bcc0418..97f03fb61e 100644 --- a/plugins/search/CHANGELOG.md +++ b/plugins/search/CHANGELOG.md @@ -1,5 +1,23 @@ # @backstage/plugin-search +## 1.4.12 + +### Patch Changes + +- 4f92394: Migrate from identityApi to fetchApi in frontend plugins. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-compat-api@0.2.6 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/plugin-search-common@1.2.12 + - @backstage/plugin-search-react@1.7.12 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + ## 1.4.12-next.3 ### Patch Changes diff --git a/plugins/search/package.json b/plugins/search/package.json index ec5d704e87..68279bfab6 100644 --- a/plugins/search/package.json +++ b/plugins/search/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-search", - "version": "1.4.12-next.3", + "version": "1.4.12", "description": "The Backstage plugin that provides your backstage app with search", "backstage": { "role": "frontend-plugin", diff --git a/plugins/signals-backend/CHANGELOG.md b/plugins/signals-backend/CHANGELOG.md index aed8136b7b..068c2be032 100644 --- a/plugins/signals-backend/CHANGELOG.md +++ b/plugins/signals-backend/CHANGELOG.md @@ -1,5 +1,21 @@ # @backstage/plugin-signals-backend +## 0.1.5 + +### Patch Changes + +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 6a576dc: Replace the usage of `getVoidLogger` with `mockServices.logger.mock` in order to remove the dependency with the soon-to-be-deprecated `backend-common` package. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-events-node@0.3.5 + - @backstage/plugin-signals-node@0.1.5 + - @backstage/config@1.2.0 + - @backstage/types@1.1.1 + ## 0.1.5-next.3 ### Patch Changes diff --git a/plugins/signals-backend/package.json b/plugins/signals-backend/package.json index 33fd9e5020..420a5f7a93 100644 --- a/plugins/signals-backend/package.json +++ b/plugins/signals-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-signals-backend", - "version": "0.1.5-next.3", + "version": "0.1.5", "backstage": { "role": "backend-plugin", "pluginId": "signals", diff --git a/plugins/signals-node/CHANGELOG.md b/plugins/signals-node/CHANGELOG.md index 3563cbd5e2..825a9f9e04 100644 --- a/plugins/signals-node/CHANGELOG.md +++ b/plugins/signals-node/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-signals-node +## 0.1.5 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-events-node@0.3.5 + - @backstage/config@1.2.0 + - @backstage/types@1.1.1 + ## 0.1.5-next.3 ### Patch Changes diff --git a/plugins/signals-node/package.json b/plugins/signals-node/package.json index eb40dc897a..3a000d8fdd 100644 --- a/plugins/signals-node/package.json +++ b/plugins/signals-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-signals-node", - "version": "0.1.5-next.3", + "version": "0.1.5", "description": "Node.js library for the signals plugin", "backstage": { "role": "node-library", diff --git a/plugins/signals-react/CHANGELOG.md b/plugins/signals-react/CHANGELOG.md index 12810ba0b0..7d2af3c4d6 100644 --- a/plugins/signals-react/CHANGELOG.md +++ b/plugins/signals-react/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-signals-react +## 0.0.4 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-plugin-api@1.9.3 + - @backstage/types@1.1.1 + ## 0.0.4-next.1 ### Patch Changes diff --git a/plugins/signals-react/package.json b/plugins/signals-react/package.json index 7ea1bbafcd..b970c8e5dd 100644 --- a/plugins/signals-react/package.json +++ b/plugins/signals-react/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-signals-react", - "version": "0.0.4-next.1", + "version": "0.0.4", "description": "Web library for the signals plugin", "backstage": { "role": "web-library", diff --git a/plugins/signals/CHANGELOG.md b/plugins/signals/CHANGELOG.md index 6c35f82895..406f2d5a2d 100644 --- a/plugins/signals/CHANGELOG.md +++ b/plugins/signals/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-signals +## 0.0.7 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/plugin-signals-react@0.0.4 + - @backstage/types@1.1.1 + ## 0.0.7-next.2 ### Patch Changes diff --git a/plugins/signals/package.json b/plugins/signals/package.json index c19f9cd3dc..bda5c4bcac 100644 --- a/plugins/signals/package.json +++ b/plugins/signals/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-signals", - "version": "0.0.7-next.2", + "version": "0.0.7", "backstage": { "role": "frontend-plugin", "pluginId": "signals", diff --git a/plugins/techdocs-addons-test-utils/CHANGELOG.md b/plugins/techdocs-addons-test-utils/CHANGELOG.md index 67c17b6e9d..323053ee29 100644 --- a/plugins/techdocs-addons-test-utils/CHANGELOG.md +++ b/plugins/techdocs-addons-test-utils/CHANGELOG.md @@ -1,5 +1,21 @@ # @backstage/plugin-techdocs-addons-test-utils +## 1.0.33 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/plugin-techdocs@1.10.6 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-techdocs-react@1.2.5 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/plugin-search-react@1.7.12 + - @backstage/plugin-catalog@1.21.0 + - @backstage/core-app-api@1.12.6 + - @backstage/integration-react@1.1.28 + - @backstage/test-utils@1.5.6 + ## 1.0.33-next.2 ### Patch Changes diff --git a/plugins/techdocs-addons-test-utils/package.json b/plugins/techdocs-addons-test-utils/package.json index b805b05ae7..e21b7efdab 100644 --- a/plugins/techdocs-addons-test-utils/package.json +++ b/plugins/techdocs-addons-test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-techdocs-addons-test-utils", - "version": "1.0.33-next.2", + "version": "1.0.33", "backstage": { "role": "web-library", "pluginId": "techdocs-addons", diff --git a/plugins/techdocs-backend/CHANGELOG.md b/plugins/techdocs-backend/CHANGELOG.md index 05d8f1fd46..2bfb317da5 100644 --- a/plugins/techdocs-backend/CHANGELOG.md +++ b/plugins/techdocs-backend/CHANGELOG.md @@ -1,5 +1,27 @@ # @backstage/plugin-techdocs-backend +## 1.10.6 + +### Patch Changes + +- e64bfb2: Allow defining custom build log transport for techdocs builder +- 8869b8e: Updated local development setup. +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- 2110d76: Removed `dockerode` dependency. +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-techdocs-node@1.12.5 + - @backstage/integration@1.12.0 + - @backstage/plugin-search-backend-module-techdocs@0.1.24 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 1.10.6-next.3 ### Patch Changes diff --git a/plugins/techdocs-backend/package.json b/plugins/techdocs-backend/package.json index 3346214371..081b8ab46d 100644 --- a/plugins/techdocs-backend/package.json +++ b/plugins/techdocs-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-techdocs-backend", - "version": "1.10.6-next.3", + "version": "1.10.6", "description": "The Backstage backend plugin that renders technical documentation for your components", "backstage": { "role": "backend-plugin", diff --git a/plugins/techdocs-module-addons-contrib/CHANGELOG.md b/plugins/techdocs-module-addons-contrib/CHANGELOG.md index a5631f2492..50fc80dc51 100644 --- a/plugins/techdocs-module-addons-contrib/CHANGELOG.md +++ b/plugins/techdocs-module-addons-contrib/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-techdocs-module-addons-contrib +## 1.1.11 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/integration@1.12.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/plugin-techdocs-react@1.2.5 + - @backstage/integration-react@1.1.28 + ## 1.1.11-next.2 ### Patch Changes diff --git a/plugins/techdocs-module-addons-contrib/package.json b/plugins/techdocs-module-addons-contrib/package.json index 1b456ec300..1bc6b81393 100644 --- a/plugins/techdocs-module-addons-contrib/package.json +++ b/plugins/techdocs-module-addons-contrib/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-techdocs-module-addons-contrib", - "version": "1.1.11-next.2", + "version": "1.1.11", "description": "Plugin module for contributed TechDocs Addons", "backstage": { "role": "frontend-plugin-module", diff --git a/plugins/techdocs-node/CHANGELOG.md b/plugins/techdocs-node/CHANGELOG.md index 0c15e12faf..5eb1e136d5 100644 --- a/plugins/techdocs-node/CHANGELOG.md +++ b/plugins/techdocs-node/CHANGELOG.md @@ -1,5 +1,23 @@ # @backstage/plugin-techdocs-node +## 1.12.5 + +### Patch Changes + +- e64bfb2: Allow defining custom build log transport for techdocs builder +- 48c38f0: `TechdocsGenerator` won't require a `containerRunner` option anymore for generating TechDocs in docker. +- d44a20a: Added additional plugin metadata to `package.json`. +- 5db7536: Updated `getRepoUrlFromLocationAnnotation` to check for Harness SCM integration +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/integration@1.12.0 + - @backstage/plugin-search-common@1.2.12 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/integration-aws-node@0.1.12 + ## 1.12.5-next.3 ### Patch Changes diff --git a/plugins/techdocs-node/package.json b/plugins/techdocs-node/package.json index 8b7f87b230..ea88766af8 100644 --- a/plugins/techdocs-node/package.json +++ b/plugins/techdocs-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-techdocs-node", - "version": "1.12.5-next.3", + "version": "1.12.5", "description": "Common node.js functionalities for TechDocs, to be shared between techdocs-backend plugin and techdocs-cli", "backstage": { "role": "node-library", diff --git a/plugins/techdocs-react/CHANGELOG.md b/plugins/techdocs-react/CHANGELOG.md index 8a681308d5..19fce86d6f 100644 --- a/plugins/techdocs-react/CHANGELOG.md +++ b/plugins/techdocs-react/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-techdocs-react +## 1.2.5 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-plugin-api@1.9.3 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/version-bridge@1.0.8 + ## 1.2.5-next.2 ### Patch Changes diff --git a/plugins/techdocs-react/package.json b/plugins/techdocs-react/package.json index 233ec010bc..05bd66a014 100644 --- a/plugins/techdocs-react/package.json +++ b/plugins/techdocs-react/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-techdocs-react", - "version": "1.2.5-next.2", + "version": "1.2.5", "description": "Shared frontend utilities for TechDocs and Addons", "backstage": { "role": "web-library", diff --git a/plugins/techdocs/CHANGELOG.md b/plugins/techdocs/CHANGELOG.md index 4065b4f341..3701cb652d 100644 --- a/plugins/techdocs/CHANGELOG.md +++ b/plugins/techdocs/CHANGELOG.md @@ -1,5 +1,32 @@ # @backstage/plugin-techdocs +## 1.10.6 + +### Patch Changes + +- 654af4a: mkdocs-material have updated their CSS variable template, and a few are unset in Backstage. This patch adds the missing variables to ensure coverage. +- cbebad1: Internal updates to allow reusing Backstage's `fetchApi` implementation for event source requests. This allows you to for example, override the `Authorization` header. +- 96cd13e: `TechDocsIndexPage` now accepts an optional `ownerPickerMode` for toggling the behavior of the `EntityOwnerPicker`, exposing a new mode `` particularly suitable for larger catalogs. In this new mode, `EntityOwnerPicker` will display all the users and groups present in the catalog. +- e40bd9a: Fixed bug in `CopyToClipboardButton` component where positioning of the "Copy to clipboard" button in techdocs code snippets was broken in some cases. +- d44a20a: Added additional plugin metadata to `package.json`. +- 1256d88: Fixed an issue preventing the `TechDocsSearchBar` component from opening when clicking on the arrow icon. +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-compat-api@0.2.6 + - @backstage/integration@1.12.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/plugin-techdocs-react@1.2.5 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/plugin-search-common@1.2.12 + - @backstage/plugin-search-react@1.7.12 + - @backstage/plugin-auth-react@0.1.3 + - @backstage/integration-react@1.1.28 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 1.10.6-next.2 ### Patch Changes diff --git a/plugins/techdocs/package.json b/plugins/techdocs/package.json index 2ec4ff38f0..194a8575d0 100644 --- a/plugins/techdocs/package.json +++ b/plugins/techdocs/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-techdocs", - "version": "1.10.6-next.2", + "version": "1.10.6", "description": "The Backstage plugin that renders technical documentation for your components", "backstage": { "role": "frontend-plugin", diff --git a/plugins/user-settings-backend/CHANGELOG.md b/plugins/user-settings-backend/CHANGELOG.md index bddd6f9fb3..489315b458 100644 --- a/plugins/user-settings-backend/CHANGELOG.md +++ b/plugins/user-settings-backend/CHANGELOG.md @@ -1,5 +1,23 @@ # @backstage/plugin-user-settings-backend +## 0.2.18 + +### Patch Changes + +- 8869b8e: Updated local development setup. +- 78a0b08: Internal refactor to handle `BackendFeature` contract change. +- d44a20a: Added additional plugin metadata to `package.json`. +- e6ec179: Use signals to update user settings across sessions +- Updated dependencies + - @backstage/backend-common@0.23.0 + - @backstage/backend-plugin-api@0.6.19 + - @backstage/plugin-auth-node@0.4.14 + - @backstage/plugin-user-settings-common@0.0.1 + - @backstage/plugin-signals-node@0.1.5 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.2.18-next.3 ### Patch Changes diff --git a/plugins/user-settings-backend/package.json b/plugins/user-settings-backend/package.json index e08e63ad05..556b0d3e4a 100644 --- a/plugins/user-settings-backend/package.json +++ b/plugins/user-settings-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-user-settings-backend", - "version": "0.2.18-next.3", + "version": "0.2.18", "description": "The Backstage backend plugin to manage user settings", "backstage": { "role": "backend-plugin", diff --git a/plugins/user-settings-common/CHANGELOG.md b/plugins/user-settings-common/CHANGELOG.md index 768c2af894..652a308252 100644 --- a/plugins/user-settings-common/CHANGELOG.md +++ b/plugins/user-settings-common/CHANGELOG.md @@ -1,5 +1,12 @@ # @backstage/plugin-user-settings-common +## 0.0.1 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- e6ec179: Use signals to update user settings across sessions + ## 0.0.1-next.0 ### Patch Changes diff --git a/plugins/user-settings-common/package.json b/plugins/user-settings-common/package.json index f9a6b32d93..82c5db84f1 100644 --- a/plugins/user-settings-common/package.json +++ b/plugins/user-settings-common/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-user-settings-common", - "version": "0.0.1-next.0", + "version": "0.0.1", "description": "Common functionalities for the user-settings plugin", "backstage": { "role": "common-library", diff --git a/plugins/user-settings/CHANGELOG.md b/plugins/user-settings/CHANGELOG.md index e373503785..bde8fa4408 100644 --- a/plugins/user-settings/CHANGELOG.md +++ b/plugins/user-settings/CHANGELOG.md @@ -1,5 +1,24 @@ # @backstage/plugin-user-settings +## 0.8.7 + +### Patch Changes + +- d44a20a: Added additional plugin metadata to `package.json`. +- e6ec179: Use signals to update user settings across sessions +- Updated dependencies + - @backstage/core-components@0.14.8 + - @backstage/core-compat-api@0.2.6 + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/plugin-user-settings-common@0.0.1 + - @backstage/plugin-catalog-react@1.12.1 + - @backstage/plugin-signals-react@0.0.4 + - @backstage/core-app-api@1.12.6 + - @backstage/frontend-plugin-api@0.6.6 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.8.7-next.2 ### Patch Changes diff --git a/plugins/user-settings/package.json b/plugins/user-settings/package.json index 1d2fd3131c..05d594d85e 100644 --- a/plugins/user-settings/package.json +++ b/plugins/user-settings/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-user-settings", - "version": "0.8.7-next.2", + "version": "0.8.7", "description": "A Backstage plugin that provides a settings page", "backstage": { "role": "frontend-plugin", diff --git a/yarn.lock b/yarn.lock index 00817bfb22..b02c102c14 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3828,7 +3828,7 @@ __metadata: languageName: unknown linkType: soft -"@backstage/catalog-client@^1.6.5, @backstage/catalog-client@workspace:^, @backstage/catalog-client@workspace:packages/catalog-client": +"@backstage/catalog-client@workspace:^, @backstage/catalog-client@workspace:packages/catalog-client": version: 0.0.0-use.local resolution: "@backstage/catalog-client@workspace:packages/catalog-client" dependencies: @@ -3841,7 +3841,7 @@ __metadata: languageName: unknown linkType: soft -"@backstage/catalog-model@^1.4.3, @backstage/catalog-model@^1.4.5, @backstage/catalog-model@^1.5.0, @backstage/catalog-model@workspace:^, @backstage/catalog-model@workspace:packages/catalog-model": +"@backstage/catalog-model@^1.4.3, @backstage/catalog-model@^1.4.5, @backstage/catalog-model@workspace:^, @backstage/catalog-model@workspace:packages/catalog-model": version: 0.0.0-use.local resolution: "@backstage/catalog-model@workspace:packages/catalog-model" dependencies: @@ -4093,7 +4093,7 @@ __metadata: languageName: unknown linkType: soft -"@backstage/config@^1.1.1, @backstage/config@^1.2.0, @backstage/config@workspace:^, @backstage/config@workspace:packages/config": +"@backstage/config@^1.1.1, @backstage/config@workspace:^, @backstage/config@workspace:packages/config": version: 0.0.0-use.local resolution: "@backstage/config@workspace:packages/config" dependencies: @@ -4165,107 +4165,7 @@ __metadata: languageName: unknown linkType: soft -"@backstage/core-components@npm:^0.13.10": - version: 0.13.10 - resolution: "@backstage/core-components@npm:0.13.10" - dependencies: - "@backstage/config": ^1.1.1 - "@backstage/core-plugin-api": ^1.8.2 - "@backstage/errors": ^1.2.3 - "@backstage/theme": ^0.5.0 - "@backstage/version-bridge": ^1.0.7 - "@date-io/core": ^1.3.13 - "@material-table/core": ^3.1.0 - "@material-ui/core": ^4.12.2 - "@material-ui/icons": ^4.9.1 - "@material-ui/lab": 4.0.0-alpha.61 - "@react-hookz/web": ^23.0.0 - "@types/react": ^16.13.1 || ^17.0.0 - "@types/react-sparklines": ^1.7.0 - "@types/react-text-truncate": ^0.14.0 - ansi-regex: ^6.0.1 - classnames: ^2.2.6 - d3-selection: ^3.0.0 - d3-shape: ^3.0.0 - d3-zoom: ^3.0.0 - dagre: ^0.8.5 - linkify-react: 4.1.3 - linkifyjs: 4.1.3 - lodash: ^4.17.21 - pluralize: ^8.0.0 - qs: ^6.9.4 - rc-progress: 3.5.1 - react-helmet: 6.1.0 - react-hook-form: ^7.12.2 - react-idle-timer: 5.6.2 - react-markdown: ^8.0.0 - react-sparklines: ^1.7.0 - react-syntax-highlighter: ^15.4.5 - react-text-truncate: ^0.19.0 - react-use: ^17.3.2 - react-virtualized-auto-sizer: ^1.0.11 - react-window: ^1.8.6 - remark-gfm: ^3.0.1 - zen-observable: ^0.10.0 - zod: ^3.22.4 - peerDependencies: - react: ^16.13.1 || ^17.0.0 || ^18.0.0 - react-dom: ^16.13.1 || ^17.0.0 || ^18.0.0 - react-router-dom: 6.0.0-beta.0 || ^6.3.0 - checksum: ec2a0d0a27bc4d6b9d4da97f0b4df600148529ee51bf2c8e7d3adc45c3950adac662535d3beabc451db346f2c7e3c412ceaa756fc774012b43dff5e2695f2271 - languageName: node - linkType: hard - -"@backstage/core-components@npm:^0.14.4, @backstage/core-components@npm:^0.14.7": - version: 0.14.7 - resolution: "@backstage/core-components@npm:0.14.7" - dependencies: - "@backstage/config": ^1.2.0 - "@backstage/core-plugin-api": ^1.9.2 - "@backstage/errors": ^1.2.4 - "@backstage/theme": ^0.5.4 - "@backstage/version-bridge": ^1.0.8 - "@date-io/core": ^1.3.13 - "@material-table/core": ^3.1.0 - "@material-ui/core": ^4.12.2 - "@material-ui/icons": ^4.9.1 - "@material-ui/lab": 4.0.0-alpha.61 - "@react-hookz/web": ^24.0.0 - "@types/react": ^16.13.1 || ^17.0.0 || ^18.0.0 - "@types/react-sparklines": ^1.7.0 - ansi-regex: ^6.0.1 - classnames: ^2.2.6 - d3-selection: ^3.0.0 - d3-shape: ^3.0.0 - d3-zoom: ^3.0.0 - dagre: ^0.8.5 - linkify-react: 4.1.3 - linkifyjs: 4.1.3 - lodash: ^4.17.21 - pluralize: ^8.0.0 - qs: ^6.9.4 - rc-progress: 3.5.1 - react-helmet: 6.1.0 - react-hook-form: ^7.12.2 - react-idle-timer: 5.7.2 - react-markdown: ^8.0.0 - react-sparklines: ^1.7.0 - react-syntax-highlighter: ^15.4.5 - react-use: ^17.3.2 - react-virtualized-auto-sizer: ^1.0.11 - react-window: ^1.8.6 - remark-gfm: ^3.0.1 - zen-observable: ^0.10.0 - zod: ^3.22.4 - peerDependencies: - react: ^16.13.1 || ^17.0.0 || ^18.0.0 - react-dom: ^16.13.1 || ^17.0.0 || ^18.0.0 - react-router-dom: 6.0.0-beta.0 || ^6.3.0 - checksum: e3906347c197d741dbff24d20af5cd0117e4bf1667c34a4a3a70d8c0f3c0c92bd768b53c417ca78f8b87560a3623f497938f531be86c8727f83822a11e9aa4e5 - languageName: node - linkType: hard - -"@backstage/core-components@workspace:^, @backstage/core-components@workspace:packages/core-components": +"@backstage/core-components@^0.14.4, @backstage/core-components@workspace:^, @backstage/core-components@workspace:packages/core-components": version: 0.0.0-use.local resolution: "@backstage/core-components@workspace:packages/core-components" dependencies: @@ -4336,25 +4236,58 @@ __metadata: languageName: unknown linkType: soft -"@backstage/core-plugin-api@npm:^1.8.2, @backstage/core-plugin-api@npm:^1.9.2": - version: 1.9.2 - resolution: "@backstage/core-plugin-api@npm:1.9.2" +"@backstage/core-components@npm:^0.13.10": + version: 0.13.10 + resolution: "@backstage/core-components@npm:0.13.10" dependencies: - "@backstage/config": ^1.2.0 - "@backstage/errors": ^1.2.4 - "@backstage/types": ^1.1.1 - "@backstage/version-bridge": ^1.0.8 - "@types/react": ^16.13.1 || ^17.0.0 || ^18.0.0 - history: ^5.0.0 + "@backstage/config": ^1.1.1 + "@backstage/core-plugin-api": ^1.8.2 + "@backstage/errors": ^1.2.3 + "@backstage/theme": ^0.5.0 + "@backstage/version-bridge": ^1.0.7 + "@date-io/core": ^1.3.13 + "@material-table/core": ^3.1.0 + "@material-ui/core": ^4.12.2 + "@material-ui/icons": ^4.9.1 + "@material-ui/lab": 4.0.0-alpha.61 + "@react-hookz/web": ^23.0.0 + "@types/react": ^16.13.1 || ^17.0.0 + "@types/react-sparklines": ^1.7.0 + "@types/react-text-truncate": ^0.14.0 + ansi-regex: ^6.0.1 + classnames: ^2.2.6 + d3-selection: ^3.0.0 + d3-shape: ^3.0.0 + d3-zoom: ^3.0.0 + dagre: ^0.8.5 + linkify-react: 4.1.3 + linkifyjs: 4.1.3 + lodash: ^4.17.21 + pluralize: ^8.0.0 + qs: ^6.9.4 + rc-progress: 3.5.1 + react-helmet: 6.1.0 + react-hook-form: ^7.12.2 + react-idle-timer: 5.6.2 + react-markdown: ^8.0.0 + react-sparklines: ^1.7.0 + react-syntax-highlighter: ^15.4.5 + react-text-truncate: ^0.19.0 + react-use: ^17.3.2 + react-virtualized-auto-sizer: ^1.0.11 + react-window: ^1.8.6 + remark-gfm: ^3.0.1 + zen-observable: ^0.10.0 + zod: ^3.22.4 peerDependencies: react: ^16.13.1 || ^17.0.0 || ^18.0.0 react-dom: ^16.13.1 || ^17.0.0 || ^18.0.0 react-router-dom: 6.0.0-beta.0 || ^6.3.0 - checksum: 2df505c14853b3b35b8644d66f3e58d235bc6ee7f7b81785ec163aa9f089fc03a6c03e3b191d001b247f19d97063e02e585d67661720a8b6a13ab67a2403c218 + checksum: ec2a0d0a27bc4d6b9d4da97f0b4df600148529ee51bf2c8e7d3adc45c3950adac662535d3beabc451db346f2c7e3c412ceaa756fc774012b43dff5e2695f2271 languageName: node linkType: hard -"@backstage/core-plugin-api@workspace:^, @backstage/core-plugin-api@workspace:packages/core-plugin-api": +"@backstage/core-plugin-api@^1.8.2, @backstage/core-plugin-api@^1.9.2, @backstage/core-plugin-api@workspace:^, @backstage/core-plugin-api@workspace:packages/core-plugin-api": version: 0.0.0-use.local resolution: "@backstage/core-plugin-api@workspace:packages/core-plugin-api" dependencies: @@ -4501,26 +4434,6 @@ __metadata: languageName: unknown linkType: soft -"@backstage/frontend-plugin-api@npm:^0.6.5": - version: 0.6.5 - resolution: "@backstage/frontend-plugin-api@npm:0.6.5" - dependencies: - "@backstage/core-components": ^0.14.7 - "@backstage/core-plugin-api": ^1.9.2 - "@backstage/types": ^1.1.1 - "@backstage/version-bridge": ^1.0.8 - "@material-ui/core": ^4.12.4 - "@types/react": ^16.13.1 || ^17.0.0 || ^18.0.0 - lodash: ^4.17.21 - zod: ^3.22.4 - zod-to-json-schema: ^3.21.4 - peerDependencies: - react: ^16.13.1 || ^17.0.0 || ^18.0.0 - react-router-dom: 6.0.0-beta.0 || ^6.3.0 - checksum: be880b5a3bb86d4e2c32a90ca64265b529901dabcdcbf5a87b5cbdfd68fc347297359550da195034e671e074db9db7c659d663d4fd46ed3836896bd1878fae2f - languageName: node - linkType: hard - "@backstage/frontend-plugin-api@workspace:^, @backstage/frontend-plugin-api@workspace:packages/frontend-plugin-api": version: 0.0.0-use.local resolution: "@backstage/frontend-plugin-api@workspace:packages/frontend-plugin-api" @@ -4584,24 +4497,6 @@ __metadata: languageName: unknown linkType: soft -"@backstage/integration-react@npm:^1.1.27": - version: 1.1.27 - resolution: "@backstage/integration-react@npm:1.1.27" - dependencies: - "@backstage/config": ^1.2.0 - "@backstage/core-plugin-api": ^1.9.2 - "@backstage/integration": ^1.11.0 - "@material-ui/core": ^4.12.2 - "@material-ui/icons": ^4.9.1 - "@types/react": ^16.13.1 || ^17.0.0 - peerDependencies: - react: ^16.13.1 || ^17.0.0 || ^18.0.0 - react-dom: ^16.13.1 || ^17.0.0 || ^18.0.0 - react-router-dom: 6.0.0-beta.0 || ^6.3.0 - checksum: 136bdfeb7c4ba91eb2405a82ae99fd5d935056d7fe77064bf799a8d375a2b5c645e0df7deaee7e1e0ad6fb48dcac94c82e4b29e3d3a00f80555116b1902102b2 - languageName: node - linkType: hard - "@backstage/integration-react@workspace:^, @backstage/integration-react@workspace:packages/integration-react": version: 0.0.0-use.local resolution: "@backstage/integration-react@workspace:packages/integration-react" @@ -4626,23 +4521,6 @@ __metadata: languageName: unknown linkType: soft -"@backstage/integration@npm:^1.11.0": - version: 1.11.0 - resolution: "@backstage/integration@npm:1.11.0" - dependencies: - "@azure/identity": ^4.0.0 - "@backstage/config": ^1.2.0 - "@backstage/errors": ^1.2.4 - "@octokit/auth-app": ^4.0.0 - "@octokit/rest": ^19.0.3 - cross-fetch: ^4.0.0 - git-url-parse: ^14.0.0 - lodash: ^4.17.21 - luxon: ^3.0.0 - checksum: 57ea46e57da004cdab41e82f558105f78f84f65d58163e93363dc775d42ab29401d3a38390ace012bf388eec57350d432a415d8fed27e57419e21522044fcc33 - languageName: node - linkType: hard - "@backstage/integration@workspace:^, @backstage/integration@workspace:packages/integration": version: 0.0.0-use.local resolution: "@backstage/integration@workspace:packages/integration" @@ -5715,18 +5593,7 @@ __metadata: languageName: unknown linkType: soft -"@backstage/plugin-catalog-common@npm:^1.0.20, @backstage/plugin-catalog-common@npm:^1.0.23": - version: 1.0.23 - resolution: "@backstage/plugin-catalog-common@npm:1.0.23" - dependencies: - "@backstage/catalog-model": ^1.5.0 - "@backstage/plugin-permission-common": ^0.7.13 - "@backstage/plugin-search-common": ^1.2.11 - checksum: 071456b301689b9b349bdb1bea0d81cc41b0e8055e68096655a0abd198ea21afdc27bda7135d5c800ba8074fbc20d2d8d3a2244578fa8f6547205bee57c31c3d - languageName: node - linkType: hard - -"@backstage/plugin-catalog-common@workspace:^, @backstage/plugin-catalog-common@workspace:plugins/catalog-common": +"@backstage/plugin-catalog-common@^1.0.20, @backstage/plugin-catalog-common@workspace:^, @backstage/plugin-catalog-common@workspace:plugins/catalog-common": version: 0.0.0-use.local resolution: "@backstage/plugin-catalog-common@workspace:plugins/catalog-common" dependencies: @@ -5835,43 +5702,7 @@ __metadata: languageName: unknown linkType: soft -"@backstage/plugin-catalog-react@npm:^1.11.3, @backstage/plugin-catalog-react@npm:^1.9.3": - version: 1.12.0 - resolution: "@backstage/plugin-catalog-react@npm:1.12.0" - dependencies: - "@backstage/catalog-client": ^1.6.5 - "@backstage/catalog-model": ^1.5.0 - "@backstage/core-components": ^0.14.7 - "@backstage/core-plugin-api": ^1.9.2 - "@backstage/errors": ^1.2.4 - "@backstage/frontend-plugin-api": ^0.6.5 - "@backstage/integration-react": ^1.1.27 - "@backstage/plugin-catalog-common": ^1.0.23 - "@backstage/plugin-permission-common": ^0.7.13 - "@backstage/plugin-permission-react": ^0.4.22 - "@backstage/types": ^1.1.1 - "@backstage/version-bridge": ^1.0.8 - "@material-ui/core": ^4.12.2 - "@material-ui/icons": ^4.9.1 - "@material-ui/lab": 4.0.0-alpha.61 - "@react-hookz/web": ^24.0.0 - "@types/react": ^16.13.1 || ^17.0.0 || ^18.0.0 - classnames: ^2.2.6 - lodash: ^4.17.21 - material-ui-popup-state: ^1.9.3 - qs: ^6.9.4 - react-use: ^17.2.4 - yaml: ^2.0.0 - zen-observable: ^0.10.0 - peerDependencies: - react: ^16.13.1 || ^17.0.0 || ^18.0.0 - react-dom: ^16.13.1 || ^17.0.0 || ^18.0.0 - react-router-dom: 6.0.0-beta.0 || ^6.3.0 - checksum: 8079c6c1f4c5b07df5cfb2873f4c3ba16759a3a1ac36a1e1ff61fb428cece5baca40b5c2bc41a2d402ad9a60e73fd545c0a95eec274189423f40a04551a5f337 - languageName: node - linkType: hard - -"@backstage/plugin-catalog-react@workspace:^, @backstage/plugin-catalog-react@workspace:plugins/catalog-react": +"@backstage/plugin-catalog-react@^1.11.3, @backstage/plugin-catalog-react@^1.9.3, @backstage/plugin-catalog-react@workspace:^, @backstage/plugin-catalog-react@workspace:plugins/catalog-react": version: 0.0.0-use.local resolution: "@backstage/plugin-catalog-react@workspace:plugins/catalog-react" dependencies: @@ -6714,20 +6545,6 @@ __metadata: languageName: unknown linkType: soft -"@backstage/plugin-permission-common@npm:^0.7.13": - version: 0.7.13 - resolution: "@backstage/plugin-permission-common@npm:0.7.13" - dependencies: - "@backstage/config": ^1.2.0 - "@backstage/errors": ^1.2.4 - "@backstage/types": ^1.1.1 - cross-fetch: ^4.0.0 - uuid: ^9.0.0 - zod: ^3.22.4 - checksum: 3abea60e1016d352b99700d331af39b8c2b6f84ce7e19e02026f909e53a709b23c1ac9fadc591658252c458bb4d381545574ca66374db0912efe6640c8d58020 - languageName: node - linkType: hard - "@backstage/plugin-permission-common@workspace:^, @backstage/plugin-permission-common@workspace:plugins/permission-common": version: 0.0.0-use.local resolution: "@backstage/plugin-permission-common@workspace:plugins/permission-common" @@ -6766,23 +6583,6 @@ __metadata: languageName: unknown linkType: soft -"@backstage/plugin-permission-react@npm:^0.4.22": - version: 0.4.22 - resolution: "@backstage/plugin-permission-react@npm:0.4.22" - dependencies: - "@backstage/config": ^1.2.0 - "@backstage/core-plugin-api": ^1.9.2 - "@backstage/plugin-permission-common": ^0.7.13 - "@types/react": ^16.13.1 || ^17.0.0 || ^18.0.0 - swr: ^2.0.0 - peerDependencies: - react: ^16.13.1 || ^17.0.0 || ^18.0.0 - react-dom: ^16.13.1 || ^17.0.0 || ^18.0.0 - react-router-dom: 6.0.0-beta.0 || ^6.3.0 - checksum: c91ad5a336358ae3a2e6030e7ea7a8584735544a14aa6ada061ca0c01ee32b2e16bd2fe24c9327cbdb959eec185bac045b1211b0a03a5c9d45b350f0a6c031ca - languageName: node - linkType: hard - "@backstage/plugin-permission-react@workspace:^, @backstage/plugin-permission-react@workspace:plugins/permission-react": version: 0.0.0-use.local resolution: "@backstage/plugin-permission-react@workspace:plugins/permission-react" @@ -7531,16 +7331,6 @@ __metadata: languageName: unknown linkType: soft -"@backstage/plugin-search-common@npm:^1.2.11": - version: 1.2.11 - resolution: "@backstage/plugin-search-common@npm:1.2.11" - dependencies: - "@backstage/plugin-permission-common": ^0.7.13 - "@backstage/types": ^1.1.1 - checksum: 861ba64fd733511bad58d2b3f6b2af60426d71b8e8d74838b85a15a5870d54c0de984681a33f5adb8e97284da9167655982bcf5e543436d0f4160a2c0cbece1f - languageName: node - linkType: hard - "@backstage/plugin-search-common@workspace:^, @backstage/plugin-search-common@workspace:plugins/search-common": version: 0.0.0-use.local resolution: "@backstage/plugin-search-common@workspace:plugins/search-common" @@ -8091,23 +7881,7 @@ __metadata: languageName: unknown linkType: soft -"@backstage/theme@npm:^0.5.0, @backstage/theme@npm:^0.5.4": - version: 0.5.5 - resolution: "@backstage/theme@npm:0.5.5" - dependencies: - "@emotion/react": ^11.10.5 - "@emotion/styled": ^11.10.5 - "@mui/material": ^5.12.2 - peerDependencies: - "@material-ui/core": ^4.12.2 - "@types/react": ^16.13.1 || ^17.0.0 || ^18.0.0 - react: ^16.13.1 || ^17.0.0 || ^18.0.0 - react-dom: ^16.13.1 || ^17.0.0 || ^18.0.0 - checksum: a5ba7b39d41773a4a73a07d1a9a6bcf0815835a196a31c1ec1d5eac61ec801bfe875f31823a6ae6aa5033b21bd04b4fa692fd3fddc71a12e2126b1d222738b34 - languageName: node - linkType: hard - -"@backstage/theme@workspace:^, @backstage/theme@workspace:packages/theme": +"@backstage/theme@^0.5.0, @backstage/theme@workspace:^, @backstage/theme@workspace:packages/theme": version: 0.0.0-use.local resolution: "@backstage/theme@workspace:packages/theme" dependencies: @@ -8138,7 +7912,7 @@ __metadata: languageName: unknown linkType: soft -"@backstage/version-bridge@^1.0.7, @backstage/version-bridge@^1.0.8, @backstage/version-bridge@workspace:^, @backstage/version-bridge@workspace:packages/version-bridge": +"@backstage/version-bridge@^1.0.7, @backstage/version-bridge@workspace:^, @backstage/version-bridge@workspace:packages/version-bridge": version: 0.0.0-use.local resolution: "@backstage/version-bridge@workspace:packages/version-bridge" dependencies: From 9e186dc9197584b375bfd28a10dd47c9106fe5bc Mon Sep 17 00:00:00 2001 From: Camila Belo Date: Tue, 18 Jun 2024 10:59:36 +0200 Subject: [PATCH 246/387] docs: start drafting v1.28 release notes Signed-off-by: Camila Belo --- docs/releases/v1.28.0.md | 200 +++++++++++++++++++++++++++++++++ microsite/docusaurus.config.ts | 2 +- microsite/sidebars.json | 1 + 3 files changed, 202 insertions(+), 1 deletion(-) create mode 100644 docs/releases/v1.28.0.md diff --git a/docs/releases/v1.28.0.md b/docs/releases/v1.28.0.md new file mode 100644 index 0000000000..3e12b89f32 --- /dev/null +++ b/docs/releases/v1.28.0.md @@ -0,0 +1,200 @@ +--- +id: v1.28.0 +title: v1.28.0 +description: Backstage Release v1.28.0 +--- + +These are the release notes for the v1.28.0 release of [Backstage](https://backstage.io/). + +A huge thanks to the whole team of maintainers and contributors as well as the amazing Backstage Community for the hard work in getting this release developed and done. + +## Highlights + +### **BREAKING**: Proxy backend plugin protected by default + +The proxy backend plugin is now protected by Backstage auth, by default. Unless specifically configured (see below), all proxy endpoints will reject requests immediately unless a valid Backstage user or service token is passed along with the request. This aligns the proxy with how other Backstage backends behave out of the box, and serves to protect your upstreams from unauthorized access. + +Here's an example of how to configure: + +```diff + proxy: + endpoints: + '/pagerduty': + target: https://api.pagerduty.com ++ credentials: require + headers: + Authorization: Token token=${PAGERDUTY_TOKEN} +``` + +There are three `credentials` settings: + +- `require`: Callers need Backstage credentials. These are not forwarded to the target. +- `forward`: Callers need Backstage credentials, which are forwarded to the target. +- `dangerously-allow-unauthenticated`: No Backstage credentials needed. Target can apply its own checks. Incoming tokens of any sort will be allowed but ignored, and will also be forwarded if `allowedHeaders: ['Authorization']` is included. + +The new default is `require`, replacing the old `dangerously-allow-unauthenticated`. This means some previously permitted requests may now result in `401 Unauthorized` responses. This does not apply if `backend.auth.dangerouslyDisableDefaultAuthPolicy` is set to `true`. + +For proxy endpoints still requiring unauthenticated access, add `credentials: dangerously-allow-unauthenticated` in your app-config. + +See [the proxy documentation](https://backstage.io/docs/plugins/proxying/) for more information. + +### **BREAKING**: Gerrit integration breaking changes + +- The `workdir` argument have been removed from The `GerritUrlReader` constructor; +- The Gerrit `readTree` implementation will now only use the Gitiles api, so the support for using git to clone the repo has been removed; +- The `gitilesBaseUrl` is now mandatory for the Gerrit integration and the ability to override this requirement using the `DISABLE_GERRIT_GITILES_REQUIREMENT` environment variable has been removed. + +Contributed by @anicke in [#25123](https://github.com/backstage/backstage/pull/25123). + +### **BREAKING**: Github integration breaking changes + +- Removed deprecated code from when casing was changed from `GitHub` to `Github` nearly two years ago. The following items have been removed: + - `getGitHubFileFetchUrl` (use `getGithubFileFetchUrl` instead) + - `GitHubIntegrationConfig` (use `GithubIntegrationConfig` instead) + - `GitHubIntegration` (use `GithubIntegration` instead) + - `readGitHubIntegrationConfig` (use `readGithubIntegrationConfig` instead) + - `readGitHubIntegrationConfigs` (use `readGithubIntegrationConfigs` instead) + - `replaceGitHubUrlType` (use `replaceGithubUrlType` instead) + +Contributed by @awanlin in [#25100](https://github.com/backstage/backstage/pull/25100). + +### **BREAKING**: OAuth Scope Updates + +The way that OAuth-based auth providers handle scopes has received several updates. There is now a new `.additionalScopes` configuration for all OAuth providers, which can be used to request additional scopes for all sessions. Many providers already had a similar configuration, but in most cases this did not work correctly as scopes requested by the client would override the configured set. + +Many providers now also have a set of required scopes that will always be present. This is in contrast to the previous solution where the client would be responsible for including a set of baseline scopes. + +A bug has also been fixed in the handling of persistent scopes, which could break session refresh for some providers, such as GitHub. + +### **BREAKING**: User Info service + +Limited-access user tokens (as used in cookies) no longer contain the `ent` ownership claim. This is notably used by TechDocs and the app-backend. If you use those services, you may want to log out and in again. + +Background: As part of the previous auth improvements, we added the `coreServices.userInfo` service. This service can extract user details from incoming credentials - notably the so-called `ent` claim with its ownership information. + +In this release, the auth backend part of this has been implemented, such that the information returned by your sign-in resolver gets persisted and can be acquired after the fact. With this in place, we could finally start slimming down on token sizes, starting with the cookie tokens. Unfortunately this has to be done in such a way that it’s breaking in the short term. + +If any issues persist, try clearing your cookies, and then reach out to us on Discord or with an issue if necessary. + +Contributed by @kuangp in [#24729](https://github.com/backstage/backstage/pull/24729). + +### New Backend System API movement towards 1.0 release + +As part of finalizing the [New Backend System](https://backstage.io/docs/backend-system/), we are restructuring the out-of-the-box functionality a bit. As part of this release, you will see a large amount of deprecations on the `@backstage/backend-common` package (which will be deleted in a future release), and also on the `@backstage/backend-app-api` package (which is just being slimmed down to its essentials). Instead, you will see that the `@backstage/backend-defaults` package has received new subpath exports that neatly arrange all of these factories and default implementations. + +As an example, the `rootLoggerServiceFactory` export on `@backstage/backend-app-api` has been deprecated, and should now be imported from `@backstage/backend-defaults/rootLogger`. Most other deprecations follow the same pattern. Each deprecated symbol should have a deprecation message on it, which clearly states from where you should now be importing that particular functionality instead. + +This rearrangement was one of the crucial final pieces for settling the API surfaces of this backend system! We hope you’ll find it neater and clearer to understand. + +Please update deprecated imports in your own repo code as soon as convenient, to avoid the breaking changes in future releases when these symbols are finally removed. + +You will also note that backend features (plugins and modules) no longer are returned as functions, which simplifies interacting with features! You may see this in your editor in the form of deprecations, whose message tells you to remove the trailing parentheses. + +Your code may be changed in the following way as an example: + +```diff + await startTestBackend({ + features: [ + // service - stays unchanged + eventsServiceFactory(), + // module - remove parentheses +- catalogModuleBitbucketCloudEntityProvider(), ++ catalogModuleBitbucketCloudEntityProvider, +``` + +In related news, we have unified some type names. The `UrlReader` types are now properly prefixed with the service name, so you’ll see that for example `ReadTreeOptions` is now `UrlReaderServiceReadTreeOptions`. Functions better follow the proper naming convention for their arguments, for example `BackendPluginConfig` now becoming `CreateBackendPluginOptions`. + +### Package Metadata - Important for Package Publishers! + +All `@backstage/*` packages now include a new set of metadata in `package.json` that helps associate related plugin packages with each other. This metadata is also required for all packages published through the `@backstage/cli` to the Backstage ecosystem. For this purpose, a new `--publish` flag has been added to the `repo fix` command. You can read more about this requirement and how to generate the metadata in the documentation section on [Metadata for Published Packages](https://backstage.io/docs/tooling/package-metadata#metadata-for-published-packages). + +### Other Auth Improvements + +The OneLogin auth implementation now lives in its own module, `@backstage/plugin-auth-backend-module-onelogin-provider`. + +In some special use cases such as when you have read-replica databases, you may desire to not use the builtin zero-config plugin-to-plugin auth system that stores keys in the database. For those cases, there is now a new static mode where you supply key pairs in config that are used for this purpose. The howto is [in the docs](https://backstage.io/docs/auth/service-to-service-auth#static-keys-for-plugin-to-plugin-auth). + +There is also a new general `jwks` external access method for those of you who want to externally call Backstage plugins using already-established token flows! Check out [the docs](https://backstage.io/docs/auth/service-to-service-auth#jwks-token-auth). Contributed by @ryan-hanchett in [#24681](https://github.com/backstage/backstage/pull/24681). + +### Scaffolder `ui:widget: password` notice + +# Using `ui:widget: password` does not treat the input as a secret in the Scaffolder, and can lead to exposing some secrets in plaintext, this implementation has been overridden to provide warnings to users that mistakenly use this component and will now render a warning message along with rendering the input in plaintext for additional indication. + +Please use the `ui:field: Secret` option instead, as is mentioned in the [using secrets](https://backstage.io/docs/features/software-templates/writing-templates/#using-secrets) documentation. + +### New Scaffolder Permissions + +The Scaffolder plugin has been upgraded to include additional permissions: + +- `scaffolder.task.create` +- `scaffolder.task.cancel` +- `scaffolder.task.read` + +The new permissions allow you to control who should have read or write access to tasks. + +Contributed by @Zaperex in [#24518](https://github.com/backstage/backstage/pull/24518). + +### Route bindings via app-config + +It is now possible to configure route bindings through static configuration, using the `app.routes.bindings` key. For example: + +```yaml +app: + routes: + bindings: + catalog.createComponent: catalog-import.importPage +``` + +Is the equivalent of the following: + +```ts +const app = createApp({ + // ... + bindRoutes({ bind }) { + bind(catalogPlugin.externalRoutes, { + createComponent: catalogImportPlugin.routes.importPage, + }); + }, +}); +``` + +Additionally, the following default targets have been added for external routes. + +- For catalog: + - `createComponent` binds to the Scaffolder page. + - `viewTechDoc` binds to the TechDocs entity documentation page. + - `createFromTemplate` binds to the Scaffolder selected template page +- For scaffolder: + - `registerComponent` binds to the catalog import page. + - `viewTechDoc` binds to the TechDocs entity documentation page. + +## Security Fixes + +This release does not contain any security fixes. + +## Upgrade path + +We recommend that you keep your Backstage project up to date with this latest release. For more guidance on how to upgrade, check out the documentation for [keeping Backstage updated](https://backstage.io/docs/getting-started/keeping-backstage-updated). + +### Test utilities + +There is now a `TestCaches` class in `@backstage/backend-test-utils` that functions just like `TestDatabases`. This may help in testing out cache based flows against actual cache implementations, using `testcontainers` if available! + +### Notifications improvements + +The notifications system has received numerous updates, including the ability to perform in-flight processing of notifications. The related signals subsystem now also powers real time updates of the user settings plugin. Thanks to the notifications maintainers for their tireless efforts in this exciting area! + +## Links and References + +Below you can find a list of links and references to help you learn about and start using this new release. + +- [Backstage official website](https://backstage.io/), [documentation](https://backstage.io/docs/), and [getting started guide](https://backstage.io/docs/getting-started/) +- [GitHub repository](https://github.com/backstage/backstage) +- Backstage's [versioning and support policy](https://backstage.io/docs/overview/versioning-policy) +- [Community Discord](https://discord.gg/backstage-687207715902193673) for discussions and support +- [Changelog](https://github.com/backstage/backstage/tree/master/docs/releases/v1.28.0-changelog.md) +- Backstage [Demos](https://backstage.io/demos), [Blog](https://backstage.io/blog), [Roadmap](https://backstage.io/docs/overview/roadmap) and [Plugins](https://backstage.io/plugins) + +Sign up for our [newsletter](https://info.backstage.spotify.com/newsletter_subscribe) if you want to be informed about what is happening in the world of Backstage. + +Big shoutout to all 64 of you amazing folks who chipped in on this release 🙏: @acierto, @adityak60, @adsk-mukul, @alexef, @andrei-ivanovici, @anicke, @aramissennyeydd, @awanlin, @benjdlambert, @benjidotsh, @bethgriggs, @brianphillips, @brunobastosg, @camilaibs, @cjlee01, @cmoulliard, @davidfestal, @debsmita1, @drodil, @dweber019, @elaine-mattos, @erik-adsk, @fabian-m-95, @freben, @grantila, @huggingpixels, @ismailmmd, @jeevaramanathan, @johanhammar, @jslott2sigma, @julien-hery, @kalleericson, @kissmikijr, @kuangp, @maetis, @marcpalm, @marcuseide, @mareklibra, @mario-mui, @matteosilv, @mclarke47, @npiyush97, @nurbaysymbat, @parsifal-m, @piatkiewicz, @raffitamizian, @rbillon59, @rewixe, @rugvip, @ryan-hanchett, @sblausten, @snowblitzer, @stanislav-c, @stephenglass, @stijnbrouwers, @suniljose25, @tcardonne, @vadave, @veenarm, @vinisdl, @vinzscam, @waldirmontoya25, @ydayagi, @zaperex diff --git a/microsite/docusaurus.config.ts b/microsite/docusaurus.config.ts index 9e2a70e74e..b1a6533ab9 100644 --- a/microsite/docusaurus.config.ts +++ b/microsite/docusaurus.config.ts @@ -241,7 +241,7 @@ const config: Config = { position: 'left', }, { - to: 'docs/releases/v1.27.0', + to: 'docs/releases/v1.28.0', label: 'Releases', position: 'left', }, diff --git a/microsite/sidebars.json b/microsite/sidebars.json index e81a410825..075025afbb 100644 --- a/microsite/sidebars.json +++ b/microsite/sidebars.json @@ -1,6 +1,7 @@ { "releases": { "Release Notes": [ + "releases/v1.28.0", "releases/v1.27.0", "releases/v1.26.0", "releases/v1.25.0", From ebe186b5e27f82fed744a3cd55b75892adc5d958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 18 Jun 2024 15:19:13 +0200 Subject: [PATCH 247/387] spelling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .github/vale/config/vocabularies/Backstage/accept.txt | 2 ++ docs/releases/v1.28.0.md | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/vale/config/vocabularies/Backstage/accept.txt b/.github/vale/config/vocabularies/Backstage/accept.txt index 4f89369011..6ff0ef56da 100644 --- a/.github/vale/config/vocabularies/Backstage/accept.txt +++ b/.github/vale/config/vocabularies/Backstage/accept.txt @@ -161,6 +161,7 @@ hoc horizontalpodautoscalers Hostname hotspots +howto http https Iain @@ -291,6 +292,7 @@ Periskop permissioned permissioning pipx +plaintext plantuml Platformize Podman diff --git a/docs/releases/v1.28.0.md b/docs/releases/v1.28.0.md index 3e12b89f32..bd9af128c0 100644 --- a/docs/releases/v1.28.0.md +++ b/docs/releases/v1.28.0.md @@ -118,7 +118,7 @@ There is also a new general `jwks` external access method for those of you who w ### Scaffolder `ui:widget: password` notice -# Using `ui:widget: password` does not treat the input as a secret in the Scaffolder, and can lead to exposing some secrets in plaintext, this implementation has been overridden to provide warnings to users that mistakenly use this component and will now render a warning message along with rendering the input in plaintext for additional indication. +Using `ui:widget: password` does not treat the input as a secret in the Scaffolder, and can lead to exposing some secrets in plaintext, this implementation has been overridden to provide warnings to users that mistakenly use this component and will now render a warning message along with rendering the input in plaintext for additional indication. Please use the `ui:field: Secret` option instead, as is mentioned in the [using secrets](https://backstage.io/docs/features/software-templates/writing-templates/#using-secrets) documentation. From f8bf62f6c4babd47dc042f63c7ba680eb59ad5c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 18 Jun 2024 15:55:48 +0200 Subject: [PATCH 248/387] Update docs/releases/v1.28.0.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vincenzo Scamporlino Signed-off-by: Fredrik Adelöw --- docs/releases/v1.28.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/releases/v1.28.0.md b/docs/releases/v1.28.0.md index bd9af128c0..74e2ab9a2b 100644 --- a/docs/releases/v1.28.0.md +++ b/docs/releases/v1.28.0.md @@ -44,7 +44,7 @@ See [the proxy documentation](https://backstage.io/docs/plugins/proxying/) for m - The Gerrit `readTree` implementation will now only use the Gitiles api, so the support for using git to clone the repo has been removed; - The `gitilesBaseUrl` is now mandatory for the Gerrit integration and the ability to override this requirement using the `DISABLE_GERRIT_GITILES_REQUIREMENT` environment variable has been removed. -Contributed by @anicke in [#25123](https://github.com/backstage/backstage/pull/25123). +Contributed by [@anicke](https://github.com/anicke) in [#25123](https://github.com/backstage/backstage/pull/25123). ### **BREAKING**: Github integration breaking changes From 37269759f40e6f7f5235d1909a261a970d7245e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 18 Jun 2024 15:55:56 +0200 Subject: [PATCH 249/387] Update docs/releases/v1.28.0.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vincenzo Scamporlino Signed-off-by: Fredrik Adelöw --- docs/releases/v1.28.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/releases/v1.28.0.md b/docs/releases/v1.28.0.md index 74e2ab9a2b..aa55a54cf9 100644 --- a/docs/releases/v1.28.0.md +++ b/docs/releases/v1.28.0.md @@ -56,7 +56,7 @@ Contributed by [@anicke](https://github.com/anicke) in [#25123](https://github.c - `readGitHubIntegrationConfigs` (use `readGithubIntegrationConfigs` instead) - `replaceGitHubUrlType` (use `replaceGithubUrlType` instead) -Contributed by @awanlin in [#25100](https://github.com/backstage/backstage/pull/25100). +Contributed by [@awanlin](https://github.com/awanlin) in [#25100](https://github.com/backstage/backstage/pull/25100). ### **BREAKING**: OAuth Scope Updates From f5468acacfcc557d4c33f39e6c981a3d2d7880ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 18 Jun 2024 15:56:03 +0200 Subject: [PATCH 250/387] Update docs/releases/v1.28.0.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vincenzo Scamporlino Signed-off-by: Fredrik Adelöw --- docs/releases/v1.28.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/releases/v1.28.0.md b/docs/releases/v1.28.0.md index aa55a54cf9..2b3539606c 100644 --- a/docs/releases/v1.28.0.md +++ b/docs/releases/v1.28.0.md @@ -197,4 +197,4 @@ Below you can find a list of links and references to help you learn about and st Sign up for our [newsletter](https://info.backstage.spotify.com/newsletter_subscribe) if you want to be informed about what is happening in the world of Backstage. -Big shoutout to all 64 of you amazing folks who chipped in on this release 🙏: @acierto, @adityak60, @adsk-mukul, @alexef, @andrei-ivanovici, @anicke, @aramissennyeydd, @awanlin, @benjdlambert, @benjidotsh, @bethgriggs, @brianphillips, @brunobastosg, @camilaibs, @cjlee01, @cmoulliard, @davidfestal, @debsmita1, @drodil, @dweber019, @elaine-mattos, @erik-adsk, @fabian-m-95, @freben, @grantila, @huggingpixels, @ismailmmd, @jeevaramanathan, @johanhammar, @jslott2sigma, @julien-hery, @kalleericson, @kissmikijr, @kuangp, @maetis, @marcpalm, @marcuseide, @mareklibra, @mario-mui, @matteosilv, @mclarke47, @npiyush97, @nurbaysymbat, @parsifal-m, @piatkiewicz, @raffitamizian, @rbillon59, @rewixe, @rugvip, @ryan-hanchett, @sblausten, @snowblitzer, @stanislav-c, @stephenglass, @stijnbrouwers, @suniljose25, @tcardonne, @vadave, @veenarm, @vinisdl, @vinzscam, @waldirmontoya25, @ydayagi, @zaperex +Big shoutout to all 64 of you amazing folks who chipped in on this release 🙏: [@acierto](https://github.com/acierto), [@adityak60](https://github.com/adityak60), [@adsk-mukul](https://github.com/adsk-mukul), [@alexef](https://github.com/alexef), [@andrei-ivanovici](https://github.com/andrei-ivanovici), [@anicke](https://github.com/anicke), [@aramissennyeydd](https://github.com/aramissennyeydd), [@awanlin](https://github.com/awanlin), [@benjdlambert](https://github.com/benjdlambert), [@benjidotsh](https://github.com/benjidotsh), [@bethgriggs](https://github.com/bethgriggs), [@brianphillips](https://github.com/brianphillips), [@brunobastosg](https://github.com/brunobastosg), [@camilaibs](https://github.com/camilaibs), [@cjlee01](https://github.com/cjlee01), [@cmoulliard](https://github.com/cmoulliard), [@davidfestal](https://github.com/davidfestal), [@debsmita1](https://github.com/debsmita1), [@drodil](https://github.com/drodil), [@dweber019](https://github.com/dweber019), [@elaine-mattos](https://github.com/elaine-mattos), [@erik-adsk](https://github.com/erik-adsk), [@fabian-m-95](https://github.com/fabian-m-95), [@freben](https://github.com/freben), [@grantila](https://github.com/grantila), [@huggingpixels](https://github.com/huggingpixels), [@ismailmmd](https://github.com/ismailmmd), [@jeevaramanathan](https://github.com/jeevaramanathan), [@johanhammar](https://github.com/johanhammar), [@jslott2sigma](https://github.com/jslott2sigma), [@julien-hery](https://github.com/julien-hery), [@kalleericson](https://github.com/kalleericson), [@kissmikijr](https://github.com/kissmikijr), [@kuangp](https://github.com/kuangp), [@maetis](https://github.com/maetis), [@marcpalm](https://github.com/marcpalm), [@marcuseide](https://github.com/marcuseide), [@mareklibra](https://github.com/mareklibra), [@mario-mui](https://github.com/mario-mui), [@matteosilv](https://github.com/matteosilv), [@mclarke47](https://github.com/mclarke47), [@npiyush97](https://github.com/npiyush97), [@nurbaysymbat](https://github.com/nurbaysymbat), [@parsifal-m](https://github.com/parsifal-m), [@piatkiewicz](https://github.com/piatkiewicz), [@raffitamizian](https://github.com/raffitamizian), [@rbillon59](https://github.com/rbillon59), [@rewixe](https://github.com/rewixe), [@rugvip](https://github.com/rugvip), [@ryan-hanchett](https://github.com/ryan-hanchett), [@sblausten](https://github.com/sblausten), [@snowblitzer](https://github.com/snowblitzer), [@stanislav-c](https://github.com/stanislav-c), [@stephenglass](https://github.com/stephenglass), [@stijnbrouwers](https://github.com/stijnbrouwers), [@suniljose25](https://github.com/suniljose25), [@tcardonne](https://github.com/tcardonne), [@vadave](https://github.com/vadave), [@veenarm](https://github.com/veenarm), [@vinisdl](https://github.com/vinisdl), [@vinzscam](https://github.com/vinzscam), [@waldirmontoya25](https://github.com/waldirmontoya25), [@ydayagi](https://github.com/ydayagi), [@zaperex](https://github.com/zaperex). From e1bef4bd050c555ceea323c0ccb0e8c7961fd45a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 18 Jun 2024 15:56:19 +0200 Subject: [PATCH 251/387] Update docs/releases/v1.28.0.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vincenzo Scamporlino Signed-off-by: Fredrik Adelöw --- docs/releases/v1.28.0.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/releases/v1.28.0.md b/docs/releases/v1.28.0.md index 2b3539606c..e34af9c492 100644 --- a/docs/releases/v1.28.0.md +++ b/docs/releases/v1.28.0.md @@ -114,7 +114,9 @@ The OneLogin auth implementation now lives in its own module, `@backstage/plugin In some special use cases such as when you have read-replica databases, you may desire to not use the builtin zero-config plugin-to-plugin auth system that stores keys in the database. For those cases, there is now a new static mode where you supply key pairs in config that are used for this purpose. The howto is [in the docs](https://backstage.io/docs/auth/service-to-service-auth#static-keys-for-plugin-to-plugin-auth). -There is also a new general `jwks` external access method for those of you who want to externally call Backstage plugins using already-established token flows! Check out [the docs](https://backstage.io/docs/auth/service-to-service-auth#jwks-token-auth). Contributed by @ryan-hanchett in [#24681](https://github.com/backstage/backstage/pull/24681). +There is also a new general `jwks` external access method for those of you who want to externally call Backstage plugins using already-established token flows! Check out [the docs](https://backstage.io/docs/auth/service-to-service-auth#jwks-token-auth). + +Contributed by [@ryan-hanchett](https://github.com/ryan-hanchett) in [#24681](https://github.com/backstage/backstage/pull/24681). ### Scaffolder `ui:widget: password` notice From 2cb21117e1b8e064c71fa8586a5452979c242ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 18 Jun 2024 15:56:24 +0200 Subject: [PATCH 252/387] Update docs/releases/v1.28.0.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vincenzo Scamporlino Signed-off-by: Fredrik Adelöw --- docs/releases/v1.28.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/releases/v1.28.0.md b/docs/releases/v1.28.0.md index e34af9c492..0a28c02dbb 100644 --- a/docs/releases/v1.28.0.md +++ b/docs/releases/v1.28.0.md @@ -134,7 +134,7 @@ The Scaffolder plugin has been upgraded to include additional permissions: The new permissions allow you to control who should have read or write access to tasks. -Contributed by @Zaperex in [#24518](https://github.com/backstage/backstage/pull/24518). +Contributed by [@Zaperex](https://github.com/Zaperex) in [#24518](https://github.com/backstage/backstage/pull/24518). ### Route bindings via app-config From d64671701159aaa505707146124628e14b878df9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 18 Jun 2024 15:56:31 +0200 Subject: [PATCH 253/387] Update docs/releases/v1.28.0.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vincenzo Scamporlino Signed-off-by: Fredrik Adelöw --- docs/releases/v1.28.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/releases/v1.28.0.md b/docs/releases/v1.28.0.md index 0a28c02dbb..bc690fbeef 100644 --- a/docs/releases/v1.28.0.md +++ b/docs/releases/v1.28.0.md @@ -76,7 +76,7 @@ In this release, the auth backend part of this has been implemented, such that t If any issues persist, try clearing your cookies, and then reach out to us on Discord or with an issue if necessary. -Contributed by @kuangp in [#24729](https://github.com/backstage/backstage/pull/24729). +Contributed by [@kuangp](https://github.com/kuangp) in [#24729](https://github.com/backstage/backstage/pull/24729). ### New Backend System API movement towards 1.0 release From c964a3d03cce15461c843dc38b0eeb46df268b76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 18 Jun 2024 22:41:26 +0200 Subject: [PATCH 254/387] hopefully unbreak backend-common dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/moody-llamas-breathe.md | 5 +++++ .changeset/rich-bears-march.md | 5 +++++ packages/backend-common/package.json | 10 ++++++++++ packages/techdocs-cli/package.json | 2 +- .../techdocs-cli/src/commands/migrate/migrate.ts | 2 +- .../techdocs-cli/src/commands/publish/publish.ts | 2 +- yarn.lock | 12 +++++++++++- 7 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 .changeset/moody-llamas-breathe.md create mode 100644 .changeset/rich-bears-march.md diff --git a/.changeset/moody-llamas-breathe.md b/.changeset/moody-llamas-breathe.md new file mode 100644 index 0000000000..418cf7480e --- /dev/null +++ b/.changeset/moody-llamas-breathe.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-common': patch +--- + +Add dependencies that are needed by cross-imports from backend-defaults diff --git a/.changeset/rich-bears-march.md b/.changeset/rich-bears-march.md new file mode 100644 index 0000000000..ec4a4a9404 --- /dev/null +++ b/.changeset/rich-bears-march.md @@ -0,0 +1,5 @@ +--- +'@techdocs/cli': patch +--- + +Import discovery from backend-defaults instead of backend-common diff --git a/packages/backend-common/package.json b/packages/backend-common/package.json index fc09a6e125..e993e1f21e 100644 --- a/packages/backend-common/package.json +++ b/packages/backend-common/package.json @@ -99,12 +99,19 @@ "logform": "^2.3.2", "luxon": "^3.0.0", "minimatch": "^9.0.0", + "minimist": "^1.2.5", + "morgan": "^1.10.0", "mysql2": "^3.0.0", "node-fetch": "^2.6.7", + "node-forge": "^1.3.1", "p-limit": "^3.1.0", + "path-to-regexp": "^6.2.1", "pg": "^8.11.3", "raw-body": "^2.4.1", + "selfsigned": "^2.0.0", + "stoppable": "^1.1.0", "tar": "^6.1.12", + "triple-beam": "^1.4.1", "uuid": "^9.0.0", "winston": "^3.2.1", "winston-transport": "^4.5.0", @@ -121,7 +128,10 @@ "@types/concat-stream": "^2.0.0", "@types/fs-extra": "^11.0.0", "@types/http-errors": "^2.0.0", + "@types/morgan": "^1.9.0", + "@types/node-forge": "^1.3.0", "@types/pg": "^8.6.6", + "@types/stoppable": "^1.1.0", "@types/supertest": "^2.0.8", "@types/tar": "^6.1.1", "@types/webpack-env": "^1.15.2", diff --git a/packages/techdocs-cli/package.json b/packages/techdocs-cli/package.json index 7650316962..9c87235af7 100644 --- a/packages/techdocs-cli/package.json +++ b/packages/techdocs-cli/package.json @@ -56,7 +56,7 @@ "ext": "ts" }, "dependencies": { - "@backstage/backend-common": "workspace:^", + "@backstage/backend-defaults": "workspace:^", "@backstage/catalog-model": "workspace:^", "@backstage/cli-common": "workspace:^", "@backstage/config": "workspace:^", diff --git a/packages/techdocs-cli/src/commands/migrate/migrate.ts b/packages/techdocs-cli/src/commands/migrate/migrate.ts index 1340d852f6..ab11585493 100644 --- a/packages/techdocs-cli/src/commands/migrate/migrate.ts +++ b/packages/techdocs-cli/src/commands/migrate/migrate.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { HostDiscovery } from '@backstage/backend-common'; +import { HostDiscovery } from '@backstage/backend-defaults/discovery'; import { Publisher } from '@backstage/plugin-techdocs-node'; import { OptionValues } from 'commander'; import { createLogger } from '../../lib/utility'; diff --git a/packages/techdocs-cli/src/commands/publish/publish.ts b/packages/techdocs-cli/src/commands/publish/publish.ts index 961f42c73b..ded578546a 100644 --- a/packages/techdocs-cli/src/commands/publish/publish.ts +++ b/packages/techdocs-cli/src/commands/publish/publish.ts @@ -17,7 +17,7 @@ import { resolve } from 'path'; import { OptionValues } from 'commander'; import { createLogger } from '../../lib/utility'; -import { HostDiscovery } from '@backstage/backend-common'; +import { HostDiscovery } from '@backstage/backend-defaults/discovery'; import { Publisher } from '@backstage/plugin-techdocs-node'; import { Entity } from '@backstage/catalog-model'; import { PublisherConfig } from '../../lib/PublisherConfig'; diff --git a/yarn.lock b/yarn.lock index b02c102c14..a0a385ca66 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3548,7 +3548,10 @@ __metadata: "@types/fs-extra": ^11.0.0 "@types/http-errors": ^2.0.0 "@types/luxon": ^3.0.0 + "@types/morgan": ^1.9.0 + "@types/node-forge": ^1.3.0 "@types/pg": ^8.6.6 + "@types/stoppable": ^1.1.0 "@types/supertest": ^2.0.8 "@types/tar": ^6.1.1 "@types/webpack-env": ^1.15.2 @@ -3575,14 +3578,21 @@ __metadata: logform: ^2.3.2 luxon: ^3.0.0 minimatch: ^9.0.0 + minimist: ^1.2.5 + morgan: ^1.10.0 msw: ^1.0.0 mysql2: ^3.0.0 node-fetch: ^2.6.7 + node-forge: ^1.3.1 p-limit: ^3.1.0 + path-to-regexp: ^6.2.1 pg: ^8.11.3 raw-body: ^2.4.1 + selfsigned: ^2.0.0 + stoppable: ^1.1.0 supertest: ^6.1.3 tar: ^6.1.12 + triple-beam: ^1.4.1 uuid: ^9.0.0 winston: ^3.2.1 winston-transport: ^4.5.0 @@ -16405,7 +16415,7 @@ __metadata: version: 0.0.0-use.local resolution: "@techdocs/cli@workspace:packages/techdocs-cli" dependencies: - "@backstage/backend-common": "workspace:^" + "@backstage/backend-defaults": "workspace:^" "@backstage/catalog-model": "workspace:^" "@backstage/cli": "workspace:^" "@backstage/cli-common": "workspace:^" From 62d1fe301cc652b399170acd91a7c1edeb6c8fdb Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Tue, 18 Jun 2024 01:25:03 -0400 Subject: [PATCH 255/387] Fix user entity not being fetched for scaffolder dry runner Signed-off-by: Stephen Glass --- .changeset/young-fishes-lie.md | 5 ++++ .../src/scaffolder/dryrun/createDryRunner.ts | 5 ++++ .../src/service/router.test.ts | 28 +++++++++++++++++++ .../scaffolder-backend/src/service/router.ts | 12 ++++++++ 4 files changed, 50 insertions(+) create mode 100644 .changeset/young-fishes-lie.md diff --git a/.changeset/young-fishes-lie.md b/.changeset/young-fishes-lie.md new file mode 100644 index 0000000000..769d046375 --- /dev/null +++ b/.changeset/young-fishes-lie.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend': patch +--- + +Fix user entity not being fetched for scaffolder dry runner diff --git a/plugins/scaffolder-backend/src/scaffolder/dryrun/createDryRunner.ts b/plugins/scaffolder-backend/src/scaffolder/dryrun/createDryRunner.ts index 6b8caf5a3d..c993e0d46d 100644 --- a/plugins/scaffolder-backend/src/scaffolder/dryrun/createDryRunner.ts +++ b/plugins/scaffolder-backend/src/scaffolder/dryrun/createDryRunner.ts @@ -38,12 +38,17 @@ import { BackstageCredentials, resolveSafeChildPath, } from '@backstage/backend-plugin-api'; +import type { UserEntity } from '@backstage/catalog-model'; interface DryRunInput { spec: TaskSpec; secrets?: TaskSecrets; directoryContents: SerializedFile[]; credentials: BackstageCredentials; + user?: { + entity?: UserEntity; + ref?: string; + }; } interface DryRunResult { diff --git a/plugins/scaffolder-backend/src/service/router.test.ts b/plugins/scaffolder-backend/src/service/router.test.ts index 8ba26c68a4..c776f563d7 100644 --- a/plugins/scaffolder-backend/src/service/router.test.ts +++ b/plugins/scaffolder-backend/src/service/router.test.ts @@ -691,6 +691,34 @@ data: {"id":1,"taskId":"a-random-id","type":"completion","createdAt":"","body":{ expect(subscriber!.closed).toBe(true); }); }); + + describe('POST /v2/dry-run', () => { + it('should get user entity', async () => { + const mockToken = mockCredentials.user.token(); + const mockTemplate = getMockTemplate(); + + const catalogSpy = jest.spyOn(catalogClient, 'getEntityByRef'); + + await request(app) + .post('/v2/dry-run') + .set('Authorization', `Bearer ${mockToken}`) + .send({ + template: mockTemplate, + values: { + requiredParameter1: 'required-value-1', + requiredParameter2: 'required-value-2', + }, + directoryContents: [], + }); + + expect(catalogSpy).toHaveBeenCalledTimes(1); + + expect(catalogSpy).toHaveBeenCalledWith( + 'user:default/mock', + expect.anything(), + ); + }); + }); }); describe('providing an identity api', () => { diff --git a/plugins/scaffolder-backend/src/service/router.ts b/plugins/scaffolder-backend/src/service/router.ts index 384b9f5340..84cdac0c3f 100644 --- a/plugins/scaffolder-backend/src/service/router.ts +++ b/plugins/scaffolder-backend/src/service/router.ts @@ -730,6 +730,14 @@ export async function createRouter( targetPluginId: 'catalog', }); + const userEntityRef = auth.isPrincipal(credentials, 'user') + ? credentials.principal.userEntityRef + : undefined; + + const userEntity = userEntityRef + ? await catalogClient.getEntityByRef(userEntityRef, { token }) + : undefined; + for (const parameters of [template.spec.parameters ?? []].flat()) { const result = validate(body.values, parameters); if (!result.valid) { @@ -750,6 +758,10 @@ export async function createRouter( steps, output: template.spec.output ?? {}, parameters: body.values as JsonObject, + user: { + entity: userEntity as UserEntity, + ref: userEntityRef, + }, }, directoryContents: (body.directoryContents ?? []).map(file => ({ path: file.path, From a82cbab3c4a507d74e95ba5d07b1d27fce1f2470 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 19 Jun 2024 10:25:42 +0200 Subject: [PATCH 256/387] chore: starting to refactor a little bit] Signed-off-by: blam --- .../src/ScaffolderPlugin.ts | 8 ++++++ .../src/service/autocomplete.ts | 2 +- plugins/scaffolder-node/src/alpha.ts | 28 +++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/plugins/scaffolder-backend/src/ScaffolderPlugin.ts b/plugins/scaffolder-backend/src/ScaffolderPlugin.ts index a8213cf585..9fc4b2537a 100644 --- a/plugins/scaffolder-backend/src/ScaffolderPlugin.ts +++ b/plugins/scaffolder-backend/src/ScaffolderPlugin.ts @@ -29,6 +29,7 @@ import { } from '@backstage/plugin-scaffolder-node'; import { scaffolderActionsExtensionPoint, + scaffolderAutocompleteExtensionPoint, scaffolderTaskBrokerExtensionPoint, scaffolderTemplatingExtensionPoint, } from '@backstage/plugin-scaffolder-node/alpha'; @@ -82,6 +83,13 @@ export const scaffolderPlugin = createBackendPlugin({ }, }); + const autocompleteResolers = []; + env.registerExtensionPoint(scaffolderAutocompleteExtensionPoint, { + addAutocompleteProvider(provider) { + autocompleteResolers.push(provider); + }, + }); + env.registerInit({ deps: { logger: coreServices.logger, diff --git a/plugins/scaffolder-backend/src/service/autocomplete.ts b/plugins/scaffolder-backend/src/service/autocomplete.ts index 034a201450..131305d53e 100644 --- a/plugins/scaffolder-backend/src/service/autocomplete.ts +++ b/plugins/scaffolder-backend/src/service/autocomplete.ts @@ -17,7 +17,7 @@ import { InputError } from '@backstage/errors'; import { BitbucketCloudClient } from '@backstage/plugin-bitbucket-cloud-common'; -export async function handleBitbucketCloudRequest( +export async function handleAutocompleteRequest( token: string, resource: string, parameters: Record, diff --git a/plugins/scaffolder-node/src/alpha.ts b/plugins/scaffolder-node/src/alpha.ts index b85da5b590..3644d48b7c 100644 --- a/plugins/scaffolder-node/src/alpha.ts +++ b/plugins/scaffolder-node/src/alpha.ts @@ -79,3 +79,31 @@ export const scaffolderTemplatingExtensionPoint = createExtensionPoint({ id: 'scaffolder.templating', }); + +/** + * Extension point for adding autocomplete handler providers + * @alpha + */ +export interface ScaffolderAutocompleteExtensionPoint { + addAutocompleteProvider( + provider: ({ + type, + token, + query, + }: { + type: string; + token: string; + query: Record; + }) => Promise<{ results: { title: string }[] }>, + ): void; +} + +/** + * Extension point for adding template filters and globals. + * + * @alpha + */ +export const scaffolderAutocompleteExtensionPoint = + createExtensionPoint({ + id: 'scaffolder.autocomplete', + }); From 3583ce550c16a2c17034e632c6b0d996ddd1df9f Mon Sep 17 00:00:00 2001 From: Mikko Korhonen Date: Wed, 19 Jun 2024 11:29:39 +0300 Subject: [PATCH 257/387] feat(scaffolder): use virtualization with MultiEntityPicker Signed-off-by: Mikko Korhonen --- .changeset/heavy-moose-pull.md | 5 +++ plugins/scaffolder/package.json | 2 ++ .../MultiEntityPicker/MultiEntityPicker.tsx | 34 +++++++++++++++++++ yarn.lock | 6 ++-- 4 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 .changeset/heavy-moose-pull.md diff --git a/.changeset/heavy-moose-pull.md b/.changeset/heavy-moose-pull.md new file mode 100644 index 0000000000..7ba7b1aa39 --- /dev/null +++ b/.changeset/heavy-moose-pull.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder': minor +--- + +Use virtualization with MultiEntityPicker. Fixes performance issues with large data sets. diff --git a/plugins/scaffolder/package.json b/plugins/scaffolder/package.json index f2c96eee58..50cbda8e31 100644 --- a/plugins/scaffolder/package.json +++ b/plugins/scaffolder/package.json @@ -97,6 +97,7 @@ "luxon": "^3.0.0", "qs": "^6.9.4", "react-use": "^17.2.4", + "react-window": "^1.8.10", "yaml": "^2.0.0", "zen-observable": "^0.10.0", "zod": "^3.22.4", @@ -115,6 +116,7 @@ "@testing-library/user-event": "^14.0.0", "@types/humanize-duration": "^3.18.1", "@types/json-schema": "^7.0.9", + "@types/react-window": "^1.8.8", "msw": "^1.0.0", "swr": "^2.0.0" }, diff --git a/plugins/scaffolder/src/components/fields/MultiEntityPicker/MultiEntityPicker.tsx b/plugins/scaffolder/src/components/fields/MultiEntityPicker/MultiEntityPicker.tsx index 4ea26b4414..84a050622a 100644 --- a/plugins/scaffolder/src/components/fields/MultiEntityPicker/MultiEntityPicker.tsx +++ b/plugins/scaffolder/src/components/fields/MultiEntityPicker/MultiEntityPicker.tsx @@ -35,6 +35,7 @@ import Autocomplete, { AutocompleteChangeReason, } from '@material-ui/lab/Autocomplete'; import React, { useCallback, useEffect } from 'react'; +import { FixedSizeList, ListChildComponentProps } from 'react-window'; import useAsync from 'react-use/esm/useAsync'; import { FieldValidation } from '@rjsf/utils'; import { @@ -46,6 +47,38 @@ import { export { MultiEntityPickerSchema } from './schema'; +const renderRow = (props: ListChildComponentProps) => { + const { data, index, style } = props; + return React.cloneElement(data[index], { style }); +}; + +const ListboxComponent = React.forwardRef< + HTMLDivElement, + { children?: React.ReactNode } +>((props, ref) => { + const itemData = React.Children.toArray(props.children); + const itemCount = itemData.length; + + const itemSize = 36; + + const itemsToShow = Math.min(10, itemCount); + const height = Math.max(itemSize, itemsToShow * itemSize - 0.5 * itemSize); + + return ( +
+ + {renderRow} + +
+ ); +}); + /** * The underlying component that is rendered in the form for the `MultiEntityPicker` * field extension. @@ -177,6 +210,7 @@ export const MultiEntityPicker = (props: MultiEntityPickerProps) => { }} /> )} + ListboxComponent={ListboxComponent} /> ); diff --git a/yarn.lock b/yarn.lock index a0a385ca66..7cf1726496 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7138,6 +7138,7 @@ __metadata: "@types/humanize-duration": ^3.18.1 "@types/json-schema": ^7.0.9 "@types/react": ^16.13.1 || ^17.0.0 || ^18.0.0 + "@types/react-window": ^1.8.8 "@uiw/react-codemirror": ^4.9.3 classnames: ^2.2.6 git-url-parse: ^14.0.0 @@ -7150,6 +7151,7 @@ __metadata: msw: ^1.0.0 qs: ^6.9.4 react-use: ^17.2.4 + react-window: ^1.8.10 swr: ^2.0.0 yaml: ^2.0.0 zen-observable: ^0.10.0 @@ -18077,7 +18079,7 @@ __metadata: languageName: node linkType: hard -"@types/react-window@npm:^1.8.5": +"@types/react-window@npm:^1.8.5, @types/react-window@npm:^1.8.8": version: 1.8.8 resolution: "@types/react-window@npm:1.8.8" dependencies: @@ -38305,7 +38307,7 @@ __metadata: languageName: node linkType: hard -"react-window@npm:^1.8.6": +"react-window@npm:^1.8.10, react-window@npm:^1.8.6": version: 1.8.10 resolution: "react-window@npm:1.8.10" dependencies: From 100341c307caaf6d1d1ca013847fa63f9ce1612d Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 19 Jun 2024 12:12:00 +0200 Subject: [PATCH 258/387] chore: fix issue with exported `typeof` should have been classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fredrik Adelöw Co-authored-by: Vincenzo Scamporlino Co-authored-by: Camila Belo Signed-off-by: blam --- packages/backend-app-api/api-report.md | 13 ++- packages/backend-app-api/src/http/index.ts | 109 +++++++++++++++++- packages/backend-common/api-report.md | 48 ++++---- .../backend-common/src/deprecated/index.ts | 74 +++++++++--- 4 files changed, 202 insertions(+), 42 deletions(-) diff --git a/packages/backend-app-api/api-report.md b/packages/backend-app-api/api-report.md index 071fd6c1d3..724d3409bf 100644 --- a/packages/backend-app-api/api-report.md +++ b/packages/backend-app-api/api-report.md @@ -204,10 +204,17 @@ export const loggerServiceFactory: () => ServiceFactory< 'plugin' >; -// Warning: (ae-forgotten-export) The symbol "MiddlewareFactory_2" needs to be exported by the entry point index.d.ts -// // @public @deprecated (undocumented) -export const MiddlewareFactory: typeof MiddlewareFactory_2; +export class MiddlewareFactory { + compression(): RequestHandler; + cors(): RequestHandler; + // Warning: (ae-forgotten-export) The symbol "MiddlewareFactory_2" needs to be exported by the entry point index.d.ts + static create(options: MiddlewareFactoryOptions): MiddlewareFactory_2; + error(options?: MiddlewareFactoryErrorOptions): ErrorRequestHandler; + helmet(): RequestHandler; + logging(): RequestHandler; + notFound(): RequestHandler; +} // Warning: (ae-forgotten-export) The symbol "MiddlewareFactoryErrorOptions_2" needs to be exported by the entry point index.d.ts // diff --git a/packages/backend-app-api/src/http/index.ts b/packages/backend-app-api/src/http/index.ts index ab1d134688..8fd1b31e75 100644 --- a/packages/backend-app-api/src/http/index.ts +++ b/packages/backend-app-api/src/http/index.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +import { ErrorRequestHandler, RequestHandler } from 'express'; // eslint-disable-next-line @backstage/no-relative-monorepo-imports import { readHttpServerOptions as _readHttpServerOptions, @@ -52,7 +53,113 @@ export const readHelmetOptions = _readHelmetOptions; * @public * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead. */ -export const MiddlewareFactory = _MiddlewareFactory; +export class MiddlewareFactory { + /** + * Creates a new {@link MiddlewareFactory}. + */ + static create(options: MiddlewareFactoryOptions) { + return _MiddlewareFactory.create(options); + } + + private constructor(private readonly impl: _MiddlewareFactory) {} + + /** + * Returns a middleware that unconditionally produces a 404 error response. + * + * @remarks + * + * Typically you want to place this middleware at the end of the chain, such + * that it's the last one attempted after no other routes matched. + * + * @returns An Express request handler + */ + notFound(): RequestHandler { + return this.impl.notFound(); + } + + /** + * Returns the compression middleware. + * + * @remarks + * + * The middleware will attempt to compress response bodies for all requests + * that traverse through the middleware. + */ + compression(): RequestHandler { + return this.impl.compression(); + } + + /** + * Returns a request logging middleware. + * + * @remarks + * + * Typically you want to place this middleware at the start of the chain, such + * that it always logs requests whether they are "caught" by handlers farther + * down or not. + * + * @returns An Express request handler + */ + logging(): RequestHandler { + return this.impl.logging(); + } + + /** + * Returns a middleware that implements the helmet library. + * + * @remarks + * + * This middleware applies security policies to incoming requests and outgoing + * responses. It is configured using config keys such as `backend.csp`. + * + * @see {@link https://helmetjs.github.io/} + * + * @returns An Express request handler + */ + helmet(): RequestHandler { + return this.impl.helmet(); + } + + /** + * Returns a middleware that implements the cors library. + * + * @remarks + * + * This middleware handles CORS. It is configured using the config key + * `backend.cors`. + * + * @see {@link https://github.com/expressjs/cors} + * + * @returns An Express request handler + */ + cors(): RequestHandler { + return this.impl.cors(); + } + + /** + * Express middleware to handle errors during request processing. + * + * @remarks + * + * This is commonly the very last middleware in the chain. + * + * Its primary purpose is not to do translation of business logic exceptions, + * but rather to be a global catch-all for uncaught "fatal" errors that are + * expected to result in a 500 error. However, it also does handle some common + * error types (such as http-error exceptions, and the well-known error types + * in the `@backstage/errors` package) and returns the enclosed status code + * accordingly. + * + * It will also produce a response body with a serialized form of the error, + * unless a previous handler already did send a body. See + * {@link @backstage/errors#ErrorResponseBody} for the response shape used. + * + * @returns An Express error request handler + */ + error(options: MiddlewareFactoryErrorOptions = {}): ErrorRequestHandler { + return this.impl.error(options); + } +} /** * @public * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead. diff --git a/packages/backend-common/api-report.md b/packages/backend-common/api-report.md index 7915503d7c..de00ef6a5a 100644 --- a/packages/backend-common/api-report.md +++ b/packages/backend-common/api-report.md @@ -88,27 +88,27 @@ export type AuthCallbackOptions = { // Warning: (ae-forgotten-export) The symbol "AwsS3UrlReader_2" needs to be exported by the entry point index.d.ts // // @public @deprecated (undocumented) -export const AwsS3UrlReader: typeof AwsS3UrlReader_2; +export class AwsS3UrlReader extends AwsS3UrlReader_2 {} // Warning: (ae-forgotten-export) The symbol "AzureUrlReader_2" needs to be exported by the entry point index.d.ts // // @public @deprecated (undocumented) -export const AzureUrlReader: typeof AzureUrlReader_2; +export class AzureUrlReader extends AzureUrlReader_2 {} // Warning: (ae-forgotten-export) The symbol "BitbucketCloudUrlReader_2" needs to be exported by the entry point index.d.ts // // @public @deprecated (undocumented) -export const BitbucketCloudUrlReader: typeof BitbucketCloudUrlReader_2; +export class BitbucketCloudUrlReader extends BitbucketCloudUrlReader_2 {} // Warning: (ae-forgotten-export) The symbol "BitbucketServerUrlReader_2" needs to be exported by the entry point index.d.ts // // @public @deprecated (undocumented) -export const BitbucketServerUrlReader: typeof BitbucketServerUrlReader_2; +export class BitbucketServerUrlReader extends BitbucketServerUrlReader_2 {} // Warning: (ae-forgotten-export) The symbol "BitbucketUrlReader_2" needs to be exported by the entry point index.d.ts // // @public @deprecated (undocumented) -export const BitbucketUrlReader: typeof BitbucketUrlReader_2; +export class BitbucketUrlReader extends BitbucketUrlReader_2 {} // @public @deprecated (undocumented) export type CacheClient = CacheService; @@ -122,7 +122,7 @@ export type CacheClientSetOptions = CacheServiceSetOptions; // Warning: (ae-forgotten-export) The symbol "CacheManager_2" needs to be exported by the entry point index.d.ts // // @public @deprecated (undocumented) -export const CacheManager: typeof CacheManager_2; +export class CacheManager extends CacheManager_2 {} // Warning: (ae-forgotten-export) The symbol "CacheManagerOptions_2" needs to be exported by the entry point index.d.ts // @@ -242,7 +242,7 @@ export type ErrorHandlerOptions = { // Warning: (ae-forgotten-export) The symbol "FetchUrlReader_2" needs to be exported by the entry point index.d.ts // // @public @deprecated (undocumented) -export const FetchUrlReader: typeof FetchUrlReader_2; +export class FetchUrlReader extends FetchUrlReader_2 {} // Warning: (ae-forgotten-export) The symbol "FromReadableArrayOptions_2" needs to be exported by the entry point index.d.ts // @@ -252,7 +252,7 @@ export type FromReadableArrayOptions = FromReadableArrayOptions_2; // Warning: (ae-forgotten-export) The symbol "GerritUrlReader_2" needs to be exported by the entry point index.d.ts // // @public @deprecated (undocumented) -export const GerritUrlReader: typeof GerritUrlReader_2; +export class GerritUrlReader extends GerritUrlReader_2 {} // @public @deprecated export function getRootLogger(): winston.Logger; @@ -339,27 +339,38 @@ export class Git { // Warning: (ae-forgotten-export) The symbol "GiteaUrlReader_2" needs to be exported by the entry point index.d.ts // // @public @deprecated (undocumented) -export const GiteaUrlReader: typeof GiteaUrlReader_2; +export class GiteaUrlReader extends GiteaUrlReader_2 {} // Warning: (ae-forgotten-export) The symbol "GithubUrlReader_2" needs to be exported by the entry point index.d.ts // // @public @deprecated (undocumented) -export const GithubUrlReader: typeof GithubUrlReader_2; +export class GithubUrlReader extends GithubUrlReader_2 {} // Warning: (ae-forgotten-export) The symbol "GitlabUrlReader_2" needs to be exported by the entry point index.d.ts // // @public @deprecated (undocumented) -export const GitlabUrlReader: typeof GitlabUrlReader_2; +export class GitlabUrlReader extends GitlabUrlReader_2 {} // Warning: (ae-forgotten-export) The symbol "HarnessUrlReader_2" needs to be exported by the entry point index.d.ts // // @public @deprecated (undocumented) -export const HarnessUrlReader: typeof HarnessUrlReader_2; +export class HarnessUrlReader extends HarnessUrlReader_2 {} -// Warning: (ae-forgotten-export) The symbol "HostDiscovery_2" needs to be exported by the entry point index.d.ts -// // @public @deprecated -export const HostDiscovery: typeof HostDiscovery_2; +class HostDiscovery implements DiscoveryService { + static fromConfig( + config: Config, + options?: { + basePath?: string; + }, + ): HostDiscovery; + // (undocumented) + getBaseUrl(pluginId: string): Promise; + // (undocumented) + getExternalBaseUrl(pluginId: string): Promise; +} +export { HostDiscovery }; +export { HostDiscovery as SingleHostDiscovery }; // @public @deprecated (undocumented) export const isChildPath: typeof isChildPath_2; @@ -525,7 +536,7 @@ export type ReadUrlResponse = ReadUrlResponse_2; // Warning: (ae-forgotten-export) The symbol "ReadUrlResponseFactory_2" needs to be exported by the entry point index.d.ts // // @public @deprecated (undocumented) -export const ReadUrlResponseFactory: typeof ReadUrlResponseFactory_2; +export class ReadUrlResponseFactory extends ReadUrlResponseFactory_2 {} // Warning: (ae-forgotten-export) The symbol "ReadUrlResponseFactoryFromStreamOptions_2" needs to be exported by the entry point index.d.ts // @@ -626,9 +637,6 @@ export type ServiceBuilder = { // @public @deprecated export function setRootLogger(newLogger: winston.Logger): void; -// @public @deprecated -export const SingleHostDiscovery: typeof HostDiscovery_2; - // @public @deprecated export type StaticAuthOptions = { username?: string; @@ -664,7 +672,7 @@ export type UrlReaderPredicateTuple = UrlReaderPredicateTuple_2; // Warning: (ae-forgotten-export) The symbol "UrlReaders_2" needs to be exported by the entry point index.d.ts // // @public @deprecated (undocumented) -export const UrlReaders: typeof UrlReaders_2; +export class UrlReaders extends UrlReaders_2 {} // Warning: (ae-forgotten-export) The symbol "UrlReadersOptions_2" needs to be exported by the entry point index.d.ts // diff --git a/packages/backend-common/src/deprecated/index.ts b/packages/backend-common/src/deprecated/index.ts index ba8b8e7db2..e3e4101d25 100644 --- a/packages/backend-common/src/deprecated/index.ts +++ b/packages/backend-common/src/deprecated/index.ts @@ -77,8 +77,6 @@ import type { import { DiscoveryService, - LifecycleService, - PluginMetadataService, CacheService, CacheServiceOptions, CacheServiceSetOptions, @@ -97,6 +95,8 @@ import { SearchResponse as _SearchResponse, SearchResponseFile as _SearchResponseFile, UrlReaderService as _UrlReaderService, + LifecycleService, + PluginMetadataService, } from '@backstage/backend-plugin-api'; export * from './hot'; @@ -125,7 +125,45 @@ export type PluginEndpointDiscovery = DiscoveryService; * @public * @deprecated Please import from `@backstage/backend-defaults/discovery` instead. */ -export const HostDiscovery = _HostDiscovery; +export class HostDiscovery implements DiscoveryService { + /** + * Creates a new HostDiscovery discovery instance by reading + * from the `backend` config section, specifically the `.baseUrl` for + * discovering the external URL, and the `.listen` and `.https` config + * for the internal one. + * + * Can be overridden in config by providing a target and corresponding plugins in `discovery.endpoints`. + * eg. + * ```yaml + * discovery: + * endpoints: + * - target: https://internal.example.com/internal-catalog + * plugins: [catalog] + * - target: https://internal.example.com/secure/api/{{pluginId}} + * plugins: [auth, permission] + * - target: + * internal: https://internal.example.com/search + * external: https://example.com/search + * plugins: [search] + * ``` + * + * The basePath defaults to `/api`, meaning the default full internal + * path for the `catalog` plugin will be `http://localhost:7007/api/catalog`. + */ + static fromConfig(config: Config, options?: { basePath?: string }) { + return new HostDiscovery(_HostDiscovery.fromConfig(config, options)); + } + + private constructor(private readonly impl: _HostDiscovery) {} + + async getBaseUrl(pluginId: string): Promise { + return this.impl.getBaseUrl(pluginId); + } + + async getExternalBaseUrl(pluginId: string): Promise { + return this.impl.getExternalBaseUrl(pluginId); + } +} /** * SingleHostDiscovery is a basic PluginEndpointDiscovery implementation @@ -138,13 +176,13 @@ export const HostDiscovery = _HostDiscovery; * @public * @deprecated Use `HostDiscovery` from `@backstage/backend-defaults/discovery` instead */ -export const SingleHostDiscovery = _HostDiscovery; +export { HostDiscovery as SingleHostDiscovery }; /** * @public * @deprecated Use `CacheManager` from the `@backstage/backend-defaults` package instead */ -export const CacheManager = _CacheManager; +export class CacheManager extends _CacheManager {} /** * @public @@ -257,79 +295,79 @@ export const isChildPath = _isChildPath; * @public * @deprecated Import from `@backstage/backend-defaults/urlReader` instead */ -export const AzureUrlReader = _AzureUrlReader; +export class AzureUrlReader extends _AzureUrlReader {} /** * @public * @deprecated Import from `@backstage/backend-defaults/urlReader` instead */ -export const BitbucketCloudUrlReader = _BitbucketCloudUrlReader; +export class BitbucketCloudUrlReader extends _BitbucketCloudUrlReader {} /** * @public * @deprecated Import from `@backstage/backend-defaults/urlReader` instead */ -export const BitbucketUrlReader = _BitbucketUrlReader; +export class BitbucketUrlReader extends _BitbucketUrlReader {} /** * @public * @deprecated Import from `@backstage/backend-defaults/urlReader` instead */ -export const BitbucketServerUrlReader = _BitbucketServerUrlReader; +export class BitbucketServerUrlReader extends _BitbucketServerUrlReader {} /** * @public * @deprecated Import from `@backstage/backend-defaults/urlReader` instead */ -export const GerritUrlReader = _GerritUrlReader; +export class GerritUrlReader extends _GerritUrlReader {} /** * @public * @deprecated Import from `@backstage/backend-defaults/urlReader` instead */ -export const GithubUrlReader = _GithubUrlReader; +export class GithubUrlReader extends _GithubUrlReader {} /** * @public * @deprecated Import from `@backstage/backend-defaults/urlReader` instead */ -export const GitlabUrlReader = _GitlabUrlReader; +export class GitlabUrlReader extends _GitlabUrlReader {} /** * @public * @deprecated Import from `@backstage/backend-defaults/urlReader` instead */ -export const GiteaUrlReader = _GiteaUrlReader; +export class GiteaUrlReader extends _GiteaUrlReader {} /** * @public * @deprecated Import from `@backstage/backend-defaults/urlReader` instead */ -export const HarnessUrlReader = _HarnessUrlReader; +export class HarnessUrlReader extends _HarnessUrlReader {} /** * @public * @deprecated Import from `@backstage/backend-defaults/urlReader` instead */ -export const AwsS3UrlReader = _AwsS3UrlReader; +export class AwsS3UrlReader extends _AwsS3UrlReader {} /** * @public * @deprecated Import from `@backstage/backend-defaults/urlReader` instead */ -export const FetchUrlReader = _FetchUrlReader; +export class FetchUrlReader extends _FetchUrlReader {} /** * @public * @deprecated Import from `@backstage/backend-defaults/urlReader` instead */ -export const UrlReaders = _UrlReaders; +export class UrlReaders extends _UrlReaders {} /** * @public * @deprecated Import from `@backstage/backend-defaults/urlReader` instead */ -export const ReadUrlResponseFactory = _ReadUrlResponseFactory; +export class ReadUrlResponseFactory extends _ReadUrlResponseFactory {} /** * @public From 083eaf98b3413b814d1c03702627b0c30f052179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 18 Jun 2024 17:28:22 +0200 Subject: [PATCH 259/387] fix iso duration parsing in schedules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/curvy-teachers-smell.md | 8 +++ .../scheduler/lib/PluginTaskSchedulerImpl.ts | 2 +- .../definitions/SchedulerService.test.ts | 5 +- .../services/definitions/SchedulerService.ts | 6 +- ...adTaskScheduleDefinitionFromConfig.test.ts | 5 +- .../readTaskScheduleDefinitionFromConfig.ts | 4 +- .../catalogModuleAwsS3EntityProvider.test.ts | 5 +- .../src/providers/config.test.ts | 3 +- ...logModuleAzureDevOpsEntityProvider.test.ts | 5 +- .../src/providers/config.test.ts | 3 +- ...ModuleBitbucketCloudEntityProvider.test.ts | 5 +- ...BitbucketCloudEntityProviderConfig.test.ts | 3 +- ...oduleBitbucketServerEntityProvider.test.ts | 5 +- ...itbucketServerEntityProviderConfig.test.ts | 3 +- .../catalogModuleGerritEntityProvider.test.ts | 5 +- .../src/providers/config.test.ts | 3 +- .../src/module.test.ts | 5 +- .../src/module/githubCatalogModule.test.ts | 5 +- .../GithubEntityProviderConfig.test.ts | 3 +- ...leGitlabOrgDiscoveryEntityProvider.test.ts | 5 +- ...oduleGitlabDiscoveryEntityProvider.test.ts | 5 +- .../src/providers/config.test.ts | 3 +- .../catalog-backend-module-ldap/api-report.md | 14 ++-- .../src/ldap/config.test.ts | 69 +++++++++++++++++++ .../src/ldap/config.ts | 12 ++-- .../src/processors/LdapOrgEntityProvider.ts | 19 ++--- .../src/microsoftGraph/config.test.ts | 3 +- ...uleMicrosoftGraphOrgEntityProvider.test.ts | 5 +- .../PuppetDbEntityProviderConfig.test.ts | 7 +- 29 files changed, 142 insertions(+), 83 deletions(-) create mode 100644 .changeset/curvy-teachers-smell.md diff --git a/.changeset/curvy-teachers-smell.md b/.changeset/curvy-teachers-smell.md new file mode 100644 index 0000000000..3f032f2177 --- /dev/null +++ b/.changeset/curvy-teachers-smell.md @@ -0,0 +1,8 @@ +--- +'@backstage/plugin-catalog-backend-module-ldap': patch +'@backstage/backend-plugin-api': patch +'@backstage/backend-defaults': patch +'@backstage/backend-tasks': patch +--- + +Fix bug where ISO durations could no longer be used for schedules diff --git a/packages/backend-defaults/src/entrypoints/scheduler/lib/PluginTaskSchedulerImpl.ts b/packages/backend-defaults/src/entrypoints/scheduler/lib/PluginTaskSchedulerImpl.ts index 62b36e024c..40aa9d521c 100644 --- a/packages/backend-defaults/src/entrypoints/scheduler/lib/PluginTaskSchedulerImpl.ts +++ b/packages/backend-defaults/src/entrypoints/scheduler/lib/PluginTaskSchedulerImpl.ts @@ -152,7 +152,7 @@ export class PluginTaskSchedulerImpl implements SchedulerService { export function parseDuration( frequency: SchedulerServiceTaskScheduleDefinition['frequency'], ): string { - if ('cron' in frequency) { + if (typeof frequency === 'object' && 'cron' in frequency) { return frequency.cron; } diff --git a/packages/backend-plugin-api/src/services/definitions/SchedulerService.test.ts b/packages/backend-plugin-api/src/services/definitions/SchedulerService.test.ts index 7b20487af4..875e24786f 100644 --- a/packages/backend-plugin-api/src/services/definitions/SchedulerService.test.ts +++ b/packages/backend-plugin-api/src/services/definitions/SchedulerService.test.ts @@ -16,7 +16,6 @@ import { ConfigReader } from '@backstage/config'; import { HumanDuration } from '@backstage/types'; -import { Duration } from 'luxon'; import { readSchedulerServiceTaskScheduleDefinitionFromConfig } from './SchedulerService'; describe('readSchedulerServiceTaskScheduleDefinitionFromConfig', () => { @@ -35,7 +34,7 @@ describe('readSchedulerServiceTaskScheduleDefinitionFromConfig', () => { const result = readSchedulerServiceTaskScheduleDefinitionFromConfig(config); expect((result.frequency as { cron: string }).cron).toBe('0 30 * * * *'); - expect(result.timeout).toEqual(Duration.fromISO('PT3M')); + expect(result.timeout).toEqual({ minutes: 3 }); expect((result.initialDelay as HumanDuration).minutes).toEqual(20); expect(result.scope).toBe('global'); }); @@ -51,7 +50,7 @@ describe('readSchedulerServiceTaskScheduleDefinitionFromConfig', () => { const result = readSchedulerServiceTaskScheduleDefinitionFromConfig(config); expect((result.frequency as { cron: string }).cron).toBe('0 30 * * * *'); - expect(result.timeout).toEqual(Duration.fromISO('PT3M')); + expect(result.timeout).toEqual({ minutes: 3 }); expect(result.initialDelay).toBeUndefined(); expect(result.scope).toBeUndefined(); }); diff --git a/packages/backend-plugin-api/src/services/definitions/SchedulerService.ts b/packages/backend-plugin-api/src/services/definitions/SchedulerService.ts index 91edf27ad6..a7ec79a336 100644 --- a/packages/backend-plugin-api/src/services/definitions/SchedulerService.ts +++ b/packages/backend-plugin-api/src/services/definitions/SchedulerService.ts @@ -348,14 +348,14 @@ export interface SchedulerService { getScheduledTasks(): Promise; } -function readDuration(config: Config, key: string): Duration | HumanDuration { +function readDuration(config: Config, key: string): HumanDuration { if (typeof config.get(key) === 'string') { const value = config.getString(key); const duration = Duration.fromISO(value); if (!duration.isValid) { throw new Error(`Invalid duration: ${value}`); } - return duration; + return duration.toObject(); } return readDurationFromConfig(config, { key }); @@ -364,7 +364,7 @@ function readDuration(config: Config, key: string): Duration | HumanDuration { function readCronOrDuration( config: Config, key: string, -): { cron: string } | Duration | HumanDuration { +): { cron: string } | HumanDuration { const value = config.get(key); if (typeof value === 'object' && (value as { cron?: string }).cron) { return value as { cron: string }; diff --git a/packages/backend-tasks/src/tasks/readTaskScheduleDefinitionFromConfig.test.ts b/packages/backend-tasks/src/tasks/readTaskScheduleDefinitionFromConfig.test.ts index c52d59b016..adeb134611 100644 --- a/packages/backend-tasks/src/tasks/readTaskScheduleDefinitionFromConfig.test.ts +++ b/packages/backend-tasks/src/tasks/readTaskScheduleDefinitionFromConfig.test.ts @@ -16,7 +16,6 @@ import { ConfigReader } from '@backstage/config'; import { HumanDuration } from '@backstage/types'; -import { Duration } from 'luxon'; import { readTaskScheduleDefinitionFromConfig } from './readTaskScheduleDefinitionFromConfig'; describe('readTaskScheduleDefinitionFromConfig', () => { @@ -35,7 +34,7 @@ describe('readTaskScheduleDefinitionFromConfig', () => { const result = readTaskScheduleDefinitionFromConfig(config); expect((result.frequency as { cron: string }).cron).toBe('0 30 * * * *'); - expect(result.timeout).toEqual(Duration.fromISO('PT3M')); + expect(result.timeout).toEqual({ minutes: 3 }); expect((result.initialDelay as HumanDuration).minutes).toEqual(20); expect(result.scope).toBe('global'); }); @@ -51,7 +50,7 @@ describe('readTaskScheduleDefinitionFromConfig', () => { const result = readTaskScheduleDefinitionFromConfig(config); expect((result.frequency as { cron: string }).cron).toBe('0 30 * * * *'); - expect(result.timeout).toEqual(Duration.fromISO('PT3M')); + expect(result.timeout).toEqual({ minutes: 3 }); expect(result.initialDelay).toBeUndefined(); expect(result.scope).toBeUndefined(); }); diff --git a/packages/backend-tasks/src/tasks/readTaskScheduleDefinitionFromConfig.ts b/packages/backend-tasks/src/tasks/readTaskScheduleDefinitionFromConfig.ts index 5a173f246b..e94d06d5c3 100644 --- a/packages/backend-tasks/src/tasks/readTaskScheduleDefinitionFromConfig.ts +++ b/packages/backend-tasks/src/tasks/readTaskScheduleDefinitionFromConfig.ts @@ -19,14 +19,14 @@ import { HumanDuration } from '@backstage/types'; import { TaskScheduleDefinition } from './types'; import { Duration } from 'luxon'; -function readDuration(config: Config, key: string): Duration | HumanDuration { +function readDuration(config: Config, key: string): HumanDuration { if (typeof config.get(key) === 'string') { const value = config.getString(key); const duration = Duration.fromISO(value); if (!duration.isValid) { throw new Error(`Invalid duration: ${value}`); } - return duration; + return duration.toObject(); } return readDurationFromConfig(config, { key }); diff --git a/plugins/catalog-backend-module-aws/src/module/catalogModuleAwsS3EntityProvider.test.ts b/plugins/catalog-backend-module-aws/src/module/catalogModuleAwsS3EntityProvider.test.ts index 4addd1cb45..9165eb4322 100644 --- a/plugins/catalog-backend-module-aws/src/module/catalogModuleAwsS3EntityProvider.test.ts +++ b/plugins/catalog-backend-module-aws/src/module/catalogModuleAwsS3EntityProvider.test.ts @@ -17,7 +17,6 @@ import { TaskScheduleDefinition } from '@backstage/backend-tasks'; import { mockServices, startTestBackend } from '@backstage/backend-test-utils'; import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha'; -import { Duration } from 'luxon'; import { catalogModuleAwsS3EntityProvider } from './catalogModuleAwsS3EntityProvider'; import { AwsS3EntityProvider } from '../providers'; @@ -62,8 +61,8 @@ describe('catalogModuleAwsS3EntityProvider', () => { ], }); - expect(usedSchedule?.frequency).toEqual(Duration.fromISO('P1M')); - expect(usedSchedule?.timeout).toEqual(Duration.fromISO('PT3M')); + expect(usedSchedule?.frequency).toEqual({ months: 1 }); + expect(usedSchedule?.timeout).toEqual({ minutes: 3 }); expect(addedProviders?.length).toEqual(1); expect(addedProviders?.pop()?.getProviderName()).toEqual( 'awsS3-provider:default', diff --git a/plugins/catalog-backend-module-aws/src/providers/config.test.ts b/plugins/catalog-backend-module-aws/src/providers/config.test.ts index fb2f3c0790..4c7ec9a964 100644 --- a/plugins/catalog-backend-module-aws/src/providers/config.test.ts +++ b/plugins/catalog-backend-module-aws/src/providers/config.test.ts @@ -15,7 +15,6 @@ */ import { ConfigReader } from '@backstage/config'; -import { Duration } from 'luxon'; import { readAwsS3Configs } from './config'; describe('readAwsS3Configs', () => { @@ -92,7 +91,7 @@ describe('readAwsS3Configs', () => { id: 'provider4', schedule: { ...provider4.schedule, - frequency: Duration.fromISO(provider4.schedule.frequency), + frequency: { minutes: 30 }, }, }); }); diff --git a/plugins/catalog-backend-module-azure/src/module/catalogModuleAzureDevOpsEntityProvider.test.ts b/plugins/catalog-backend-module-azure/src/module/catalogModuleAzureDevOpsEntityProvider.test.ts index 2c674a8061..e406c61e07 100644 --- a/plugins/catalog-backend-module-azure/src/module/catalogModuleAzureDevOpsEntityProvider.test.ts +++ b/plugins/catalog-backend-module-azure/src/module/catalogModuleAzureDevOpsEntityProvider.test.ts @@ -17,7 +17,6 @@ import { TaskScheduleDefinition } from '@backstage/backend-tasks'; import { mockServices, startTestBackend } from '@backstage/backend-test-utils'; import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha'; -import { Duration } from 'luxon'; import { catalogModuleAzureDevOpsEntityProvider } from './catalogModuleAzureDevOpsEntityProvider'; import { AzureDevOpsEntityProvider } from '../providers'; @@ -66,8 +65,8 @@ describe('catalogModuleAzureDevOpsEntityProvider', () => { ], }); - expect(usedSchedule?.frequency).toEqual(Duration.fromISO('P1M')); - expect(usedSchedule?.timeout).toEqual(Duration.fromISO('PT3M')); + expect(usedSchedule?.frequency).toEqual({ months: 1 }); + expect(usedSchedule?.timeout).toEqual({ minutes: 3 }); expect(addedProviders?.length).toEqual(1); expect(addedProviders?.pop()?.getProviderName()).toEqual( 'AzureDevOpsEntityProvider:test', diff --git a/plugins/catalog-backend-module-azure/src/providers/config.test.ts b/plugins/catalog-backend-module-azure/src/providers/config.test.ts index 02dbaab90e..5d5ae930c1 100644 --- a/plugins/catalog-backend-module-azure/src/providers/config.test.ts +++ b/plugins/catalog-backend-module-azure/src/providers/config.test.ts @@ -15,7 +15,6 @@ */ import { ConfigReader } from '@backstage/config'; -import { Duration } from 'luxon'; import { readAzureDevOpsConfigs } from './config'; describe('readAzureDevOpsConfigs', () => { @@ -95,7 +94,7 @@ describe('readAzureDevOpsConfigs', () => { id: 'provider4', schedule: { ...provider4.schedule, - frequency: Duration.fromISO(provider4.schedule.frequency), + frequency: { minutes: 30 }, }, }); expect(actual[4]).toEqual({ diff --git a/plugins/catalog-backend-module-bitbucket-cloud/src/module/catalogModuleBitbucketCloudEntityProvider.test.ts b/plugins/catalog-backend-module-bitbucket-cloud/src/module/catalogModuleBitbucketCloudEntityProvider.test.ts index db53b0b41b..bcf13e786d 100644 --- a/plugins/catalog-backend-module-bitbucket-cloud/src/module/catalogModuleBitbucketCloudEntityProvider.test.ts +++ b/plugins/catalog-backend-module-bitbucket-cloud/src/module/catalogModuleBitbucketCloudEntityProvider.test.ts @@ -21,7 +21,6 @@ import { EntityProviderConnection } from '@backstage/plugin-catalog-node'; import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha'; import { TestEventsService } from '@backstage/plugin-events-backend-test-utils'; import { eventsServiceRef } from '@backstage/plugin-events-node'; -import { Duration } from 'luxon'; import { catalogModuleBitbucketCloudEntityProvider } from './catalogModuleBitbucketCloudEntityProvider'; import { BitbucketCloudEntityProvider } from '../providers/BitbucketCloudEntityProvider'; @@ -78,8 +77,8 @@ describe('catalogModuleBitbucketCloudEntityProvider', () => { ], }); - expect(usedSchedule?.frequency).toEqual(Duration.fromISO('P1M')); - expect(usedSchedule?.timeout).toEqual(Duration.fromISO('PT3M')); + expect(usedSchedule?.frequency).toEqual({ months: 1 }); + expect(usedSchedule?.timeout).toEqual({ minutes: 3 }); expect(addedProviders?.length).toEqual(1); expect(runner).not.toHaveBeenCalled(); const provider = addedProviders!.pop()!; diff --git a/plugins/catalog-backend-module-bitbucket-cloud/src/providers/BitbucketCloudEntityProviderConfig.test.ts b/plugins/catalog-backend-module-bitbucket-cloud/src/providers/BitbucketCloudEntityProviderConfig.test.ts index 5a2cc99437..7f13616586 100644 --- a/plugins/catalog-backend-module-bitbucket-cloud/src/providers/BitbucketCloudEntityProviderConfig.test.ts +++ b/plugins/catalog-backend-module-bitbucket-cloud/src/providers/BitbucketCloudEntityProviderConfig.test.ts @@ -15,7 +15,6 @@ */ import { ConfigReader } from '@backstage/config'; -import { Duration } from 'luxon'; import { readProviderConfigs } from './BitbucketCloudEntityProviderConfig'; describe('readProviderConfigs', () => { @@ -130,7 +129,7 @@ describe('readProviderConfigs', () => { repoSlug: undefined, }, schedule: { - frequency: Duration.fromISO('PT30M'), + frequency: { minutes: 30 }, timeout: { minutes: 3, }, diff --git a/plugins/catalog-backend-module-bitbucket-server/src/module/catalogModuleBitbucketServerEntityProvider.test.ts b/plugins/catalog-backend-module-bitbucket-server/src/module/catalogModuleBitbucketServerEntityProvider.test.ts index 56b44b29f5..5335b04e2d 100644 --- a/plugins/catalog-backend-module-bitbucket-server/src/module/catalogModuleBitbucketServerEntityProvider.test.ts +++ b/plugins/catalog-backend-module-bitbucket-server/src/module/catalogModuleBitbucketServerEntityProvider.test.ts @@ -18,7 +18,6 @@ import { TaskScheduleDefinition } from '@backstage/backend-tasks'; import { mockServices, startTestBackend } from '@backstage/backend-test-utils'; import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha'; import { catalogModuleBitbucketServerEntityProvider } from './catalogModuleBitbucketServerEntityProvider'; -import { Duration } from 'luxon'; import { BitbucketServerEntityProvider } from '../providers'; describe('catalogModuleBitbucketServerEntityProvider', () => { @@ -70,8 +69,8 @@ describe('catalogModuleBitbucketServerEntityProvider', () => { ], }); - expect(usedSchedule?.frequency).toEqual(Duration.fromISO('P1M')); - expect(usedSchedule?.timeout).toEqual(Duration.fromISO('PT3M')); + expect(usedSchedule?.frequency).toEqual({ months: 1 }); + expect(usedSchedule?.timeout).toEqual({ minutes: 3 }); expect(addedProviders?.length).toEqual(1); expect(addedProviders?.pop()?.getProviderName()).toEqual( 'bitbucketServer-provider:default', diff --git a/plugins/catalog-backend-module-bitbucket-server/src/providers/BitbucketServerEntityProviderConfig.test.ts b/plugins/catalog-backend-module-bitbucket-server/src/providers/BitbucketServerEntityProviderConfig.test.ts index 9e8aca5dd9..755fa4b58a 100644 --- a/plugins/catalog-backend-module-bitbucket-server/src/providers/BitbucketServerEntityProviderConfig.test.ts +++ b/plugins/catalog-backend-module-bitbucket-server/src/providers/BitbucketServerEntityProviderConfig.test.ts @@ -15,7 +15,6 @@ */ import { ConfigReader } from '@backstage/config'; -import { Duration } from 'luxon'; import { readProviderConfigs } from './BitbucketServerEntityProviderConfig'; describe('readProviderConfigs', () => { @@ -111,7 +110,7 @@ describe('readProviderConfigs', () => { skipArchivedRepos: undefined, }, schedule: { - frequency: Duration.fromISO('PT30M'), + frequency: { minutes: 30 }, timeout: { minutes: 3, }, diff --git a/plugins/catalog-backend-module-gerrit/src/module/catalogModuleGerritEntityProvider.test.ts b/plugins/catalog-backend-module-gerrit/src/module/catalogModuleGerritEntityProvider.test.ts index 66f0cbab2c..dc40e0525d 100644 --- a/plugins/catalog-backend-module-gerrit/src/module/catalogModuleGerritEntityProvider.test.ts +++ b/plugins/catalog-backend-module-gerrit/src/module/catalogModuleGerritEntityProvider.test.ts @@ -17,7 +17,6 @@ import { TaskScheduleDefinition } from '@backstage/backend-tasks'; import { mockServices, startTestBackend } from '@backstage/backend-test-utils'; import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha'; -import { Duration } from 'luxon'; import { catalogModuleGerritEntityProvider } from './catalogModuleGerritEntityProvider'; import { GerritEntityProvider } from '../providers/GerritEntityProvider'; @@ -76,8 +75,8 @@ describe('catalogModuleGerritEntityProvider', () => { ], }); - expect(usedSchedule?.frequency).toEqual(Duration.fromISO('P1M')); - expect(usedSchedule?.timeout).toEqual(Duration.fromISO('PT3M')); + expect(usedSchedule?.frequency).toEqual({ months: 1 }); + expect(usedSchedule?.timeout).toEqual({ minutes: 3 }); expect(addedProviders?.length).toEqual(1); expect(addedProviders?.pop()?.getProviderName()).toEqual( 'gerrit-provider:test', diff --git a/plugins/catalog-backend-module-gerrit/src/providers/config.test.ts b/plugins/catalog-backend-module-gerrit/src/providers/config.test.ts index ecf68d9f3c..85ab3383f0 100644 --- a/plugins/catalog-backend-module-gerrit/src/providers/config.test.ts +++ b/plugins/catalog-backend-module-gerrit/src/providers/config.test.ts @@ -15,7 +15,6 @@ */ import { ConfigReader } from '@backstage/config'; -import { Duration } from 'luxon'; import { readGerritConfigs } from './config'; describe('readGerritConfigs', () => { @@ -63,7 +62,7 @@ describe('readGerritConfigs', () => { id: 'active-g3', schedule: { ...provider3.schedule, - frequency: Duration.fromISO(provider3.schedule.frequency), + frequency: { minutes: 30 }, }, }); }); diff --git a/plugins/catalog-backend-module-github-org/src/module.test.ts b/plugins/catalog-backend-module-github-org/src/module.test.ts index 6e03d8d9cc..76ab4d1fbc 100644 --- a/plugins/catalog-backend-module-github-org/src/module.test.ts +++ b/plugins/catalog-backend-module-github-org/src/module.test.ts @@ -18,7 +18,6 @@ import { TaskScheduleDefinition } from '@backstage/backend-tasks'; import { mockServices, startTestBackend } from '@backstage/backend-test-utils'; import { EntityProvider } from '@backstage/plugin-catalog-node'; import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha'; -import { Duration } from 'luxon'; import { catalogModuleGithubOrgEntityProvider } from './module'; describe('catalogModuleGithubOrgEntityProvider', () => { @@ -66,8 +65,8 @@ describe('catalogModuleGithubOrgEntityProvider', () => { ], }); - expect(usedSchedule?.frequency).toEqual(Duration.fromISO('P1M')); - expect(usedSchedule?.timeout).toEqual(Duration.fromISO('PT3M')); + expect(usedSchedule?.frequency).toEqual({ months: 1 }); + expect(usedSchedule?.timeout).toEqual({ minutes: 3 }); expect(addedProviders?.length).toEqual(1); expect(addedProviders![0].getProviderName()).toEqual( 'GithubMultiOrgEntityProvider:default', diff --git a/plugins/catalog-backend-module-github/src/module/githubCatalogModule.test.ts b/plugins/catalog-backend-module-github/src/module/githubCatalogModule.test.ts index 59f8b41a6d..018d339de8 100644 --- a/plugins/catalog-backend-module-github/src/module/githubCatalogModule.test.ts +++ b/plugins/catalog-backend-module-github/src/module/githubCatalogModule.test.ts @@ -21,7 +21,6 @@ import { catalogAnalysisExtensionPoint, catalogProcessingExtensionPoint, } from '@backstage/plugin-catalog-node/alpha'; -import { Duration } from 'luxon'; import { githubCatalogModule } from './githubCatalogModule'; import { GithubLocationAnalyzer } from '../analyzers/GithubLocationAnalyzer'; @@ -75,8 +74,8 @@ describe('githubCatalogModule', () => { ], }); - expect(usedSchedule?.frequency).toEqual(Duration.fromISO('P1M')); - expect(usedSchedule?.timeout).toEqual(Duration.fromISO('PT3M')); + expect(usedSchedule?.frequency).toEqual({ months: 1 }); + expect(usedSchedule?.timeout).toEqual({ minutes: 3 }); expect(addedProviders?.length).toEqual(1); expect(addedProviders?.pop()?.getProviderName()).toEqual( 'github-provider:default', diff --git a/plugins/catalog-backend-module-github/src/providers/GithubEntityProviderConfig.test.ts b/plugins/catalog-backend-module-github/src/providers/GithubEntityProviderConfig.test.ts index c83bfe5db1..296cbc12df 100644 --- a/plugins/catalog-backend-module-github/src/providers/GithubEntityProviderConfig.test.ts +++ b/plugins/catalog-backend-module-github/src/providers/GithubEntityProviderConfig.test.ts @@ -15,7 +15,6 @@ */ import { ConfigReader } from '@backstage/config'; -import { Duration } from 'luxon'; import { readProviderConfigs } from './GithubEntityProviderConfig'; describe('readProviderConfigs', () => { @@ -270,7 +269,7 @@ describe('readProviderConfigs', () => { visibility: undefined, }, schedule: { - frequency: Duration.fromISO('PT30M'), + frequency: { minutes: 30 }, timeout: { minutes: 3, }, diff --git a/plugins/catalog-backend-module-gitlab-org/src/catalogModuleGitlabOrgDiscoveryEntityProvider.test.ts b/plugins/catalog-backend-module-gitlab-org/src/catalogModuleGitlabOrgDiscoveryEntityProvider.test.ts index 1078936950..5fbc321cc2 100644 --- a/plugins/catalog-backend-module-gitlab-org/src/catalogModuleGitlabOrgDiscoveryEntityProvider.test.ts +++ b/plugins/catalog-backend-module-gitlab-org/src/catalogModuleGitlabOrgDiscoveryEntityProvider.test.ts @@ -22,7 +22,6 @@ import { EntityProviderConnection } from '@backstage/plugin-catalog-node'; import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha'; import { TestEventsService } from '@backstage/plugin-events-backend-test-utils'; import { eventsServiceRef } from '@backstage/plugin-events-node'; -import { Duration } from 'luxon'; import { catalogModuleGitlabOrgDiscoveryEntityProvider } from './catalogModuleGitlabOrgDiscoveryEntityProvider'; describe('catalogModuleGitlabOrgDiscoveryEntityProvider', () => { @@ -90,8 +89,8 @@ describe('catalogModuleGitlabOrgDiscoveryEntityProvider', () => { ], }); - expect(usedSchedule?.frequency).toEqual(Duration.fromISO('P1M')); - expect(usedSchedule?.timeout).toEqual(Duration.fromISO('PT3M')); + expect(usedSchedule?.frequency).toEqual({ months: 1 }); + expect(usedSchedule?.timeout).toEqual({ minutes: 3 }); expect(addedProviders?.length).toEqual(1); expect(runner).not.toHaveBeenCalled(); diff --git a/plugins/catalog-backend-module-gitlab/src/module/catalogModuleGitlabDiscoveryEntityProvider.test.ts b/plugins/catalog-backend-module-gitlab/src/module/catalogModuleGitlabDiscoveryEntityProvider.test.ts index e4cff56bbd..636405220b 100644 --- a/plugins/catalog-backend-module-gitlab/src/module/catalogModuleGitlabDiscoveryEntityProvider.test.ts +++ b/plugins/catalog-backend-module-gitlab/src/module/catalogModuleGitlabDiscoveryEntityProvider.test.ts @@ -21,7 +21,6 @@ import { EntityProviderConnection } from '@backstage/plugin-catalog-node'; import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha'; import { TestEventsService } from '@backstage/plugin-events-backend-test-utils'; import { eventsServiceRef } from '@backstage/plugin-events-node'; -import { Duration } from 'luxon'; import { GitlabDiscoveryEntityProvider } from '../providers'; import { catalogModuleGitlabDiscoveryEntityProvider } from './catalogModuleGitlabDiscoveryEntityProvider'; @@ -89,8 +88,8 @@ describe('catalogModuleGitlabDiscoveryEntityProvider', () => { ], }); - expect(usedSchedule?.frequency).toEqual(Duration.fromISO('P1M')); - expect(usedSchedule?.timeout).toEqual(Duration.fromISO('PT3M')); + expect(usedSchedule?.frequency).toEqual({ months: 1 }); + expect(usedSchedule?.timeout).toEqual({ minutes: 3 }); expect(addedProviders?.length).toEqual(1); expect(runner).not.toHaveBeenCalled(); diff --git a/plugins/catalog-backend-module-gitlab/src/providers/config.test.ts b/plugins/catalog-backend-module-gitlab/src/providers/config.test.ts index 09b42e6475..a5c3ab2b28 100644 --- a/plugins/catalog-backend-module-gitlab/src/providers/config.test.ts +++ b/plugins/catalog-backend-module-gitlab/src/providers/config.test.ts @@ -15,7 +15,6 @@ */ import { ConfigReader } from '@backstage/config'; -import { Duration } from 'luxon'; import { readGitlabConfigs } from './config'; describe('config', () => { @@ -179,7 +178,7 @@ describe('config', () => { allowInherited: false, skipForkedRepos: false, schedule: { - frequency: Duration.fromISO('PT30M'), + frequency: { minutes: 30 }, timeout: { minutes: 3, }, diff --git a/plugins/catalog-backend-module-ldap/api-report.md b/plugins/catalog-backend-module-ldap/api-report.md index 84de581387..de245b8cd6 100644 --- a/plugins/catalog-backend-module-ldap/api-report.md +++ b/plugins/catalog-backend-module-ldap/api-report.md @@ -16,11 +16,11 @@ import { GroupTransformer as GroupTransformer_2 } from '@backstage/plugin-catalo import { JsonValue } from '@backstage/types'; import { LocationSpec } from '@backstage/plugin-catalog-common'; import { LoggerService } from '@backstage/backend-plugin-api'; -import { PluginTaskScheduler } from '@backstage/backend-tasks'; +import { SchedulerService } from '@backstage/backend-plugin-api'; +import { SchedulerServiceTaskRunner } from '@backstage/backend-plugin-api'; +import { SchedulerServiceTaskScheduleDefinition } from '@backstage/backend-plugin-api'; import { SearchEntry } from 'ldapjs'; import { SearchOptions } from 'ldapjs'; -import { TaskRunner } from '@backstage/backend-tasks'; -import { TaskScheduleDefinition } from '@backstage/backend-tasks'; import { UserEntity } from '@backstage/catalog-model'; import { UserTransformer as UserTransformer_2 } from '@backstage/plugin-catalog-backend-module-ldap'; @@ -135,7 +135,7 @@ export interface LdapOrgEntityProviderLegacyOptions { groupTransformer?: GroupTransformer; id: string; logger: LoggerService; - schedule: 'manual' | TaskRunner; + schedule: 'manual' | SchedulerServiceTaskRunner; target: string; userTransformer?: UserTransformer; } @@ -145,8 +145,8 @@ export type LdapOrgEntityProviderOptions = | LdapOrgEntityProviderLegacyOptions | { logger: LoggerService; - schedule?: 'manual' | TaskRunner; - scheduler?: PluginTaskScheduler; + schedule?: 'manual' | SchedulerServiceTaskRunner; + scheduler?: SchedulerService; userTransformer?: UserTransformer | Record; groupTransformer?: GroupTransformer | Record; }; @@ -199,7 +199,7 @@ export type LdapProviderConfig = { bind?: BindConfig; users: UserConfig; groups: GroupConfig; - schedule?: TaskScheduleDefinition; + schedule?: SchedulerServiceTaskScheduleDefinition; }; // @public diff --git a/plugins/catalog-backend-module-ldap/src/ldap/config.test.ts b/plugins/catalog-backend-module-ldap/src/ldap/config.test.ts index ddea9de03f..4edfaeebea 100644 --- a/plugins/catalog-backend-module-ldap/src/ldap/config.test.ts +++ b/plugins/catalog-backend-module-ldap/src/ldap/config.test.ts @@ -79,6 +79,75 @@ describe('readLdapConfig', () => { expect(actual).toEqual(expected); }); + it('reads schedules well', () => { + const config = { + catalog: { + providers: { + ldapOrg: { + default: { + schedule: { + frequency: 'PT3M', // should work for ISO durations + timeout: { minutes: 1 }, + }, + target: 'target', + users: { + dn: 'udn', + }, + groups: { + dn: 'gdn', + }, + }, + }, + }, + }, + }; + const actual = readProviderConfigs(new ConfigReader(config)); + const expected = [ + { + id: 'default', + target: 'target', + bind: undefined, + schedule: { + frequency: { minutes: 3 }, + timeout: { minutes: 1 }, + }, + users: { + dn: 'udn', + options: { + scope: 'one', + attributes: ['*', '+'], + }, + set: undefined, + map: { + rdn: 'uid', + name: 'uid', + displayName: 'cn', + email: 'mail', + memberOf: 'memberOf', + }, + }, + groups: { + dn: 'gdn', + options: { + scope: 'one', + attributes: ['*', '+'], + }, + set: undefined, + map: { + rdn: 'cn', + name: 'cn', + description: 'description', + type: 'groupType', + displayName: 'cn', + memberOf: 'memberOf', + members: 'member', + }, + }, + }, + ]; + expect(actual).toEqual(expected); + }); + it('reads all the values', () => { const config = { catalog: { diff --git a/plugins/catalog-backend-module-ldap/src/ldap/config.ts b/plugins/catalog-backend-module-ldap/src/ldap/config.ts index 2bd21fd166..7c4795fc46 100644 --- a/plugins/catalog-backend-module-ldap/src/ldap/config.ts +++ b/plugins/catalog-backend-module-ldap/src/ldap/config.ts @@ -15,9 +15,9 @@ */ import { - readTaskScheduleDefinitionFromConfig, - TaskScheduleDefinition, -} from '@backstage/backend-tasks'; + SchedulerServiceTaskScheduleDefinition, + readSchedulerServiceTaskScheduleDefinitionFromConfig, +} from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { JsonValue } from '@backstage/types'; import { SearchOptions } from 'ldapjs'; @@ -46,7 +46,7 @@ export type LdapProviderConfig = { // The settings that govern the reading and interpretation of groups groups: GroupConfig; // Schedule configuration for refresh tasks. - schedule?: TaskScheduleDefinition; + schedule?: SchedulerServiceTaskScheduleDefinition; }; /** @@ -380,7 +380,9 @@ export function readProviderConfigs(config: Config): LdapProviderConfig[] { const c = providersConfig.getConfig(id); const schedule = c.has('schedule') - ? readTaskScheduleDefinitionFromConfig(c.getConfig('schedule')) + ? readSchedulerServiceTaskScheduleDefinitionFromConfig( + c.getConfig('schedule'), + ) : undefined; const newConfig = { diff --git a/plugins/catalog-backend-module-ldap/src/processors/LdapOrgEntityProvider.ts b/plugins/catalog-backend-module-ldap/src/processors/LdapOrgEntityProvider.ts index fb8f27d685..0e5fae55bb 100644 --- a/plugins/catalog-backend-module-ldap/src/processors/LdapOrgEntityProvider.ts +++ b/plugins/catalog-backend-module-ldap/src/processors/LdapOrgEntityProvider.ts @@ -14,7 +14,6 @@ * limitations under the License. */ -import { PluginTaskScheduler, TaskRunner } from '@backstage/backend-tasks'; import { ANNOTATION_LOCATION, ANNOTATION_ORIGIN_LOCATION, @@ -35,7 +34,11 @@ import { readLdapOrg, UserTransformer, } from '../ldap'; -import { LoggerService } from '@backstage/backend-plugin-api'; +import { + LoggerService, + SchedulerService, + SchedulerServiceTaskRunner, +} from '@backstage/backend-plugin-api'; import { readLdapLegacyConfig, readProviderConfigs } from '../ldap'; /** @@ -60,16 +63,16 @@ export type LdapOrgEntityProviderOptions = * manually at some interval. * * But more commonly you will pass in the result of - * {@link @backstage/backend-tasks#PluginTaskScheduler.createScheduledTaskRunner} + * {@link @backstage/backend-plugin-api#SchedulerService.createScheduledTaskRunner} * to enable automatic scheduling of tasks. */ - schedule?: 'manual' | TaskRunner; + schedule?: 'manual' | SchedulerServiceTaskRunner; /** * Scheduler used to schedule refreshes based on * the schedule config. */ - scheduler?: PluginTaskScheduler; + scheduler?: SchedulerService; /** * The function that transforms a user entry in msgraph to an entity. @@ -122,10 +125,10 @@ export interface LdapOrgEntityProviderLegacyOptions { * manually at some interval. * * But more commonly you will pass in the result of - * {@link @backstage/backend-tasks#PluginTaskScheduler.createScheduledTaskRunner} + * {@link @backstage/backend-plugin-api#SchedulerService.createScheduledTaskRunner} * to enable automatic scheduling of tasks. */ - schedule: 'manual' | TaskRunner; + schedule: 'manual' | SchedulerServiceTaskRunner; /** * The function that transforms a user entry in LDAP to an entity. @@ -311,7 +314,7 @@ export class LdapOrgEntityProvider implements EntityProvider { markCommitComplete(); } - private schedule(taskRunner: TaskRunner) { + private schedule(taskRunner: SchedulerServiceTaskRunner) { this.scheduleFn = async () => { const id = `${this.getProviderName()}:refresh`; await taskRunner.run({ diff --git a/plugins/catalog-backend-module-msgraph/src/microsoftGraph/config.test.ts b/plugins/catalog-backend-module-msgraph/src/microsoftGraph/config.test.ts index b02894dfd9..c0e9f61f29 100644 --- a/plugins/catalog-backend-module-msgraph/src/microsoftGraph/config.test.ts +++ b/plugins/catalog-backend-module-msgraph/src/microsoftGraph/config.test.ts @@ -15,7 +15,6 @@ */ import { ConfigReader } from '@backstage/config'; -import { Duration } from 'luxon'; import { readMicrosoftGraphConfig, readProviderConfigs } from './config'; describe('readMicrosoftGraphConfig', () => { @@ -204,7 +203,7 @@ describe('readProviderConfigs', () => { groupSelect: ['id', 'displayName', 'description'], groupFilter: 'securityEnabled eq false', schedule: { - frequency: Duration.fromISO('PT30M'), + frequency: { minutes: 30 }, timeout: { minutes: 3, }, diff --git a/plugins/catalog-backend-module-msgraph/src/module/catalogModuleMicrosoftGraphOrgEntityProvider.test.ts b/plugins/catalog-backend-module-msgraph/src/module/catalogModuleMicrosoftGraphOrgEntityProvider.test.ts index 5742fbbc6c..2a3e66a9b3 100644 --- a/plugins/catalog-backend-module-msgraph/src/module/catalogModuleMicrosoftGraphOrgEntityProvider.test.ts +++ b/plugins/catalog-backend-module-msgraph/src/module/catalogModuleMicrosoftGraphOrgEntityProvider.test.ts @@ -17,7 +17,6 @@ import { TaskScheduleDefinition } from '@backstage/backend-tasks'; import { mockServices, startTestBackend } from '@backstage/backend-test-utils'; import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha'; -import { Duration } from 'luxon'; import { catalogModuleMicrosoftGraphOrgEntityProvider } from './catalogModuleMicrosoftGraphOrgEntityProvider'; import { MicrosoftGraphOrgEntityProvider } from '../processors'; @@ -67,8 +66,8 @@ describe('catalogModuleMicrosoftGraphOrgEntityProvider', () => { ], }); - expect(usedSchedule?.frequency).toEqual(Duration.fromISO('PT30M')); - expect(usedSchedule?.timeout).toEqual(Duration.fromISO('PT3M')); + expect(usedSchedule?.frequency).toEqual({ minutes: 30 }); + expect(usedSchedule?.timeout).toEqual({ minutes: 3 }); expect(addedProviders?.length).toEqual(1); expect(addedProviders?.pop()?.getProviderName()).toEqual( 'MicrosoftGraphOrgEntityProvider:customProviderId', diff --git a/plugins/catalog-backend-module-puppetdb/src/providers/PuppetDbEntityProviderConfig.test.ts b/plugins/catalog-backend-module-puppetdb/src/providers/PuppetDbEntityProviderConfig.test.ts index 8da0fb4150..86335cb97d 100644 --- a/plugins/catalog-backend-module-puppetdb/src/providers/PuppetDbEntityProviderConfig.test.ts +++ b/plugins/catalog-backend-module-puppetdb/src/providers/PuppetDbEntityProviderConfig.test.ts @@ -16,7 +16,6 @@ import { ConfigReader } from '@backstage/config'; import { readProviderConfigs } from './PuppetDbEntityProviderConfig'; -import { Duration } from 'luxon'; describe('readProviderConfigs', () => { afterEach(() => jest.resetAllMocks()); @@ -120,10 +119,8 @@ describe('readProviderConfigs', () => { expect(providerConfigs).toHaveLength(1); expect(providerConfigs[0].schedule).toEqual({ - frequency: Duration.fromISO('PT30M'), - timeout: { - minutes: 10, - }, + frequency: { minutes: 30 }, + timeout: { minutes: 10 }, }); }); }); From b60db08179bb8ab122829543a1875c191ff4436b Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 19 Jun 2024 15:26:48 +0200 Subject: [PATCH 260/387] chore: add changeset Signed-off-by: blam --- .changeset/thick-lizards-divide.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/thick-lizards-divide.md diff --git a/.changeset/thick-lizards-divide.md b/.changeset/thick-lizards-divide.md new file mode 100644 index 0000000000..84c1ab311a --- /dev/null +++ b/.changeset/thick-lizards-divide.md @@ -0,0 +1,6 @@ +--- +'@backstage/backend-app-api': patch +'@backstage/backend-common': patch +--- + +Fixing exporting of classes properly from new packages From 71bf2c492494d4a855788f4a71e6e7803aefc79b Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 19 Jun 2024 15:32:30 +0200 Subject: [PATCH 261/387] chore: fixing issues with package name for subpath exports Signed-off-by: blam --- packages/cli/src/lib/packager/productionPack.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/lib/packager/productionPack.ts b/packages/cli/src/lib/packager/productionPack.ts index 6a59924a30..3c2b5aa89e 100644 --- a/packages/cli/src/lib/packager/productionPack.ts +++ b/packages/cli/src/lib/packager/productionPack.ts @@ -180,7 +180,9 @@ async function prepareExportsEntryPoints( await fs.writeJson( resolvePath(entryPointDir, PKG_PATH), { - name: pkg.name, + // Need a temporary name, as sharing the same name causes some typescript issues with caching of packages names + // And their defined `types` field. + name: `${pkg.name}__${entryPoint.name.toLocaleLowerCase('en-US')}`, version: pkg.version, ...(exp.default ? { main: posixPath.join('..', exp.default) } : {}), ...(exp.import ? { module: posixPath.join('..', exp.import) } : {}), From 0510d983ab670aa9f1e707d48339084e5cbb5aaa Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 19 Jun 2024 15:33:31 +0200 Subject: [PATCH 262/387] chore: added changeset Signed-off-by: blam --- .changeset/silent-experts-move.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/silent-experts-move.md diff --git a/.changeset/silent-experts-move.md b/.changeset/silent-experts-move.md new file mode 100644 index 0000000000..06441a62c6 --- /dev/null +++ b/.changeset/silent-experts-move.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Subpath export `package.json` should be of a unique name to avoid typescript resolution issues From cb14a050d0acaacd026f82fdfbf10ca381b781ba Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 19 Jun 2024 15:40:54 +0200 Subject: [PATCH 263/387] chore: added changeset Signed-off-by: blam --- .changeset/rare-peas-dream.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/rare-peas-dream.md diff --git a/.changeset/rare-peas-dream.md b/.changeset/rare-peas-dream.md new file mode 100644 index 0000000000..443f8c566d --- /dev/null +++ b/.changeset/rare-peas-dream.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-defaults': patch +--- + +Repack the package to fix issues with typescript with named exports From 1fbd77fb56fc9c1031ff1bd679a9e9c821c01338 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 19 Jun 2024 17:09:53 +0200 Subject: [PATCH 264/387] chore: small refactor to move the handlers out into an extension point Signed-off-by: blam --- .../package.json | 1 + .../src/autocomplete}/autocomplete.test.ts | 16 ++--- .../src/autocomplete}/autocomplete.ts | 34 +++++----- .../src/module.ts | 14 ++++- .../src/service/router.test.ts | 2 +- .../scaffolder-backend/src/service/router.ts | 31 +++++----- plugins/scaffolder-node/src/alpha.ts | 32 ++++++---- plugins/scaffolder-react/src/api/types.ts | 12 ++-- plugins/scaffolder/src/api.ts | 36 +++++++---- .../RepoUrlPicker/BitbucketRepoPicker.tsx | 62 ++++++++++++------- 10 files changed, 144 insertions(+), 96 deletions(-) rename plugins/{scaffolder-backend/src/service => scaffolder-backend-module-bitbucket-cloud/src/autocomplete}/autocomplete.test.ts (81%) rename plugins/{scaffolder-backend/src/service => scaffolder-backend-module-bitbucket-cloud/src/autocomplete}/autocomplete.ts (69%) diff --git a/plugins/scaffolder-backend-module-bitbucket-cloud/package.json b/plugins/scaffolder-backend-module-bitbucket-cloud/package.json index f846f751cc..97a08e2741 100644 --- a/plugins/scaffolder-backend-module-bitbucket-cloud/package.json +++ b/plugins/scaffolder-backend-module-bitbucket-cloud/package.json @@ -46,6 +46,7 @@ "@backstage/config": "workspace:^", "@backstage/errors": "workspace:^", "@backstage/integration": "workspace:^", + "@backstage/plugin-bitbucket-cloud-common": "workspace:^", "@backstage/plugin-scaffolder-node": "workspace:^", "fs-extra": "^11.2.0", "node-fetch": "^2.6.7", diff --git a/plugins/scaffolder-backend/src/service/autocomplete.test.ts b/plugins/scaffolder-backend-module-bitbucket-cloud/src/autocomplete/autocomplete.test.ts similarity index 81% rename from plugins/scaffolder-backend/src/service/autocomplete.test.ts rename to plugins/scaffolder-backend-module-bitbucket-cloud/src/autocomplete/autocomplete.test.ts index 53816f0126..50e218ce85 100644 --- a/plugins/scaffolder-backend/src/service/autocomplete.test.ts +++ b/plugins/scaffolder-backend-module-bitbucket-cloud/src/autocomplete/autocomplete.test.ts @@ -15,10 +15,10 @@ */ import { BitbucketCloudClient } from '@backstage/plugin-bitbucket-cloud-common'; -import { handleBitbucketCloudRequest } from './autocomplete'; +import { handleAutocompleteRequest } from './autocomplete'; import { InputError } from '@backstage/errors'; -describe('handleBitbucketCloudRequest', () => { +describe('handleAutocompleteRequest', () => { const client: Partial = { listWorkspaces: jest.fn().mockReturnValue({ iteratePages: jest @@ -43,7 +43,7 @@ describe('handleBitbucketCloudRequest', () => { it('should pass the token to the client', async () => { const accessToken = 'foo'; - await handleBitbucketCloudRequest(accessToken, 'workspaces', {}); + await handleAutocompleteRequest(accessToken, 'workspaces', {}); expect(fromConfig).toHaveBeenCalledWith( expect.objectContaining({ accessToken }), @@ -51,13 +51,13 @@ describe('handleBitbucketCloudRequest', () => { }); it('should return workspaces', async () => { - const result = await handleBitbucketCloudRequest('foo', 'workspaces', {}); + const result = await handleAutocompleteRequest('foo', 'workspaces', {}); expect(result).toEqual(['workspace1']); }); it('should return projects', async () => { - const result = await handleBitbucketCloudRequest('foo', 'projects', { + const result = await handleAutocompleteRequest('foo', 'projects', { workspace: 'workspace1', }); @@ -65,7 +65,7 @@ describe('handleBitbucketCloudRequest', () => { }); it('should return repositories', async () => { - const result = await handleBitbucketCloudRequest('foo', 'repositories', { + const result = await handleAutocompleteRequest('foo', 'repositories', { workspace: 'workspace1', project: 'project1', }); @@ -75,13 +75,13 @@ describe('handleBitbucketCloudRequest', () => { it('should throw an error when passing an invalid resource', async () => { await expect( - handleBitbucketCloudRequest('token', 'invalid', {}), + handleAutocompleteRequest('token', 'invalid', {}), ).rejects.toThrow(InputError); }); it('should throw an error when there are missing parameters', async () => { await expect( - handleBitbucketCloudRequest('token', 'projects', {}), + handleAutocompleteRequest('token', 'projects', {}), ).rejects.toThrow(InputError); }); }); diff --git a/plugins/scaffolder-backend/src/service/autocomplete.ts b/plugins/scaffolder-backend-module-bitbucket-cloud/src/autocomplete/autocomplete.ts similarity index 69% rename from plugins/scaffolder-backend/src/service/autocomplete.ts rename to plugins/scaffolder-backend-module-bitbucket-cloud/src/autocomplete/autocomplete.ts index 131305d53e..50723fb41d 100644 --- a/plugins/scaffolder-backend/src/service/autocomplete.ts +++ b/plugins/scaffolder-backend-module-bitbucket-cloud/src/autocomplete/autocomplete.ts @@ -17,11 +17,15 @@ import { InputError } from '@backstage/errors'; import { BitbucketCloudClient } from '@backstage/plugin-bitbucket-cloud-common'; -export async function handleAutocompleteRequest( - token: string, - resource: string, - parameters: Record, -): Promise { +export async function handleAutocompleteRequest({ + resource, + token, + context, +}: { + resource: string; + token: string; + context: Record; +}): Promise<{ results: { title: string }[] }> { const client = BitbucketCloudClient.fromConfig({ host: 'bitbucket.org', apiBaseUrl: 'https://api.bitbucket.org/2.0', @@ -37,41 +41,41 @@ export async function handleAutocompleteRequest( result.push(...slugs); } - return result; + return { results: result.map(title => ({ title })) }; } case 'projects': { - if (!parameters.workspace) - throw new InputError('Missing workspace query parameter'); + if (!context.workspace) + throw new InputError('Missing workspace context parameter'); const result: string[] = []; for await (const page of client - .listProjectsByWorkspace(parameters.workspace) + .listProjectsByWorkspace(context.workspace) .iteratePages()) { const keys = [...page.values!].map(p => p.key!); result.push(...keys); } - return result; + return { results: result.map(title => ({ title })) }; } case 'repositories': { - if (!parameters.workspace || !parameters.project) + if (!context.workspace || !context.project) throw new InputError( - 'Missing workspace and/or project query parameter', + 'Missing workspace and/or project context parameter', ); const result: string[] = []; for await (const page of client - .listRepositoriesByWorkspace(parameters.workspace, { - q: `project.key="${parameters.project}"`, + .listRepositoriesByWorkspace(context.workspace, { + q: `project.key="${context.project}"`, }) .iteratePages()) { const slugs = [...page.values!].map(p => p.slug!); result.push(...slugs); } - return result; + return { results: result.map(title => ({ title })) }; } default: throw new InputError(`Invalid resource: ${resource}`); diff --git a/plugins/scaffolder-backend-module-bitbucket-cloud/src/module.ts b/plugins/scaffolder-backend-module-bitbucket-cloud/src/module.ts index 81afbf8c88..5bf49f7cd9 100644 --- a/plugins/scaffolder-backend-module-bitbucket-cloud/src/module.ts +++ b/plugins/scaffolder-backend-module-bitbucket-cloud/src/module.ts @@ -17,12 +17,16 @@ import { coreServices, createBackendModule, } from '@backstage/backend-plugin-api'; -import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha'; +import { + scaffolderActionsExtensionPoint, + scaffolderAutocompleteExtensionPoint, +} from '@backstage/plugin-scaffolder-node/alpha'; import { createBitbucketPipelinesRunAction, createPublishBitbucketCloudAction, } from './actions'; import { ScmIntegrations } from '@backstage/integration'; +import { handleAutocompleteRequest } from './autocomplete/autocomplete'; /** * @public @@ -35,15 +39,21 @@ export const bitbucketCloudModule = createBackendModule({ registerInit({ deps: { scaffolder: scaffolderActionsExtensionPoint, + autocomplete: scaffolderAutocompleteExtensionPoint, config: coreServices.rootConfig, }, - async init({ scaffolder, config }) { + async init({ scaffolder, config, autocomplete }) { const integrations = ScmIntegrations.fromConfig(config); scaffolder.addActions( createPublishBitbucketCloudAction({ integrations, config }), createBitbucketPipelinesRunAction({ integrations }), ); + + autocomplete.addAutocompleteProvider({ + id: 'bitbucket-cloud', + handler: handleAutocompleteRequest, + }); }, }); }, diff --git a/plugins/scaffolder-backend/src/service/router.test.ts b/plugins/scaffolder-backend/src/service/router.test.ts index f9ff1b2a04..10975d6b52 100644 --- a/plugins/scaffolder-backend/src/service/router.test.ts +++ b/plugins/scaffolder-backend/src/service/router.test.ts @@ -46,7 +46,7 @@ import { PermissionEvaluator, } from '@backstage/plugin-permission-common'; import { mockCredentials, mockServices } from '@backstage/backend-test-utils'; -import { handleBitbucketCloudRequest } from './autocomplete'; +import { handleBitbucketCloudRequest } from '@backstage/plugin-scaffolder-backend-module-bitbucket-cloud/src/autocomplete/autocomplete'; const mockAccess = jest.fn(); diff --git a/plugins/scaffolder-backend/src/service/router.ts b/plugins/scaffolder-backend/src/service/router.ts index dbccd6ddb5..e5f88c3482 100644 --- a/plugins/scaffolder-backend/src/service/router.ts +++ b/plugins/scaffolder-backend/src/service/router.ts @@ -94,7 +94,7 @@ import { } from '@backstage/plugin-auth-node'; import { InternalTaskSecrets } from '../scaffolder/tasks/types'; import { checkPermission } from '../util/checkPermissions'; -import { handleBitbucketCloudRequest } from './autocomplete'; +import { AutocompleteHandler } from '@backstage/plugin-scaffolder-node/alpha'; /** * @@ -167,6 +167,8 @@ export interface RouterOptions { httpAuth?: HttpAuthService; identity?: IdentityApi; discovery?: DiscoveryService; + + autocompleteHandlers?: Record; } function isSupportedTemplate(entity: TemplateEntityV1beta3) { @@ -274,6 +276,7 @@ export async function createRouter( permissionRules, discovery = HostDiscovery.fromConfig(config), identity = buildDefaultIdentityClient(options), + autocompleteHandlers = {}, } = options; const { auth, httpAuth } = createLegacyAuthAdapters({ @@ -773,28 +776,22 @@ export async function createRouter( })), }); }) - .get('/v2/autocomplete/:provider/:resource', async (req, res) => { - const { token, ...query } = req.query; + .post('/v2/autocomplete/:provider/:resource', async (req, res) => { + const { token, context } = req.body; const { provider, resource } = req.params; if (!token) throw new InputError('Missing token query parameter'); - let result: string[]; - - switch (provider) { - case 'bitbucketCloud': { - result = await handleBitbucketCloudRequest( - token as string, - resource, - query as Record, - ); - break; - } - default: - throw new InputError(`Unsupported provider: ${provider}`); + if (!autocompleteHandlers[provider]) { + throw new InputError(`Unsupported provider: ${provider}`); } + const { results } = await autocompleteHandlers[provider]({ + resource, + token, + context, + }); - res.status(200).json(result); + res.status(200).json({ results }); }); const app = express(); diff --git a/plugins/scaffolder-node/src/alpha.ts b/plugins/scaffolder-node/src/alpha.ts index 3644d48b7c..ef4d5ab289 100644 --- a/plugins/scaffolder-node/src/alpha.ts +++ b/plugins/scaffolder-node/src/alpha.ts @@ -80,22 +80,32 @@ export const scaffolderTemplatingExtensionPoint = id: 'scaffolder.templating', }); +/** + * Autocomplete handler for the scaffolder. + * @alpha + */ +export type AutocompleteHandler = ({ + resource, + token, + context, +}: { + resource: string; + token: string; + context: Record; +}) => Promise<{ results: { title: string }[] }>; + /** * Extension point for adding autocomplete handler providers * @alpha */ export interface ScaffolderAutocompleteExtensionPoint { - addAutocompleteProvider( - provider: ({ - type, - token, - query, - }: { - type: string; - token: string; - query: Record; - }) => Promise<{ results: { title: string }[] }>, - ): void; + addAutocompleteProvider({ + id, + handler, + }: { + id: string; + handler: AutocompleteHandler; + }): void; } /** diff --git a/plugins/scaffolder-react/src/api/types.ts b/plugins/scaffolder-react/src/api/types.ts index c79f98c780..eaef54ff1b 100644 --- a/plugins/scaffolder-react/src/api/types.ts +++ b/plugins/scaffolder-react/src/api/types.ts @@ -230,10 +230,10 @@ export interface ScaffolderApi { dryRun?(options: ScaffolderDryRunOptions): Promise; - autocomplete( - token: string, - provider: string, - resource: string, - params?: Record, - ): Promise; + autocomplete?(options: { + token: string; + provider: string; + resource: string; + context?: Record; + }): Promise<{ results: { title: string }[] }>; } diff --git a/plugins/scaffolder/src/api.ts b/plugins/scaffolder/src/api.ts index ff5c89e91e..1809ed4c15 100644 --- a/plugins/scaffolder/src/api.ts +++ b/plugins/scaffolder/src/api.ts @@ -338,27 +338,37 @@ export class ScaffolderClient implements ScaffolderApi { return await response.json(); } - async autocomplete( - token: string, - provider: string, - resource: string, - params?: Record, - ): Promise { + async autocomplete({ + token, + resource, + provider, + context, + }: { + token: string; + provider: string; + resource: string; + context?: Record; + }): Promise<{ results: { title: string }[] }> { const baseUrl = await this.discoveryApi.getBaseUrl('scaffolder'); - const query = new URLSearchParams({ - ...params, - token, - }); - const url = `${baseUrl}/v2/autocomplete/${provider}/${resource}?${query}`; + + const url = `${baseUrl}/v2/autocomplete/${provider}/${resource}`; const response = await this.fetchApi.fetch(url, { - method: 'GET', + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + token, + context: context ?? {}, + }), }); if (!response.ok) { throw await ResponseError.fromResponse(response); } - return await response.json(); + const { results } = await response.json(); + return { results }; } } diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx index 51bd1f5c67..10d4a6e6c3 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx @@ -72,14 +72,19 @@ export const BitbucketRepoPicker = (props: { useDebounce( () => { const updateAvailableWorkspaces = async () => { - if (host === 'bitbucket.org' && accessToken) { - const result = await scaffolderApi.autocomplete( - accessToken, - 'bitbucketCloud', - 'workspaces', - ); + if ( + host === 'bitbucket.org' && + accessToken && + scaffolderApi.autocomplete + ) { + const { results } = await scaffolderApi.autocomplete({ + token: accessToken, + resource: 'workspaces', + context: {}, + provider: 'bitbucket-cloud', + }); - setAvailableWorkspaces(result); + setAvailableWorkspaces(results.map(r => r.title)); } else { setAvailableWorkspaces([]); } @@ -95,15 +100,20 @@ export const BitbucketRepoPicker = (props: { useDebounce( () => { const updateAvailableProjects = async () => { - if (host === 'bitbucket.org' && accessToken && workspace) { - const result = await scaffolderApi.autocomplete( - accessToken, - 'bitbucketCloud', - 'projects', - { workspace }, - ); + if ( + host === 'bitbucket.org' && + accessToken && + workspace && + scaffolderApi.autocomplete + ) { + const { results } = await scaffolderApi.autocomplete({ + token: accessToken, + resource: 'projects', + context: { workspace }, + provider: 'bitbucket-cloud', + }); - setAvailableProjects(result); + setAvailableProjects(results.map(r => r.title)); } else { setAvailableProjects([]); } @@ -119,15 +129,21 @@ export const BitbucketRepoPicker = (props: { useDebounce( () => { const updateAvailableRepositories = async () => { - if (host === 'bitbucket.org' && accessToken && workspace && project) { - const availableRepos = await scaffolderApi.autocomplete( - accessToken, - 'bitbucketCloud', - 'repositories', - { workspace, project }, - ); + if ( + host === 'bitbucket.org' && + accessToken && + workspace && + project && + scaffolderApi.autocomplete + ) { + const { results } = await scaffolderApi.autocomplete({ + token: accessToken, + resource: 'repositories', + context: { workspace, project }, + provider: 'bitbucket-cloud', + }); - onChange({ availableRepos }); + onChange({ availableRepos: results.map(r => r.title) }); } else { onChange({ availableRepos: [] }); } From 16acc0fc10a1879e19075c5ce0f8900b6c5263b6 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 19 Jun 2024 17:10:11 +0200 Subject: [PATCH 265/387] chore: pass through the handlers to the autocomplete Signed-off-by: blam --- plugins/scaffolder-backend/src/ScaffolderPlugin.ts | 6 ++++-- plugins/scaffolder-backend/src/service/router.test.ts | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/scaffolder-backend/src/ScaffolderPlugin.ts b/plugins/scaffolder-backend/src/ScaffolderPlugin.ts index 9fc4b2537a..c83c6d437d 100644 --- a/plugins/scaffolder-backend/src/ScaffolderPlugin.ts +++ b/plugins/scaffolder-backend/src/ScaffolderPlugin.ts @@ -28,6 +28,7 @@ import { TemplateGlobal, } from '@backstage/plugin-scaffolder-node'; import { + AutocompleteHandler, scaffolderActionsExtensionPoint, scaffolderAutocompleteExtensionPoint, scaffolderTaskBrokerExtensionPoint, @@ -83,10 +84,10 @@ export const scaffolderPlugin = createBackendPlugin({ }, }); - const autocompleteResolers = []; + const autocompleteHandlers: Record = {}; env.registerExtensionPoint(scaffolderAutocompleteExtensionPoint, { addAutocompleteProvider(provider) { - autocompleteResolers.push(provider); + autocompleteHandlers[provider.id] = provider.handler; }, }); @@ -170,6 +171,7 @@ export const scaffolderPlugin = createBackendPlugin({ httpAuth, discovery, permissions, + autocompleteHandlers, }); httpRouter.use(router); }, diff --git a/plugins/scaffolder-backend/src/service/router.test.ts b/plugins/scaffolder-backend/src/service/router.test.ts index 10975d6b52..4bd3847666 100644 --- a/plugins/scaffolder-backend/src/service/router.test.ts +++ b/plugins/scaffolder-backend/src/service/router.test.ts @@ -46,7 +46,6 @@ import { PermissionEvaluator, } from '@backstage/plugin-permission-common'; import { mockCredentials, mockServices } from '@backstage/backend-test-utils'; -import { handleBitbucketCloudRequest } from '@backstage/plugin-scaffolder-backend-module-bitbucket-cloud/src/autocomplete/autocomplete'; const mockAccess = jest.fn(); From ef7d1f77b8e3042078a082b52de8a8411859e6bb Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 19 Jun 2024 17:58:20 +0200 Subject: [PATCH 266/387] chore: woops small fix Signed-off-by: blam --- packages/backend-app-api/src/http/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend-app-api/src/http/index.ts b/packages/backend-app-api/src/http/index.ts index 8fd1b31e75..a056ed2d61 100644 --- a/packages/backend-app-api/src/http/index.ts +++ b/packages/backend-app-api/src/http/index.ts @@ -58,7 +58,7 @@ export class MiddlewareFactory { * Creates a new {@link MiddlewareFactory}. */ static create(options: MiddlewareFactoryOptions) { - return _MiddlewareFactory.create(options); + return new MiddlewareFactory(_MiddlewareFactory.create(options)); } private constructor(private readonly impl: _MiddlewareFactory) {} From a63c4b699ad8d815ee664747f20712930b61812c Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 19 Jun 2024 17:58:58 +0200 Subject: [PATCH 267/387] chore: fix Signed-off-by: blam --- .changeset/young-houses-unite.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/young-houses-unite.md diff --git a/.changeset/young-houses-unite.md b/.changeset/young-houses-unite.md new file mode 100644 index 0000000000..47ffe43c21 --- /dev/null +++ b/.changeset/young-houses-unite.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-app-api': patch +--- + +Fixing issue with `MiddlewareFactory` deprecation wrapping From 138a01db54c89ddb14cbcb7fd39db92e170342af Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 19 Jun 2024 18:45:24 +0200 Subject: [PATCH 268/387] chore: fixing api--report Signed-off-by: blam --- packages/backend-app-api/api-report.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/backend-app-api/api-report.md b/packages/backend-app-api/api-report.md index 724d3409bf..7518f8e2cc 100644 --- a/packages/backend-app-api/api-report.md +++ b/packages/backend-app-api/api-report.md @@ -208,8 +208,7 @@ export const loggerServiceFactory: () => ServiceFactory< export class MiddlewareFactory { compression(): RequestHandler; cors(): RequestHandler; - // Warning: (ae-forgotten-export) The symbol "MiddlewareFactory_2" needs to be exported by the entry point index.d.ts - static create(options: MiddlewareFactoryOptions): MiddlewareFactory_2; + static create(options: MiddlewareFactoryOptions): MiddlewareFactory; error(options?: MiddlewareFactoryErrorOptions): ErrorRequestHandler; helmet(): RequestHandler; logging(): RequestHandler; From 526075a5b0cdc0cff4e7e9834e2cbee67c3a8b81 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 19 Jun 2024 19:04:41 +0200 Subject: [PATCH 269/387] chore: revert lockfile changes Signed-off-by: blam --- packages/cli/src/lib/versioning/Lockfile.ts | 80 ++++----------------- 1 file changed, 13 insertions(+), 67 deletions(-) diff --git a/packages/cli/src/lib/versioning/Lockfile.ts b/packages/cli/src/lib/versioning/Lockfile.ts index 6af115a4da..50d0a77cfd 100644 --- a/packages/cli/src/lib/versioning/Lockfile.ts +++ b/packages/cli/src/lib/versioning/Lockfile.ts @@ -98,24 +98,6 @@ export class Lockfile { return Lockfile.parse(lockfileContents); } - static #getRangesFromDataKey(key: string): string[] { - const [, name, ranges] = key.match(ENTRY_PATTERN) ?? []; - if (!name) { - throw new Error(`Failed to parse yarn.lock entry '${key}'`); - } - - return ranges.split(/\s*,\s*/).map(rangePart => { - let range = rangePart; - if (range.startsWith(`${name}@`)) { - range = range.slice(`${name}@`.length); - } - if (range.startsWith('npm:')) { - range = range.slice('npm:'.length); - } - return range; - }); - } - static parse(content: string) { const legacy = LEGACY_REGEX.test(content); @@ -131,7 +113,7 @@ export class Lockfile { for (const [key, value] of Object.entries(data)) { if (SPECIAL_OBJECT_KEYS.includes(key)) continue; - const [, name] = ENTRY_PATTERN.exec(key) ?? []; + const [, name, ranges] = ENTRY_PATTERN.exec(key) ?? []; if (!name) { throw new Error(`Failed to parse yarn.lock entry '${key}'`); } @@ -141,8 +123,13 @@ export class Lockfile { queries = []; packages.set(name, queries); } - const ranges = Lockfile.#getRangesFromDataKey(key); - for (const range of ranges) { + for (let range of ranges.split(/\s*,\s*/)) { + if (range.startsWith(`${name}@`)) { + range = range.slice(`${name}@`.length); + } + if (range.startsWith('npm:')) { + range = range.slice('npm:'.length); + } queries.push({ range, version: value.version, dataKey: key }); } } @@ -289,34 +276,9 @@ export class Lockfile { } remove(name: string, range: string): boolean { - const simpleQuery = `${name}@${range}`; - const query = this.getEntryOf(name, range); - + const query = `${name}@${range}`; const existed = Boolean(this.data[query]); - - if (simpleQuery === query) { - // Single-versioned entry, just delete - delete this.data[query]; - } else { - // Remove this version from the entry key. This modifies the key, so the - // package queries' needs to be updated too. - const newRanges = Lockfile.#getRangesFromDataKey(query).filter( - q => q !== simpleQuery, - ); - const newQuery = newRanges.join(', '); - - // Replace the entry with a new one without this particular range - const entry = this.data[query]; - delete this.data[query]; - this.data[newQuery] = entry; - - // Fix all package queries pointing to the old query - this.packages.get(name)?.forEach(q => { - if (q.dataKey === query) { - q.dataKey = newQuery; - } - }); - } + delete this.data[query]; const newEntries = this.packages.get(name)?.filter(e => e.range !== range); if (newEntries) { @@ -326,35 +288,19 @@ export class Lockfile { return existed; } - getEntryOf(name: string, range: string) { - const query = this.packages.get(name)?.find(q => q.range === range); - if (!query) { - throw new Error(`No entry data for ${name}@${range}`); - } - - return query.dataKey; - } - /** Modifies the lockfile by bumping packages to the suggested versions */ replaceVersions(results: AnalyzeResultNewVersion[]) { - // When replacing versions, we might replace the same version multiple times, - // as a query may contain multiple versions. This keeps the original version, - // to ensure we don't make mistakes. - const oldVersions = Object.fromEntries( - Object.entries(this.data).map(([key, val]) => [key, val.version]), - ); - for (const { name, range, oldVersion, newVersion } of results) { - const query = this.getEntryOf(name, range); + const query = `${name}@${range}`; // Update the backing data const entryData = this.data[query]; if (!entryData) { throw new Error(`No entry data for ${query}`); } - if (oldVersions[query] !== oldVersion) { + if (entryData.version !== oldVersion) { throw new Error( - `Expected existing version data for ${query} to be ${oldVersion}, was ${oldVersions[query]}`, + `Expected existing version data for ${query} to be ${oldVersion}, was ${entryData.version}`, ); } From f0c0039fff1ade5b6945ed8a954a00c18a0c5429 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 19 Jun 2024 19:06:53 +0200 Subject: [PATCH 270/387] chore: add changeset Signed-off-by: blam --- .changeset/grumpy-wolves-hang.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/grumpy-wolves-hang.md diff --git a/.changeset/grumpy-wolves-hang.md b/.changeset/grumpy-wolves-hang.md new file mode 100644 index 0000000000..8ab3740e74 --- /dev/null +++ b/.changeset/grumpy-wolves-hang.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Fix issue with CLI that was preventing upgrading from 1.28 From 96be5d14d8477e69641912c992479e3e7a854fc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Wed, 19 Jun 2024 14:44:35 +0200 Subject: [PATCH 271/387] try to debug the _a.destroy problem MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .github/workflows/ci.yml | 27 +++++++++++- ...-interceptors-npm-0.17.10-c1199a9424.patch | 18 ++++++++ ...s-interceptors-npm-0.29.1-b5be72ad54.patch | 36 ++++++++++++++++ package.json | 3 ++ packages/cli/src/commands/versions/bump.ts | 20 ++++++++- yarn.lock | 42 ++++++++++++++++++- 6 files changed, 142 insertions(+), 4 deletions(-) create mode 100644 .yarn/patches/@mswjs-interceptors-npm-0.17.10-c1199a9424.patch create mode 100644 .yarn/patches/@mswjs-interceptors-npm-0.29.1-b5be72ad54.patch diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 135076ba40..95d6bbee34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -150,7 +150,32 @@ jobs: strategy: fail-fast: false matrix: - node-version: [18.x, 20.x] + node-version: + [ + 18.x, + 20.x, + 20.x, + 20.x, + 20.x, + 20.x, + 20.x, + 20.x, + 20.x, + 20.x, + 20.x, + 20.x, + 20.x, + 20.x, + 20.x, + 20.x, + 20.x, + 20.x, + 20.x, + 20.x, + 20.x, + 20.x, + 20.x, + ] name: Test ${{ matrix.node-version }} services: diff --git a/.yarn/patches/@mswjs-interceptors-npm-0.17.10-c1199a9424.patch b/.yarn/patches/@mswjs-interceptors-npm-0.17.10-c1199a9424.patch new file mode 100644 index 0000000000..3b6e9c1fbf --- /dev/null +++ b/.yarn/patches/@mswjs-interceptors-npm-0.17.10-c1199a9424.patch @@ -0,0 +1,18 @@ +diff --git a/lib/interceptors/ClientRequest/NodeClientRequest.js b/lib/interceptors/ClientRequest/NodeClientRequest.js +index 9bcc5a6adfd3c84541d686c3d0039f5e79dd34f5..f72d47b02a437eaefead4ec1543a0dd70dd1bb6f 100644 +--- a/lib/interceptors/ClientRequest/NodeClientRequest.js ++++ b/lib/interceptors/ClientRequest/NodeClientRequest.js +@@ -382,6 +382,13 @@ var NodeClientRequest = /** @class */ (function (_super) { + */ + NodeClientRequest.prototype.terminate = function () { + var _a; ++ const tempAgent = this.agent; ++ if (tempAgent && typeof tempAgent === 'object' && typeof tempAgent.destroy !== 'function') { ++ console.log( ++ `No agent to destroy, found '${typeof tempAgent}'->'${typeof tempAgent.destroy}':`, ++ tempAgent ++ ); ++ } + // @ts-ignore + (_a = this.agent) === null || _a === void 0 ? void 0 : _a.destroy(); + }; diff --git a/.yarn/patches/@mswjs-interceptors-npm-0.29.1-b5be72ad54.patch b/.yarn/patches/@mswjs-interceptors-npm-0.29.1-b5be72ad54.patch new file mode 100644 index 0000000000..946777f134 --- /dev/null +++ b/.yarn/patches/@mswjs-interceptors-npm-0.29.1-b5be72ad54.patch @@ -0,0 +1,36 @@ +diff --git a/lib/node/chunk-CVV3L375.mjs b/lib/node/chunk-CVV3L375.mjs +index c37d61d709235efebe4ea19703a901bfbc05c9e3..4085c9b33075e18f7e4e3ad82fdd3fa5f6bb31e2 100644 +--- a/lib/node/chunk-CVV3L375.mjs ++++ b/lib/node/chunk-CVV3L375.mjs +@@ -540,6 +540,13 @@ var _NodeClientRequest = class extends ClientRequest { + * Terminates a pending request. + */ + terminate() { ++ const tempAgent = this.agent; ++ if (tempAgent && typeof tempAgent === 'object' && typeof tempAgent.destroy !== 'function') { ++ console.log( ++ `No agent to destroy, found '${typeof tempAgent}'->'${typeof tempAgent.destroy}':`, ++ tempAgent ++ ); ++ } + var _a; + (_a = this.agent) == null ? void 0 : _a.destroy(); + } +diff --git a/lib/node/chunk-SXGRMPXP.js b/lib/node/chunk-SXGRMPXP.js +index a5129f18a9b754acf2bfb3b1545df2378b01a95a..8228b6d4f649937559f45aefbdb8c8df275c5285 100644 +--- a/lib/node/chunk-SXGRMPXP.js ++++ b/lib/node/chunk-SXGRMPXP.js +@@ -540,6 +540,13 @@ var _NodeClientRequest = class extends _http.ClientRequest { + * Terminates a pending request. + */ + terminate() { ++ const tempAgent = this.agent; ++ if (tempAgent && typeof tempAgent === 'object' && typeof tempAgent.destroy !== 'function') { ++ console.log( ++ `No agent to destroy, found '${typeof tempAgent}'->'${typeof tempAgent.destroy}':`, ++ tempAgent ++ ); ++ } + var _a; + (_a = this.agent) == null ? void 0 : _a.destroy(); + } diff --git a/package.json b/package.json index 39c5d021c1..47dad4b2a2 100644 --- a/package.json +++ b/package.json @@ -87,6 +87,8 @@ "@changesets/assemble-release-plan@^6.0.0": "patch:@changesets/assemble-release-plan@npm%3A6.0.0#./.yarn/patches/@changesets-assemble-release-plan-npm-6.0.0-f7b3005037.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", "@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", + "@mswjs/interceptors@^0.17.10": "patch:@mswjs/interceptors@npm%3A0.17.10#.yarn/patches/@mswjs-interceptors-npm-0.17.10-c1199a9424.patch", + "@mswjs/interceptors@^0.29.0": "patch:@mswjs/interceptors@npm%3A0.29.1#./.yarn/patches/@mswjs-interceptors-npm-0.29.1-b5be72ad54.patch", "@types/react": "^18", "@types/react-dom": "^18", "jest-haste-map@^29.7.0": "patch:jest-haste-map@npm%3A29.7.0#./.yarn/patches/jest-haste-map-npm-29.7.0-e3be419eff.patch" @@ -94,6 +96,7 @@ "dependencies": { "@backstage/errors": "workspace:^", "@manypkg/get-packages": "^1.1.3", + "@types/global-agent": "^2.1.3", "@useoptic/optic": "^0.50.10" }, "devDependencies": { diff --git a/packages/cli/src/commands/versions/bump.ts b/packages/cli/src/commands/versions/bump.ts index 1544240704..d6d5f424ba 100644 --- a/packages/cli/src/commands/versions/bump.ts +++ b/packages/cli/src/commands/versions/bump.ts @@ -14,6 +14,12 @@ * limitations under the License. */ +import { bootstrap } from 'global-agent'; + +if (shouldUseGlobalAgent()) { + bootstrap(); +} + import fs from 'fs-extra'; import chalk from 'chalk'; import ora from 'ora'; @@ -38,10 +44,22 @@ import { getManifestByVersion, ReleaseManifest, } from '@backstage/release-manifests'; -import 'global-agent/bootstrap'; import { PackageGraph } from '@backstage/cli-node'; import { migrateMovedPackages } from './migrate'; +function shouldUseGlobalAgent(): boolean { + // see https://www.npmjs.com/package/global-agent + const namespace = + process.env.GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE ?? 'GLOBAL_AGENT_'; + if ( + process.env[`${namespace}HTTP_PROXY`] || + process.env[`${namespace}HTTPS_PROXY`] + ) { + return true; + } + return false; +} + const DEP_TYPES = [ 'dependencies', 'devDependencies', diff --git a/yarn.lock b/yarn.lock index a0a385ca66..2b8090e00d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10782,7 +10782,7 @@ __metadata: languageName: node linkType: hard -"@mswjs/interceptors@npm:^0.17.10": +"@mswjs/interceptors@npm:0.17.10": version: 0.17.10 resolution: "@mswjs/interceptors@npm:0.17.10" dependencies: @@ -10798,7 +10798,7 @@ __metadata: languageName: node linkType: hard -"@mswjs/interceptors@npm:^0.29.0": +"@mswjs/interceptors@npm:0.29.1": version: 0.29.1 resolution: "@mswjs/interceptors@npm:0.29.1" dependencies: @@ -10812,6 +10812,36 @@ __metadata: languageName: node linkType: hard +"@mswjs/interceptors@patch:@mswjs/interceptors@npm%3A0.17.10#.yarn/patches/@mswjs-interceptors-npm-0.17.10-c1199a9424.patch::locator=root%40workspace%3A.": + version: 0.17.10 + resolution: "@mswjs/interceptors@patch:@mswjs/interceptors@npm%3A0.17.10#.yarn/patches/@mswjs-interceptors-npm-0.17.10-c1199a9424.patch::version=0.17.10&hash=652df3&locator=root%40workspace%3A." + dependencies: + "@open-draft/until": ^1.0.3 + "@types/debug": ^4.1.7 + "@xmldom/xmldom": ^0.8.3 + debug: ^4.3.3 + headers-polyfill: 3.2.5 + outvariant: ^1.2.1 + strict-event-emitter: ^0.2.4 + web-encoding: ^1.1.5 + checksum: 32ca2f2d4e8bc46e1f773ca440a0ec5ba9c69ea4d89c07fbd25a0fde73627a232eb7d0cf3ce426fbe1fd58863ab9c84386352ecdc55eeb2a5240ba126c0ba6f0 + languageName: node + linkType: hard + +"@mswjs/interceptors@patch:@mswjs/interceptors@npm%3A0.29.1#./.yarn/patches/@mswjs-interceptors-npm-0.29.1-b5be72ad54.patch::locator=root%40workspace%3A.": + version: 0.29.1 + resolution: "@mswjs/interceptors@patch:@mswjs/interceptors@npm%3A0.29.1#./.yarn/patches/@mswjs-interceptors-npm-0.29.1-b5be72ad54.patch::version=0.29.1&hash=d6ea98&locator=root%40workspace%3A." + dependencies: + "@open-draft/deferred-promise": ^2.2.0 + "@open-draft/logger": ^0.3.0 + "@open-draft/until": ^2.0.0 + is-node-process: ^1.2.0 + outvariant: ^1.2.1 + strict-event-emitter: ^0.5.1 + checksum: d7ce191736c8b5df2dcdb36d11dbf25ca37cd3c0d1319cf8594713c443c5bdf733c2aeb4863aba646a67b50813e64dc1b13fbd31cee238cc4c9f8a8fd2908486 + languageName: node + linkType: hard + "@mui/base@npm:5.0.0-beta.40": version: 5.0.0-beta.40 resolution: "@mui/base@npm:5.0.0-beta.40" @@ -17173,6 +17203,13 @@ __metadata: languageName: node linkType: hard +"@types/global-agent@npm:^2.1.3": + version: 2.1.3 + resolution: "@types/global-agent@npm:2.1.3" + checksum: 6129b6d5ba871b9d111ddf91e6f9a1725d3f28bf2aa6869ec83bebd14c688cde4275ebea6fa45b0b1c00d78109d022c935f952e9e4876d76289d4706484776c3 + languageName: node + linkType: hard + "@types/google-protobuf@npm:^3.7.2": version: 3.15.12 resolution: "@types/google-protobuf@npm:3.15.12" @@ -39395,6 +39432,7 @@ __metadata: "@spotify/eslint-plugin": ^15.0.0 "@spotify/prettier-config": ^15.0.0 "@techdocs/cli": "workspace:*" + "@types/global-agent": ^2.1.3 "@types/node": ^18.17.8 "@types/webpack": ^5.28.0 "@useoptic/optic": ^0.50.10 From dcacad5d81c4bae38aab028006ad1fd1f315d2e2 Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Thu, 6 Jun 2024 20:15:46 -0400 Subject: [PATCH 272/387] docs: update catalog error eventing/logging Signed-off-by: Christopher Diaz --- .../software-catalog/life-of-an-entity.md | 124 +++++++++++++++++- 1 file changed, 120 insertions(+), 4 deletions(-) diff --git a/docs/features/software-catalog/life-of-an-entity.md b/docs/features/software-catalog/life-of-an-entity.md index 13fe496fc1..9c45bec814 100644 --- a/docs/features/software-catalog/life-of-an-entity.md +++ b/docs/features/software-catalog/life-of-an-entity.md @@ -197,13 +197,15 @@ cannot be parsed successfully, etc. There are two main ways that these errors are surfaced. -First, the catalog backend will produce detailed logs that should contain -sufficient information for a reader to find the causes for errors. Since these -logs are typically not easily found by end users, this can mainly be a useful +First, the catalog backend will emit [events](https://github.com/backstage/backstage/tree/master/plugins/events-node) you can subscribe to that should contain +sufficient information for a reader to find the causes for errors. +Since these events are typically not easily found by end users, this can mainly be a useful tool for Backstage operators who want to debug problems either with statically registered entities that are under their control, or to help end users find problems. +> Prior to Backstage version v1.26.0 and `@backstage/plugin-catalog-backend` v1.21.9 catalog errors were logged by default. See the docs below on how to enable these logs and an example on how you can further customize how you ingest these errors. + Second, for most classes of errors, the entity itself will contain a status field that describes the problem. The contents of this field is shown at the top of your entity page in Backstage, if you have placed the corresponding error @@ -212,6 +214,118 @@ callout component (`EntityProcessingErrorsPanel`) there. We are still working to improve the surfacing and observability around processing loop errors. +### Subscribing to Catalog Errors + +Errors are published to the [events plugin](https://github.com/backstage/backstage/tree/master/plugins/events-node): `@backstage/plugin-events-node`. You can subscribe to events and respond to errors, for example you may wish to log them. + +#### New Backend System + +Make sure you have the events plugin installed. + +```ts title="packages/backend/src/index.ts" +backend.add(import('@backstage/plugin-events-backend/alpha')); +``` + +Create a backend module that subscribes to the catalog error events. The topic is `experimental.catalog.errors`. + +```ts title="packages/backend/src/index.ts" +import { CATALOG_ERRORS_TOPIC } from '@backstage/plugin-catalog-backend'; +import { + coreServices, + createBackendModule, +} from '@backstage/backend-plugin-api'; +import { eventsServiceRef, EventParams } from '@backstage/plugin-events-node'; + +interface EventsPayload { + entity: string; + location?: string; + errors: Error[]; +} + +interface EventsParamsWithPayload extends EventParams { + eventPayload: EventsPayload; +} + +const eventsModuleCatalogErrors = createBackendModule({ + pluginId: 'events', + moduleId: 'catalog-errors', + register(env) { + env.registerInit({ + deps: { + events: eventsServiceRef, + logger: coreServices.logger, + }, + async init({ events, logger }) { + events.subscribe({ + id: 'catalog', + topics: [CATALOG_ERRORS_TOPIC], + async onEvent(params: EventParams): Promise { + const event = params as EventsParamsWithPayload; + const { entity, location, errors } = event.eventPayload; + for (const error of errors) { + logger.warn(error.message, { + entity, + location, + }); + } + }, + }); + }, + }); + }, +}); +``` + +Now install your module. + +```ts title="packages/backend/src/index.ts" +backend.add(eventsModuleCatalogErrors); +``` + +You should now see logs as the catalog emits events. + +``` +[1] 2024-06-07T00:00:28.787Z events warn Policy check failed for user:default/guest; caused by Error: Malformed envelope, /metadata/tags must be array entity=user:default/guest location=file:/Users/foobar/code/backstage-demo-instance/examples/org.yaml +``` + +#### Legacy Backend + +Make sure you have the events plugin installed. See the legacy backend instructions [here](https://github.com/backstage/backstage/tree/master/plugins/events-node#legacy-backend-system). + +Subscribe to the events using the `eventBroker` set in the environment. + +```ts +import { CATALOG_ERRORS_TOPIC } from '@backstage/plugin-catalog-backend'; + +env.eventBroker.subscribe({ + supportsEventTopics(): string[] { + return [CATALOG_ERRORS_TOPIC]; + }, + + async onEvent( + params: EventParams<{ + entity: string; + location?: string; + errors: Array; + }>, + ): Promise { + const { entity, location, errors } = params.eventPayload; + for (const error of errors) { + env.logger.warn(error.message, { + entity, + location, + }); + } + }, +}); +``` + +You should now see logs as the catalog emits events. + +``` +[1] 2024-06-07T00:00:28.787Z events warn Policy check failed for user:default/guest; caused by Error: Malformed envelope, /metadata/tags must be array entity=user:default/guest location=file:/Users/foobar/code/backstage-demo-instance/examples/org.yaml +``` + ## Orphaning As mentioned earlier, entities internally form a graph. The edges go from @@ -268,8 +382,10 @@ However, if you want to delete orphaned entities automatically anyway, you can enable the automated clean up with the following app-config option. ``` + catalog: - orphanStrategy: delete +orphanStrategy: delete + ``` ## Implicit Deletion From 9809a3aadd232b5c74dc42871917ca48cd7e8cc4 Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Thu, 6 Jun 2024 20:28:19 -0400 Subject: [PATCH 273/387] fix formatting Signed-off-by: Christopher Diaz --- docs/features/software-catalog/life-of-an-entity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/software-catalog/life-of-an-entity.md b/docs/features/software-catalog/life-of-an-entity.md index 9c45bec814..3db33bf42b 100644 --- a/docs/features/software-catalog/life-of-an-entity.md +++ b/docs/features/software-catalog/life-of-an-entity.md @@ -384,7 +384,7 @@ enable the automated clean up with the following app-config option. ``` catalog: -orphanStrategy: delete + orphanStrategy: delete ``` From 12694f9a55b2550ed65d9d897067e843ecac80da Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Thu, 6 Jun 2024 20:28:39 -0400 Subject: [PATCH 274/387] fix formatting Signed-off-by: Christopher Diaz --- docs/features/software-catalog/life-of-an-entity.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/features/software-catalog/life-of-an-entity.md b/docs/features/software-catalog/life-of-an-entity.md index 3db33bf42b..6dfb656c4b 100644 --- a/docs/features/software-catalog/life-of-an-entity.md +++ b/docs/features/software-catalog/life-of-an-entity.md @@ -382,10 +382,8 @@ However, if you want to delete orphaned entities automatically anyway, you can enable the automated clean up with the following app-config option. ``` - catalog: orphanStrategy: delete - ``` ## Implicit Deletion From e2de06cf344ab9739a4e047b7df5f5a15f85e8b0 Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Thu, 6 Jun 2024 20:29:45 -0400 Subject: [PATCH 275/387] specify the log is an example Signed-off-by: Christopher Diaz --- docs/features/software-catalog/life-of-an-entity.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/features/software-catalog/life-of-an-entity.md b/docs/features/software-catalog/life-of-an-entity.md index 6dfb656c4b..017b5322be 100644 --- a/docs/features/software-catalog/life-of-an-entity.md +++ b/docs/features/software-catalog/life-of-an-entity.md @@ -282,7 +282,7 @@ Now install your module. backend.add(eventsModuleCatalogErrors); ``` -You should now see logs as the catalog emits events. +You should now see logs as the catalog emits events. Example: ``` [1] 2024-06-07T00:00:28.787Z events warn Policy check failed for user:default/guest; caused by Error: Malformed envelope, /metadata/tags must be array entity=user:default/guest location=file:/Users/foobar/code/backstage-demo-instance/examples/org.yaml @@ -320,7 +320,7 @@ env.eventBroker.subscribe({ }); ``` -You should now see logs as the catalog emits events. +You should now see logs as the catalog emits events. Example: ``` [1] 2024-06-07T00:00:28.787Z events warn Policy check failed for user:default/guest; caused by Error: Malformed envelope, /metadata/tags must be array entity=user:default/guest location=file:/Users/foobar/code/backstage-demo-instance/examples/org.yaml From 6dbe3921ca0fc383f32893f017840c24593c5942 Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Fri, 7 Jun 2024 11:17:10 -0400 Subject: [PATCH 276/387] update docs Signed-off-by: Christopher Diaz --- .../software-catalog/configuration.md | 79 ++++++++++++ .../software-catalog/life-of-an-entity.md | 116 +----------------- 2 files changed, 81 insertions(+), 114 deletions(-) diff --git a/docs/features/software-catalog/configuration.md b/docs/features/software-catalog/configuration.md index 61366a91f7..54a2b99faf 100644 --- a/docs/features/software-catalog/configuration.md +++ b/docs/features/software-catalog/configuration.md @@ -177,3 +177,82 @@ here. Setting this value too low risks exhausting rate limits on external systems that are queried by processors, such as version control systems housing catalog-info files. + +## Subscribing to Catalog Errors + +Catalog errors are published to the [events plugin](https://github.com/backstage/backstage/tree/master/plugins/events-node): `@backstage/plugin-events-node`. You can subscribe to events and respond to errors, for example you may wish to log them. + +The first step is to add the events backend plugin to your Backstage application. Navigate to your Backstage application directory and add the plugin package. + +```ts +# From your Backstage root directory +yarn --cwd packages/backend add @backstage/plugin-events-node +``` + +Now you can install the events backend plugin in your backend. + +```ts title="packages/backend/src/index.ts" +backend.add(import('@backstage/plugin-events-backend/alpha')); +``` + +Next, create a backend module that subscribes to the catalog error events. The topic is `experimental.catalog.errors`. + +```ts title="packages/backend/src/index.ts" +import { CATALOG_ERRORS_TOPIC } from '@backstage/plugin-catalog-backend'; +import { + coreServices, + createBackendModule, +} from '@backstage/backend-plugin-api'; +import { eventsServiceRef, EventParams } from '@backstage/plugin-events-node'; + +interface EventsPayload { + entity: string; + location?: string; + errors: Error[]; +} + +interface EventsParamsWithPayload extends EventParams { + eventPayload: EventsPayload; +} + +const eventsModuleCatalogErrors = createBackendModule({ + pluginId: 'events', + moduleId: 'catalog-errors', + register(env) { + env.registerInit({ + deps: { + events: eventsServiceRef, + logger: coreServices.logger, + }, + async init({ events, logger }) { + events.subscribe({ + id: 'catalog', + topics: [CATALOG_ERRORS_TOPIC], + async onEvent(params: EventParams): Promise { + const event = params as EventsParamsWithPayload; + const { entity, location, errors } = event.eventPayload; + for (const error of errors) { + logger.warn(error.message, { + entity, + location, + }); + } + }, + }); + }, + }); + }, +}); +``` + +Now install your module. + +```ts title="packages/backend/src/index.ts" +backend.add(eventsModuleCatalogErrors); +``` + +You should now see logs as the catalog emits events. Example: + +``` +[1] 2024-06-07T00:00:28.787Z events warn Policy check failed for user:default/guest; caused by Error: Malformed envelope, /metadata/tags must be array entity=user:default/guest location=file:/Users/foobar/code/backstage-demo-instance/examples/org.yaml +``` diff --git a/docs/features/software-catalog/life-of-an-entity.md b/docs/features/software-catalog/life-of-an-entity.md index 017b5322be..029778510a 100644 --- a/docs/features/software-catalog/life-of-an-entity.md +++ b/docs/features/software-catalog/life-of-an-entity.md @@ -197,8 +197,8 @@ cannot be parsed successfully, etc. There are two main ways that these errors are surfaced. -First, the catalog backend will emit [events](https://github.com/backstage/backstage/tree/master/plugins/events-node) you can subscribe to that should contain -sufficient information for a reader to find the causes for errors. +First, the catalog backend will emit events using the [events backend plugin](https://github.com/backstage/backstage/tree/master/plugins/events-node). You can subscribe to the events. The events should contain +sufficient information for a reader to find the causes for errors. See the configuration documentation [here](./configuration.md#subscribing-to-catalog-errors) for how to subscribe and log these error events. Since these events are typically not easily found by end users, this can mainly be a useful tool for Backstage operators who want to debug problems either with statically registered entities that are under their control, or to help end users find @@ -214,118 +214,6 @@ callout component (`EntityProcessingErrorsPanel`) there. We are still working to improve the surfacing and observability around processing loop errors. -### Subscribing to Catalog Errors - -Errors are published to the [events plugin](https://github.com/backstage/backstage/tree/master/plugins/events-node): `@backstage/plugin-events-node`. You can subscribe to events and respond to errors, for example you may wish to log them. - -#### New Backend System - -Make sure you have the events plugin installed. - -```ts title="packages/backend/src/index.ts" -backend.add(import('@backstage/plugin-events-backend/alpha')); -``` - -Create a backend module that subscribes to the catalog error events. The topic is `experimental.catalog.errors`. - -```ts title="packages/backend/src/index.ts" -import { CATALOG_ERRORS_TOPIC } from '@backstage/plugin-catalog-backend'; -import { - coreServices, - createBackendModule, -} from '@backstage/backend-plugin-api'; -import { eventsServiceRef, EventParams } from '@backstage/plugin-events-node'; - -interface EventsPayload { - entity: string; - location?: string; - errors: Error[]; -} - -interface EventsParamsWithPayload extends EventParams { - eventPayload: EventsPayload; -} - -const eventsModuleCatalogErrors = createBackendModule({ - pluginId: 'events', - moduleId: 'catalog-errors', - register(env) { - env.registerInit({ - deps: { - events: eventsServiceRef, - logger: coreServices.logger, - }, - async init({ events, logger }) { - events.subscribe({ - id: 'catalog', - topics: [CATALOG_ERRORS_TOPIC], - async onEvent(params: EventParams): Promise { - const event = params as EventsParamsWithPayload; - const { entity, location, errors } = event.eventPayload; - for (const error of errors) { - logger.warn(error.message, { - entity, - location, - }); - } - }, - }); - }, - }); - }, -}); -``` - -Now install your module. - -```ts title="packages/backend/src/index.ts" -backend.add(eventsModuleCatalogErrors); -``` - -You should now see logs as the catalog emits events. Example: - -``` -[1] 2024-06-07T00:00:28.787Z events warn Policy check failed for user:default/guest; caused by Error: Malformed envelope, /metadata/tags must be array entity=user:default/guest location=file:/Users/foobar/code/backstage-demo-instance/examples/org.yaml -``` - -#### Legacy Backend - -Make sure you have the events plugin installed. See the legacy backend instructions [here](https://github.com/backstage/backstage/tree/master/plugins/events-node#legacy-backend-system). - -Subscribe to the events using the `eventBroker` set in the environment. - -```ts -import { CATALOG_ERRORS_TOPIC } from '@backstage/plugin-catalog-backend'; - -env.eventBroker.subscribe({ - supportsEventTopics(): string[] { - return [CATALOG_ERRORS_TOPIC]; - }, - - async onEvent( - params: EventParams<{ - entity: string; - location?: string; - errors: Array; - }>, - ): Promise { - const { entity, location, errors } = params.eventPayload; - for (const error of errors) { - env.logger.warn(error.message, { - entity, - location, - }); - } - }, -}); -``` - -You should now see logs as the catalog emits events. Example: - -``` -[1] 2024-06-07T00:00:28.787Z events warn Policy check failed for user:default/guest; caused by Error: Malformed envelope, /metadata/tags must be array entity=user:default/guest location=file:/Users/foobar/code/backstage-demo-instance/examples/org.yaml -``` - ## Orphaning As mentioned earlier, entities internally form a graph. The edges go from From 21bef93e3535d310abea47bd1173e6ba0a0d4539 Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Fri, 7 Jun 2024 11:52:48 -0400 Subject: [PATCH 277/387] add logging module to make this easier for users but retain custom docs Signed-off-by: Christopher Diaz --- .../software-catalog/configuration.md | 29 ++++++--- .../catalog-backend-module-logs/.eslintrc.js | 1 + plugins/catalog-backend-module-logs/README.md | 30 +++++++++ .../catalog-info.yaml | 10 +++ .../catalog-backend-module-logs/package.json | 39 ++++++++++++ .../catalog-backend-module-logs/src/index.ts | 23 +++++++ .../catalog-backend-module-logs/src/module.ts | 61 +++++++++++++++++++ yarn.lock | 13 ++++ 8 files changed, 199 insertions(+), 7 deletions(-) create mode 100644 plugins/catalog-backend-module-logs/.eslintrc.js create mode 100644 plugins/catalog-backend-module-logs/README.md create mode 100644 plugins/catalog-backend-module-logs/catalog-info.yaml create mode 100644 plugins/catalog-backend-module-logs/package.json create mode 100644 plugins/catalog-backend-module-logs/src/index.ts create mode 100644 plugins/catalog-backend-module-logs/src/module.ts diff --git a/docs/features/software-catalog/configuration.md b/docs/features/software-catalog/configuration.md index 54a2b99faf..4bab2313b8 100644 --- a/docs/features/software-catalog/configuration.md +++ b/docs/features/software-catalog/configuration.md @@ -195,7 +195,27 @@ Now you can install the events backend plugin in your backend. backend.add(import('@backstage/plugin-events-backend/alpha')); ``` -Next, create a backend module that subscribes to the catalog error events. The topic is `experimental.catalog.errors`. +### Logging Errors + +If you want to log catalog errors you can install the `@backstage/plugin-catalog-backend-module-logs` module. + +```ts title="packages/backend/src/index.ts" +backend.add(import('@backstage/plugin-catalog-backend-module-logs')); +``` + +This will log errors with a level of `warn`. + +You should now see logs as the catalog emits events. Example: + +``` +[1] 2024-06-07T00:00:28.787Z events warn Policy check failed for user:default/guest; caused by Error: Malformed envelope, /metadata/tags must be array entity=user:default/guest location=file:/Users/foobar/code/backstage-demo-instance/examples/org.yaml +``` + +### Custom Error Handling + +If you wish to handle catalog errors with logic the following should help you get started. + +Create a backend module that subscribes to the catalog error events. The topic is `experimental.catalog.errors`. ```ts title="packages/backend/src/index.ts" import { CATALOG_ERRORS_TOPIC } from '@backstage/plugin-catalog-backend'; @@ -231,6 +251,7 @@ const eventsModuleCatalogErrors = createBackendModule({ async onEvent(params: EventParams): Promise { const event = params as EventsParamsWithPayload; const { entity, location, errors } = event.eventPayload; + // Add custom logic here for responding to errors for (const error of errors) { logger.warn(error.message, { entity, @@ -250,9 +271,3 @@ Now install your module. ```ts title="packages/backend/src/index.ts" backend.add(eventsModuleCatalogErrors); ``` - -You should now see logs as the catalog emits events. Example: - -``` -[1] 2024-06-07T00:00:28.787Z events warn Policy check failed for user:default/guest; caused by Error: Malformed envelope, /metadata/tags must be array entity=user:default/guest location=file:/Users/foobar/code/backstage-demo-instance/examples/org.yaml -``` diff --git a/plugins/catalog-backend-module-logs/.eslintrc.js b/plugins/catalog-backend-module-logs/.eslintrc.js new file mode 100644 index 0000000000..e2a53a6ad2 --- /dev/null +++ b/plugins/catalog-backend-module-logs/.eslintrc.js @@ -0,0 +1 @@ +module.exports = require('@backstage/cli/config/eslint-factory')(__dirname); diff --git a/plugins/catalog-backend-module-logs/README.md b/plugins/catalog-backend-module-logs/README.md new file mode 100644 index 0000000000..6c84114306 --- /dev/null +++ b/plugins/catalog-backend-module-logs/README.md @@ -0,0 +1,30 @@ +# backstage-plugin-catalog-backend-module-logs + +A module that subscribes to catalog related events and logs them. + +Catalog errors are published to the [events plugin](https://github.com/backstage/backstage/tree/master/plugins/events-node): `@backstage/plugin-events-node`. You can subscribe to events and respond to errors, for example you may wish to log them. + +The first step is to add the events backend plugin to your Backstage application. Navigate to your Backstage application directory and add the plugin package. + +```ts +# From your Backstage root directory +yarn --cwd packages/backend add @backstage/plugin-events-node +``` + +Now you can install the events backend plugin in your backend. + +```ts title="packages/backend/src/index.ts" +backend.add(import('@backstage/plugin-events-backend/alpha')); +``` + +Now install the catalog logs module. + +```ts title="packages/backend/src/index.ts" +backend.add(import('@backstage/plugin-catalog-backend-module-logs')); +``` + +You should now see logs as the catalog emits events. Example: + +``` +[1] 2024-06-07T00:00:28.787Z events warn Policy check failed for user:default/guest; caused by Error: Malformed envelope, /metadata/tags must be array entity=user:default/guest location=file:/Users/foobar/code/backstage-demo-instance/examples/org.yaml +``` diff --git a/plugins/catalog-backend-module-logs/catalog-info.yaml b/plugins/catalog-backend-module-logs/catalog-info.yaml new file mode 100644 index 0000000000..f2223174c3 --- /dev/null +++ b/plugins/catalog-backend-module-logs/catalog-info.yaml @@ -0,0 +1,10 @@ +apiVersion: backstage.io/v1alpha1 +kind: Component +metadata: + name: backstage-plugin-catalog-backend-module-logs + title: '@backstage/plugin-catalog-backend-module-logs' + description: A module that subscribes to catalog releated events and logs them. +spec: + lifecycle: experimental + type: backstage-backend-plugin-module + owner: maintainers diff --git a/plugins/catalog-backend-module-logs/package.json b/plugins/catalog-backend-module-logs/package.json new file mode 100644 index 0000000000..f35a8b7816 --- /dev/null +++ b/plugins/catalog-backend-module-logs/package.json @@ -0,0 +1,39 @@ +{ + "name": "@backstage/plugin-catalog-backend-module-logs", + "description": "A module that subscribes to catalog releated events and logs them.", + "version": "0.0.0", + "main": "src/index.ts", + "types": "src/index.ts", + "license": "Apache-2.0", + "private": true, + "publishConfig": { + "access": "public", + "main": "dist/index.cjs.js", + "types": "dist/index.d.ts" + }, + "backstage": { + "role": "backend-plugin-module" + }, + "scripts": { + "start": "backstage-cli package start", + "build": "backstage-cli package build", + "lint": "backstage-cli package lint", + "test": "backstage-cli package test", + "clean": "backstage-cli package clean", + "prepack": "backstage-cli package prepack", + "postpack": "backstage-cli package postpack" + }, + "dependencies": { + "@backstage/backend-common": "workspace:^", + "@backstage/backend-plugin-api": "workspace:^", + "@backstage/plugin-catalog-backend": "workspace:^", + "@backstage/plugin-events-node": "workspace:^" + }, + "devDependencies": { + "@backstage/backend-test-utils": "workspace:^", + "@backstage/cli": "workspace:^" + }, + "files": [ + "dist" + ] +} diff --git a/plugins/catalog-backend-module-logs/src/index.ts b/plugins/catalog-backend-module-logs/src/index.ts new file mode 100644 index 0000000000..3d5f606d27 --- /dev/null +++ b/plugins/catalog-backend-module-logs/src/index.ts @@ -0,0 +1,23 @@ +/* + * Copyright 2024 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 logs backend module for the catalog plugin. + * + * @packageDocumentation + */ + +export { catalogModuleLogs as default } from './module'; diff --git a/plugins/catalog-backend-module-logs/src/module.ts b/plugins/catalog-backend-module-logs/src/module.ts new file mode 100644 index 0000000000..0f41d2e1a6 --- /dev/null +++ b/plugins/catalog-backend-module-logs/src/module.ts @@ -0,0 +1,61 @@ +/* + * Copyright 2024 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 { + coreServices, + createBackendModule, +} from '@backstage/backend-plugin-api'; +import { CATALOG_ERRORS_TOPIC } from '@backstage/plugin-catalog-backend'; +import { eventsServiceRef, EventParams } from '@backstage/plugin-events-node'; + +interface EventsPayload { + entity: string; + location?: string; + errors: Error[]; +} + +interface EventsParamsWithPayload extends EventParams { + eventPayload: EventsPayload; +} + +export const catalogModuleLogs = createBackendModule({ + pluginId: 'catalog', + moduleId: 'logs', + register(env) { + env.registerInit({ + deps: { + events: eventsServiceRef, + logger: coreServices.logger, + }, + async init({ events, logger }) { + events.subscribe({ + id: 'catalog', + topics: [CATALOG_ERRORS_TOPIC], + async onEvent(params: EventParams): Promise { + const event = params as EventsParamsWithPayload; + const { entity, location, errors } = event.eventPayload; + for (const error of errors) { + logger.warn(error.message, { + entity, + location, + }); + } + }, + }); + }, + }); + }, +}); diff --git a/yarn.lock b/yarn.lock index a0a385ca66..542d9242da 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5440,6 +5440,19 @@ __metadata: languageName: unknown linkType: soft +"@backstage/plugin-catalog-backend-module-logs@workspace:plugins/catalog-backend-module-logs": + version: 0.0.0-use.local + resolution: "@backstage/plugin-catalog-backend-module-logs@workspace:plugins/catalog-backend-module-logs" + dependencies: + "@backstage/backend-common": "workspace:^" + "@backstage/backend-plugin-api": "workspace:^" + "@backstage/backend-test-utils": "workspace:^" + "@backstage/cli": "workspace:^" + "@backstage/plugin-catalog-backend": "workspace:^" + "@backstage/plugin-events-node": "workspace:^" + languageName: unknown + linkType: soft + "@backstage/plugin-catalog-backend-module-msgraph@workspace:plugins/catalog-backend-module-msgraph": version: 0.0.0-use.local resolution: "@backstage/plugin-catalog-backend-module-msgraph@workspace:plugins/catalog-backend-module-msgraph" From 97caf558236a4d2d9ac8029a186607cb9deddd4c Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Fri, 7 Jun 2024 11:56:36 -0400 Subject: [PATCH 278/387] add logging module to make this easier for users but retain custom docs Signed-off-by: Christopher Diaz --- .changeset/ten-pots-walk.md | 39 +++++++++++++++++++ .../software-catalog/configuration.md | 9 +++++ plugins/catalog-backend-module-logs/README.md | 9 +++++ 3 files changed, 57 insertions(+) create mode 100644 .changeset/ten-pots-walk.md diff --git a/.changeset/ten-pots-walk.md b/.changeset/ten-pots-walk.md new file mode 100644 index 0000000000..6265e8dd7f --- /dev/null +++ b/.changeset/ten-pots-walk.md @@ -0,0 +1,39 @@ +--- +'@backstage/plugin-catalog-backend-module-logs': patch +--- + +Creates a new module to make logging catalog errors simple. This module subscribes to catalog events and logs them. + +Catalog errors are published to the [events plugin](https://github.com/backstage/backstage/tree/master/plugins/events-node): `@backstage/plugin-events-node`. You can subscribe to events and respond to errors, for example you may wish to log them. + +The first step is to add the events backend plugin to your Backstage application. Navigate to your Backstage application directory and add the plugin package. + +```ts +# From your Backstage root directory +yarn --cwd packages/backend add @backstage/plugin-events-node +``` + +Now you can install the events backend plugin in your backend. + +```ts title="packages/backend/src/index.ts" +backend.add(import('@backstage/plugin-events-backend/alpha')); +``` + +Install the catalog logs module. + +```ts +# From your Backstage root directory +yarn --cwd packages/backend add @backstage/plugin-catalog-backend-module-logs +``` + +Now install the catalog logs module. + +```ts title="packages/backend/src/index.ts" +backend.add(import('@backstage/plugin-catalog-backend-module-logs')); +``` + +You should now see logs as the catalog emits events. Example: + +``` +[1] 2024-06-07T00:00:28.787Z events warn Policy check failed for user:default/guest; caused by Error: Malformed envelope, /metadata/tags must be array entity=user:default/guest location=file:/Users/foobar/code/backstage-demo-instance/examples/org.yaml +``` diff --git a/docs/features/software-catalog/configuration.md b/docs/features/software-catalog/configuration.md index 4bab2313b8..9805eb06dd 100644 --- a/docs/features/software-catalog/configuration.md +++ b/docs/features/software-catalog/configuration.md @@ -199,6 +199,15 @@ backend.add(import('@backstage/plugin-events-backend/alpha')); If you want to log catalog errors you can install the `@backstage/plugin-catalog-backend-module-logs` module. +Install the catalog logs module. + +```ts +# From your Backstage root directory +yarn --cwd packages/backend add @backstage/plugin-catalog-backend-module-logs +``` + +Add the module to your backend. + ```ts title="packages/backend/src/index.ts" backend.add(import('@backstage/plugin-catalog-backend-module-logs')); ``` diff --git a/plugins/catalog-backend-module-logs/README.md b/plugins/catalog-backend-module-logs/README.md index 6c84114306..7e20a0161b 100644 --- a/plugins/catalog-backend-module-logs/README.md +++ b/plugins/catalog-backend-module-logs/README.md @@ -13,6 +13,15 @@ yarn --cwd packages/backend add @backstage/plugin-events-node Now you can install the events backend plugin in your backend. +Install the catalog logs module. + +```ts +# From your Backstage root directory +yarn --cwd packages/backend add @backstage/plugin-catalog-backend-module-logs +``` + +Add the module to your backend. + ```ts title="packages/backend/src/index.ts" backend.add(import('@backstage/plugin-events-backend/alpha')); ``` From c4c81bcc73446a29c6cda5456ffded2698c8a816 Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Fri, 7 Jun 2024 11:57:41 -0400 Subject: [PATCH 279/387] add logging module to make this easier for users but retain custom docs Signed-off-by: Christopher Diaz --- .changeset/ten-pots-walk.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/ten-pots-walk.md b/.changeset/ten-pots-walk.md index 6265e8dd7f..e8f68afbe0 100644 --- a/.changeset/ten-pots-walk.md +++ b/.changeset/ten-pots-walk.md @@ -26,7 +26,7 @@ Install the catalog logs module. yarn --cwd packages/backend add @backstage/plugin-catalog-backend-module-logs ``` -Now install the catalog logs module. +Add the module to your backend. ```ts title="packages/backend/src/index.ts" backend.add(import('@backstage/plugin-catalog-backend-module-logs')); From 9c8518e29a1c1d40bf096f7a5e44ace9c4e70449 Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Fri, 7 Jun 2024 12:00:10 -0400 Subject: [PATCH 280/387] module should not be private Signed-off-by: Christopher Diaz --- .../catalog-backend-module-logs/package.json | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/plugins/catalog-backend-module-logs/package.json b/plugins/catalog-backend-module-logs/package.json index f35a8b7816..3d07b115ae 100644 --- a/plugins/catalog-backend-module-logs/package.json +++ b/plugins/catalog-backend-module-logs/package.json @@ -1,27 +1,29 @@ { "name": "@backstage/plugin-catalog-backend-module-logs", - "description": "A module that subscribes to catalog releated events and logs them.", "version": "0.0.0", - "main": "src/index.ts", - "types": "src/index.ts", - "license": "Apache-2.0", - "private": true, + "description": "A module that subscribes to catalog releated events and logs them.", + "backstage": { + "role": "backend-plugin-module" + }, "publishConfig": { "access": "public", "main": "dist/index.cjs.js", "types": "dist/index.d.ts" }, - "backstage": { - "role": "backend-plugin-module" - }, + "license": "Apache-2.0", + "main": "src/index.ts", + "types": "src/index.ts", + "files": [ + "dist" + ], "scripts": { - "start": "backstage-cli package start", "build": "backstage-cli package build", - "lint": "backstage-cli package lint", - "test": "backstage-cli package test", "clean": "backstage-cli package clean", + "lint": "backstage-cli package lint", "prepack": "backstage-cli package prepack", - "postpack": "backstage-cli package postpack" + "postpack": "backstage-cli package postpack", + "start": "backstage-cli package start", + "test": "backstage-cli package test" }, "dependencies": { "@backstage/backend-common": "workspace:^", @@ -32,8 +34,5 @@ "devDependencies": { "@backstage/backend-test-utils": "workspace:^", "@backstage/cli": "workspace:^" - }, - "files": [ - "dist" - ] + } } From acb3c93b4ce5be9bbc4ed5d2ac4a9ab912bb908f Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Fri, 7 Jun 2024 12:10:05 -0400 Subject: [PATCH 281/387] add api report Signed-off-by: Christopher Diaz --- plugins/catalog-backend-module-logs/api-report.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 plugins/catalog-backend-module-logs/api-report.md diff --git a/plugins/catalog-backend-module-logs/api-report.md b/plugins/catalog-backend-module-logs/api-report.md new file mode 100644 index 0000000000..abad6c3095 --- /dev/null +++ b/plugins/catalog-backend-module-logs/api-report.md @@ -0,0 +1,13 @@ +## API Report File for "@backstage/plugin-catalog-backend-module-logs" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import { BackendFeature } from '@backstage/backend-plugin-api'; + +// Warning: (ae-missing-release-tag) "catalogModuleLogs" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const catalogModuleLogs: () => BackendFeature; +export default catalogModuleLogs; +``` From d9772b13cb1f37dca41b4219dc466ebe59916c72 Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Fri, 7 Jun 2024 12:17:27 -0400 Subject: [PATCH 282/387] add api report Signed-off-by: Christopher Diaz --- plugins/catalog-backend-module-logs/src/index.ts | 1 + plugins/catalog-backend-module-logs/src/module.ts | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/plugins/catalog-backend-module-logs/src/index.ts b/plugins/catalog-backend-module-logs/src/index.ts index 3d5f606d27..6808046373 100644 --- a/plugins/catalog-backend-module-logs/src/index.ts +++ b/plugins/catalog-backend-module-logs/src/index.ts @@ -18,6 +18,7 @@ * The logs backend module for the catalog plugin. * * @packageDocumentation + * @public */ export { catalogModuleLogs as default } from './module'; diff --git a/plugins/catalog-backend-module-logs/src/module.ts b/plugins/catalog-backend-module-logs/src/module.ts index 0f41d2e1a6..13a96a64f8 100644 --- a/plugins/catalog-backend-module-logs/src/module.ts +++ b/plugins/catalog-backend-module-logs/src/module.ts @@ -14,6 +14,11 @@ * limitations under the License. */ +/** + * Logs catalog errors from events. + * + * @public + */ import { coreServices, createBackendModule, From 4118216077183039f33434011b0fc9cd0b7cdf8a Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Fri, 7 Jun 2024 12:22:25 -0400 Subject: [PATCH 283/387] add api report Signed-off-by: Christopher Diaz --- plugins/catalog-backend-module-logs/package.json | 5 +++++ plugins/catalog-backend-module-logs/src/index.ts | 3 +-- plugins/catalog-backend-module-logs/src/module.ts | 2 -- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/catalog-backend-module-logs/package.json b/plugins/catalog-backend-module-logs/package.json index 3d07b115ae..d2e76131fb 100644 --- a/plugins/catalog-backend-module-logs/package.json +++ b/plugins/catalog-backend-module-logs/package.json @@ -10,6 +10,11 @@ "main": "dist/index.cjs.js", "types": "dist/index.d.ts" }, + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/catalog-backend-module-logs" + }, "license": "Apache-2.0", "main": "src/index.ts", "types": "src/index.ts", diff --git a/plugins/catalog-backend-module-logs/src/index.ts b/plugins/catalog-backend-module-logs/src/index.ts index 6808046373..717b7bde9e 100644 --- a/plugins/catalog-backend-module-logs/src/index.ts +++ b/plugins/catalog-backend-module-logs/src/index.ts @@ -16,9 +16,8 @@ /** * The logs backend module for the catalog plugin. - * - * @packageDocumentation * @public + * @packageDocumentation */ export { catalogModuleLogs as default } from './module'; diff --git a/plugins/catalog-backend-module-logs/src/module.ts b/plugins/catalog-backend-module-logs/src/module.ts index 13a96a64f8..84f92cfe92 100644 --- a/plugins/catalog-backend-module-logs/src/module.ts +++ b/plugins/catalog-backend-module-logs/src/module.ts @@ -16,8 +16,6 @@ /** * Logs catalog errors from events. - * - * @public */ import { coreServices, From abeb6b982ea01473e15207af6c7ae1a80392b75e Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Fri, 7 Jun 2024 12:27:24 -0400 Subject: [PATCH 284/387] add api report without warnings Signed-off-by: Christopher Diaz --- plugins/catalog-backend-module-logs/api-report.md | 2 -- plugins/catalog-backend-module-logs/src/index.ts | 5 ++--- plugins/catalog-backend-module-logs/src/module.ts | 4 +--- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/plugins/catalog-backend-module-logs/api-report.md b/plugins/catalog-backend-module-logs/api-report.md index abad6c3095..7dd45e6119 100644 --- a/plugins/catalog-backend-module-logs/api-report.md +++ b/plugins/catalog-backend-module-logs/api-report.md @@ -5,8 +5,6 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -// Warning: (ae-missing-release-tag) "catalogModuleLogs" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) const catalogModuleLogs: () => BackendFeature; export default catalogModuleLogs; diff --git a/plugins/catalog-backend-module-logs/src/index.ts b/plugins/catalog-backend-module-logs/src/index.ts index 717b7bde9e..77a7d424eb 100644 --- a/plugins/catalog-backend-module-logs/src/index.ts +++ b/plugins/catalog-backend-module-logs/src/index.ts @@ -15,9 +15,8 @@ */ /** - * The logs backend module for the catalog plugin. - * @public + * A catalog module that logs catalog errors using the logger service. + * * @packageDocumentation */ - export { catalogModuleLogs as default } from './module'; diff --git a/plugins/catalog-backend-module-logs/src/module.ts b/plugins/catalog-backend-module-logs/src/module.ts index 84f92cfe92..54fc428cdf 100644 --- a/plugins/catalog-backend-module-logs/src/module.ts +++ b/plugins/catalog-backend-module-logs/src/module.ts @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * Logs catalog errors from events. - */ import { coreServices, createBackendModule, @@ -34,6 +31,7 @@ interface EventsParamsWithPayload extends EventParams { eventPayload: EventsPayload; } +/** @public */ export const catalogModuleLogs = createBackendModule({ pluginId: 'catalog', moduleId: 'logs', From 486ce82f7fa799725408728ee6dc04da541a81f8 Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Fri, 7 Jun 2024 14:07:22 -0400 Subject: [PATCH 285/387] add basic test Signed-off-by: Christopher Diaz --- .../catalog-backend-module-logs/package.json | 3 +- .../src/module.test.ts | 45 +++++++++++++++++++ yarn.lock | 1 + 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 plugins/catalog-backend-module-logs/src/module.test.ts diff --git a/plugins/catalog-backend-module-logs/package.json b/plugins/catalog-backend-module-logs/package.json index d2e76131fb..879ed3176a 100644 --- a/plugins/catalog-backend-module-logs/package.json +++ b/plugins/catalog-backend-module-logs/package.json @@ -38,6 +38,7 @@ }, "devDependencies": { "@backstage/backend-test-utils": "workspace:^", - "@backstage/cli": "workspace:^" + "@backstage/cli": "workspace:^", + "@backstage/plugin-events-backend-test-utils": "workspace:^" } } diff --git a/plugins/catalog-backend-module-logs/src/module.test.ts b/plugins/catalog-backend-module-logs/src/module.test.ts new file mode 100644 index 0000000000..733474512e --- /dev/null +++ b/plugins/catalog-backend-module-logs/src/module.test.ts @@ -0,0 +1,45 @@ +/* + * Copyright 2024 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 { mockServices, startTestBackend } from '@backstage/backend-test-utils'; +import { catalogModuleLogs } from './module'; +import { createServiceFactory } from '@backstage/backend-plugin-api'; +import { TestEventsService } from '@backstage/plugin-events-backend-test-utils'; +import { eventsServiceRef } from '@backstage/plugin-events-node'; + +describe('eventsModuleLogs', () => { + it('should be correctly wired and set up', async () => { + const events = new TestEventsService(); + const eventsServiceFactory = createServiceFactory({ + service: eventsServiceRef, + deps: {}, + async factory({}) { + return events; + }, + }); + + await startTestBackend({ + features: [ + mockServices.logger.factory(), + eventsServiceFactory(), + catalogModuleLogs(), + ], + }); + + expect(events.subscribed).toHaveLength(1); + expect(events.subscribed[0].id).toEqual('catalog'); + }); +}); diff --git a/yarn.lock b/yarn.lock index 542d9242da..6c298b9c89 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5449,6 +5449,7 @@ __metadata: "@backstage/backend-test-utils": "workspace:^" "@backstage/cli": "workspace:^" "@backstage/plugin-catalog-backend": "workspace:^" + "@backstage/plugin-events-backend-test-utils": "workspace:^" "@backstage/plugin-events-node": "workspace:^" languageName: unknown linkType: soft From 5f4090221f598ddfb101db3a629dcf577157edf0 Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Fri, 7 Jun 2024 14:08:31 -0400 Subject: [PATCH 286/387] add basic test Signed-off-by: Christopher Diaz --- plugins/catalog-backend-module-logs/src/module.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/catalog-backend-module-logs/src/module.test.ts b/plugins/catalog-backend-module-logs/src/module.test.ts index 733474512e..79f1b8c295 100644 --- a/plugins/catalog-backend-module-logs/src/module.test.ts +++ b/plugins/catalog-backend-module-logs/src/module.test.ts @@ -20,7 +20,7 @@ import { createServiceFactory } from '@backstage/backend-plugin-api'; import { TestEventsService } from '@backstage/plugin-events-backend-test-utils'; import { eventsServiceRef } from '@backstage/plugin-events-node'; -describe('eventsModuleLogs', () => { +describe('catalogModuleLogs', () => { it('should be correctly wired and set up', async () => { const events = new TestEventsService(); const eventsServiceFactory = createServiceFactory({ From 916449c0452b6e80df5b8a40ed4f3236f84f8d2b Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Wed, 19 Jun 2024 10:08:20 -0400 Subject: [PATCH 287/387] Update docs/features/software-catalog/life-of-an-entity.md Co-authored-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com> Signed-off-by: Christopher Diaz --- docs/features/software-catalog/life-of-an-entity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/software-catalog/life-of-an-entity.md b/docs/features/software-catalog/life-of-an-entity.md index 029778510a..d333b90565 100644 --- a/docs/features/software-catalog/life-of-an-entity.md +++ b/docs/features/software-catalog/life-of-an-entity.md @@ -198,7 +198,7 @@ cannot be parsed successfully, etc. There are two main ways that these errors are surfaced. First, the catalog backend will emit events using the [events backend plugin](https://github.com/backstage/backstage/tree/master/plugins/events-node). You can subscribe to the events. The events should contain -sufficient information for a reader to find the causes for errors. See the configuration documentation [here](./configuration.md#subscribing-to-catalog-errors) for how to subscribe and log these error events. +sufficient information for a reader to find the causes for errors. See the [configuration documentation](./configuration.md#subscribing-to-catalog-errors) for how to subscribe and log these error events. Since these events are typically not easily found by end users, this can mainly be a useful tool for Backstage operators who want to debug problems either with statically registered entities that are under their control, or to help end users find From f304e99204b0c8a211f4a616daf4baec2c469974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Wed, 19 Jun 2024 16:34:44 +0200 Subject: [PATCH 288/387] Update plugins/catalog-backend-module-logs/package.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/catalog-backend-module-logs/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/catalog-backend-module-logs/package.json b/plugins/catalog-backend-module-logs/package.json index 879ed3176a..e8ed120872 100644 --- a/plugins/catalog-backend-module-logs/package.json +++ b/plugins/catalog-backend-module-logs/package.json @@ -3,7 +3,9 @@ "version": "0.0.0", "description": "A module that subscribes to catalog releated events and logs them.", "backstage": { - "role": "backend-plugin-module" + "role": "backend-plugin-module", + "pluginId": "catalog", + "pluginPackage": "@backstage/plugin-catalog-backend" }, "publishConfig": { "access": "public", From 2a2de3984e6e261a0d0965595bbed5fd69a4bd60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Wed, 19 Jun 2024 16:34:49 +0200 Subject: [PATCH 289/387] Update plugins/catalog-backend-module-logs/package.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/catalog-backend-module-logs/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/catalog-backend-module-logs/package.json b/plugins/catalog-backend-module-logs/package.json index e8ed120872..858f7ec198 100644 --- a/plugins/catalog-backend-module-logs/package.json +++ b/plugins/catalog-backend-module-logs/package.json @@ -33,7 +33,6 @@ "test": "backstage-cli package test" }, "dependencies": { - "@backstage/backend-common": "workspace:^", "@backstage/backend-plugin-api": "workspace:^", "@backstage/plugin-catalog-backend": "workspace:^", "@backstage/plugin-events-node": "workspace:^" From 066cc7143ef4c51f8baff98b914ab2c2cdb5ff95 Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Wed, 19 Jun 2024 11:09:50 -0400 Subject: [PATCH 290/387] remove verbage to docs that exist elsewhere Signed-off-by: Christopher Diaz --- docs/features/software-catalog/life-of-an-entity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/software-catalog/life-of-an-entity.md b/docs/features/software-catalog/life-of-an-entity.md index d333b90565..1489688720 100644 --- a/docs/features/software-catalog/life-of-an-entity.md +++ b/docs/features/software-catalog/life-of-an-entity.md @@ -204,7 +204,7 @@ tool for Backstage operators who want to debug problems either with statically registered entities that are under their control, or to help end users find problems. -> Prior to Backstage version v1.26.0 and `@backstage/plugin-catalog-backend` v1.21.9 catalog errors were logged by default. See the docs below on how to enable these logs and an example on how you can further customize how you ingest these errors. +> Prior to Backstage version v1.26.0 and `@backstage/plugin-catalog-backend` v1.21.9 catalog errors were logged by default. Second, for most classes of errors, the entity itself will contain a status field that describes the problem. The contents of this field is shown at the top From 16589947aa9bdc95fba049d17f3cecc50b869e78 Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Wed, 19 Jun 2024 11:12:30 -0400 Subject: [PATCH 291/387] remove duplicate module docs and point to backstage docs Signed-off-by: Christopher Diaz --- plugins/catalog-backend-module-logs/README.md | 37 ++----------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/plugins/catalog-backend-module-logs/README.md b/plugins/catalog-backend-module-logs/README.md index 7e20a0161b..1771dbe02c 100644 --- a/plugins/catalog-backend-module-logs/README.md +++ b/plugins/catalog-backend-module-logs/README.md @@ -2,38 +2,7 @@ A module that subscribes to catalog related events and logs them. -Catalog errors are published to the [events plugin](https://github.com/backstage/backstage/tree/master/plugins/events-node): `@backstage/plugin-events-node`. You can subscribe to events and respond to errors, for example you may wish to log them. +## Getting started -The first step is to add the events backend plugin to your Backstage application. Navigate to your Backstage application directory and add the plugin package. - -```ts -# From your Backstage root directory -yarn --cwd packages/backend add @backstage/plugin-events-node -``` - -Now you can install the events backend plugin in your backend. - -Install the catalog logs module. - -```ts -# From your Backstage root directory -yarn --cwd packages/backend add @backstage/plugin-catalog-backend-module-logs -``` - -Add the module to your backend. - -```ts title="packages/backend/src/index.ts" -backend.add(import('@backstage/plugin-events-backend/alpha')); -``` - -Now install the catalog logs module. - -```ts title="packages/backend/src/index.ts" -backend.add(import('@backstage/plugin-catalog-backend-module-logs')); -``` - -You should now see logs as the catalog emits events. Example: - -``` -[1] 2024-06-07T00:00:28.787Z events warn Policy check failed for user:default/guest; caused by Error: Malformed envelope, /metadata/tags must be array entity=user:default/guest location=file:/Users/foobar/code/backstage-demo-instance/examples/org.yaml -``` +See [Backstage documentation](https://backstage.io/docs/features/software-catalog/configuration#subscribing-to-catalog-errors) for details on how to install +and configure the plugin. From d3f280b51fa7f0c0283cfbd02a7efad73f729aa9 Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Wed, 19 Jun 2024 11:21:41 -0400 Subject: [PATCH 292/387] remove un-needed line in docs and update changeset to use a link Signed-off-by: Christopher Diaz --- .changeset/ten-pots-walk.md | 35 ++----------------- .../software-catalog/configuration.md | 2 +- 2 files changed, 3 insertions(+), 34 deletions(-) diff --git a/.changeset/ten-pots-walk.md b/.changeset/ten-pots-walk.md index e8f68afbe0..cf540fd0e2 100644 --- a/.changeset/ten-pots-walk.md +++ b/.changeset/ten-pots-walk.md @@ -4,36 +4,5 @@ Creates a new module to make logging catalog errors simple. This module subscribes to catalog events and logs them. -Catalog errors are published to the [events plugin](https://github.com/backstage/backstage/tree/master/plugins/events-node): `@backstage/plugin-events-node`. You can subscribe to events and respond to errors, for example you may wish to log them. - -The first step is to add the events backend plugin to your Backstage application. Navigate to your Backstage application directory and add the plugin package. - -```ts -# From your Backstage root directory -yarn --cwd packages/backend add @backstage/plugin-events-node -``` - -Now you can install the events backend plugin in your backend. - -```ts title="packages/backend/src/index.ts" -backend.add(import('@backstage/plugin-events-backend/alpha')); -``` - -Install the catalog logs module. - -```ts -# From your Backstage root directory -yarn --cwd packages/backend add @backstage/plugin-catalog-backend-module-logs -``` - -Add the module to your backend. - -```ts title="packages/backend/src/index.ts" -backend.add(import('@backstage/plugin-catalog-backend-module-logs')); -``` - -You should now see logs as the catalog emits events. Example: - -``` -[1] 2024-06-07T00:00:28.787Z events warn Policy check failed for user:default/guest; caused by Error: Malformed envelope, /metadata/tags must be array entity=user:default/guest location=file:/Users/foobar/code/backstage-demo-instance/examples/org.yaml -``` +See [Backstage documentation](https://backstage.io/docs/features/software-catalog/configuration#subscribing-to-catalog-errors) for details on how to install +and configure the plugin. diff --git a/docs/features/software-catalog/configuration.md b/docs/features/software-catalog/configuration.md index 9805eb06dd..3bbbfd6716 100644 --- a/docs/features/software-catalog/configuration.md +++ b/docs/features/software-catalog/configuration.md @@ -222,7 +222,7 @@ You should now see logs as the catalog emits events. Example: ### Custom Error Handling -If you wish to handle catalog errors with logic the following should help you get started. +If you wish to handle catalog errors with specific logic different from logging the errors the following should help you get started. For example, you may wish to send a notification or create a ticket for someone to investigate. Create a backend module that subscribes to the catalog error events. The topic is `experimental.catalog.errors`. From e61267416795b27e6530a40686c1459ac88b272f Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Wed, 19 Jun 2024 11:24:03 -0400 Subject: [PATCH 293/387] update lockfile Signed-off-by: Christopher Diaz --- yarn.lock | 1 - 1 file changed, 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 6c298b9c89..7d440ea43f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5444,7 +5444,6 @@ __metadata: version: 0.0.0-use.local resolution: "@backstage/plugin-catalog-backend-module-logs@workspace:plugins/catalog-backend-module-logs" dependencies: - "@backstage/backend-common": "workspace:^" "@backstage/backend-plugin-api": "workspace:^" "@backstage/backend-test-utils": "workspace:^" "@backstage/cli": "workspace:^" From 26bd7a7a92971f9157f5a04fc537aed232414925 Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Wed, 19 Jun 2024 12:16:26 -0400 Subject: [PATCH 294/387] try to update api docs Signed-off-by: Christopher Diaz --- plugins/catalog-backend-module-logs/api-report.md | 2 +- plugins/catalog-backend-module-logs/src/module.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/catalog-backend-module-logs/api-report.md b/plugins/catalog-backend-module-logs/api-report.md index 7dd45e6119..bb08280566 100644 --- a/plugins/catalog-backend-module-logs/api-report.md +++ b/plugins/catalog-backend-module-logs/api-report.md @@ -5,7 +5,7 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -// @public (undocumented) +// @public const catalogModuleLogs: () => BackendFeature; export default catalogModuleLogs; ``` diff --git a/plugins/catalog-backend-module-logs/src/module.ts b/plugins/catalog-backend-module-logs/src/module.ts index 54fc428cdf..bdc916e958 100644 --- a/plugins/catalog-backend-module-logs/src/module.ts +++ b/plugins/catalog-backend-module-logs/src/module.ts @@ -31,7 +31,12 @@ interface EventsParamsWithPayload extends EventParams { eventPayload: EventsPayload; } -/** @public */ +/** + * A catalog module that logs catalog errors using the logger service. + * + * @packageDocumentation + * @public + */ export const catalogModuleLogs = createBackendModule({ pluginId: 'catalog', moduleId: 'logs', From c057720a67cd0b34a322de0d492091d42a81a94a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Wed, 19 Jun 2024 19:36:51 +0200 Subject: [PATCH 295/387] api report MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/catalog-backend-module-logs/api-report.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/catalog-backend-module-logs/api-report.md b/plugins/catalog-backend-module-logs/api-report.md index bb08280566..0be2197c9a 100644 --- a/plugins/catalog-backend-module-logs/api-report.md +++ b/plugins/catalog-backend-module-logs/api-report.md @@ -3,9 +3,9 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureCompat } from '@backstage/backend-plugin-api'; // @public -const catalogModuleLogs: () => BackendFeature; +const catalogModuleLogs: BackendFeatureCompat; export default catalogModuleLogs; ``` From 7652db4b9483e937712413ff59c73c5f3ab63836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Wed, 19 Jun 2024 14:44:35 +0200 Subject: [PATCH 296/387] fix the _a.destroy test flakiness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/gentle-avocados-obey.md | 5 +++ .github/workflows/ci.yml | 27 +------------- ...-interceptors-npm-0.17.10-c1199a9424.patch | 18 ---------- ...s-interceptors-npm-0.29.1-b5be72ad54.patch | 36 ------------------- package.json | 2 -- yarn.lock | 34 ++---------------- 6 files changed, 8 insertions(+), 114 deletions(-) create mode 100644 .changeset/gentle-avocados-obey.md delete mode 100644 .yarn/patches/@mswjs-interceptors-npm-0.17.10-c1199a9424.patch delete mode 100644 .yarn/patches/@mswjs-interceptors-npm-0.29.1-b5be72ad54.patch diff --git a/.changeset/gentle-avocados-obey.md b/.changeset/gentle-avocados-obey.md new file mode 100644 index 0000000000..80bf5f89c7 --- /dev/null +++ b/.changeset/gentle-avocados-obey.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Only bootstrap global-agent if it's actually being used diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95d6bbee34..135076ba40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -150,32 +150,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: - [ - 18.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - ] + node-version: [18.x, 20.x] name: Test ${{ matrix.node-version }} services: diff --git a/.yarn/patches/@mswjs-interceptors-npm-0.17.10-c1199a9424.patch b/.yarn/patches/@mswjs-interceptors-npm-0.17.10-c1199a9424.patch deleted file mode 100644 index 3b6e9c1fbf..0000000000 --- a/.yarn/patches/@mswjs-interceptors-npm-0.17.10-c1199a9424.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/lib/interceptors/ClientRequest/NodeClientRequest.js b/lib/interceptors/ClientRequest/NodeClientRequest.js -index 9bcc5a6adfd3c84541d686c3d0039f5e79dd34f5..f72d47b02a437eaefead4ec1543a0dd70dd1bb6f 100644 ---- a/lib/interceptors/ClientRequest/NodeClientRequest.js -+++ b/lib/interceptors/ClientRequest/NodeClientRequest.js -@@ -382,6 +382,13 @@ var NodeClientRequest = /** @class */ (function (_super) { - */ - NodeClientRequest.prototype.terminate = function () { - var _a; -+ const tempAgent = this.agent; -+ if (tempAgent && typeof tempAgent === 'object' && typeof tempAgent.destroy !== 'function') { -+ console.log( -+ `No agent to destroy, found '${typeof tempAgent}'->'${typeof tempAgent.destroy}':`, -+ tempAgent -+ ); -+ } - // @ts-ignore - (_a = this.agent) === null || _a === void 0 ? void 0 : _a.destroy(); - }; diff --git a/.yarn/patches/@mswjs-interceptors-npm-0.29.1-b5be72ad54.patch b/.yarn/patches/@mswjs-interceptors-npm-0.29.1-b5be72ad54.patch deleted file mode 100644 index 946777f134..0000000000 --- a/.yarn/patches/@mswjs-interceptors-npm-0.29.1-b5be72ad54.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/lib/node/chunk-CVV3L375.mjs b/lib/node/chunk-CVV3L375.mjs -index c37d61d709235efebe4ea19703a901bfbc05c9e3..4085c9b33075e18f7e4e3ad82fdd3fa5f6bb31e2 100644 ---- a/lib/node/chunk-CVV3L375.mjs -+++ b/lib/node/chunk-CVV3L375.mjs -@@ -540,6 +540,13 @@ var _NodeClientRequest = class extends ClientRequest { - * Terminates a pending request. - */ - terminate() { -+ const tempAgent = this.agent; -+ if (tempAgent && typeof tempAgent === 'object' && typeof tempAgent.destroy !== 'function') { -+ console.log( -+ `No agent to destroy, found '${typeof tempAgent}'->'${typeof tempAgent.destroy}':`, -+ tempAgent -+ ); -+ } - var _a; - (_a = this.agent) == null ? void 0 : _a.destroy(); - } -diff --git a/lib/node/chunk-SXGRMPXP.js b/lib/node/chunk-SXGRMPXP.js -index a5129f18a9b754acf2bfb3b1545df2378b01a95a..8228b6d4f649937559f45aefbdb8c8df275c5285 100644 ---- a/lib/node/chunk-SXGRMPXP.js -+++ b/lib/node/chunk-SXGRMPXP.js -@@ -540,6 +540,13 @@ var _NodeClientRequest = class extends _http.ClientRequest { - * Terminates a pending request. - */ - terminate() { -+ const tempAgent = this.agent; -+ if (tempAgent && typeof tempAgent === 'object' && typeof tempAgent.destroy !== 'function') { -+ console.log( -+ `No agent to destroy, found '${typeof tempAgent}'->'${typeof tempAgent.destroy}':`, -+ tempAgent -+ ); -+ } - var _a; - (_a = this.agent) == null ? void 0 : _a.destroy(); - } diff --git a/package.json b/package.json index 47dad4b2a2..59150dedc9 100644 --- a/package.json +++ b/package.json @@ -87,8 +87,6 @@ "@changesets/assemble-release-plan@^6.0.0": "patch:@changesets/assemble-release-plan@npm%3A6.0.0#./.yarn/patches/@changesets-assemble-release-plan-npm-6.0.0-f7b3005037.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", "@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", - "@mswjs/interceptors@^0.17.10": "patch:@mswjs/interceptors@npm%3A0.17.10#.yarn/patches/@mswjs-interceptors-npm-0.17.10-c1199a9424.patch", - "@mswjs/interceptors@^0.29.0": "patch:@mswjs/interceptors@npm%3A0.29.1#./.yarn/patches/@mswjs-interceptors-npm-0.29.1-b5be72ad54.patch", "@types/react": "^18", "@types/react-dom": "^18", "jest-haste-map@^29.7.0": "patch:jest-haste-map@npm%3A29.7.0#./.yarn/patches/jest-haste-map-npm-29.7.0-e3be419eff.patch" diff --git a/yarn.lock b/yarn.lock index 2b8090e00d..dd05b8d157 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10782,7 +10782,7 @@ __metadata: languageName: node linkType: hard -"@mswjs/interceptors@npm:0.17.10": +"@mswjs/interceptors@npm:^0.17.10": version: 0.17.10 resolution: "@mswjs/interceptors@npm:0.17.10" dependencies: @@ -10798,7 +10798,7 @@ __metadata: languageName: node linkType: hard -"@mswjs/interceptors@npm:0.29.1": +"@mswjs/interceptors@npm:^0.29.0": version: 0.29.1 resolution: "@mswjs/interceptors@npm:0.29.1" dependencies: @@ -10812,36 +10812,6 @@ __metadata: languageName: node linkType: hard -"@mswjs/interceptors@patch:@mswjs/interceptors@npm%3A0.17.10#.yarn/patches/@mswjs-interceptors-npm-0.17.10-c1199a9424.patch::locator=root%40workspace%3A.": - version: 0.17.10 - resolution: "@mswjs/interceptors@patch:@mswjs/interceptors@npm%3A0.17.10#.yarn/patches/@mswjs-interceptors-npm-0.17.10-c1199a9424.patch::version=0.17.10&hash=652df3&locator=root%40workspace%3A." - dependencies: - "@open-draft/until": ^1.0.3 - "@types/debug": ^4.1.7 - "@xmldom/xmldom": ^0.8.3 - debug: ^4.3.3 - headers-polyfill: 3.2.5 - outvariant: ^1.2.1 - strict-event-emitter: ^0.2.4 - web-encoding: ^1.1.5 - checksum: 32ca2f2d4e8bc46e1f773ca440a0ec5ba9c69ea4d89c07fbd25a0fde73627a232eb7d0cf3ce426fbe1fd58863ab9c84386352ecdc55eeb2a5240ba126c0ba6f0 - languageName: node - linkType: hard - -"@mswjs/interceptors@patch:@mswjs/interceptors@npm%3A0.29.1#./.yarn/patches/@mswjs-interceptors-npm-0.29.1-b5be72ad54.patch::locator=root%40workspace%3A.": - version: 0.29.1 - resolution: "@mswjs/interceptors@patch:@mswjs/interceptors@npm%3A0.29.1#./.yarn/patches/@mswjs-interceptors-npm-0.29.1-b5be72ad54.patch::version=0.29.1&hash=d6ea98&locator=root%40workspace%3A." - dependencies: - "@open-draft/deferred-promise": ^2.2.0 - "@open-draft/logger": ^0.3.0 - "@open-draft/until": ^2.0.0 - is-node-process: ^1.2.0 - outvariant: ^1.2.1 - strict-event-emitter: ^0.5.1 - checksum: d7ce191736c8b5df2dcdb36d11dbf25ca37cd3c0d1319cf8594713c443c5bdf733c2aeb4863aba646a67b50813e64dc1b13fbd31cee238cc4c9f8a8fd2908486 - languageName: node - linkType: hard - "@mui/base@npm:5.0.0-beta.40": version: 5.0.0-beta.40 resolution: "@mui/base@npm:5.0.0-beta.40" From bdcb2990b321d2fc1e9379f637e3e6ab97f20126 Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Wed, 19 Jun 2024 15:28:07 -0400 Subject: [PATCH 297/387] feat: support tag based policies Signed-off-by: Christopher Diaz --- .../src/actions/githubEnvironment.ts | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.ts b/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.ts index 7f6f9f7fa3..e821ff0cd6 100644 --- a/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.ts +++ b/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.ts @@ -44,6 +44,7 @@ export function createGithubEnvironmentAction(options: { custom_branch_policies: boolean; }; customBranchPolicyNames?: string[]; + customTagPolicyNames?: string[]; environmentVariables?: { [key: string]: string }; secrets?: { [key: string]: string }; token?: string; @@ -94,6 +95,16 @@ export function createGithubEnvironmentAction(options: { type: 'string', }, }, + customTagPolicyNames: { + title: 'Custom Tag Policy Name', + description: `The name pattern that tags must match in order to deploy to the environment. + + Wildcard characters will not match /. For example, to match tags that begin with release/ and contain an additional single slash, use release/*/*. For more information about pattern matching syntax, see the Ruby File.fnmatch documentation.`, + type: 'array', + items: { + type: 'string', + }, + }, environmentVariables: { title: 'Environment Variables', description: `Environment variables attached to the deployment environment`, @@ -118,6 +129,7 @@ export function createGithubEnvironmentAction(options: { name, deploymentBranchPolicy, customBranchPolicyNames, + customTagPolicyNames, environmentVariables, secrets, token: providedToken, @@ -153,6 +165,19 @@ export function createGithubEnvironmentAction(options: { await client.rest.repos.createDeploymentBranchPolicy({ owner: owner, repo: repo, + type: 'branch', + environment_name: name, + name: item, + }); + } + } + + if (customTagPolicyNames) { + for (const item of customTagPolicyNames) { + await client.rest.repos.createDeploymentBranchPolicy({ + owner: owner, + repo: repo, + type: 'tag', environment_name: name, name: item, }); From 70c4b3625db012293b6f3c638e4f60eb61ecc5a5 Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Wed, 19 Jun 2024 15:32:42 -0400 Subject: [PATCH 298/387] feat: support tag based policies Signed-off-by: Christopher Diaz --- .changeset/short-flowers-cry.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/short-flowers-cry.md diff --git a/.changeset/short-flowers-cry.md b/.changeset/short-flowers-cry.md new file mode 100644 index 0000000000..bf2c354465 --- /dev/null +++ b/.changeset/short-flowers-cry.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend-module-github': minor +--- + +Adds support for custom tag policies when creating GitHub environments. From 8dc15aae58a74fcca6a978b41b13b1bace21b8e8 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Fri, 17 May 2024 11:19:40 +0200 Subject: [PATCH 299/387] backend-app-api: httpRouter add healthCheckConfig Signed-off-by: Vincenzo Scamporlino --- .../httpRouter/httpRouterServiceFactory.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/backend-defaults/src/entrypoints/httpRouter/httpRouterServiceFactory.test.ts b/packages/backend-defaults/src/entrypoints/httpRouter/httpRouterServiceFactory.test.ts index 58c074f985..2fd6923125 100644 --- a/packages/backend-defaults/src/entrypoints/httpRouter/httpRouterServiceFactory.test.ts +++ b/packages/backend-defaults/src/entrypoints/httpRouter/httpRouterServiceFactory.test.ts @@ -162,6 +162,18 @@ describe('httpRouterFactory', () => { }); }); + it('should always allow the healthcheck endpoint', async () => { + const { server } = await startTestBackend({ + features: [pluginSubject, ...defaultServices], + }); + + await expect( + request(server).get('/api/test/healthcheck'), + ).resolves.toMatchObject({ + status: 200, + }); + }); + it('should not block unauthenticated requests if default policy is disabled', async () => { const { server } = await startTestBackend({ features: [ From 8bbbc314f1d0693f616015301a0b06ba418e7ca5 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Fri, 17 May 2024 11:20:10 +0200 Subject: [PATCH 300/387] backend-app-api: healthcheck middleware Signed-off-by: Vincenzo Scamporlino --- .../httpRouter/createHealthcheck.test.ts | 33 ++++++++++++++++++ .../httpRouter/createHealthcheck.ts | 34 +++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 packages/backend-app-api/src/services/implementations/httpRouter/createHealthcheck.test.ts create mode 100644 packages/backend-app-api/src/services/implementations/httpRouter/createHealthcheck.ts diff --git a/packages/backend-app-api/src/services/implementations/httpRouter/createHealthcheck.test.ts b/packages/backend-app-api/src/services/implementations/httpRouter/createHealthcheck.test.ts new file mode 100644 index 0000000000..c23200a823 --- /dev/null +++ b/packages/backend-app-api/src/services/implementations/httpRouter/createHealthcheck.test.ts @@ -0,0 +1,33 @@ +/* + * Copyright 2024 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 request from 'supertest'; +import { createHealthcheck } from './createHealthcheck'; + +describe('createHealthcheck', () => { + it('should return a router with a healthcheck endpoint', async () => { + const hc = createHealthcheck(); + const app = express().use(hc.router); + + let response = await request(app).get('/healthcheck').expect(200); + expect(response.body).toEqual({ status: 'ok' }); + + hc.addHandler(async () => ({ allgood: true })); + response = await request(app).get('/healthcheck').expect(200); + expect(response.body).toEqual({ allgood: true }); + }); +}); diff --git a/packages/backend-app-api/src/services/implementations/httpRouter/createHealthcheck.ts b/packages/backend-app-api/src/services/implementations/httpRouter/createHealthcheck.ts new file mode 100644 index 0000000000..f177822a17 --- /dev/null +++ b/packages/backend-app-api/src/services/implementations/httpRouter/createHealthcheck.ts @@ -0,0 +1,34 @@ +/* + * Copyright 2024 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 { Request, Response } from 'express'; +import Router from 'express-promise-router'; + +export function createHealthcheck() { + const router = Router(); + let handler = () => Promise.resolve({ status: 'ok' }); + + router.get('/healthcheck', async (_request: Request, response: Response) => { + const status = await handler(); + response.json(status); + }); + + return { + router, + addHandler: (newHandler: () => Promise) => { + handler = newHandler; + }, + }; +} From 14e982e8d3fa699196c94d392484f581cd426d5d Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Fri, 17 May 2024 11:34:55 +0200 Subject: [PATCH 301/387] backend-plugin-api: export healthCheckConfig fn Signed-off-by: Vincenzo Scamporlino --- .../src/services/definitions/HttpRouterService.ts | 7 +++++++ .../backend-plugin-api/src/services/definitions/index.ts | 1 + .../backend-test-utils/src/next/services/mockServices.ts | 1 + 3 files changed, 9 insertions(+) diff --git a/packages/backend-plugin-api/src/services/definitions/HttpRouterService.ts b/packages/backend-plugin-api/src/services/definitions/HttpRouterService.ts index 92f7e950f9..2cb5c74649 100644 --- a/packages/backend-plugin-api/src/services/definitions/HttpRouterService.ts +++ b/packages/backend-plugin-api/src/services/definitions/HttpRouterService.ts @@ -26,6 +26,11 @@ export interface HttpRouterServiceAuthPolicy { allow: 'unauthenticated' | 'user-cookie'; } +/** @public */ +export interface HttpRouterHealthCheckConfig { + handler: () => Promise; +} + /** * Allows plugins to register HTTP routes. * @@ -40,6 +45,8 @@ export interface HttpRouterService { */ use(handler: Handler): void; + healthCheckConfig(healthCheckOptions: HttpRouterHealthCheckConfig): void; + /** * Adds an auth policy to the router. This is used to allow unauthenticated or * cookie based access to parts of a plugin's API. diff --git a/packages/backend-plugin-api/src/services/definitions/index.ts b/packages/backend-plugin-api/src/services/definitions/index.ts index 6f30c5f980..57cfd404c1 100644 --- a/packages/backend-plugin-api/src/services/definitions/index.ts +++ b/packages/backend-plugin-api/src/services/definitions/index.ts @@ -35,6 +35,7 @@ export type { DiscoveryService } from './DiscoveryService'; export type { HttpRouterService, HttpRouterServiceAuthPolicy, + HttpRouterHealthCheckConfig, } from './HttpRouterService'; export type { HttpAuthService } from './HttpAuthService'; export type { diff --git a/packages/backend-test-utils/src/next/services/mockServices.ts b/packages/backend-test-utils/src/next/services/mockServices.ts index 24571b634c..379e9473ca 100644 --- a/packages/backend-test-utils/src/next/services/mockServices.ts +++ b/packages/backend-test-utils/src/next/services/mockServices.ts @@ -348,6 +348,7 @@ export namespace mockServices { export const factory = httpRouterServiceFactory; export const mock = simpleMock(coreServices.httpRouter, () => ({ use: jest.fn(), + healthCheckConfig: jest.fn(), addAuthPolicy: jest.fn(), })); } From 53ced701dd6f68b956c3c311da9d674befb0b64a Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Fri, 17 May 2024 11:41:37 +0200 Subject: [PATCH 302/387] healthcheck changeset Signed-off-by: Vincenzo Scamporlino --- .changeset/bright-panthers-leave.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changeset/bright-panthers-leave.md diff --git a/.changeset/bright-panthers-leave.md b/.changeset/bright-panthers-leave.md new file mode 100644 index 0000000000..133760cadd --- /dev/null +++ b/.changeset/bright-panthers-leave.md @@ -0,0 +1,7 @@ +--- +'@backstage/backend-plugin-api': patch +'@backstage/backend-test-utils': patch +'@backstage/backend-app-api': patch +--- + +Added a default `/healthcheck` endpoint to the HTTP Router. From 8d4735767dbada61ac99000ec4e126f5d090c292 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Fri, 17 May 2024 15:17:26 +0200 Subject: [PATCH 303/387] backend-app-api: move healthchecks to healthService Signed-off-by: Vincenzo Scamporlino --- .../health/createHealthRouter.test.ts | 81 +++++++++++++++++++ .../health/createHealthRouter.ts | 46 +++++++++++ .../health/healthServiceFactory.ts | 34 ++++++++ .../services/implementations/health/index.ts | 17 ++++ .../createHealthcheck.test.ts | 0 .../createHealthcheck.ts | 0 .../src/services/definitions/HealthService.ts | 20 +++++ .../services/definitions/HttpRouterService.ts | 5 -- .../src/services/definitions/coreServices.ts | 7 ++ .../src/services/definitions/index.ts | 2 +- .../src/next/services/mockServices.ts | 1 - 11 files changed, 206 insertions(+), 7 deletions(-) create mode 100644 packages/backend-app-api/src/services/implementations/health/createHealthRouter.test.ts create mode 100644 packages/backend-app-api/src/services/implementations/health/createHealthRouter.ts create mode 100644 packages/backend-app-api/src/services/implementations/health/healthServiceFactory.ts create mode 100644 packages/backend-app-api/src/services/implementations/health/index.ts rename packages/backend-app-api/src/services/implementations/{httpRouter => rootHttpRouter}/createHealthcheck.test.ts (100%) rename packages/backend-app-api/src/services/implementations/{httpRouter => rootHttpRouter}/createHealthcheck.ts (100%) create mode 100644 packages/backend-plugin-api/src/services/definitions/HealthService.ts diff --git a/packages/backend-app-api/src/services/implementations/health/createHealthRouter.test.ts b/packages/backend-app-api/src/services/implementations/health/createHealthRouter.test.ts new file mode 100644 index 0000000000..f8c51ee08d --- /dev/null +++ b/packages/backend-app-api/src/services/implementations/health/createHealthRouter.test.ts @@ -0,0 +1,81 @@ +/* + * Copyright 2024 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 { mockServices } from '@backstage/backend-test-utils'; +import request from 'supertest'; +import { createHealthRouter } from './createHealthRouter'; +import express from 'express'; + +describe('createHealthRouter', () => { + describe('readiness', () => { + it(`should return a 500 response if the server hasn't started yet`, async () => { + const hc = createHealthRouter({ + lifecycle: mockServices.rootLifecycle.mock(), + }); + const app = express().use(hc); + + const response = await request(app).get('/v1/readiness'); + expect(response.status).toBe(500); + }); + + it('should return 200 if the server has started', async () => { + const lifecycle = mockServices.rootLifecycle.mock(); + let mockServerStartedFn = () => {}; + lifecycle.addStartupHook.mockImplementation( + fn => (mockServerStartedFn = fn), + ); + + const hc = createHealthRouter({ lifecycle }); + const app = express().use(hc); + + mockServerStartedFn(); + const response = await request(app).get('/v1/readiness').expect(200); + expect(response.body).toEqual({ status: 'ok' }); + }); + + it(`should return a 500 response if the server has stopped`, async () => { + const lifecycle = mockServices.rootLifecycle.mock(); + let mockServerStartedFn = () => {}; + let mockServerStoppedFn = () => {}; + lifecycle.addStartupHook.mockImplementation( + fn => (mockServerStartedFn = fn), + ); + lifecycle.addShutdownHook.mockImplementation( + fn => (mockServerStoppedFn = fn), + ); + + const hc = createHealthRouter({ lifecycle }); + const app = express().use(hc); + + mockServerStartedFn(); + mockServerStoppedFn(); + const response = await request(app).get('/v1/readiness'); + expect(response.status).toBe(500); + }); + }); + + describe('liveness', () => { + it('should return 200 if the server has started', async () => { + const lifecycle = mockServices.rootLifecycle.mock(); + + const hc = createHealthRouter({ lifecycle }); + const app = express().use(hc); + + const response = await request(app).get('/v1/liveness').expect(200); + expect(response.body).toEqual({ status: 'ok' }); + }); + }); +}); diff --git a/packages/backend-app-api/src/services/implementations/health/createHealthRouter.ts b/packages/backend-app-api/src/services/implementations/health/createHealthRouter.ts new file mode 100644 index 0000000000..f2ff2ecd73 --- /dev/null +++ b/packages/backend-app-api/src/services/implementations/health/createHealthRouter.ts @@ -0,0 +1,46 @@ +/* + * Copyright 2024 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 Router from 'express-promise-router'; +import { Request, Response } from 'express'; +import { RootLifecycleService } from '@backstage/backend-plugin-api'; + +export function createHealthRouter(options: { + lifecycle: RootLifecycleService; +}) { + const router = Router(); + + let isRunning = false; + options.lifecycle.addStartupHook(() => { + isRunning = true; + }); + options.lifecycle.addShutdownHook(() => { + isRunning = false; + }); + + router.get('/v1/readiness', async (_request: Request, response: Response) => { + if (!isRunning) { + throw new Error('Backend has not started yet'); + } + response.json({ status: 'ok' }); + }); + + router.get('/v1/liveness', async (_request: Request, response: Response) => { + response.json({ status: 'ok' }); + }); + + return router; +} diff --git a/packages/backend-app-api/src/services/implementations/health/healthServiceFactory.ts b/packages/backend-app-api/src/services/implementations/health/healthServiceFactory.ts new file mode 100644 index 0000000000..831f4fa6e8 --- /dev/null +++ b/packages/backend-app-api/src/services/implementations/health/healthServiceFactory.ts @@ -0,0 +1,34 @@ +/* + * Copyright 2024 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 { + coreServices, + createServiceFactory, +} from '@backstage/backend-plugin-api'; +import { createHealthRouter } from './createHealthRouter'; + +export const healthServiceFactory = createServiceFactory({ + service: coreServices.health, + deps: { + rootHttpRouter: coreServices.rootHttpRouter, + lifecycle: coreServices.rootLifecycle, + }, + async factory({ lifecycle, rootHttpRouter }) { + rootHttpRouter.use('.backstage/health', createHealthRouter({ lifecycle })); + + return {}; + }, +}); diff --git a/packages/backend-app-api/src/services/implementations/health/index.ts b/packages/backend-app-api/src/services/implementations/health/index.ts new file mode 100644 index 0000000000..4aeb4b7979 --- /dev/null +++ b/packages/backend-app-api/src/services/implementations/health/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2024 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. + */ + +export { healthServiceFactory } from './healthServiceFactory'; diff --git a/packages/backend-app-api/src/services/implementations/httpRouter/createHealthcheck.test.ts b/packages/backend-app-api/src/services/implementations/rootHttpRouter/createHealthcheck.test.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/httpRouter/createHealthcheck.test.ts rename to packages/backend-app-api/src/services/implementations/rootHttpRouter/createHealthcheck.test.ts diff --git a/packages/backend-app-api/src/services/implementations/httpRouter/createHealthcheck.ts b/packages/backend-app-api/src/services/implementations/rootHttpRouter/createHealthcheck.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/httpRouter/createHealthcheck.ts rename to packages/backend-app-api/src/services/implementations/rootHttpRouter/createHealthcheck.ts diff --git a/packages/backend-plugin-api/src/services/definitions/HealthService.ts b/packages/backend-plugin-api/src/services/definitions/HealthService.ts new file mode 100644 index 0000000000..d04a8a6133 --- /dev/null +++ b/packages/backend-plugin-api/src/services/definitions/HealthService.ts @@ -0,0 +1,20 @@ +/* + * Copyright 2024 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. + */ + +/** + * @public + */ +export interface HealthService {} diff --git a/packages/backend-plugin-api/src/services/definitions/HttpRouterService.ts b/packages/backend-plugin-api/src/services/definitions/HttpRouterService.ts index 2cb5c74649..30c4fb31c8 100644 --- a/packages/backend-plugin-api/src/services/definitions/HttpRouterService.ts +++ b/packages/backend-plugin-api/src/services/definitions/HttpRouterService.ts @@ -26,11 +26,6 @@ export interface HttpRouterServiceAuthPolicy { allow: 'unauthenticated' | 'user-cookie'; } -/** @public */ -export interface HttpRouterHealthCheckConfig { - handler: () => Promise; -} - /** * Allows plugins to register HTTP routes. * diff --git a/packages/backend-plugin-api/src/services/definitions/coreServices.ts b/packages/backend-plugin-api/src/services/definitions/coreServices.ts index b0518fb9d4..36ec0151c5 100644 --- a/packages/backend-plugin-api/src/services/definitions/coreServices.ts +++ b/packages/backend-plugin-api/src/services/definitions/coreServices.ts @@ -102,6 +102,13 @@ export namespace coreServices { import('./DiscoveryService').DiscoveryService >({ id: 'core.discovery' }); + /** + * The service reference for the plugin scoped {@link RootHealthService}. + */ + export const health = createServiceRef< + import('./RootHealthService').RootHealthService + >({ id: 'core.health', scope: 'root' }); + /** * Authentication of HTTP requests. * diff --git a/packages/backend-plugin-api/src/services/definitions/index.ts b/packages/backend-plugin-api/src/services/definitions/index.ts index 57cfd404c1..af0d991f58 100644 --- a/packages/backend-plugin-api/src/services/definitions/index.ts +++ b/packages/backend-plugin-api/src/services/definitions/index.ts @@ -32,10 +32,10 @@ export type { export type { RootConfigService } from './RootConfigService'; export type { DatabaseService } from './DatabaseService'; export type { DiscoveryService } from './DiscoveryService'; +export type { HealthService } from './HealthService'; export type { HttpRouterService, HttpRouterServiceAuthPolicy, - HttpRouterHealthCheckConfig, } from './HttpRouterService'; export type { HttpAuthService } from './HttpAuthService'; export type { diff --git a/packages/backend-test-utils/src/next/services/mockServices.ts b/packages/backend-test-utils/src/next/services/mockServices.ts index 379e9473ca..24571b634c 100644 --- a/packages/backend-test-utils/src/next/services/mockServices.ts +++ b/packages/backend-test-utils/src/next/services/mockServices.ts @@ -348,7 +348,6 @@ export namespace mockServices { export const factory = httpRouterServiceFactory; export const mock = simpleMock(coreServices.httpRouter, () => ({ use: jest.fn(), - healthCheckConfig: jest.fn(), addAuthPolicy: jest.fn(), })); } From b26877ffc50329ce93bd9a7b3d6f016a6f8cd7c6 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Fri, 17 May 2024 15:18:16 +0200 Subject: [PATCH 304/387] backend-defaults: add healthservice Signed-off-by: Vincenzo Scamporlino --- packages/backend-defaults/src/CreateBackend.ts | 2 ++ .../src/services/definitions/HttpRouterService.ts | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend-defaults/src/CreateBackend.ts b/packages/backend-defaults/src/CreateBackend.ts index 9b3fa5d649..453c5fe592 100644 --- a/packages/backend-defaults/src/CreateBackend.ts +++ b/packages/backend-defaults/src/CreateBackend.ts @@ -24,6 +24,7 @@ import { authServiceFactory } from '@backstage/backend-defaults/auth'; import { cacheServiceFactory } from '@backstage/backend-defaults/cache'; import { databaseServiceFactory } from '@backstage/backend-defaults/database'; import { discoveryServiceFactory } from '@backstage/backend-defaults/discovery'; +import { rootHealthServiceFactory } from './entrypoints/rootHealth'; import { httpAuthServiceFactory } from '@backstage/backend-defaults/httpAuth'; import { httpRouterServiceFactory } from '@backstage/backend-defaults/httpRouter'; import { lifecycleServiceFactory } from '@backstage/backend-defaults/lifecycle'; @@ -58,6 +59,7 @@ export const defaultServiceFactories = [ userInfoServiceFactory(), urlReaderServiceFactory(), eventsServiceFactory(), + rootHealthServiceFactory(), ]; /** diff --git a/packages/backend-plugin-api/src/services/definitions/HttpRouterService.ts b/packages/backend-plugin-api/src/services/definitions/HttpRouterService.ts index 30c4fb31c8..92f7e950f9 100644 --- a/packages/backend-plugin-api/src/services/definitions/HttpRouterService.ts +++ b/packages/backend-plugin-api/src/services/definitions/HttpRouterService.ts @@ -40,8 +40,6 @@ export interface HttpRouterService { */ use(handler: Handler): void; - healthCheckConfig(healthCheckOptions: HttpRouterHealthCheckConfig): void; - /** * Adds an auth policy to the router. This is used to allow unauthenticated or * cookie based access to parts of a plugin's API. From 1ce0bb70605a3124af959e83993a24f47b58e26e Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Fri, 17 May 2024 15:20:44 +0200 Subject: [PATCH 305/387] tweak changeset Signed-off-by: Vincenzo Scamporlino --- .changeset/bright-panthers-leave.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/bright-panthers-leave.md b/.changeset/bright-panthers-leave.md index 133760cadd..acd9764fe6 100644 --- a/.changeset/bright-panthers-leave.md +++ b/.changeset/bright-panthers-leave.md @@ -1,7 +1,7 @@ --- '@backstage/backend-plugin-api': patch -'@backstage/backend-test-utils': patch +'@backstage/backend-defaults': patch '@backstage/backend-app-api': patch --- -Added a default `/healthcheck` endpoint to the HTTP Router. +Added a new health service which adds new endpoints for health checks. From 0717aaeda6098f7f3e72f7bb721ec8e38f7062d1 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Fri, 17 May 2024 19:18:06 +0200 Subject: [PATCH 306/387] backend-app-api: remove test Signed-off-by: Vincenzo Scamporlino --- .../httpRouter/httpRouterServiceFactory.test.ts | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/packages/backend-defaults/src/entrypoints/httpRouter/httpRouterServiceFactory.test.ts b/packages/backend-defaults/src/entrypoints/httpRouter/httpRouterServiceFactory.test.ts index 2fd6923125..58c074f985 100644 --- a/packages/backend-defaults/src/entrypoints/httpRouter/httpRouterServiceFactory.test.ts +++ b/packages/backend-defaults/src/entrypoints/httpRouter/httpRouterServiceFactory.test.ts @@ -162,18 +162,6 @@ describe('httpRouterFactory', () => { }); }); - it('should always allow the healthcheck endpoint', async () => { - const { server } = await startTestBackend({ - features: [pluginSubject, ...defaultServices], - }); - - await expect( - request(server).get('/api/test/healthcheck'), - ).resolves.toMatchObject({ - status: 200, - }); - }); - it('should not block unauthenticated requests if default policy is disabled', async () => { const { server } = await startTestBackend({ features: [ From 49b489088cd9f7e262949c21599001c918349dd6 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Fri, 17 May 2024 20:20:44 +0200 Subject: [PATCH 307/387] backend-app-api: mark healthServiceFactory as public Signed-off-by: Vincenzo Scamporlino --- packages/backend-app-api/api-report.md | 4 ++++ .../services/implementations/health/healthServiceFactory.ts | 3 +++ 2 files changed, 7 insertions(+) diff --git a/packages/backend-app-api/api-report.md b/packages/backend-app-api/api-report.md index 7518f8e2cc..a18f027273 100644 --- a/packages/backend-app-api/api-report.md +++ b/packages/backend-app-api/api-report.md @@ -18,6 +18,7 @@ import { ErrorRequestHandler } from 'express'; import { Express as Express_2 } from 'express'; import { Format } from 'logform'; import { Handler } from 'express'; +import { HealthService } from '@backstage/backend-plugin-api'; import { HelmetOptions } from 'helmet'; import * as http from 'http'; import { HttpAuthService } from '@backstage/backend-plugin-api'; @@ -126,6 +127,9 @@ export const discoveryServiceFactory: () => ServiceFactory< // @public @deprecated (undocumented) export type ExtendedHttpServer = ExtendedHttpServer_2; +// @public (undocumented) +export const healthServiceFactory: () => ServiceFactory; + // @public @deprecated export class HostDiscovery implements DiscoveryService { static fromConfig( diff --git a/packages/backend-app-api/src/services/implementations/health/healthServiceFactory.ts b/packages/backend-app-api/src/services/implementations/health/healthServiceFactory.ts index 831f4fa6e8..b79ba34a87 100644 --- a/packages/backend-app-api/src/services/implementations/health/healthServiceFactory.ts +++ b/packages/backend-app-api/src/services/implementations/health/healthServiceFactory.ts @@ -20,6 +20,9 @@ import { } from '@backstage/backend-plugin-api'; import { createHealthRouter } from './createHealthRouter'; +/** + * @public + */ export const healthServiceFactory = createServiceFactory({ service: coreServices.health, deps: { From a38ffb2cb3a72d80027e3293efa74fbd13212a6a Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Mon, 3 Jun 2024 13:33:38 +0200 Subject: [PATCH 308/387] backend-test-utils: mock health service Signed-off-by: Vincenzo Scamporlino --- .../backend-test-utils/src/next/services/mockServices.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/backend-test-utils/src/next/services/mockServices.ts b/packages/backend-test-utils/src/next/services/mockServices.ts index 24571b634c..22496bd6e1 100644 --- a/packages/backend-test-utils/src/next/services/mockServices.ts +++ b/packages/backend-test-utils/src/next/services/mockServices.ts @@ -24,6 +24,7 @@ import { httpRouterServiceFactory } from '@backstage/backend-defaults/httpRouter import { lifecycleServiceFactory } from '@backstage/backend-defaults/lifecycle'; import { loggerServiceFactory } from '@backstage/backend-defaults/logger'; import { permissionsServiceFactory } from '@backstage/backend-defaults/permissions'; +import { rootHealthServiceFactory } from '@backstage/backend-defaults/rootHealth'; import { rootHttpRouterServiceFactory } from '@backstage/backend-defaults/rootHttpRouter'; import { rootLifecycleServiceFactory } from '@backstage/backend-defaults/rootLifecycle'; import { schedulerServiceFactory } from '@backstage/backend-defaults/scheduler'; @@ -383,6 +384,14 @@ export namespace mockServices { })); } + export namespace rootHealth { + export const factory = rootHealthServiceFactory; + export const mock = simpleMock(coreServices.health, () => ({ + getLiveness: jest.fn(), + getReadiness: jest.fn(), + })); + } + export namespace rootLifecycle { export const factory = rootLifecycleServiceFactory; export const mock = simpleMock(coreServices.rootLifecycle, () => ({ From 972896d192834f5ff2d0c115bb6513f758a13829 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Mon, 3 Jun 2024 13:33:54 +0200 Subject: [PATCH 309/387] backend-app-api: clean up Signed-off-by: Vincenzo Scamporlino --- .../rootHttpRouter/createHealthcheck.test.ts | 33 ------------------ .../rootHttpRouter/createHealthcheck.ts | 34 ------------------- 2 files changed, 67 deletions(-) delete mode 100644 packages/backend-app-api/src/services/implementations/rootHttpRouter/createHealthcheck.test.ts delete mode 100644 packages/backend-app-api/src/services/implementations/rootHttpRouter/createHealthcheck.ts diff --git a/packages/backend-app-api/src/services/implementations/rootHttpRouter/createHealthcheck.test.ts b/packages/backend-app-api/src/services/implementations/rootHttpRouter/createHealthcheck.test.ts deleted file mode 100644 index c23200a823..0000000000 --- a/packages/backend-app-api/src/services/implementations/rootHttpRouter/createHealthcheck.test.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2024 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 request from 'supertest'; -import { createHealthcheck } from './createHealthcheck'; - -describe('createHealthcheck', () => { - it('should return a router with a healthcheck endpoint', async () => { - const hc = createHealthcheck(); - const app = express().use(hc.router); - - let response = await request(app).get('/healthcheck').expect(200); - expect(response.body).toEqual({ status: 'ok' }); - - hc.addHandler(async () => ({ allgood: true })); - response = await request(app).get('/healthcheck').expect(200); - expect(response.body).toEqual({ allgood: true }); - }); -}); diff --git a/packages/backend-app-api/src/services/implementations/rootHttpRouter/createHealthcheck.ts b/packages/backend-app-api/src/services/implementations/rootHttpRouter/createHealthcheck.ts deleted file mode 100644 index f177822a17..0000000000 --- a/packages/backend-app-api/src/services/implementations/rootHttpRouter/createHealthcheck.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2024 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 { Request, Response } from 'express'; -import Router from 'express-promise-router'; - -export function createHealthcheck() { - const router = Router(); - let handler = () => Promise.resolve({ status: 'ok' }); - - router.get('/healthcheck', async (_request: Request, response: Response) => { - const status = await handler(); - response.json(status); - }); - - return { - router, - addHandler: (newHandler: () => Promise) => { - handler = newHandler; - }, - }; -} From 652da2e3e342994f72639754cafba858dc1d0a94 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Mon, 3 Jun 2024 13:45:41 +0200 Subject: [PATCH 310/387] docs: add health service Signed-off-by: Vincenzo Scamporlino --- docs/backend-system/core-services/01-index.md | 1 + docs/backend-system/core-services/health.md | 39 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 docs/backend-system/core-services/health.md diff --git a/docs/backend-system/core-services/01-index.md b/docs/backend-system/core-services/01-index.md index 04d2e57ae8..63324292c1 100644 --- a/docs/backend-system/core-services/01-index.md +++ b/docs/backend-system/core-services/01-index.md @@ -20,6 +20,7 @@ import { coreServices } from '@backstage/backend-plugin-api'; - [Cache Service](./cache.md) - Key-value store for caching data. - [Database Service](./database.md) - Database access and management via [knex](https://knexjs.org/). - [Discovery Service](./discovery.md) - Service discovery for inter-plugin communication. +- [Health Service](./health.md) - Health check endpoints for the backend. - [Http Auth Service](./http-auth.md) - Authentication of HTTP requests. - [Http Router Service](./http-router.md) - HTTP route registration for plugins. - [Identity Service](./identity.md) - Deprecated user authentication service, use the [Auth Service](./auth.md) instead. diff --git a/docs/backend-system/core-services/health.md b/docs/backend-system/core-services/health.md new file mode 100644 index 0000000000..9a69891624 --- /dev/null +++ b/docs/backend-system/core-services/health.md @@ -0,0 +1,39 @@ +--- +id: health +title: Heath Service +sidebar_label: Health +description: Documentation for the Health service +--- + +The Health service provides some health check endpoints for the plugins. By default, it attaches `/.backstage/health/v1/readiness` and `/.backstage/health/v1/liveness` endpoints to the backend server, which return a JSON object with the status of the backend services. + +## Configuring the service + +The following example is how you can override the health service to add custom endpoints. + +```ts +import { coreServices } from '@backstage/backend-plugin-api'; +import { WinstonLogger } from '@backstage/backend-app-api'; + +const backend = createBackend(); + +backend.add( + createServiceFactory({ + service: coreServices.health, + deps: { + rootHttpRouter: coreServices.rootHttpRouter, + }, + async factory({ rootHttpRouter }) { + rootHttpRouter.get('.backstage/health/v1/readiness', async (req, res) => { + res.json({ status: 'ok' }); + }); + + rootHttpRouter.get('.backstage/health/v1/liveness', async (req, res) => { + res.json({ status: 'ok' }); + }); + + return {}; + }, + }), +); +``` From 78fdc5a39f613a50f6a024b68a9abb1201396d78 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Mon, 3 Jun 2024 14:11:33 +0200 Subject: [PATCH 311/387] health service api report Signed-off-by: Vincenzo Scamporlino --- packages/backend-plugin-api/api-report.md | 4 ++++ packages/backend-test-utils/api-report.md | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/packages/backend-plugin-api/api-report.md b/packages/backend-plugin-api/api-report.md index 258cdefe1b..5e02ad1787 100644 --- a/packages/backend-plugin-api/api-report.md +++ b/packages/backend-plugin-api/api-report.md @@ -194,6 +194,7 @@ export namespace coreServices { const rootConfig: ServiceRef; const database: ServiceRef; const discovery: ServiceRef; + const health: ServiceRef; const httpAuth: ServiceRef; const httpRouter: ServiceRef; const lifecycle: ServiceRef; @@ -333,6 +334,9 @@ export type ExtensionPoint = { // @public @deprecated (undocumented) export type ExtensionPointConfig = CreateExtensionPointOptions; +// @public (undocumented) +export interface HealthService {} + // @public export interface HttpAuthService { credentials( diff --git a/packages/backend-test-utils/api-report.md b/packages/backend-test-utils/api-report.md index 019d398ea6..07b393b653 100644 --- a/packages/backend-test-utils/api-report.md +++ b/packages/backend-test-utils/api-report.md @@ -21,6 +21,7 @@ import { DiscoveryService } from '@backstage/backend-plugin-api'; import { EventsService } from '@backstage/plugin-events-node'; import { ExtendedHttpServer } from '@backstage/backend-app-api'; import { ExtensionPoint } from '@backstage/backend-plugin-api'; +import { HealthService } from '@backstage/backend-plugin-api'; import { HttpAuthService } from '@backstage/backend-plugin-api'; import { HttpRouterFactoryOptions } from '@backstage/backend-defaults/httpRouter'; import { HttpRouterService } from '@backstage/backend-plugin-api'; @@ -199,6 +200,15 @@ export namespace mockServices { partialImpl?: Partial | undefined, ) => ServiceMock; } + // (undocumented) + export namespace health { + const // (undocumented) + factory: () => ServiceFactory; + const // (undocumented) + mock: ( + partialImpl?: Partial | undefined, + ) => ServiceMock; + } export function httpAuth(options?: { pluginId?: string; defaultCredentials?: BackstageCredentials; From fce7887109d2741e896b0c2d25303999db42760c Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Mon, 3 Jun 2024 14:18:11 +0200 Subject: [PATCH 312/387] backend-test-utils: health service mock changeset Signed-off-by: Vincenzo Scamporlino --- .changeset/serious-kings-trade.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/serious-kings-trade.md diff --git a/.changeset/serious-kings-trade.md b/.changeset/serious-kings-trade.md new file mode 100644 index 0000000000..c07e92b88a --- /dev/null +++ b/.changeset/serious-kings-trade.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-test-utils': patch +--- + +Added mock for health service in `mockServices`. From 918b397763b17f70bab8494bd7b87ddeb084d1b2 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Wed, 5 Jun 2024 13:27:10 +0200 Subject: [PATCH 313/387] backend-defaults: move over health service Signed-off-by: Vincenzo Scamporlino --- .../health/createHealthRouter.ts | 46 -------------- .../health/healthServiceFactory.ts | 37 ----------- .../backend-defaults/api-report-health.md | 13 ++++ packages/backend-defaults/package.json | 4 ++ .../health/healthServiceFactory.test.ts} | 53 ++++++++-------- .../health/healthServiceFactory.ts | 63 +++++++++++++++++++ .../src/entrypoints}/health/index.ts | 0 7 files changed, 107 insertions(+), 109 deletions(-) delete mode 100644 packages/backend-app-api/src/services/implementations/health/createHealthRouter.ts delete mode 100644 packages/backend-app-api/src/services/implementations/health/healthServiceFactory.ts create mode 100644 packages/backend-defaults/api-report-health.md rename packages/{backend-app-api/src/services/implementations/health/createHealthRouter.test.ts => backend-defaults/src/entrypoints/health/healthServiceFactory.test.ts} (63%) create mode 100644 packages/backend-defaults/src/entrypoints/health/healthServiceFactory.ts rename packages/{backend-app-api/src/services/implementations => backend-defaults/src/entrypoints}/health/index.ts (100%) diff --git a/packages/backend-app-api/src/services/implementations/health/createHealthRouter.ts b/packages/backend-app-api/src/services/implementations/health/createHealthRouter.ts deleted file mode 100644 index f2ff2ecd73..0000000000 --- a/packages/backend-app-api/src/services/implementations/health/createHealthRouter.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2024 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 Router from 'express-promise-router'; -import { Request, Response } from 'express'; -import { RootLifecycleService } from '@backstage/backend-plugin-api'; - -export function createHealthRouter(options: { - lifecycle: RootLifecycleService; -}) { - const router = Router(); - - let isRunning = false; - options.lifecycle.addStartupHook(() => { - isRunning = true; - }); - options.lifecycle.addShutdownHook(() => { - isRunning = false; - }); - - router.get('/v1/readiness', async (_request: Request, response: Response) => { - if (!isRunning) { - throw new Error('Backend has not started yet'); - } - response.json({ status: 'ok' }); - }); - - router.get('/v1/liveness', async (_request: Request, response: Response) => { - response.json({ status: 'ok' }); - }); - - return router; -} diff --git a/packages/backend-app-api/src/services/implementations/health/healthServiceFactory.ts b/packages/backend-app-api/src/services/implementations/health/healthServiceFactory.ts deleted file mode 100644 index b79ba34a87..0000000000 --- a/packages/backend-app-api/src/services/implementations/health/healthServiceFactory.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2024 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 { - coreServices, - createServiceFactory, -} from '@backstage/backend-plugin-api'; -import { createHealthRouter } from './createHealthRouter'; - -/** - * @public - */ -export const healthServiceFactory = createServiceFactory({ - service: coreServices.health, - deps: { - rootHttpRouter: coreServices.rootHttpRouter, - lifecycle: coreServices.rootLifecycle, - }, - async factory({ lifecycle, rootHttpRouter }) { - rootHttpRouter.use('.backstage/health', createHealthRouter({ lifecycle })); - - return {}; - }, -}); diff --git a/packages/backend-defaults/api-report-health.md b/packages/backend-defaults/api-report-health.md new file mode 100644 index 0000000000..795bdaac78 --- /dev/null +++ b/packages/backend-defaults/api-report-health.md @@ -0,0 +1,13 @@ +## API Report File for "@backstage/backend-defaults" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import { HealthService } from '@backstage/backend-plugin-api'; +import { ServiceFactory } from '@backstage/backend-plugin-api'; + +// @public (undocumented) +export const healthServiceFactory: () => ServiceFactory; + +// (No @packageDocumentation comment for this package) +``` diff --git a/packages/backend-defaults/package.json b/packages/backend-defaults/package.json index 4c34c7f317..c29d973997 100644 --- a/packages/backend-defaults/package.json +++ b/packages/backend-defaults/package.json @@ -24,6 +24,7 @@ "./cache": "./src/entrypoints/cache/index.ts", "./database": "./src/entrypoints/database/index.ts", "./discovery": "./src/entrypoints/discovery/index.ts", + "./health": "./src/entrypoints/health/index.ts", "./httpAuth": "./src/entrypoints/httpAuth/index.ts", "./httpRouter": "./src/entrypoints/httpRouter/index.ts", "./lifecycle": "./src/entrypoints/lifecycle/index.ts", @@ -54,6 +55,9 @@ "discovery": [ "src/entrypoints/discovery/index.ts" ], + "health": [ + "src/entrypoints/health/index.ts" + ], "httpAuth": [ "src/entrypoints/httpAuth/index.ts" ], diff --git a/packages/backend-app-api/src/services/implementations/health/createHealthRouter.test.ts b/packages/backend-defaults/src/entrypoints/health/healthServiceFactory.test.ts similarity index 63% rename from packages/backend-app-api/src/services/implementations/health/createHealthRouter.test.ts rename to packages/backend-defaults/src/entrypoints/health/healthServiceFactory.test.ts index f8c51ee08d..40a41d74f5 100644 --- a/packages/backend-app-api/src/services/implementations/health/createHealthRouter.test.ts +++ b/packages/backend-defaults/src/entrypoints/health/healthServiceFactory.test.ts @@ -1,3 +1,6 @@ +import { mockServices } from '@backstage/backend-test-utils'; +import { DefaultHealthService } from './healthServiceFactory'; + /* * Copyright 2024 The Backstage Authors * @@ -13,22 +16,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -import { mockServices } from '@backstage/backend-test-utils'; -import request from 'supertest'; -import { createHealthRouter } from './createHealthRouter'; -import express from 'express'; - -describe('createHealthRouter', () => { +describe('DefaultHealthService', () => { describe('readiness', () => { it(`should return a 500 response if the server hasn't started yet`, async () => { - const hc = createHealthRouter({ + const service = new DefaultHealthService({ lifecycle: mockServices.rootLifecycle.mock(), }); - const app = express().use(hc); - - const response = await request(app).get('/v1/readiness'); - expect(response.status).toBe(500); + await expect(service.getReadiness()).resolves.toEqual({ status: 503 }); }); it('should return 200 if the server has started', async () => { @@ -38,12 +32,16 @@ describe('createHealthRouter', () => { fn => (mockServerStartedFn = fn), ); - const hc = createHealthRouter({ lifecycle }); - const app = express().use(hc); + const service = new DefaultHealthService({ + lifecycle: mockServices.rootLifecycle.mock(), + }); mockServerStartedFn(); - const response = await request(app).get('/v1/readiness').expect(200); - expect(response.body).toEqual({ status: 'ok' }); + + await expect(service.getReadiness()).resolves.toEqual({ + status: 200, + payload: { status: 'ok' }, + }); }); it(`should return a 500 response if the server has stopped`, async () => { @@ -57,25 +55,28 @@ describe('createHealthRouter', () => { fn => (mockServerStoppedFn = fn), ); - const hc = createHealthRouter({ lifecycle }); - const app = express().use(hc); + const service = new DefaultHealthService({ + lifecycle: mockServices.rootLifecycle.mock(), + }); mockServerStartedFn(); mockServerStoppedFn(); - const response = await request(app).get('/v1/readiness'); - expect(response.status).toBe(500); + await expect(service.getReadiness()).resolves.toEqual({ + status: 503, + }); }); }); describe('liveness', () => { it('should return 200 if the server has started', async () => { - const lifecycle = mockServices.rootLifecycle.mock(); + const service = new DefaultHealthService({ + lifecycle: mockServices.rootLifecycle.mock(), + }); - const hc = createHealthRouter({ lifecycle }); - const app = express().use(hc); - - const response = await request(app).get('/v1/liveness').expect(200); - expect(response.body).toEqual({ status: 'ok' }); + await expect(service.getLiveness()).resolves.toEqual({ + status: 200, + payload: { status: 'ok' }, + }); }); }); }); diff --git a/packages/backend-defaults/src/entrypoints/health/healthServiceFactory.ts b/packages/backend-defaults/src/entrypoints/health/healthServiceFactory.ts new file mode 100644 index 0000000000..3f397ce29b --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/health/healthServiceFactory.ts @@ -0,0 +1,63 @@ +import { + HealthService, + RootLifecycleService, + coreServices, + createServiceFactory, +} from '@backstage/backend-plugin-api'; + +/* + * Copyright 2024 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. + */ + +/** @internal */ +export class DefaultHealthService implements HealthService { + #isRunning = false; + + constructor(readonly options: { lifecycle: RootLifecycleService }) { + options.lifecycle.addStartupHook(() => { + this.#isRunning = true; + }); + options.lifecycle.addShutdownHook(() => { + this.#isRunning = false; + }); + } + + async getLiveness(): Promise<{ status: number; payload?: any }> { + return { status: 200, payload: { status: 'ok' } }; + } + async getReadiness(): Promise<{ status: number; payload?: any }> { + if (!this.#isRunning) { + return { + status: 503, + payload: { message: 'Backend has not started yet', status: 'error' }, + }; + } + + return { status: 200, payload: { status: 'ok' } }; + } +} + +/** + * @public + */ +export const healthServiceFactory = createServiceFactory({ + service: coreServices.health, + deps: { + lifecycle: coreServices.rootLifecycle, + }, + async factory({ lifecycle }) { + return new DefaultHealthService({ lifecycle }); + }, +}); diff --git a/packages/backend-app-api/src/services/implementations/health/index.ts b/packages/backend-defaults/src/entrypoints/health/index.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/health/index.ts rename to packages/backend-defaults/src/entrypoints/health/index.ts From 44f97c173bf9eefb3c281928b84aa1f80bc32375 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Wed, 5 Jun 2024 13:27:39 +0200 Subject: [PATCH 314/387] backend-app-api: flip logic of health service Signed-off-by: Vincenzo Scamporlino --- .../health/healthServiceFactory.test.ts | 14 ++++++- .../health/healthServiceFactory.ts | 1 + .../rootHttpRouter/createHealthRouter.ts | 42 +++++++++++++++++++ .../rootHttpRouterServiceFactory.ts | 9 +++- packages/backend-plugin-api/api-report.md | 13 +++++- .../src/services/definitions/HealthService.ts | 5 ++- .../src/next/services/mockServices.ts | 18 ++++---- 7 files changed, 88 insertions(+), 14 deletions(-) create mode 100644 packages/backend-defaults/src/entrypoints/rootHttpRouter/createHealthRouter.ts diff --git a/packages/backend-defaults/src/entrypoints/health/healthServiceFactory.test.ts b/packages/backend-defaults/src/entrypoints/health/healthServiceFactory.test.ts index 40a41d74f5..7e160cbd82 100644 --- a/packages/backend-defaults/src/entrypoints/health/healthServiceFactory.test.ts +++ b/packages/backend-defaults/src/entrypoints/health/healthServiceFactory.test.ts @@ -22,7 +22,13 @@ describe('DefaultHealthService', () => { const service = new DefaultHealthService({ lifecycle: mockServices.rootLifecycle.mock(), }); - await expect(service.getReadiness()).resolves.toEqual({ status: 503 }); + await expect(service.getReadiness()).resolves.toEqual({ + status: 503, + payload: { + message: 'Backend has not started yet', + status: 'error', + }, + }); }); it('should return 200 if the server has started', async () => { @@ -33,7 +39,7 @@ describe('DefaultHealthService', () => { ); const service = new DefaultHealthService({ - lifecycle: mockServices.rootLifecycle.mock(), + lifecycle, }); mockServerStartedFn(); @@ -63,6 +69,10 @@ describe('DefaultHealthService', () => { mockServerStoppedFn(); await expect(service.getReadiness()).resolves.toEqual({ status: 503, + payload: { + message: 'Backend has not started yet', + status: 'error', + }, }); }); }); diff --git a/packages/backend-defaults/src/entrypoints/health/healthServiceFactory.ts b/packages/backend-defaults/src/entrypoints/health/healthServiceFactory.ts index 3f397ce29b..f68451df74 100644 --- a/packages/backend-defaults/src/entrypoints/health/healthServiceFactory.ts +++ b/packages/backend-defaults/src/entrypoints/health/healthServiceFactory.ts @@ -37,6 +37,7 @@ export class DefaultHealthService implements HealthService { async getLiveness(): Promise<{ status: number; payload?: any }> { return { status: 200, payload: { status: 'ok' } }; } + async getReadiness(): Promise<{ status: number; payload?: any }> { if (!this.#isRunning) { return { diff --git a/packages/backend-defaults/src/entrypoints/rootHttpRouter/createHealthRouter.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/createHealthRouter.ts new file mode 100644 index 0000000000..012a268e02 --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/rootHttpRouter/createHealthRouter.ts @@ -0,0 +1,42 @@ +import { HealthService } from '@backstage/backend-plugin-api'; + +/* + * Copyright 2024 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 Router from 'express-promise-router'; +import { Request, Response } from 'express'; + +export function createHealthRouter(options: { health: HealthService }) { + const router = Router(); + + router.get( + '.backstage/health/v1/readiness', + async (_request: Request, response: Response) => { + const { status, payload } = await options.health.getReadiness(); + response.status(status).json(payload); + }, + ); + + router.get( + '.backstage/health/v1/liveness', + async (_request: Request, response: Response) => { + const { status, payload } = await options.health.getLiveness(); + response.status(status).json(payload); + }, + ); + + return router; +} diff --git a/packages/backend-defaults/src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.ts index ea3dc42eb7..5f22cf5ced 100644 --- a/packages/backend-defaults/src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.ts +++ b/packages/backend-defaults/src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.ts @@ -29,6 +29,7 @@ import { readHttpServerOptions, } from './http'; import { DefaultRootHttpRouter } from './DefaultRootHttpRouter'; +import { createHealthRouter } from './createHealthRouter'; /** * @public @@ -41,6 +42,7 @@ export interface RootHttpRouterConfigureContext { config: RootConfigService; logger: LoggerService; lifecycle: LifecycleService; + healthRouter: RequestHandler; applyDefaults: () => void; } @@ -75,8 +77,9 @@ export const rootHttpRouterServiceFactory = createServiceFactory( config: coreServices.rootConfig, rootLogger: coreServices.rootLogger, lifecycle: coreServices.rootLifecycle, + health: coreServices.health, }, - async factory({ config, rootLogger, lifecycle }) { + async factory({ config, rootLogger, lifecycle, health }) { const { indexPath, configure = defaultConfigure } = options ?? {}; const logger = rootLogger.child({ service: 'rootHttpRouter' }); const app = express(); @@ -84,6 +87,8 @@ export const rootHttpRouterServiceFactory = createServiceFactory( const router = DefaultRootHttpRouter.create({ indexPath }); const middleware = MiddlewareFactory.create({ config, logger }); const routes = router.handler(); + + const healthRouter = createHealthRouter({ health }); const server = await createHttpServer( app, readHttpServerOptions(config.getOptionalConfig('backend')), @@ -98,11 +103,13 @@ export const rootHttpRouterServiceFactory = createServiceFactory( config, logger, lifecycle, + healthRouter, applyDefaults() { app.use(middleware.helmet()); app.use(middleware.cors()); app.use(middleware.compression()); app.use(middleware.logging()); + app.use(healthRouter); app.use(routes); app.use(middleware.notFound()); app.use(middleware.error()); diff --git a/packages/backend-plugin-api/api-report.md b/packages/backend-plugin-api/api-report.md index 5e02ad1787..ee5aecd63b 100644 --- a/packages/backend-plugin-api/api-report.md +++ b/packages/backend-plugin-api/api-report.md @@ -335,7 +335,18 @@ export type ExtensionPoint = { export type ExtensionPointConfig = CreateExtensionPointOptions; // @public (undocumented) -export interface HealthService {} +export interface HealthService { + // (undocumented) + getLiveness(): Promise<{ + status: number; + payload?: any; + }>; + // (undocumented) + getReadiness(): Promise<{ + status: number; + payload?: any; + }>; +} // @public export interface HttpAuthService { diff --git a/packages/backend-plugin-api/src/services/definitions/HealthService.ts b/packages/backend-plugin-api/src/services/definitions/HealthService.ts index d04a8a6133..b2dc4f415e 100644 --- a/packages/backend-plugin-api/src/services/definitions/HealthService.ts +++ b/packages/backend-plugin-api/src/services/definitions/HealthService.ts @@ -17,4 +17,7 @@ /** * @public */ -export interface HealthService {} +export interface HealthService { + getLiveness(): Promise<{ status: number; payload?: any }>; + getReadiness(): Promise<{ status: number; payload?: any }>; +} diff --git a/packages/backend-test-utils/src/next/services/mockServices.ts b/packages/backend-test-utils/src/next/services/mockServices.ts index 22496bd6e1..a59d053b95 100644 --- a/packages/backend-test-utils/src/next/services/mockServices.ts +++ b/packages/backend-test-utils/src/next/services/mockServices.ts @@ -20,11 +20,11 @@ import { HostDiscovery, discoveryServiceFactory, } from '@backstage/backend-defaults/discovery'; +import { healthServiceFactory } from '@backstage/backend-defaults/health'; import { httpRouterServiceFactory } from '@backstage/backend-defaults/httpRouter'; import { lifecycleServiceFactory } from '@backstage/backend-defaults/lifecycle'; import { loggerServiceFactory } from '@backstage/backend-defaults/logger'; import { permissionsServiceFactory } from '@backstage/backend-defaults/permissions'; -import { rootHealthServiceFactory } from '@backstage/backend-defaults/rootHealth'; import { rootHttpRouterServiceFactory } from '@backstage/backend-defaults/rootHttpRouter'; import { rootLifecycleServiceFactory } from '@backstage/backend-defaults/rootLifecycle'; import { schedulerServiceFactory } from '@backstage/backend-defaults/scheduler'; @@ -345,6 +345,14 @@ export namespace mockServices { })); } + export namespace health { + export const factory = healthServiceFactory; + export const mock = simpleMock(coreServices.health, () => ({ + getLiveness: jest.fn(), + getReadiness: jest.fn(), + })); + } + export namespace httpRouter { export const factory = httpRouterServiceFactory; export const mock = simpleMock(coreServices.httpRouter, () => ({ @@ -384,14 +392,6 @@ export namespace mockServices { })); } - export namespace rootHealth { - export const factory = rootHealthServiceFactory; - export const mock = simpleMock(coreServices.health, () => ({ - getLiveness: jest.fn(), - getReadiness: jest.fn(), - })); - } - export namespace rootLifecycle { export const factory = rootLifecycleServiceFactory; export const mock = simpleMock(coreServices.rootLifecycle, () => ({ From 506fc235567a02a8609c5859f3311cda393aaa04 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Thu, 13 Jun 2024 13:11:03 +0200 Subject: [PATCH 315/387] backend-defaults: fix notice Signed-off-by: Vincenzo Scamporlino --- .../src/entrypoints/health/healthServiceFactory.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/backend-defaults/src/entrypoints/health/healthServiceFactory.ts b/packages/backend-defaults/src/entrypoints/health/healthServiceFactory.ts index f68451df74..652ad8758f 100644 --- a/packages/backend-defaults/src/entrypoints/health/healthServiceFactory.ts +++ b/packages/backend-defaults/src/entrypoints/health/healthServiceFactory.ts @@ -1,10 +1,3 @@ -import { - HealthService, - RootLifecycleService, - coreServices, - createServiceFactory, -} from '@backstage/backend-plugin-api'; - /* * Copyright 2024 The Backstage Authors * @@ -21,6 +14,13 @@ import { * limitations under the License. */ +import { + HealthService, + RootLifecycleService, + coreServices, + createServiceFactory, +} from '@backstage/backend-plugin-api'; + /** @internal */ export class DefaultHealthService implements HealthService { #isRunning = false; From 0c621514042da57665afc28336be9cfa03fe430d Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Thu, 13 Jun 2024 13:39:33 +0200 Subject: [PATCH 316/387] Rename HealthService to RootHealthService Signed-off-by: Vincenzo Scamporlino --- docs/backend-system/core-services/01-index.md | 2 +- .../core-services/{health.md => root-health.md} | 0 packages/backend-defaults/package.json | 8 ++++---- packages/backend-defaults/src/CreateBackend.ts | 4 ++-- .../src/entrypoints/{health => rootHealth}/index.ts | 2 +- .../rootHealthServiceFactory.test.ts} | 12 ++++++------ .../rootHealthServiceFactory.ts} | 8 ++++---- .../entrypoints/rootHttpRouter/createHealthRouter.ts | 4 ++-- .../{HealthService.ts => RootHealthService.ts} | 8 +++++++- .../src/services/definitions/index.ts | 2 +- .../src/next/services/mockServices.ts | 6 +++--- 11 files changed, 31 insertions(+), 25 deletions(-) rename docs/backend-system/core-services/{health.md => root-health.md} (100%) rename packages/backend-defaults/src/entrypoints/{health => rootHealth}/index.ts (89%) rename packages/backend-defaults/src/entrypoints/{health/healthServiceFactory.test.ts => rootHealth/rootHealthServiceFactory.test.ts} (88%) rename packages/backend-defaults/src/entrypoints/{health/healthServiceFactory.ts => rootHealth/rootHealthServiceFactory.ts} (88%) rename packages/backend-plugin-api/src/services/definitions/{HealthService.ts => RootHealthService.ts} (83%) diff --git a/docs/backend-system/core-services/01-index.md b/docs/backend-system/core-services/01-index.md index 63324292c1..3be12b2e26 100644 --- a/docs/backend-system/core-services/01-index.md +++ b/docs/backend-system/core-services/01-index.md @@ -20,7 +20,6 @@ import { coreServices } from '@backstage/backend-plugin-api'; - [Cache Service](./cache.md) - Key-value store for caching data. - [Database Service](./database.md) - Database access and management via [knex](https://knexjs.org/). - [Discovery Service](./discovery.md) - Service discovery for inter-plugin communication. -- [Health Service](./health.md) - Health check endpoints for the backend. - [Http Auth Service](./http-auth.md) - Authentication of HTTP requests. - [Http Router Service](./http-router.md) - HTTP route registration for plugins. - [Identity Service](./identity.md) - Deprecated user authentication service, use the [Auth Service](./auth.md) instead. @@ -29,6 +28,7 @@ import { coreServices } from '@backstage/backend-plugin-api'; - [Permissions Service](./permissions.md) - Permission system integration for authorization of user actions. - [Plugin Metadata Service](./plugin-metadata.md) - Built-in service for accessing metadata about the current plugin. - [Root Config Service](./root-config.md) - Access to static configuration. +- [Root Health Service](./root-health.md) - Health check endpoints for the backend. - [Root Http Router Service](./root-http-router.md) - HTTP route registration for root services. - [Root Lifecycle Service](./root-lifecycle.md) - Registration of backend startup and shutdown lifecycle hooks. - [Root Logger Service](./root-logger.md) - Root-level logging. diff --git a/docs/backend-system/core-services/health.md b/docs/backend-system/core-services/root-health.md similarity index 100% rename from docs/backend-system/core-services/health.md rename to docs/backend-system/core-services/root-health.md diff --git a/packages/backend-defaults/package.json b/packages/backend-defaults/package.json index c29d973997..2d84bae308 100644 --- a/packages/backend-defaults/package.json +++ b/packages/backend-defaults/package.json @@ -24,13 +24,13 @@ "./cache": "./src/entrypoints/cache/index.ts", "./database": "./src/entrypoints/database/index.ts", "./discovery": "./src/entrypoints/discovery/index.ts", - "./health": "./src/entrypoints/health/index.ts", "./httpAuth": "./src/entrypoints/httpAuth/index.ts", "./httpRouter": "./src/entrypoints/httpRouter/index.ts", "./lifecycle": "./src/entrypoints/lifecycle/index.ts", "./logger": "./src/entrypoints/logger/index.ts", "./permissions": "./src/entrypoints/permissions/index.ts", "./rootConfig": "./src/entrypoints/rootConfig/index.ts", + "./rootHealth": "./src/entrypoints/rootHealth/index.ts", "./rootHttpRouter": "./src/entrypoints/rootHttpRouter/index.ts", "./rootLifecycle": "./src/entrypoints/rootLifecycle/index.ts", "./rootLogger": "./src/entrypoints/rootLogger/index.ts", @@ -55,9 +55,6 @@ "discovery": [ "src/entrypoints/discovery/index.ts" ], - "health": [ - "src/entrypoints/health/index.ts" - ], "httpAuth": [ "src/entrypoints/httpAuth/index.ts" ], @@ -76,6 +73,9 @@ "rootConfig": [ "src/entrypoints/rootConfig/index.ts" ], + "rootHealth": [ + "src/entrypoints/rootHealth/index.ts" + ], "rootHttpRouter": [ "src/entrypoints/rootHttpRouter/index.ts" ], diff --git a/packages/backend-defaults/src/CreateBackend.ts b/packages/backend-defaults/src/CreateBackend.ts index 453c5fe592..e3195748a6 100644 --- a/packages/backend-defaults/src/CreateBackend.ts +++ b/packages/backend-defaults/src/CreateBackend.ts @@ -24,13 +24,13 @@ import { authServiceFactory } from '@backstage/backend-defaults/auth'; import { cacheServiceFactory } from '@backstage/backend-defaults/cache'; import { databaseServiceFactory } from '@backstage/backend-defaults/database'; import { discoveryServiceFactory } from '@backstage/backend-defaults/discovery'; -import { rootHealthServiceFactory } from './entrypoints/rootHealth'; import { httpAuthServiceFactory } from '@backstage/backend-defaults/httpAuth'; import { httpRouterServiceFactory } from '@backstage/backend-defaults/httpRouter'; import { lifecycleServiceFactory } from '@backstage/backend-defaults/lifecycle'; import { loggerServiceFactory } from '@backstage/backend-defaults/logger'; import { permissionsServiceFactory } from '@backstage/backend-defaults/permissions'; import { rootConfigServiceFactory } from '@backstage/backend-defaults/rootConfig'; +import { rootHealthServiceFactory } from '@backstage/backend-defaults/rootHealth'; import { rootHttpRouterServiceFactory } from '@backstage/backend-defaults/rootHttpRouter'; import { rootLifecycleServiceFactory } from '@backstage/backend-defaults/rootLifecycle'; import { rootLoggerServiceFactory } from '@backstage/backend-defaults/rootLogger'; @@ -51,6 +51,7 @@ export const defaultServiceFactories = [ lifecycleServiceFactory(), loggerServiceFactory(), permissionsServiceFactory(), + rootHealthServiceFactory(), rootHttpRouterServiceFactory(), rootLifecycleServiceFactory(), rootLoggerServiceFactory(), @@ -59,7 +60,6 @@ export const defaultServiceFactories = [ userInfoServiceFactory(), urlReaderServiceFactory(), eventsServiceFactory(), - rootHealthServiceFactory(), ]; /** diff --git a/packages/backend-defaults/src/entrypoints/health/index.ts b/packages/backend-defaults/src/entrypoints/rootHealth/index.ts similarity index 89% rename from packages/backend-defaults/src/entrypoints/health/index.ts rename to packages/backend-defaults/src/entrypoints/rootHealth/index.ts index 4aeb4b7979..35225b39c4 100644 --- a/packages/backend-defaults/src/entrypoints/health/index.ts +++ b/packages/backend-defaults/src/entrypoints/rootHealth/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export { healthServiceFactory } from './healthServiceFactory'; +export { rootHealthServiceFactory } from './rootHealthServiceFactory'; diff --git a/packages/backend-defaults/src/entrypoints/health/healthServiceFactory.test.ts b/packages/backend-defaults/src/entrypoints/rootHealth/rootHealthServiceFactory.test.ts similarity index 88% rename from packages/backend-defaults/src/entrypoints/health/healthServiceFactory.test.ts rename to packages/backend-defaults/src/entrypoints/rootHealth/rootHealthServiceFactory.test.ts index 7e160cbd82..fd786e2b28 100644 --- a/packages/backend-defaults/src/entrypoints/health/healthServiceFactory.test.ts +++ b/packages/backend-defaults/src/entrypoints/rootHealth/rootHealthServiceFactory.test.ts @@ -1,5 +1,5 @@ import { mockServices } from '@backstage/backend-test-utils'; -import { DefaultHealthService } from './healthServiceFactory'; +import { DefaultRootHealthService } from './rootHealthServiceFactory'; /* * Copyright 2024 The Backstage Authors @@ -16,10 +16,10 @@ import { DefaultHealthService } from './healthServiceFactory'; * See the License for the specific language governing permissions and * limitations under the License. */ -describe('DefaultHealthService', () => { +describe('DefaultRootHealthService', () => { describe('readiness', () => { it(`should return a 500 response if the server hasn't started yet`, async () => { - const service = new DefaultHealthService({ + const service = new DefaultRootHealthService({ lifecycle: mockServices.rootLifecycle.mock(), }); await expect(service.getReadiness()).resolves.toEqual({ @@ -38,7 +38,7 @@ describe('DefaultHealthService', () => { fn => (mockServerStartedFn = fn), ); - const service = new DefaultHealthService({ + const service = new DefaultRootHealthService({ lifecycle, }); @@ -61,7 +61,7 @@ describe('DefaultHealthService', () => { fn => (mockServerStoppedFn = fn), ); - const service = new DefaultHealthService({ + const service = new DefaultRootHealthService({ lifecycle: mockServices.rootLifecycle.mock(), }); @@ -79,7 +79,7 @@ describe('DefaultHealthService', () => { describe('liveness', () => { it('should return 200 if the server has started', async () => { - const service = new DefaultHealthService({ + const service = new DefaultRootHealthService({ lifecycle: mockServices.rootLifecycle.mock(), }); diff --git a/packages/backend-defaults/src/entrypoints/health/healthServiceFactory.ts b/packages/backend-defaults/src/entrypoints/rootHealth/rootHealthServiceFactory.ts similarity index 88% rename from packages/backend-defaults/src/entrypoints/health/healthServiceFactory.ts rename to packages/backend-defaults/src/entrypoints/rootHealth/rootHealthServiceFactory.ts index 652ad8758f..3a00db8285 100644 --- a/packages/backend-defaults/src/entrypoints/health/healthServiceFactory.ts +++ b/packages/backend-defaults/src/entrypoints/rootHealth/rootHealthServiceFactory.ts @@ -15,14 +15,14 @@ */ import { - HealthService, + RootHealthService, RootLifecycleService, coreServices, createServiceFactory, } from '@backstage/backend-plugin-api'; /** @internal */ -export class DefaultHealthService implements HealthService { +export class DefaultRootHealthService implements RootHealthService { #isRunning = false; constructor(readonly options: { lifecycle: RootLifecycleService }) { @@ -53,12 +53,12 @@ export class DefaultHealthService implements HealthService { /** * @public */ -export const healthServiceFactory = createServiceFactory({ +export const rootHealthServiceFactory = createServiceFactory({ service: coreServices.health, deps: { lifecycle: coreServices.rootLifecycle, }, async factory({ lifecycle }) { - return new DefaultHealthService({ lifecycle }); + return new DefaultRootHealthService({ lifecycle }); }, }); diff --git a/packages/backend-defaults/src/entrypoints/rootHttpRouter/createHealthRouter.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/createHealthRouter.ts index 012a268e02..13691ede28 100644 --- a/packages/backend-defaults/src/entrypoints/rootHttpRouter/createHealthRouter.ts +++ b/packages/backend-defaults/src/entrypoints/rootHttpRouter/createHealthRouter.ts @@ -1,4 +1,4 @@ -import { HealthService } from '@backstage/backend-plugin-api'; +import { RootHealthService } from '@backstage/backend-plugin-api'; /* * Copyright 2024 The Backstage Authors @@ -19,7 +19,7 @@ import { HealthService } from '@backstage/backend-plugin-api'; import Router from 'express-promise-router'; import { Request, Response } from 'express'; -export function createHealthRouter(options: { health: HealthService }) { +export function createHealthRouter(options: { health: RootHealthService }) { const router = Router(); router.get( diff --git a/packages/backend-plugin-api/src/services/definitions/HealthService.ts b/packages/backend-plugin-api/src/services/definitions/RootHealthService.ts similarity index 83% rename from packages/backend-plugin-api/src/services/definitions/HealthService.ts rename to packages/backend-plugin-api/src/services/definitions/RootHealthService.ts index b2dc4f415e..ac482b5dbb 100644 --- a/packages/backend-plugin-api/src/services/definitions/HealthService.ts +++ b/packages/backend-plugin-api/src/services/definitions/RootHealthService.ts @@ -17,7 +17,13 @@ /** * @public */ -export interface HealthService { +export interface RootHealthService { + /** + * Get the liveness status of the backend. + */ getLiveness(): Promise<{ status: number; payload?: any }>; + /** + * Get the readiness status of the backend. + */ getReadiness(): Promise<{ status: number; payload?: any }>; } diff --git a/packages/backend-plugin-api/src/services/definitions/index.ts b/packages/backend-plugin-api/src/services/definitions/index.ts index af0d991f58..5e30d444fd 100644 --- a/packages/backend-plugin-api/src/services/definitions/index.ts +++ b/packages/backend-plugin-api/src/services/definitions/index.ts @@ -32,7 +32,7 @@ export type { export type { RootConfigService } from './RootConfigService'; export type { DatabaseService } from './DatabaseService'; export type { DiscoveryService } from './DiscoveryService'; -export type { HealthService } from './HealthService'; +export type { RootHealthService } from './RootHealthService'; export type { HttpRouterService, HttpRouterServiceAuthPolicy, diff --git a/packages/backend-test-utils/src/next/services/mockServices.ts b/packages/backend-test-utils/src/next/services/mockServices.ts index a59d053b95..5055a9eae8 100644 --- a/packages/backend-test-utils/src/next/services/mockServices.ts +++ b/packages/backend-test-utils/src/next/services/mockServices.ts @@ -20,11 +20,11 @@ import { HostDiscovery, discoveryServiceFactory, } from '@backstage/backend-defaults/discovery'; -import { healthServiceFactory } from '@backstage/backend-defaults/health'; import { httpRouterServiceFactory } from '@backstage/backend-defaults/httpRouter'; import { lifecycleServiceFactory } from '@backstage/backend-defaults/lifecycle'; import { loggerServiceFactory } from '@backstage/backend-defaults/logger'; import { permissionsServiceFactory } from '@backstage/backend-defaults/permissions'; +import { rootHealthServiceFactory } from '@backstage/backend-defaults/rootHealth'; import { rootHttpRouterServiceFactory } from '@backstage/backend-defaults/rootHttpRouter'; import { rootLifecycleServiceFactory } from '@backstage/backend-defaults/rootLifecycle'; import { schedulerServiceFactory } from '@backstage/backend-defaults/scheduler'; @@ -345,8 +345,8 @@ export namespace mockServices { })); } - export namespace health { - export const factory = healthServiceFactory; + export namespace rootHealth { + export const factory = rootHealthServiceFactory; export const mock = simpleMock(coreServices.health, () => ({ getLiveness: jest.fn(), getReadiness: jest.fn(), From 5c4e876e62afbfa56ff3105a2eca0811a7942e8f Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Thu, 13 Jun 2024 14:25:02 +0200 Subject: [PATCH 317/387] health api reports Signed-off-by: Vincenzo Scamporlino --- ...ort-health.md => api-report-rootHealth.md} | 7 +++-- packages/backend-plugin-api/api-report.md | 28 +++++++++---------- 2 files changed, 18 insertions(+), 17 deletions(-) rename packages/backend-defaults/{api-report-health.md => api-report-rootHealth.md} (65%) diff --git a/packages/backend-defaults/api-report-health.md b/packages/backend-defaults/api-report-rootHealth.md similarity index 65% rename from packages/backend-defaults/api-report-health.md rename to packages/backend-defaults/api-report-rootHealth.md index 795bdaac78..ffa067605a 100644 --- a/packages/backend-defaults/api-report-health.md +++ b/packages/backend-defaults/api-report-rootHealth.md @@ -3,11 +3,14 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { HealthService } from '@backstage/backend-plugin-api'; +import { RootHealthService } from '@backstage/backend-plugin-api'; import { ServiceFactory } from '@backstage/backend-plugin-api'; // @public (undocumented) -export const healthServiceFactory: () => ServiceFactory; +export const rootHealthServiceFactory: () => ServiceFactory< + RootHealthService, + 'root' +>; // (No @packageDocumentation comment for this package) ``` diff --git a/packages/backend-plugin-api/api-report.md b/packages/backend-plugin-api/api-report.md index ee5aecd63b..f527e366c0 100644 --- a/packages/backend-plugin-api/api-report.md +++ b/packages/backend-plugin-api/api-report.md @@ -194,7 +194,7 @@ export namespace coreServices { const rootConfig: ServiceRef; const database: ServiceRef; const discovery: ServiceRef; - const health: ServiceRef; + const health: ServiceRef; const httpAuth: ServiceRef; const httpRouter: ServiceRef; const lifecycle: ServiceRef; @@ -334,20 +334,6 @@ export type ExtensionPoint = { // @public @deprecated (undocumented) export type ExtensionPointConfig = CreateExtensionPointOptions; -// @public (undocumented) -export interface HealthService { - // (undocumented) - getLiveness(): Promise<{ - status: number; - payload?: any; - }>; - // (undocumented) - getReadiness(): Promise<{ - status: number; - payload?: any; - }>; -} - // @public export interface HttpAuthService { credentials( @@ -515,6 +501,18 @@ export function resolveSafeChildPath(base: string, path: string): string; // @public export interface RootConfigService extends Config {} +// @public (undocumented) +export interface RootHealthService { + getLiveness(): Promise<{ + status: number; + payload?: any; + }>; + getReadiness(): Promise<{ + status: number; + payload?: any; + }>; +} + // @public export interface RootHttpRouterService { use(path: string, handler: Handler): void; From 73a45650e2872fdad10ea9edc9f37baa1e847957 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Thu, 20 Jun 2024 12:11:08 +0200 Subject: [PATCH 318/387] api reports Signed-off-by: Vincenzo Scamporlino --- packages/backend-app-api/api-report.md | 4 ---- .../api-report-rootHttpRouter.md | 2 ++ .../rootHealth/rootHealthServiceFactory.ts | 2 +- .../rootHttpRouterServiceFactory.ts | 2 +- packages/backend-plugin-api/api-report.md | 2 +- .../src/services/definitions/coreServices.ts | 4 ++-- packages/backend-test-utils/api-report.md | 20 +++++++++---------- .../src/next/services/mockServices.ts | 2 +- 8 files changed, 18 insertions(+), 20 deletions(-) diff --git a/packages/backend-app-api/api-report.md b/packages/backend-app-api/api-report.md index a18f027273..7518f8e2cc 100644 --- a/packages/backend-app-api/api-report.md +++ b/packages/backend-app-api/api-report.md @@ -18,7 +18,6 @@ import { ErrorRequestHandler } from 'express'; import { Express as Express_2 } from 'express'; import { Format } from 'logform'; import { Handler } from 'express'; -import { HealthService } from '@backstage/backend-plugin-api'; import { HelmetOptions } from 'helmet'; import * as http from 'http'; import { HttpAuthService } from '@backstage/backend-plugin-api'; @@ -127,9 +126,6 @@ export const discoveryServiceFactory: () => ServiceFactory< // @public @deprecated (undocumented) export type ExtendedHttpServer = ExtendedHttpServer_2; -// @public (undocumented) -export const healthServiceFactory: () => ServiceFactory; - // @public @deprecated export class HostDiscovery implements DiscoveryService { static fromConfig( diff --git a/packages/backend-defaults/api-report-rootHttpRouter.md b/packages/backend-defaults/api-report-rootHttpRouter.md index b753406202..d9727fd36d 100644 --- a/packages/backend-defaults/api-report-rootHttpRouter.md +++ b/packages/backend-defaults/api-report-rootHttpRouter.md @@ -121,6 +121,8 @@ export interface RootHttpRouterConfigureContext { // (undocumented) config: RootConfigService; // (undocumented) + healthRouter: RequestHandler; + // (undocumented) lifecycle: LifecycleService; // (undocumented) logger: LoggerService; diff --git a/packages/backend-defaults/src/entrypoints/rootHealth/rootHealthServiceFactory.ts b/packages/backend-defaults/src/entrypoints/rootHealth/rootHealthServiceFactory.ts index 3a00db8285..c8b4ad5394 100644 --- a/packages/backend-defaults/src/entrypoints/rootHealth/rootHealthServiceFactory.ts +++ b/packages/backend-defaults/src/entrypoints/rootHealth/rootHealthServiceFactory.ts @@ -54,7 +54,7 @@ export class DefaultRootHealthService implements RootHealthService { * @public */ export const rootHealthServiceFactory = createServiceFactory({ - service: coreServices.health, + service: coreServices.rootHealth, deps: { lifecycle: coreServices.rootLifecycle, }, diff --git a/packages/backend-defaults/src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.ts index 5f22cf5ced..22f5c2f310 100644 --- a/packages/backend-defaults/src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.ts +++ b/packages/backend-defaults/src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.ts @@ -77,7 +77,7 @@ export const rootHttpRouterServiceFactory = createServiceFactory( config: coreServices.rootConfig, rootLogger: coreServices.rootLogger, lifecycle: coreServices.rootLifecycle, - health: coreServices.health, + health: coreServices.rootHealth, }, async factory({ config, rootLogger, lifecycle, health }) { const { indexPath, configure = defaultConfigure } = options ?? {}; diff --git a/packages/backend-plugin-api/api-report.md b/packages/backend-plugin-api/api-report.md index f527e366c0..ef5aa22cf4 100644 --- a/packages/backend-plugin-api/api-report.md +++ b/packages/backend-plugin-api/api-report.md @@ -194,7 +194,7 @@ export namespace coreServices { const rootConfig: ServiceRef; const database: ServiceRef; const discovery: ServiceRef; - const health: ServiceRef; + const rootHealth: ServiceRef; const httpAuth: ServiceRef; const httpRouter: ServiceRef; const lifecycle: ServiceRef; diff --git a/packages/backend-plugin-api/src/services/definitions/coreServices.ts b/packages/backend-plugin-api/src/services/definitions/coreServices.ts index 36ec0151c5..33d1da2903 100644 --- a/packages/backend-plugin-api/src/services/definitions/coreServices.ts +++ b/packages/backend-plugin-api/src/services/definitions/coreServices.ts @@ -105,9 +105,9 @@ export namespace coreServices { /** * The service reference for the plugin scoped {@link RootHealthService}. */ - export const health = createServiceRef< + export const rootHealth = createServiceRef< import('./RootHealthService').RootHealthService - >({ id: 'core.health', scope: 'root' }); + >({ id: 'core.rootHealth', scope: 'root' }); /** * Authentication of HTTP requests. diff --git a/packages/backend-test-utils/api-report.md b/packages/backend-test-utils/api-report.md index 07b393b653..a2fb4b7674 100644 --- a/packages/backend-test-utils/api-report.md +++ b/packages/backend-test-utils/api-report.md @@ -21,7 +21,6 @@ import { DiscoveryService } from '@backstage/backend-plugin-api'; import { EventsService } from '@backstage/plugin-events-node'; import { ExtendedHttpServer } from '@backstage/backend-app-api'; import { ExtensionPoint } from '@backstage/backend-plugin-api'; -import { HealthService } from '@backstage/backend-plugin-api'; import { HttpAuthService } from '@backstage/backend-plugin-api'; import { HttpRouterFactoryOptions } from '@backstage/backend-defaults/httpRouter'; import { HttpRouterService } from '@backstage/backend-plugin-api'; @@ -33,6 +32,7 @@ import { LifecycleService } from '@backstage/backend-plugin-api'; import { LoggerService } from '@backstage/backend-plugin-api'; import { PermissionsService } from '@backstage/backend-plugin-api'; import { RootConfigService } from '@backstage/backend-plugin-api'; +import { RootHealthService } from '@backstage/backend-plugin-api'; import { RootHttpRouterFactoryOptions } from '@backstage/backend-defaults/rootHttpRouter'; import { RootHttpRouterService } from '@backstage/backend-plugin-api'; import { RootLifecycleService } from '@backstage/backend-plugin-api'; @@ -200,15 +200,6 @@ export namespace mockServices { partialImpl?: Partial | undefined, ) => ServiceMock; } - // (undocumented) - export namespace health { - const // (undocumented) - factory: () => ServiceFactory; - const // (undocumented) - mock: ( - partialImpl?: Partial | undefined, - ) => ServiceMock; - } export function httpAuth(options?: { pluginId?: string; defaultCredentials?: BackstageCredentials; @@ -290,6 +281,15 @@ export namespace mockServices { ) => ServiceFactory; } // (undocumented) + export namespace rootHealth { + const // (undocumented) + factory: () => ServiceFactory; + const // (undocumented) + mock: ( + partialImpl?: Partial | undefined, + ) => ServiceMock; + } + // (undocumented) export namespace rootHttpRouter { const // (undocumented) factory: ( diff --git a/packages/backend-test-utils/src/next/services/mockServices.ts b/packages/backend-test-utils/src/next/services/mockServices.ts index 5055a9eae8..d56179d958 100644 --- a/packages/backend-test-utils/src/next/services/mockServices.ts +++ b/packages/backend-test-utils/src/next/services/mockServices.ts @@ -347,7 +347,7 @@ export namespace mockServices { export namespace rootHealth { export const factory = rootHealthServiceFactory; - export const mock = simpleMock(coreServices.health, () => ({ + export const mock = simpleMock(coreServices.rootHealth, () => ({ getLiveness: jest.fn(), getReadiness: jest.fn(), })); From e36e507d592c3a6011b6834cd8a0b751bc38c339 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Thu, 20 Jun 2024 12:20:18 +0200 Subject: [PATCH 319/387] docs: update root health docs Signed-off-by: Vincenzo Scamporlino --- .../core-services/root-health.md | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/docs/backend-system/core-services/root-health.md b/docs/backend-system/core-services/root-health.md index 9a69891624..2a6625fd70 100644 --- a/docs/backend-system/core-services/root-health.md +++ b/docs/backend-system/core-services/root-health.md @@ -1,38 +1,40 @@ --- -id: health -title: Heath Service +id: root-health +title: Root Health Service sidebar_label: Health description: Documentation for the Health service --- -The Health service provides some health check endpoints for the plugins. By default, it attaches `/.backstage/health/v1/readiness` and `/.backstage/health/v1/liveness` endpoints to the backend server, which return a JSON object with the status of the backend services. +The Root Health service provides some health check endpoints for the backend. By default, the `rootHttpRouter` exposes a `/.backstage/health/v1/readiness` and `/.backstage/health/v1/liveness` endpoints, which return a JSON object with the status of the backend services according the implementation of the Root Health Service. ## Configuring the service -The following example is how you can override the health service to add custom endpoints. +The following example is how you can override the health service implementation. ```ts -import { coreServices } from '@backstage/backend-plugin-api'; +import { RootHealthService, coreServices } from '@backstage/backend-plugin-api'; import { WinstonLogger } from '@backstage/backend-app-api'; const backend = createBackend(); +class MyRootHealthService implements RootHealthService { + async getLiveness(): Promise<{ status: number; payload?: any }> { + // provide your own implementation + return { status: 200, payload: { status: 'ok' } }; + } + + async getReadiness(): Promise<{ status: number; payload?: any }> { + // provide your own implementation + return { status: 200, payload: { status: 'ok' } }; + } +} + backend.add( createServiceFactory({ - service: coreServices.health, - deps: { - rootHttpRouter: coreServices.rootHttpRouter, - }, - async factory({ rootHttpRouter }) { - rootHttpRouter.get('.backstage/health/v1/readiness', async (req, res) => { - res.json({ status: 'ok' }); - }); - - rootHttpRouter.get('.backstage/health/v1/liveness', async (req, res) => { - res.json({ status: 'ok' }); - }); - - return {}; + service: coreServices.rootHealth, + deps: {}, + async factory({}) { + return new MyRootHealthService(); }, }), ); From 4e8455f0bd18bf4e779df3b2484f9ac1dfd2430f Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Thu, 20 Jun 2024 12:43:34 +0200 Subject: [PATCH 320/387] Apply suggestions from code review Signed-off-by: Vincenzo Scamporlino --- .changeset/bright-panthers-leave.md | 2 +- .changeset/serious-kings-trade.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/bright-panthers-leave.md b/.changeset/bright-panthers-leave.md index acd9764fe6..14798b6b39 100644 --- a/.changeset/bright-panthers-leave.md +++ b/.changeset/bright-panthers-leave.md @@ -4,4 +4,4 @@ '@backstage/backend-app-api': patch --- -Added a new health service which adds new endpoints for health checks. +Added a new Root Health Service which adds new endpoints for health checks. diff --git a/.changeset/serious-kings-trade.md b/.changeset/serious-kings-trade.md index c07e92b88a..826392bf98 100644 --- a/.changeset/serious-kings-trade.md +++ b/.changeset/serious-kings-trade.md @@ -2,4 +2,4 @@ '@backstage/backend-test-utils': patch --- -Added mock for health service in `mockServices`. +Added mock for the Root Health Service in `mockServices`. From d133eaa5c2cd95a31f29b8d4944dc01b6dfb9894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Thu, 20 Jun 2024 13:38:27 +0200 Subject: [PATCH 321/387] document suggestion to fork AboutCard if needed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/soft-clocks-bake.md | 5 +++++ plugins/catalog/api-report.md | 2 +- .../catalog/src/components/AboutCard/AboutCard.tsx | 4 ++++ plugins/catalog/src/plugin.ts | 13 ++++++++++++- 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 .changeset/soft-clocks-bake.md diff --git a/.changeset/soft-clocks-bake.md b/.changeset/soft-clocks-bake.md new file mode 100644 index 0000000000..29d7658869 --- /dev/null +++ b/.changeset/soft-clocks-bake.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog': patch +--- + +Added small notes to AboutCard to discourage customizability PRs diff --git a/plugins/catalog/api-report.md b/plugins/catalog/api-report.md index a26099d613..c1fb52fb94 100644 --- a/plugins/catalog/api-report.md +++ b/plugins/catalog/api-report.md @@ -334,7 +334,7 @@ export interface DependsOnResourcesCardProps { variant?: InfoCardVariants; } -// @public (undocumented) +// @public export const EntityAboutCard: (props: AboutCardProps) => JSX.Element; // @public (undocumented) diff --git a/plugins/catalog/src/components/AboutCard/AboutCard.tsx b/plugins/catalog/src/components/AboutCard/AboutCard.tsx index ee6147c54e..ce975f28ad 100644 --- a/plugins/catalog/src/components/AboutCard/AboutCard.tsx +++ b/plugins/catalog/src/components/AboutCard/AboutCard.tsx @@ -100,6 +100,10 @@ export interface AboutCardProps { /** * Exported publicly via the EntityAboutCard + * + * NOTE: We generally do not accept pull requests to extend this class with more + * props and cusomizability. If you need to tweak it, consider making a bespoke + * card in your own repository instead, that is perfect for your own needs. */ export function AboutCard(props: AboutCardProps) { const { variant } = props; diff --git a/plugins/catalog/src/plugin.ts b/plugins/catalog/src/plugin.ts index f41fefe404..33ceaef632 100644 --- a/plugins/catalog/src/plugin.ts +++ b/plugins/catalog/src/plugin.ts @@ -115,7 +115,18 @@ export const CatalogEntityPage: () => JSX.Element = catalogPlugin.provide( }), ); -/** @public */ +/** + * An example About card to show at the top of entity pages. + * + * @public + * @remarks + * + * This card collects some high level information about the entity, but is just + * an example component. Many organizations will want to replace it with a + * custom card that is more tailored to their specific needs. The card itself is + * not extremely customizable; feel free to make a copy of it as a starting + * point if you like. + */ export const EntityAboutCard: (props: AboutCardProps) => JSX.Element = catalogPlugin.provide( createComponentExtension({ From 73b4e727e9a3c31460f1b8ba4533562404a9b2ad Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Thu, 20 Jun 2024 15:22:35 +0200 Subject: [PATCH 322/387] Update .changeset/bright-panthers-leave.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fredrik Adelöw Signed-off-by: Vincenzo Scamporlino --- .changeset/bright-panthers-leave.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.changeset/bright-panthers-leave.md b/.changeset/bright-panthers-leave.md index 14798b6b39..35d9c0f869 100644 --- a/.changeset/bright-panthers-leave.md +++ b/.changeset/bright-panthers-leave.md @@ -1,7 +1,6 @@ --- '@backstage/backend-plugin-api': patch '@backstage/backend-defaults': patch -'@backstage/backend-app-api': patch --- Added a new Root Health Service which adds new endpoints for health checks. From cd22b4066660158b247ba2c9d728f6a777e44351 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Thu, 20 Jun 2024 15:31:34 +0200 Subject: [PATCH 323/387] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fredrik Adelöw Signed-off-by: Vincenzo Scamporlino --- docs/backend-system/core-services/root-health.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/backend-system/core-services/root-health.md b/docs/backend-system/core-services/root-health.md index 2a6625fd70..cdf18aa1f9 100644 --- a/docs/backend-system/core-services/root-health.md +++ b/docs/backend-system/core-services/root-health.md @@ -9,11 +9,10 @@ The Root Health service provides some health check endpoints for the backend. By ## Configuring the service -The following example is how you can override the health service implementation. +The following example shows how you can override the root health service implementation. ```ts import { RootHealthService, coreServices } from '@backstage/backend-plugin-api'; -import { WinstonLogger } from '@backstage/backend-app-api'; const backend = createBackend(); From 7df5c8875c12058e6b3e61827f074c324e3d82c0 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Thu, 20 Jun 2024 15:41:19 +0200 Subject: [PATCH 324/387] backend-defaults: test tweaks Signed-off-by: Vincenzo Scamporlino --- .../rootHealthServiceFactory.test.ts | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/packages/backend-defaults/src/entrypoints/rootHealth/rootHealthServiceFactory.test.ts b/packages/backend-defaults/src/entrypoints/rootHealth/rootHealthServiceFactory.test.ts index fd786e2b28..0eee5c18c6 100644 --- a/packages/backend-defaults/src/entrypoints/rootHealth/rootHealthServiceFactory.test.ts +++ b/packages/backend-defaults/src/entrypoints/rootHealth/rootHealthServiceFactory.test.ts @@ -1,6 +1,3 @@ -import { mockServices } from '@backstage/backend-test-utils'; -import { DefaultRootHealthService } from './rootHealthServiceFactory'; - /* * Copyright 2024 The Backstage Authors * @@ -16,6 +13,10 @@ import { DefaultRootHealthService } from './rootHealthServiceFactory'; * See the License for the specific language governing permissions and * limitations under the License. */ + +import { mockServices } from '@backstage/backend-test-utils'; +import { DefaultRootHealthService } from './rootHealthServiceFactory'; + describe('DefaultRootHealthService', () => { describe('readiness', () => { it(`should return a 500 response if the server hasn't started yet`, async () => { @@ -32,11 +33,11 @@ describe('DefaultRootHealthService', () => { }); it('should return 200 if the server has started', async () => { - const lifecycle = mockServices.rootLifecycle.mock(); let mockServerStartedFn = () => {}; - lifecycle.addStartupHook.mockImplementation( - fn => (mockServerStartedFn = fn), - ); + + const lifecycle = mockServices.rootLifecycle.mock({ + addStartupHook: jest.fn(fn => (mockServerStartedFn = fn)), + }); const service = new DefaultRootHealthService({ lifecycle, @@ -51,18 +52,16 @@ describe('DefaultRootHealthService', () => { }); it(`should return a 500 response if the server has stopped`, async () => { - const lifecycle = mockServices.rootLifecycle.mock(); let mockServerStartedFn = () => {}; let mockServerStoppedFn = () => {}; - lifecycle.addStartupHook.mockImplementation( - fn => (mockServerStartedFn = fn), - ); - lifecycle.addShutdownHook.mockImplementation( - fn => (mockServerStoppedFn = fn), - ); + + const lifecycle = mockServices.rootLifecycle.mock({ + addStartupHook: jest.fn(fn => (mockServerStartedFn = fn)), + addShutdownHook: jest.fn(fn => (mockServerStoppedFn = fn)), + }); const service = new DefaultRootHealthService({ - lifecycle: mockServices.rootLifecycle.mock(), + lifecycle, }); mockServerStartedFn(); From 878f2efc514810e03567d167b61b92f66cd74790 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Thu, 20 Jun 2024 15:45:02 +0200 Subject: [PATCH 325/387] backend-plugin-api: fix typings in health service Signed-off-by: Vincenzo Scamporlino --- docs/backend-system/core-services/root-health.md | 4 ++-- packages/backend-plugin-api/api-report.md | 4 ++-- .../src/services/definitions/RootHealthService.ts | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/backend-system/core-services/root-health.md b/docs/backend-system/core-services/root-health.md index cdf18aa1f9..fc73ba9546 100644 --- a/docs/backend-system/core-services/root-health.md +++ b/docs/backend-system/core-services/root-health.md @@ -17,12 +17,12 @@ import { RootHealthService, coreServices } from '@backstage/backend-plugin-api'; const backend = createBackend(); class MyRootHealthService implements RootHealthService { - async getLiveness(): Promise<{ status: number; payload?: any }> { + async getLiveness() { // provide your own implementation return { status: 200, payload: { status: 'ok' } }; } - async getReadiness(): Promise<{ status: number; payload?: any }> { + async getReadiness() { // provide your own implementation return { status: 200, payload: { status: 'ok' } }; } diff --git a/packages/backend-plugin-api/api-report.md b/packages/backend-plugin-api/api-report.md index ef5aa22cf4..e9762f652e 100644 --- a/packages/backend-plugin-api/api-report.md +++ b/packages/backend-plugin-api/api-report.md @@ -505,11 +505,11 @@ export interface RootConfigService extends Config {} export interface RootHealthService { getLiveness(): Promise<{ status: number; - payload?: any; + payload?: JsonValue; }>; getReadiness(): Promise<{ status: number; - payload?: any; + payload?: JsonValue; }>; } diff --git a/packages/backend-plugin-api/src/services/definitions/RootHealthService.ts b/packages/backend-plugin-api/src/services/definitions/RootHealthService.ts index ac482b5dbb..e6c56e8654 100644 --- a/packages/backend-plugin-api/src/services/definitions/RootHealthService.ts +++ b/packages/backend-plugin-api/src/services/definitions/RootHealthService.ts @@ -14,6 +14,8 @@ * limitations under the License. */ +import { JsonValue } from '@backstage/types'; + /** * @public */ @@ -21,9 +23,9 @@ export interface RootHealthService { /** * Get the liveness status of the backend. */ - getLiveness(): Promise<{ status: number; payload?: any }>; + getLiveness(): Promise<{ status: number; payload?: JsonValue }>; /** * Get the readiness status of the backend. */ - getReadiness(): Promise<{ status: number; payload?: any }>; + getReadiness(): Promise<{ status: number; payload?: JsonValue }>; } From 2537c3f345ecc5b5755036695d1357c42ddad74e Mon Sep 17 00:00:00 2001 From: Hghtwr Date: Thu, 20 Jun 2024 16:32:26 +0200 Subject: [PATCH 326/387] Extend tests for subgroups Signed-off-by: Hghtwr --- .yarnrc.yml | 8 +- .../src/__testUtils__/handlers.ts | 63 ++++- .../src/__testUtils__/mocks.ts | 224 +++++++++++++++++- .../GitlabOrgDiscoveryEntityProvider.test.ts | 223 ++++++++++++++++- .../GitlabOrgDiscoveryEntityProvider.ts | 16 +- 5 files changed, 518 insertions(+), 16 deletions(-) diff --git a/.yarnrc.yml b/.yarnrc.yml index 466074db0a..18069eb1a7 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1,13 +1,17 @@ enableGlobalCache: true +httpProxy: "http://sia-lb.telekom.de:8080" + httpTimeout: 300000 +httpsProxy: "http://sia-lb.telekom.de:8080" + nodeLinker: node-modules -npmRegistryServer: 'https://registry.npmjs.org/' +npmRegistryServer: "https://registry.npmjs.org/" plugins: - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs - spec: '@yarnpkg/plugin-workspace-tools' + spec: "@yarnpkg/plugin-workspace-tools" yarnPath: .yarn/releases/yarn-3.8.1.cjs diff --git a/plugins/catalog-backend-module-gitlab/src/__testUtils__/handlers.ts b/plugins/catalog-backend-module-gitlab/src/__testUtils__/handlers.ts index 80aa0370d3..04a95c4332 100644 --- a/plugins/catalog-backend-module-gitlab/src/__testUtils__/handlers.ts +++ b/plugins/catalog-backend-module-gitlab/src/__testUtils__/handlers.ts @@ -19,6 +19,7 @@ import { all_groups_response, all_projects_response, all_saas_users_response, + subgroup_saas_users_response, all_users_response, apiBaseUrl, apiBaseUrlSaas, @@ -68,6 +69,13 @@ const httpHandlers = [ return res(ctx.json(all_saas_users_response)); }), + rest.get( + `${apiBaseUrlSaas}/groups/subgroup1/members/all`, + (_req, res, ctx) => { + return res(ctx.json(subgroup_saas_users_response)); // To-DO change + }, + ), + /** * Users REST endpoint mocks */ @@ -186,7 +194,34 @@ const graphqlHandlers = [ .link(graphQlBaseUrl) .query('getGroupMembers', async (req, res, ctx) => { const { group, relations } = req.variables; - + // group is actually full_path + if (group === 'group1/subgroup1' && relations.includes('DIRECT')) { + return res( + ctx.data({ + group: { + groupMembers: { + nodes: [ + { + user: { + id: 'gid://gitlab/User/1', + username: 'user1', + publicEmail: 'user1@example.com', + name: 'user1', + state: 'active', + webUrl: 'user1.com', + avatarUrl: 'user1', + }, + }, + ], + pageInfo: { + endCursor: 'end', + hasNextPage: false, + }, + }, + }, + }), + ); + } if (group === 'group1' && relations.includes('DIRECT')) { return res( ctx.data({ @@ -367,7 +402,31 @@ const graphqlHandlers = [ ]), ); } - + if (group === 'group1') { + return res( + ctx.data({ + group: { + descendantGroups: { + nodes: [ + { + id: 'gid://gitlab/Group/6', + name: 'subgroup1', + description: 'description1', + fullPath: 'group1/subgroup1', + parent: { + id: '123', + }, + }, + ], + pageInfo: { + endCursor: 'end', + hasNextPage: false, + }, + }, + }, + }), + ); + } if (group === 'group-with-parent') { return res( ctx.data({ diff --git a/plugins/catalog-backend-module-gitlab/src/__testUtils__/mocks.ts b/plugins/catalog-backend-module-gitlab/src/__testUtils__/mocks.ts index e3154eb1ce..b30f80888f 100644 --- a/plugins/catalog-backend-module-gitlab/src/__testUtils__/mocks.ts +++ b/plugins/catalog-backend-module-gitlab/src/__testUtils__/mocks.ts @@ -822,6 +822,12 @@ export const all_groups_response: GitLabGroup[] = [ description: '', full_path: 'parent1/nonMatchingGroup', }, + { + id: 6, + name: 'subgroup1', + description: '', + full_path: 'group1/subgroup1', + }, ]; export const group_with_parent: MockObject[] = [ @@ -1708,7 +1714,7 @@ export const expected_full_org_scan_entities: MockObject[] = [ name: 'JohnDoe', }, spec: { - memberOf: ['group1'], + memberOf: ['group1', 'group1-subgroup1'], profile: { displayName: 'John Doe', email: 'john.doe@company.com', @@ -1815,6 +1821,30 @@ export const expected_full_org_scan_entities: MockObject[] = [ }, locationKey: 'GitlabOrgDiscoveryEntityProvider:test-id', }, + { + entity: { + apiVersion: 'backstage.io/v1alpha1', + kind: 'Group', + metadata: { + annotations: { + 'backstage.io/managed-by-location': + 'url:https://example.com/group1/subgroup1', + 'backstage.io/managed-by-origin-location': + 'url:https://example.com/group1/subgroup1', + 'example.com/team-path': 'group1/subgroup1', + }, + name: 'group1-subgroup1', + }, + spec: { + children: [], + profile: { + displayName: 'subgroup1', + }, + type: 'team', + }, + }, + locationKey: 'GitlabOrgDiscoveryEntityProvider:test-id', + }, ]; export const expected_full_org_scan_entities_saas: MockObject[] = [ @@ -1871,3 +1901,195 @@ export const expected_full_org_scan_entities_saas: MockObject[] = [ locationKey: 'GitlabOrgDiscoveryEntityProvider:test-id', }, ]; + +export const subgroup_saas_users_response: MockObject[] = [ + { + access_level: 30, + created_at: '2023-07-17T08:58:34.984Z', + expires_at: null, + id: 12, + username: 'testuser1', + name: 'Test User 1', + state: 'active', + avatar_url: 'https://secure.gravatar.com/', + web_url: 'https://gitlab.com/testuser1', + email: 'testuser1@example.com', + group_saml_identity: { + provider: 'group_saml', + extern_uid: '51', + saml_provider_id: 1, + }, + is_using_seat: true, + membership_state: 'active', + }, + { + access_level: 50, + created_at: '2023-07-15T08:58:34.984Z', + expires_at: '2023-10-26', + id: 54, + username: 'group_100_bot_23dc8057bef66e05181f39be4652577c', + name: 'Token Bot', + state: 'active', + avatar_url: 'https://secure.gravatar.com/', + web_url: + 'https://gitlab.com/group_100_bot_23dc8057bef66e05181f39be4652577c', + group_saml_identity: null, + is_using_seat: false, + membership_state: 'active', + }, +]; + +export const expected_subgroup_org_scan_entities_saas: MockObject[] = [ + { + entity: { + apiVersion: 'backstage.io/v1alpha1', + kind: 'User', + metadata: { + annotations: { + 'backstage.io/managed-by-location': + 'url:https://gitlab.com/testuser1', + 'backstage.io/managed-by-origin-location': + 'url:https://gitlab.com/testuser1', + 'gitlab.com/user-login': 'https://gitlab.com/testuser1', + 'gitlab.com/saml-external-uid': '51', + }, + name: 'testuser1', + }, + spec: { + memberOf: [], + profile: { + displayName: 'Test User 1', + email: 'testuser1@example.com', + picture: 'https://secure.gravatar.com/', + }, + }, + }, + locationKey: 'GitlabOrgDiscoveryEntityProvider:test-id', + }, +]; + +// Simulate return of all users but only with membership of the descendants of config.group +export const expected_group_org_scan_entities: MockObject[] = [ + { + entity: { + apiVersion: 'backstage.io/v1alpha1', + kind: 'User', + metadata: { + annotations: { + 'backstage.io/managed-by-location': 'url:https://example.com/JohnDoe', + 'backstage.io/managed-by-origin-location': + 'url:https://example.com/JohnDoe', + 'example.com/user-login': 'https://gitlab.example/john_doe', + }, + name: 'JohnDoe', + }, + spec: { + memberOf: ['subgroup1'], + profile: { + displayName: 'John Doe', + email: 'john.doe@company.com', + picture: 'https://secure.gravatar.com/', + }, + }, + }, + locationKey: 'GitlabOrgDiscoveryEntityProvider:test-id', + }, + { + entity: { + apiVersion: 'backstage.io/v1alpha1', + kind: 'User', + metadata: { + annotations: { + 'backstage.io/managed-by-location': 'url:https://example.com/JaneDoe', + 'backstage.io/managed-by-origin-location': + 'url:https://example.com/JaneDoe', + 'example.com/user-login': 'https://gitlab.example/jane_doe', + }, + name: 'JaneDoe', + }, + spec: { + memberOf: [], + profile: { + displayName: 'Jane Doe', + email: 'jane.doe@company.com', + picture: 'https://secure.gravatar.com/', + }, + }, + }, + locationKey: 'GitlabOrgDiscoveryEntityProvider:test-id', + }, + { + entity: { + apiVersion: 'backstage.io/v1alpha1', + kind: 'User', + metadata: { + annotations: { + 'backstage.io/managed-by-location': + 'url:https://example.com/MarySmith', + 'backstage.io/managed-by-origin-location': + 'url:https://example.com/MarySmith', + 'example.com/user-login': 'https://gitlab.example/mary_smith', + }, + name: 'MarySmith', + }, + spec: { + memberOf: [], + profile: { + displayName: 'Mary Smith', + email: 'mary.smith@company.com', + picture: 'https://secure.gravatar.com/', + }, + }, + }, + locationKey: 'GitlabOrgDiscoveryEntityProvider:test-id', + }, + { + entity: { + apiVersion: 'backstage.io/v1alpha1', + kind: 'User', + metadata: { + annotations: { + 'backstage.io/managed-by-location': + 'url:https://example.com/MarioMario', + 'backstage.io/managed-by-origin-location': + 'url:https://example.com/MarioMario', + 'example.com/user-login': 'https://gitlab.example/mario_mario', + }, + name: 'MarioMario', + }, + spec: { + memberOf: [], + profile: { + displayName: 'Mario Mario', + email: 'mario.mario-company.com', + picture: 'https://secure.gravatar.com/', + }, + }, + }, + locationKey: 'GitlabOrgDiscoveryEntityProvider:test-id', + }, + { + entity: { + apiVersion: 'backstage.io/v1alpha1', + kind: 'Group', + metadata: { + annotations: { + 'backstage.io/managed-by-location': + 'url:https://example.com/group1/subgroup1', + 'backstage.io/managed-by-origin-location': + 'url:https://example.com/group1/subgroup1', + 'example.com/team-path': 'group1/subgroup1', + }, + name: 'subgroup1', + }, + spec: { + children: [], + profile: { + displayName: 'subgroup1', + }, + type: 'team', + }, + }, + locationKey: 'GitlabOrgDiscoveryEntityProvider:test-id', + }, +]; diff --git a/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.test.ts b/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.test.ts index 5a60f1b4b3..8cf046909d 100644 --- a/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.test.ts +++ b/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.test.ts @@ -175,6 +175,220 @@ describe('GitlabOrgDiscoveryEntityProvider - configuration', () => { }); }); +// This should return all members of the SaaS Root group (group1) -> expected_full_org_scan_entities_saas +it('SaaS: should get all saas root group users when restrictUsersToGroup is not set', async () => { + const config = new ConfigReader({ + integrations: { + gitlab: [ + { + host: 'gitlab.com', + apiBaseUrl: 'https://gitlab.com/api/v4', + token: '1234', + }, + ], + }, + catalog: { + providers: { + gitlab: { + 'test-id': { + host: 'gitlab.com', + group: 'group1', + orgEnabled: true, + skipForkedRepos: true, + }, + }, + }, + }, + }); + const schedule = new PersistingTaskRunner(); + const entityProviderConnection: EntityProviderConnection = { + applyMutation: jest.fn(), + refresh: jest.fn(), + }; + const provider = GitlabOrgDiscoveryEntityProvider.fromConfig(config, { + logger, + schedule, + })[0]; + expect(provider.getProviderName()).toEqual( + 'GitlabOrgDiscoveryEntityProvider:test-id', + ); + + await provider.connect(entityProviderConnection); + + const taskDef = schedule.getTasks()[0]; + expect(taskDef.id).toEqual( + 'GitlabOrgDiscoveryEntityProvider:test-id:refresh', + ); + await (taskDef.fn as () => Promise)(); + + expect(entityProviderConnection.applyMutation).toHaveBeenCalledTimes(1); + expect(entityProviderConnection.applyMutation).toHaveBeenCalledWith({ + type: 'full', + entities: mock.expected_full_org_scan_entities_saas, // + }); +}); + +// This should return all members of the SaaS Root group (group1) -> expected_full_org_scan_entities_saas +it('SaaS: should get all saas root group users when restrictUsersToGroup is false', async () => { + const config = new ConfigReader({ + integrations: { + gitlab: [ + { + host: 'gitlab.com', + apiBaseUrl: 'https://gitlab.com/api/v4', + token: '1234', + }, + ], + }, + catalog: { + providers: { + gitlab: { + 'test-id': { + host: 'gitlab.com', + group: 'group1', + orgEnabled: true, + skipForkedRepos: true, + restrictUsersToGroup: false, + }, + }, + }, + }, + }); + const schedule = new PersistingTaskRunner(); + const entityProviderConnection: EntityProviderConnection = { + applyMutation: jest.fn(), + refresh: jest.fn(), + }; + const provider = GitlabOrgDiscoveryEntityProvider.fromConfig(config, { + logger, + schedule, + })[0]; + expect(provider.getProviderName()).toEqual( + 'GitlabOrgDiscoveryEntityProvider:test-id', + ); + + await provider.connect(entityProviderConnection); + + const taskDef = schedule.getTasks()[0]; + expect(taskDef.id).toEqual( + 'GitlabOrgDiscoveryEntityProvider:test-id:refresh', + ); + await (taskDef.fn as () => Promise)(); + + expect(entityProviderConnection.applyMutation).toHaveBeenCalledTimes(1); + expect(entityProviderConnection.applyMutation).toHaveBeenCalledWith({ + type: 'full', + entities: mock.expected_full_org_scan_entities_saas, // + }); +}); + +// This should return only members of the SaaS subgroup (group1/subgroup1) -> expected_subgroup_org_scan_entities_saas +it('SaaS: should get only subgroup users when restrictUsersToGroup is true', async () => { + const config = new ConfigReader({ + integrations: { + gitlab: [ + { + host: 'gitlab.com', + apiBaseUrl: 'https://gitlab.com/api/v4', + token: '1234', + }, + ], + }, + catalog: { + providers: { + gitlab: { + 'test-id': { + host: 'gitlab.com', + group: 'group1/subgroup1', + restrictUsersToGroup: true, + orgEnabled: true, + skipForkedRepos: true, + }, + }, + }, + }, + }); + const schedule = new PersistingTaskRunner(); + const entityProviderConnection: EntityProviderConnection = { + applyMutation: jest.fn(), + refresh: jest.fn(), + }; + const provider = GitlabOrgDiscoveryEntityProvider.fromConfig(config, { + logger, + schedule, + })[0]; + expect(provider.getProviderName()).toEqual( + 'GitlabOrgDiscoveryEntityProvider:test-id', + ); + + await provider.connect(entityProviderConnection); + + const taskDef = schedule.getTasks()[0]; + expect(taskDef.id).toEqual( + 'GitlabOrgDiscoveryEntityProvider:test-id:refresh', + ); + await (taskDef.fn as () => Promise)(); + + expect(entityProviderConnection.applyMutation).toHaveBeenCalledTimes(1); + expect(entityProviderConnection.applyMutation).toHaveBeenCalledWith({ + type: 'full', + entities: mock.expected_subgroup_org_scan_entities_saas, + }); +}); + +// This should return all members of the self-hosted instance regardless of the group set -> expected_full_org_scan_entities +it('Self-hosted: should get all instance users when restrictUsersToGroup is not set', async () => { + const config = new ConfigReader({ + integrations: { + gitlab: [ + { + host: 'example.com', + apiBaseUrl: 'https://example.com/api/v4', + token: '1234', + }, + ], + }, + catalog: { + providers: { + gitlab: { + 'test-id': { + host: 'example.com', + group: 'group1', + orgEnabled: true, + skipForkedRepos: true, + }, + }, + }, + }, + }); + const schedule = new PersistingTaskRunner(); + const entityProviderConnection: EntityProviderConnection = { + applyMutation: jest.fn(), + refresh: jest.fn(), + }; + const provider = GitlabOrgDiscoveryEntityProvider.fromConfig(config, { + logger, + schedule, + })[0]; + expect(provider.getProviderName()).toEqual( + 'GitlabOrgDiscoveryEntityProvider:test-id', + ); + + await provider.connect(entityProviderConnection); + + const taskDef = schedule.getTasks()[0]; + expect(taskDef.id).toEqual( + 'GitlabOrgDiscoveryEntityProvider:test-id:refresh', + ); + await (taskDef.fn as () => Promise)(); + + expect(entityProviderConnection.applyMutation).toHaveBeenCalledTimes(1); + expect(entityProviderConnection.applyMutation).toHaveBeenCalledWith({ + type: 'full', + entities: mock.expected_group_org_scan_entities, // This should deliver all users but only their membership in subgroups of config.group + }); +}); + describe('GitlabOrgDiscoveryEntityProvider - refresh', () => { it('should apply full update on scheduled execution', async () => { const config = new ConfigReader(mock.config_org_integration); @@ -260,15 +474,16 @@ describe('GitlabOrgDiscoveryEntityProvider - refresh', () => { const taskDef = schedule.getTasks()[0]; await (taskDef.fn as () => Promise)(); - const userEntities = mock.expected_full_org_scan_entities.filter( + const entities = mock.expected_full_org_scan_entities.filter( element => element.entity.metadata.name !== 'MarioMario', ); // filter out user with non matched e-mail - expect(entityProviderConnection.applyMutation).toHaveBeenCalledTimes(1); - expect(userEntities).not.toHaveLength(mock.all_users_response.length); + expect(entities).not.toHaveLength( + mock.expected_full_org_scan_entities.length, + ); expect(entityProviderConnection.applyMutation).toHaveBeenCalledWith({ type: 'full', - entities: userEntities, + entities: entities, }); }); diff --git a/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts b/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts index ce545ebe84..e2043e0393 100644 --- a/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts +++ b/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts @@ -107,7 +107,7 @@ export class GitlabOrgDiscoveryEntityProvider implements EntityProvider { private userTransformer: UserTransformer; private groupEntitiesTransformer: GroupEntitiesTransformer; private groupNameTransformer: GroupNameTransformer; - private readonly gitLabClient: GitLabClient; + public readonly gitLabClient: GitLabClient; static fromConfig( config: Config, @@ -356,13 +356,14 @@ export class GitlabOrgDiscoveryEntityProvider implements EntityProvider { let groups; let users; - // Doesn't matter if we are on SaaS or not, we can either get the users from the defined group or from the root group. + // Self-hosted: Fetch the users either from the defined group (restrictUsersToGroup) or fetch all users from the GitLab instance + // SaaS: Fetch the users from the defined group (restrictUsersToGroup) or fetch all users from the root group. if (this.gitLabClient.isSelfManaged() && this.config.restrictUsersToGroup) { groups = (await this.gitLabClient.listDescendantGroups(this.config.group)) .items; users = paginated( options => - this.gitLabClient.listGroupMembers(this.config.group, options), + this.gitLabClient.listGroupMembers(this.config.group, options), // calls /groups//members { page: 1, per_page: 100, @@ -381,17 +382,18 @@ export class GitlabOrgDiscoveryEntityProvider implements EntityProvider { }, ); users = paginated( - options => this.gitLabClient.listUsers(options), + options => this.gitLabClient.listUsers(options), // calls /users? { page: 1, per_page: 100, active: true }, ); } - // For SaaS, the only difference is the root group + // SaaS: Fetch the users from the defined group (restrictUsersToGroup) or fetch all users from the root group. else { groups = (await this.gitLabClient.listDescendantGroups(this.config.group)) .items; + const rootGroupSplit = this.config.group.split('/'); const rootGroup = this.config.restrictUsersToGroup - ? this.config.group - : this.config.group.split('/')[0]; + ? rootGroupSplit[rootGroupSplit.length - 1] + : rootGroupSplit[0]; users = paginated( options => this.gitLabClient.listSaaSUsers(rootGroup, options), { From 18daa1faaa7bc0e3cbf2a7c40403649a68083d57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Gothuey?= Date: Thu, 20 Jun 2024 16:28:15 +0200 Subject: [PATCH 327/387] Fix extra closing parenthesis in code sample MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gaël Gothuey Signed-off-by: gaelgoth --- .../backend-system/building-plugins-and-modules/02-testing.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/backend-system/building-plugins-and-modules/02-testing.md b/docs/backend-system/building-plugins-and-modules/02-testing.md index 8a2dd0414d..0739ad24aa 100644 --- a/docs/backend-system/building-plugins-and-modules/02-testing.md +++ b/docs/backend-system/building-plugins-and-modules/02-testing.md @@ -138,8 +138,10 @@ describe('MyDatabaseClass', () => { await knex('foo').insert({ value: 2 }); // drive your system under test as usual await expect(subject.foos()).resolves.toEqual([{ value: 2 }]); - }); + }, + ); }); +}); ``` If you want to pass the test database instance into backend plugins or services, From 94778dd4ee8db376c6da0306b46f0f3b6f1e302e Mon Sep 17 00:00:00 2001 From: Sydney Achinger Date: Wed, 19 Jun 2024 15:08:27 -0400 Subject: [PATCH 328/387] Add setShadowRootVersionHash to force shadowRoot to update in provider when version changes. Signed-off-by: Sydney Achinger --- plugins/techdocs-react/src/context.tsx | 7 ++++++- .../TechDocsReaderPageContent.tsx | 9 ++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/plugins/techdocs-react/src/context.tsx b/plugins/techdocs-react/src/context.tsx index 43fdada98e..7492d4b2a2 100644 --- a/plugins/techdocs-react/src/context.tsx +++ b/plugins/techdocs-react/src/context.tsx @@ -64,6 +64,7 @@ export type TechDocsReaderPageValue = { entityMetadata: AsyncState; shadowRoot?: ShadowRoot; setShadowRoot: Dispatch>; + setShadowRootVersionHash: Dispatch>; title: string; setTitle: Dispatch>; subtitle: string; @@ -80,6 +81,7 @@ const defaultTechDocsReaderPageValue: TechDocsReaderPageValue = { setTitle: () => {}, setSubtitle: () => {}, setShadowRoot: () => {}, + setShadowRootVersionHash: () => {}, metadata: { loading: true }, entityMetadata: { loading: true }, entityRef: { kind: '', name: '', namespace: '' }, @@ -134,6 +136,9 @@ export const TechDocsReaderPageProvider = memo( const [shadowRoot, setShadowRoot] = useState( defaultTechDocsReaderPageValue.shadowRoot, ); + const [, setShadowRootVersionHash] = useState( + undefined, + ); useEffect(() => { if (shadowRoot && !metadata.value && !metadata.loading) { @@ -153,6 +158,7 @@ export const TechDocsReaderPageProvider = memo( entityMetadata, shadowRoot, setShadowRoot, + setShadowRootVersionHash, title, setTitle, subtitle, @@ -190,6 +196,5 @@ export const useTechDocsReaderPage = () => { if (context === undefined) { throw new Error('No context found for version 1.'); } - return context; }; diff --git a/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/TechDocsReaderPageContent.tsx b/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/TechDocsReaderPageContent.tsx index 3692ed22d3..4a93b98a83 100644 --- a/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/TechDocsReaderPageContent.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/TechDocsReaderPageContent.tsx @@ -34,6 +34,8 @@ import { TechDocsStateIndicator } from '../TechDocsStateIndicator'; import { useTechDocsReaderDom } from './dom'; import { withTechDocsReaderProvider } from '../TechDocsReaderProvider'; import { TechDocsReaderPageContentAddons } from './TechDocsReaderPageContentAddons'; +// eslint-disable-next-line no-restricted-imports +import { createHash } from 'crypto'; const useStyles = makeStyles({ search: { @@ -80,6 +82,7 @@ export const TechDocsReaderPageContent = withTechDocsReaderProvider( entityMetadata: { value: entityMetadata, loading: entityMetadataLoading }, entityRef, setShadowRoot, + setShadowRootVersionHash, } = useTechDocsReaderPage(); const dom = useTechDocsReaderDom(entityRef); const path = window.location.pathname; @@ -101,12 +104,16 @@ export const TechDocsReaderPageContent = withTechDocsReaderProvider( const handleAppend = useCallback( (newShadowRoot: ShadowRoot) => { + const newShadowRootVersionHash = createHash('sha256') + .update(newShadowRoot.innerHTML) + .digest('hex'); setShadowRoot(newShadowRoot); + setShadowRootVersionHash(newShadowRootVersionHash); if (onReady instanceof Function) { onReady(); } }, - [setShadowRoot, onReady], + [setShadowRoot, setShadowRootVersionHash, onReady], ); // No entity metadata = 404. Don't render content at all. From dd780ece4f2d1d1a73df0bfde620952bd744068c Mon Sep 17 00:00:00 2001 From: Alex Lorenzi Date: Thu, 20 Jun 2024 13:32:34 -0400 Subject: [PATCH 329/387] Switch to using a version number instead of hashing the content Signed-off-by: Alex Lorenzi Signed-off-by: Sydney Achinger --- plugins/techdocs-react/src/context.tsx | 14 ++++++++------ .../TechDocsReaderPageContent.tsx | 11 +++-------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/plugins/techdocs-react/src/context.tsx b/plugins/techdocs-react/src/context.tsx index 7492d4b2a2..29b91bcc09 100644 --- a/plugins/techdocs-react/src/context.tsx +++ b/plugins/techdocs-react/src/context.tsx @@ -25,6 +25,7 @@ import React, { } from 'react'; import useAsync, { AsyncState } from 'react-use/esm/useAsync'; import useAsyncRetry from 'react-use/esm/useAsyncRetry'; +import useCounter from 'react-use/esm/useCounter'; import { CompoundEntityRef, @@ -64,7 +65,8 @@ export type TechDocsReaderPageValue = { entityMetadata: AsyncState; shadowRoot?: ShadowRoot; setShadowRoot: Dispatch>; - setShadowRootVersionHash: Dispatch>; + shadowRootVersion: number; + incShadowRootVersion: () => void; title: string; setTitle: Dispatch>; subtitle: string; @@ -81,7 +83,8 @@ const defaultTechDocsReaderPageValue: TechDocsReaderPageValue = { setTitle: () => {}, setSubtitle: () => {}, setShadowRoot: () => {}, - setShadowRootVersionHash: () => {}, + shadowRootVersion: 0, + incShadowRootVersion: () => {}, metadata: { loading: true }, entityMetadata: { loading: true }, entityRef: { kind: '', name: '', namespace: '' }, @@ -136,9 +139,7 @@ export const TechDocsReaderPageProvider = memo( const [shadowRoot, setShadowRoot] = useState( defaultTechDocsReaderPageValue.shadowRoot, ); - const [, setShadowRootVersionHash] = useState( - undefined, - ); + const [shadowRootVersion, { inc }] = useCounter(0); useEffect(() => { if (shadowRoot && !metadata.value && !metadata.loading) { @@ -158,7 +159,8 @@ export const TechDocsReaderPageProvider = memo( entityMetadata, shadowRoot, setShadowRoot, - setShadowRootVersionHash, + shadowRootVersion, + incShadowRootVersion: inc, title, setTitle, subtitle, diff --git a/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/TechDocsReaderPageContent.tsx b/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/TechDocsReaderPageContent.tsx index 4a93b98a83..00df73cab3 100644 --- a/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/TechDocsReaderPageContent.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/TechDocsReaderPageContent.tsx @@ -34,8 +34,6 @@ import { TechDocsStateIndicator } from '../TechDocsStateIndicator'; import { useTechDocsReaderDom } from './dom'; import { withTechDocsReaderProvider } from '../TechDocsReaderProvider'; import { TechDocsReaderPageContentAddons } from './TechDocsReaderPageContentAddons'; -// eslint-disable-next-line no-restricted-imports -import { createHash } from 'crypto'; const useStyles = makeStyles({ search: { @@ -82,7 +80,7 @@ export const TechDocsReaderPageContent = withTechDocsReaderProvider( entityMetadata: { value: entityMetadata, loading: entityMetadataLoading }, entityRef, setShadowRoot, - setShadowRootVersionHash, + incShadowRootVersion, } = useTechDocsReaderPage(); const dom = useTechDocsReaderDom(entityRef); const path = window.location.pathname; @@ -104,16 +102,13 @@ export const TechDocsReaderPageContent = withTechDocsReaderProvider( const handleAppend = useCallback( (newShadowRoot: ShadowRoot) => { - const newShadowRootVersionHash = createHash('sha256') - .update(newShadowRoot.innerHTML) - .digest('hex'); setShadowRoot(newShadowRoot); - setShadowRootVersionHash(newShadowRootVersionHash); + incShadowRootVersion(); if (onReady instanceof Function) { onReady(); } }, - [setShadowRoot, setShadowRootVersionHash, onReady], + [setShadowRoot, incShadowRootVersion, onReady], ); // No entity metadata = 404. Don't render content at all. From 6919db3a3e3fa64c6578c9a17cdd63b2f99bbf9c Mon Sep 17 00:00:00 2001 From: Alex Lorenzi Date: Thu, 20 Jun 2024 13:40:54 -0400 Subject: [PATCH 330/387] Slight better variable naming Signed-off-by: Alex Lorenzi Signed-off-by: Sydney Achinger --- plugins/techdocs-react/src/context.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/techdocs-react/src/context.tsx b/plugins/techdocs-react/src/context.tsx index 29b91bcc09..2e7cd9586d 100644 --- a/plugins/techdocs-react/src/context.tsx +++ b/plugins/techdocs-react/src/context.tsx @@ -139,7 +139,7 @@ export const TechDocsReaderPageProvider = memo( const [shadowRoot, setShadowRoot] = useState( defaultTechDocsReaderPageValue.shadowRoot, ); - const [shadowRootVersion, { inc }] = useCounter(0); + const [shadowRootVersion, { inc: incShadowRootVersion }] = useCounter(0); useEffect(() => { if (shadowRoot && !metadata.value && !metadata.loading) { @@ -160,7 +160,7 @@ export const TechDocsReaderPageProvider = memo( shadowRoot, setShadowRoot, shadowRootVersion, - incShadowRootVersion: inc, + incShadowRootVersion, title, setTitle, subtitle, From abdf7445ab76154a3dd76d59b3889e3604825517 Mon Sep 17 00:00:00 2001 From: Sydney Achinger Date: Thu, 20 Jun 2024 14:53:52 -0400 Subject: [PATCH 331/387] api report Signed-off-by: Sydney Achinger --- plugins/techdocs-react/api-report.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/techdocs-react/api-report.md b/plugins/techdocs-react/api-report.md index c158bbd81e..7d787c4da6 100644 --- a/plugins/techdocs-react/api-report.md +++ b/plugins/techdocs-react/api-report.md @@ -116,6 +116,8 @@ export type TechDocsReaderPageValue = { entityMetadata: AsyncState; shadowRoot?: ShadowRoot; setShadowRoot: Dispatch>; + shadowRootVersion: number; + incShadowRootVersion: () => void; title: string; setTitle: Dispatch>; subtitle: string; From 8ac9ce5183bba1fe046f729931919c13d1a4c676 Mon Sep 17 00:00:00 2001 From: Sydney Achinger Date: Thu, 20 Jun 2024 15:25:19 -0400 Subject: [PATCH 332/387] Add changeset Signed-off-by: Sydney Achinger --- .changeset/clever-waves-judge.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/clever-waves-judge.md diff --git a/.changeset/clever-waves-judge.md b/.changeset/clever-waves-judge.md new file mode 100644 index 0000000000..585ad01bbe --- /dev/null +++ b/.changeset/clever-waves-judge.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-techdocs-react': patch +'@backstage/plugin-techdocs': patch +--- + +Fixed a bug with the TechDocsReaderPageProvider not re-rendering when setShadowDom is called, meaning that the useShadowDom hooks were inconsistent. This issue caused the TextSize addon changes not to reapply during navigation. From fc6db7af1d84959b34b47655cda3c27b0a9baa63 Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Thu, 20 Jun 2024 17:10:40 -0400 Subject: [PATCH 333/387] update tests and API reports Signed-off-by: Christopher Diaz --- .../api-report.md | 1 + .../githubEnvironment.examples.test.ts | 2 + .../src/actions/githubEnvironment.test.ts | 48 +++++++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/plugins/scaffolder-backend-module-github/api-report.md b/plugins/scaffolder-backend-module-github/api-report.md index beabdfaaf6..94b642bdbf 100644 --- a/plugins/scaffolder-backend-module-github/api-report.md +++ b/plugins/scaffolder-backend-module-github/api-report.md @@ -77,6 +77,7 @@ export function createGithubEnvironmentAction(options: { } | undefined; customBranchPolicyNames?: string[] | undefined; + customTagPolicyNames?: string[] | undefined; environmentVariables?: | { [key: string]: string; diff --git a/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.examples.test.ts b/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.examples.test.ts index ecb4e9f092..9d4395eb7a 100644 --- a/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.examples.test.ts +++ b/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.examples.test.ts @@ -171,6 +171,7 @@ describe('github:environment:create examples', () => { repo: 'repository', environment_name: 'envname', name: 'main', + type: 'branch', }); expect( @@ -180,6 +181,7 @@ describe('github:environment:create examples', () => { repo: 'repository', environment_name: 'envname', name: '*.*.*', + type: 'branch', }); expect( diff --git a/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.test.ts b/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.test.ts index 16872525b4..a8d8c4ef2e 100644 --- a/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.test.ts +++ b/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.test.ts @@ -121,6 +121,7 @@ describe('github:environment:create', () => { }, }); }); + it('should work specify deploymentBranchPolicy custom', async () => { await action.handler({ ...mockContext, @@ -153,6 +154,7 @@ describe('github:environment:create', () => { repo: 'repository', environment_name: 'envname', name: 'main', + type: 'branch', }); expect( mockOctokit.rest.repos.createDeploymentBranchPolicy, @@ -161,6 +163,52 @@ describe('github:environment:create', () => { repo: 'repository', environment_name: 'envname', name: '*.*.*', + type: 'branch', + }); + }); + + it('should work specify deploymentTagPolicy custom', async () => { + await action.handler({ + ...mockContext, + input: { + ...mockContext.input, + deploymentBranchPolicy: { + protected_branches: false, + custom_branch_policies: true, + }, + customTagPolicyNames: ['main', '*.*.*'], + }, + }); + + expect( + mockOctokit.rest.repos.createOrUpdateEnvironment, + ).toHaveBeenCalledWith({ + owner: 'owner', + repo: 'repository', + environment_name: 'envname', + deployment_branch_policy: { + protected_branches: false, + custom_branch_policies: true, + }, + }); + + expect( + mockOctokit.rest.repos.createDeploymentBranchPolicy, + ).toHaveBeenCalledWith({ + owner: 'owner', + repo: 'repository', + environment_name: 'envname', + name: 'main', + type: 'tag', + }); + expect( + mockOctokit.rest.repos.createDeploymentBranchPolicy, + ).toHaveBeenCalledWith({ + owner: 'owner', + repo: 'repository', + environment_name: 'envname', + name: '*.*.*', + type: 'tag', }); }); From c67d887ad17f3def89c48d9a5dedb6d89b81bb5b Mon Sep 17 00:00:00 2001 From: Hghtwr Date: Fri, 21 Jun 2024 09:52:36 +0200 Subject: [PATCH 334/387] add self-hosted test suite, fix format Signed-off-by: Hghtwr --- .yarnrc.yml | 8 +- .../src/__testUtils__/handlers.ts | 4 + .../src/__testUtils__/mocks.ts | 197 ++++++++- .../GitlabOrgDiscoveryEntityProvider.test.ts | 376 ++++++++---------- 4 files changed, 364 insertions(+), 221 deletions(-) diff --git a/.yarnrc.yml b/.yarnrc.yml index 18069eb1a7..466074db0a 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1,17 +1,13 @@ enableGlobalCache: true -httpProxy: "http://sia-lb.telekom.de:8080" - httpTimeout: 300000 -httpsProxy: "http://sia-lb.telekom.de:8080" - nodeLinker: node-modules -npmRegistryServer: "https://registry.npmjs.org/" +npmRegistryServer: 'https://registry.npmjs.org/' plugins: - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs - spec: "@yarnpkg/plugin-workspace-tools" + spec: '@yarnpkg/plugin-workspace-tools' yarnPath: .yarn/releases/yarn-3.8.1.cjs diff --git a/plugins/catalog-backend-module-gitlab/src/__testUtils__/handlers.ts b/plugins/catalog-backend-module-gitlab/src/__testUtils__/handlers.ts index 04a95c4332..e49fb54465 100644 --- a/plugins/catalog-backend-module-gitlab/src/__testUtils__/handlers.ts +++ b/plugins/catalog-backend-module-gitlab/src/__testUtils__/handlers.ts @@ -19,6 +19,7 @@ import { all_groups_response, all_projects_response, all_saas_users_response, + all_self_hosted_group1_members, subgroup_saas_users_response, all_users_response, apiBaseUrl, @@ -64,6 +65,9 @@ const httpHandlers = [ rest.get(`${apiBaseUrl}/groups/42`, (_, res, ctx) => { return res(ctx.status(500), ctx.json({ error: 'Internal Server Error' })); }), + rest.get(`${apiBaseUrl}/groups/group1/members/all`, (_req, res, ctx) => { + return res(ctx.json(all_self_hosted_group1_members)); + }), rest.get(`${apiBaseUrlSaas}/groups/group1/members/all`, (_req, res, ctx) => { return res(ctx.json(all_saas_users_response)); diff --git a/plugins/catalog-backend-module-gitlab/src/__testUtils__/mocks.ts b/plugins/catalog-backend-module-gitlab/src/__testUtils__/mocks.ts index b30f80888f..798df32695 100644 --- a/plugins/catalog-backend-module-gitlab/src/__testUtils__/mocks.ts +++ b/plugins/catalog-backend-module-gitlab/src/__testUtils__/mocks.ts @@ -596,6 +596,127 @@ export const config_org_double_integration: MockObject = { }, }; +export const config_org_group_saas = { + integrations: { + gitlab: [ + { + host: 'gitlab.com', + apiBaseUrl: 'https://gitlab.com/api/v4', + token: '1234', + }, + ], + }, + catalog: { + providers: { + gitlab: { + 'test-id': { + host: 'gitlab.com', + group: 'group1', + orgEnabled: true, + skipForkedRepos: true, + }, + }, + }, + }, +}; + +export const config_org_group_restrictUsers_false_saas = { + integrations: { + gitlab: [ + { + host: 'gitlab.com', + apiBaseUrl: 'https://gitlab.com/api/v4', + token: '1234', + }, + ], + }, + catalog: { + providers: { + gitlab: { + 'test-id': { + host: 'gitlab.com', + group: 'group1', + orgEnabled: true, + skipForkedRepos: true, + }, + }, + }, + }, +}; + +export const config_org_group_restrictUsers_true_saas = { + integrations: { + gitlab: [ + { + host: 'gitlab.com', + apiBaseUrl: 'https://gitlab.com/api/v4', + token: '1234', + }, + ], + }, + catalog: { + providers: { + gitlab: { + 'test-id': { + host: 'gitlab.com', + group: 'group1/subgroup1', + restrictUsersToGroup: true, + orgEnabled: true, + skipForkedRepos: true, + }, + }, + }, + }, +}; + +export const config_org_group_selfHosted = { + integrations: { + gitlab: [ + { + host: 'example.com', + apiBaseUrl: 'https://example.com/api/v4', + token: '1234', + }, + ], + }, + catalog: { + providers: { + gitlab: { + 'test-id': { + host: 'example.com', + group: 'group1', + orgEnabled: true, + skipForkedRepos: true, + }, + }, + }, + }, +}; + +export const config_org_group_restrictUsers_true_selfHosted = { + integrations: { + gitlab: [ + { + host: 'example.com', + apiBaseUrl: 'https://example.com/api/v4', + token: '1234', + }, + ], + }, + catalog: { + providers: { + gitlab: { + 'test-id': { + host: 'example.com', + group: 'group1', + orgEnabled: true, + skipForkedRepos: true, + restrictUsersToGroup: true, + }, + }, + }, + }, +}; /** * GitLab API responses */ @@ -1969,7 +2090,7 @@ export const expected_subgroup_org_scan_entities_saas: MockObject[] = [ ]; // Simulate return of all users but only with membership of the descendants of config.group -export const expected_group_org_scan_entities: MockObject[] = [ +export const expected_full_members_group_org_scan_entities: MockObject[] = [ { entity: { apiVersion: 'backstage.io/v1alpha1', @@ -2093,3 +2214,77 @@ export const expected_group_org_scan_entities: MockObject[] = [ locationKey: 'GitlabOrgDiscoveryEntityProvider:test-id', }, ]; + +export const expected_group_members_group_org_scan_entities: MockObject[] = [ + { + entity: { + apiVersion: 'backstage.io/v1alpha1', + kind: 'User', + metadata: { + annotations: { + 'backstage.io/managed-by-location': 'url:https://example.com/JohnDoe', + 'backstage.io/managed-by-origin-location': + 'url:https://example.com/JohnDoe', + 'example.com/user-login': 'https://gitlab.example/john_doe', + }, + name: 'JohnDoe', + }, + spec: { + memberOf: ['subgroup1'], + profile: { + displayName: 'John Doe', + email: 'john.doe@company.com', + picture: 'https://secure.gravatar.com/', + }, + }, + }, + locationKey: 'GitlabOrgDiscoveryEntityProvider:test-id', + }, + { + entity: { + apiVersion: 'backstage.io/v1alpha1', + kind: 'Group', + metadata: { + annotations: { + 'backstage.io/managed-by-location': + 'url:https://example.com/group1/subgroup1', + 'backstage.io/managed-by-origin-location': + 'url:https://example.com/group1/subgroup1', + 'example.com/team-path': 'group1/subgroup1', + }, + name: 'subgroup1', + description: 'description1', + }, + spec: { + children: [], + profile: { + displayName: 'subgroup1', + }, + type: 'team', + }, + }, + locationKey: 'GitlabOrgDiscoveryEntityProvider:test-id', + }, +]; + +export const all_self_hosted_group1_members: MockObject[] = [ + { + id: 1, + username: 'JohnDoe', + name: 'John Doe', + state: 'active', + email: 'john.doe@company.com', + avatar_url: 'https://secure.gravatar.com/', + web_url: 'https://gitlab.example/john_doe', + }, + // inactive + { + id: 5, + username: 'MarioMario', + name: 'Mario Mario', + state: 'inactive', + email: 'mario.mario-company.com', + avatar_url: 'https://secure.gravatar.com/', + web_url: 'https://gitlab.example/mario_mario', + }, +]; diff --git a/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.test.ts b/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.test.ts index 8cf046909d..ddc0d03570 100644 --- a/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.test.ts +++ b/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.test.ts @@ -175,220 +175,6 @@ describe('GitlabOrgDiscoveryEntityProvider - configuration', () => { }); }); -// This should return all members of the SaaS Root group (group1) -> expected_full_org_scan_entities_saas -it('SaaS: should get all saas root group users when restrictUsersToGroup is not set', async () => { - const config = new ConfigReader({ - integrations: { - gitlab: [ - { - host: 'gitlab.com', - apiBaseUrl: 'https://gitlab.com/api/v4', - token: '1234', - }, - ], - }, - catalog: { - providers: { - gitlab: { - 'test-id': { - host: 'gitlab.com', - group: 'group1', - orgEnabled: true, - skipForkedRepos: true, - }, - }, - }, - }, - }); - const schedule = new PersistingTaskRunner(); - const entityProviderConnection: EntityProviderConnection = { - applyMutation: jest.fn(), - refresh: jest.fn(), - }; - const provider = GitlabOrgDiscoveryEntityProvider.fromConfig(config, { - logger, - schedule, - })[0]; - expect(provider.getProviderName()).toEqual( - 'GitlabOrgDiscoveryEntityProvider:test-id', - ); - - await provider.connect(entityProviderConnection); - - const taskDef = schedule.getTasks()[0]; - expect(taskDef.id).toEqual( - 'GitlabOrgDiscoveryEntityProvider:test-id:refresh', - ); - await (taskDef.fn as () => Promise)(); - - expect(entityProviderConnection.applyMutation).toHaveBeenCalledTimes(1); - expect(entityProviderConnection.applyMutation).toHaveBeenCalledWith({ - type: 'full', - entities: mock.expected_full_org_scan_entities_saas, // - }); -}); - -// This should return all members of the SaaS Root group (group1) -> expected_full_org_scan_entities_saas -it('SaaS: should get all saas root group users when restrictUsersToGroup is false', async () => { - const config = new ConfigReader({ - integrations: { - gitlab: [ - { - host: 'gitlab.com', - apiBaseUrl: 'https://gitlab.com/api/v4', - token: '1234', - }, - ], - }, - catalog: { - providers: { - gitlab: { - 'test-id': { - host: 'gitlab.com', - group: 'group1', - orgEnabled: true, - skipForkedRepos: true, - restrictUsersToGroup: false, - }, - }, - }, - }, - }); - const schedule = new PersistingTaskRunner(); - const entityProviderConnection: EntityProviderConnection = { - applyMutation: jest.fn(), - refresh: jest.fn(), - }; - const provider = GitlabOrgDiscoveryEntityProvider.fromConfig(config, { - logger, - schedule, - })[0]; - expect(provider.getProviderName()).toEqual( - 'GitlabOrgDiscoveryEntityProvider:test-id', - ); - - await provider.connect(entityProviderConnection); - - const taskDef = schedule.getTasks()[0]; - expect(taskDef.id).toEqual( - 'GitlabOrgDiscoveryEntityProvider:test-id:refresh', - ); - await (taskDef.fn as () => Promise)(); - - expect(entityProviderConnection.applyMutation).toHaveBeenCalledTimes(1); - expect(entityProviderConnection.applyMutation).toHaveBeenCalledWith({ - type: 'full', - entities: mock.expected_full_org_scan_entities_saas, // - }); -}); - -// This should return only members of the SaaS subgroup (group1/subgroup1) -> expected_subgroup_org_scan_entities_saas -it('SaaS: should get only subgroup users when restrictUsersToGroup is true', async () => { - const config = new ConfigReader({ - integrations: { - gitlab: [ - { - host: 'gitlab.com', - apiBaseUrl: 'https://gitlab.com/api/v4', - token: '1234', - }, - ], - }, - catalog: { - providers: { - gitlab: { - 'test-id': { - host: 'gitlab.com', - group: 'group1/subgroup1', - restrictUsersToGroup: true, - orgEnabled: true, - skipForkedRepos: true, - }, - }, - }, - }, - }); - const schedule = new PersistingTaskRunner(); - const entityProviderConnection: EntityProviderConnection = { - applyMutation: jest.fn(), - refresh: jest.fn(), - }; - const provider = GitlabOrgDiscoveryEntityProvider.fromConfig(config, { - logger, - schedule, - })[0]; - expect(provider.getProviderName()).toEqual( - 'GitlabOrgDiscoveryEntityProvider:test-id', - ); - - await provider.connect(entityProviderConnection); - - const taskDef = schedule.getTasks()[0]; - expect(taskDef.id).toEqual( - 'GitlabOrgDiscoveryEntityProvider:test-id:refresh', - ); - await (taskDef.fn as () => Promise)(); - - expect(entityProviderConnection.applyMutation).toHaveBeenCalledTimes(1); - expect(entityProviderConnection.applyMutation).toHaveBeenCalledWith({ - type: 'full', - entities: mock.expected_subgroup_org_scan_entities_saas, - }); -}); - -// This should return all members of the self-hosted instance regardless of the group set -> expected_full_org_scan_entities -it('Self-hosted: should get all instance users when restrictUsersToGroup is not set', async () => { - const config = new ConfigReader({ - integrations: { - gitlab: [ - { - host: 'example.com', - apiBaseUrl: 'https://example.com/api/v4', - token: '1234', - }, - ], - }, - catalog: { - providers: { - gitlab: { - 'test-id': { - host: 'example.com', - group: 'group1', - orgEnabled: true, - skipForkedRepos: true, - }, - }, - }, - }, - }); - const schedule = new PersistingTaskRunner(); - const entityProviderConnection: EntityProviderConnection = { - applyMutation: jest.fn(), - refresh: jest.fn(), - }; - const provider = GitlabOrgDiscoveryEntityProvider.fromConfig(config, { - logger, - schedule, - })[0]; - expect(provider.getProviderName()).toEqual( - 'GitlabOrgDiscoveryEntityProvider:test-id', - ); - - await provider.connect(entityProviderConnection); - - const taskDef = schedule.getTasks()[0]; - expect(taskDef.id).toEqual( - 'GitlabOrgDiscoveryEntityProvider:test-id:refresh', - ); - await (taskDef.fn as () => Promise)(); - - expect(entityProviderConnection.applyMutation).toHaveBeenCalledTimes(1); - expect(entityProviderConnection.applyMutation).toHaveBeenCalledWith({ - type: 'full', - entities: mock.expected_group_org_scan_entities, // This should deliver all users but only their membership in subgroups of config.group - }); -}); - describe('GitlabOrgDiscoveryEntityProvider - refresh', () => { it('should apply full update on scheduled execution', async () => { const config = new ConfigReader(mock.config_org_integration); @@ -516,6 +302,168 @@ describe('GitlabOrgDiscoveryEntityProvider - refresh', () => { entities: mock.expected_full_org_scan_entities_saas, }); }); + + // This should return all members of the SaaS Root group (group1) -> expected_full_org_scan_entities_saas + it('SaaS: should get all saas root group users when restrictUsersToGroup is not set', async () => { + const config = new ConfigReader(mock.config_org_group_saas); + const schedule = new PersistingTaskRunner(); + const entityProviderConnection: EntityProviderConnection = { + applyMutation: jest.fn(), + refresh: jest.fn(), + }; + const provider = GitlabOrgDiscoveryEntityProvider.fromConfig(config, { + logger, + schedule, + })[0]; + expect(provider.getProviderName()).toEqual( + 'GitlabOrgDiscoveryEntityProvider:test-id', + ); + + await provider.connect(entityProviderConnection); + + const taskDef = schedule.getTasks()[0]; + expect(taskDef.id).toEqual( + 'GitlabOrgDiscoveryEntityProvider:test-id:refresh', + ); + await (taskDef.fn as () => Promise)(); + + expect(entityProviderConnection.applyMutation).toHaveBeenCalledTimes(1); + expect(entityProviderConnection.applyMutation).toHaveBeenCalledWith({ + type: 'full', + entities: mock.expected_full_org_scan_entities_saas, // + }); + }); + + // This should return all members of the SaaS Root group (group1) -> expected_full_org_scan_entities_saas + it('SaaS: should get all saas root group users when restrictUsersToGroup is false', async () => { + const config = new ConfigReader( + mock.config_org_group_restrictUsers_false_saas, + ); + const schedule = new PersistingTaskRunner(); + const entityProviderConnection: EntityProviderConnection = { + applyMutation: jest.fn(), + refresh: jest.fn(), + }; + const provider = GitlabOrgDiscoveryEntityProvider.fromConfig(config, { + logger, + schedule, + })[0]; + expect(provider.getProviderName()).toEqual( + 'GitlabOrgDiscoveryEntityProvider:test-id', + ); + + await provider.connect(entityProviderConnection); + + const taskDef = schedule.getTasks()[0]; + expect(taskDef.id).toEqual( + 'GitlabOrgDiscoveryEntityProvider:test-id:refresh', + ); + await (taskDef.fn as () => Promise)(); + + expect(entityProviderConnection.applyMutation).toHaveBeenCalledTimes(1); + expect(entityProviderConnection.applyMutation).toHaveBeenCalledWith({ + type: 'full', + entities: mock.expected_full_org_scan_entities_saas, // + }); + }); + + // This should return only members of the SaaS subgroup (group1/subgroup1) -> expected_subgroup_org_scan_entities_saas + it('SaaS: should get only subgroup users when restrictUsersToGroup is true', async () => { + const config = new ConfigReader( + mock.config_org_group_restrictUsers_true_saas, + ); + const schedule = new PersistingTaskRunner(); + const entityProviderConnection: EntityProviderConnection = { + applyMutation: jest.fn(), + refresh: jest.fn(), + }; + const provider = GitlabOrgDiscoveryEntityProvider.fromConfig(config, { + logger, + schedule, + })[0]; + expect(provider.getProviderName()).toEqual( + 'GitlabOrgDiscoveryEntityProvider:test-id', + ); + + await provider.connect(entityProviderConnection); + + const taskDef = schedule.getTasks()[0]; + expect(taskDef.id).toEqual( + 'GitlabOrgDiscoveryEntityProvider:test-id:refresh', + ); + await (taskDef.fn as () => Promise)(); + + expect(entityProviderConnection.applyMutation).toHaveBeenCalledTimes(1); + expect(entityProviderConnection.applyMutation).toHaveBeenCalledWith({ + type: 'full', + entities: mock.expected_subgroup_org_scan_entities_saas, + }); + }); + + // This should return all members of the self-hosted instance regardless of the group set -> expected_full_members_group_org_scan_entities + // All instance members, but only the group entities below the config.group + it('Self-hosted: should get all instance users when restrictUsersToGroup is not set', async () => { + const config = new ConfigReader(mock.config_org_group_selfHosted); + const schedule = new PersistingTaskRunner(); + const entityProviderConnection: EntityProviderConnection = { + applyMutation: jest.fn(), + refresh: jest.fn(), + }; + const provider = GitlabOrgDiscoveryEntityProvider.fromConfig(config, { + logger, + schedule, + })[0]; + expect(provider.getProviderName()).toEqual( + 'GitlabOrgDiscoveryEntityProvider:test-id', + ); + + await provider.connect(entityProviderConnection); + + const taskDef = schedule.getTasks()[0]; + expect(taskDef.id).toEqual( + 'GitlabOrgDiscoveryEntityProvider:test-id:refresh', + ); + await (taskDef.fn as () => Promise)(); + + expect(entityProviderConnection.applyMutation).toHaveBeenCalledTimes(1); + expect(entityProviderConnection.applyMutation).toHaveBeenCalledWith({ + type: 'full', + entities: mock.expected_full_members_group_org_scan_entities, // This should deliver all users but only their membership in subgroups of config.group + }); + }); + + // This should return all members of the self-hosted config.group and all group entities of config.group -> expected_full_members_group_org_scan_entities + it('Self-hosted: should get only groups users when restrictUsersToGroup is set', async () => { + const config = new ConfigReader( + mock.config_org_group_restrictUsers_true_selfHosted, + ); + const schedule = new PersistingTaskRunner(); + const entityProviderConnection: EntityProviderConnection = { + applyMutation: jest.fn(), + refresh: jest.fn(), + }; + const provider = GitlabOrgDiscoveryEntityProvider.fromConfig(config, { + logger, + schedule, + })[0]; + expect(provider.getProviderName()).toEqual( + 'GitlabOrgDiscoveryEntityProvider:test-id', + ); + + await provider.connect(entityProviderConnection); + + const taskDef = schedule.getTasks()[0]; + expect(taskDef.id).toEqual( + 'GitlabOrgDiscoveryEntityProvider:test-id:refresh', + ); + await (taskDef.fn as () => Promise)(); + + expect(entityProviderConnection.applyMutation).toHaveBeenCalledTimes(1); + expect(entityProviderConnection.applyMutation).toHaveBeenCalledWith({ + type: 'full', + entities: mock.expected_group_members_group_org_scan_entities, // This should deliver all users but only their membership in subgroups of config.group + }); + }); }); describe('GitlabOrgDiscoveryEntityProvider with events support', () => { From 206698c3115bfcc40c49a82c08e15ed67b170bbb Mon Sep 17 00:00:00 2001 From: Hghtwr Date: Fri, 21 Jun 2024 10:02:15 +0200 Subject: [PATCH 335/387] revert EntityProvider signature Signed-off-by: Hghtwr --- .../src/providers/GitlabOrgDiscoveryEntityProvider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts b/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts index e2043e0393..d525e3290c 100644 --- a/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts +++ b/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts @@ -107,7 +107,7 @@ export class GitlabOrgDiscoveryEntityProvider implements EntityProvider { private userTransformer: UserTransformer; private groupEntitiesTransformer: GroupEntitiesTransformer; private groupNameTransformer: GroupNameTransformer; - public readonly gitLabClient: GitLabClient; + private readonly gitLabClient: GitLabClient; static fromConfig( config: Config, From 7da81d1327e05564fcf192c82bf2f735749b3a1e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 21 Jun 2024 11:08:39 +0000 Subject: [PATCH 336/387] chore(deps): update dependency knip to v5.22.2 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 44 ++++++++++++++++++-------------------------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/yarn.lock b/yarn.lock index dd05b8d157..7f0bd34e43 100644 --- a/yarn.lock +++ b/yarn.lock @@ -26876,15 +26876,6 @@ __metadata: languageName: node linkType: hard -"file-entry-cache@npm:8.0.0": - version: 8.0.0 - resolution: "file-entry-cache@npm:8.0.0" - dependencies: - flat-cache: ^4.0.0 - checksum: f67802d3334809048c69b3d458f672e1b6d26daefda701761c81f203b80149c35dea04d78ea4238969dd617678e530876722a0634c43031a0957f10cc3ed190f - languageName: node - linkType: hard - "file-entry-cache@npm:^6.0.1": version: 6.0.1 resolution: "file-entry-cache@npm:6.0.1" @@ -27082,16 +27073,6 @@ __metadata: languageName: node linkType: hard -"flat-cache@npm:^4.0.0": - version: 4.0.1 - resolution: "flat-cache@npm:4.0.1" - dependencies: - flatted: ^3.2.9 - keyv: ^4.5.4 - checksum: 899fc86bf6df093547d76e7bfaeb900824b869d7d457d02e9b8aae24836f0a99fbad79328cfd6415ee8908f180699bf259dc7614f793447cb14f707caf5996f6 - languageName: node - linkType: hard - "flatstr@npm:^1.0.12": version: 1.0.12 resolution: "flatstr@npm:1.0.12" @@ -27099,7 +27080,7 @@ __metadata: languageName: node linkType: hard -"flatted@npm:3.3.1, flatted@npm:^3.1.0, flatted@npm:^3.2.9": +"flatted@npm:3.3.1, flatted@npm:^3.1.0": version: 3.3.1 resolution: "flatted@npm:3.3.1" checksum: 85ae7181650bb728c221e7644cbc9f4bf28bc556f2fc89bb21266962bdf0ce1029cc7acc44bb646cd469d9baac7c317f64e841c4c4c00516afa97320cdac7f94 @@ -31317,7 +31298,7 @@ __metadata: languageName: node linkType: hard -"json5@npm:^2.1.2, json5@npm:^2.1.3, json5@npm:^2.2.3": +"json5@npm:^2.1.2, json5@npm:^2.1.3, json5@npm:^2.2.2, json5@npm:^2.2.3": version: 2.2.3 resolution: "json5@npm:2.2.3" bin: @@ -31622,7 +31603,7 @@ __metadata: languageName: node linkType: hard -"keyv@npm:*, keyv@npm:^4.0.0, keyv@npm:^4.5.2, keyv@npm:^4.5.4": +"keyv@npm:*, keyv@npm:^4.0.0, keyv@npm:^4.5.2": version: 4.5.4 resolution: "keyv@npm:4.5.4" dependencies: @@ -31701,15 +31682,14 @@ __metadata: linkType: hard "knip@npm:^5.0.0": - version: 5.19.0 - resolution: "knip@npm:5.19.0" + version: 5.22.2 + resolution: "knip@npm:5.22.2" dependencies: "@ericcornelissen/bash-parser": 0.5.3 "@nodelib/fs.walk": 2.0.0 "@snyk/github-codeowners": 1.1.0 easy-table: 1.2.0 fast-glob: ^3.3.2 - file-entry-cache: 8.0.0 jiti: ^1.21.0 js-yaml: ^4.1.0 minimist: ^1.2.8 @@ -31720,6 +31700,7 @@ __metadata: smol-toml: ^1.1.4 strip-json-comments: 5.0.1 summary: 2.1.0 + tsconfig-paths: ^4.2.0 zod: ^3.22.4 zod-validation-error: ^3.0.3 peerDependencies: @@ -31728,7 +31709,7 @@ __metadata: bin: knip: bin/knip.js knip-bun: bin/knip-bun.js - checksum: de4c564e1242fff2d005ee5626c509b8ccf3b0b7e2402766363ac193b607d5742e7a336e321b964c38c143832839b3e361ef6cb8d83add7163ee48902dd6995c + checksum: 995924973618391af39ba6bfb324f1f4dac427879a944eeecbcf48b61ec165f10f18196f27a7d079076f351223ed067bb917bc863e0424153c3fae2dd65582d6 languageName: node linkType: hard @@ -42316,6 +42297,17 @@ __metadata: languageName: node linkType: hard +"tsconfig-paths@npm:^4.2.0": + version: 4.2.0 + resolution: "tsconfig-paths@npm:4.2.0" + dependencies: + json5: ^2.2.2 + minimist: ^1.2.6 + strip-bom: ^3.0.0 + checksum: 28c5f7bbbcabc9dabd4117e8fdc61483f6872a1c6b02a4b1c4d68c5b79d06896c3cc9547610c4c3ba64658531caa2de13ead1ea1bf321c7b53e969c4752b98c7 + languageName: node + linkType: hard + "tslib@npm:2.6.2, tslib@npm:^2.0.0, tslib@npm:^2.0.1, tslib@npm:^2.0.3, tslib@npm:^2.1.0, tslib@npm:^2.2.0, tslib@npm:^2.3.0, tslib@npm:^2.3.1, tslib@npm:^2.4.0, tslib@npm:^2.4.1, tslib@npm:^2.4.1 || ^1.9.3, tslib@npm:^2.5.0, tslib@npm:^2.6.0, tslib@npm:^2.6.2": version: 2.6.2 resolution: "tslib@npm:2.6.2" From 5c3760b61c06e96ca11ca0a14e1a2cf6d93ff3e2 Mon Sep 17 00:00:00 2001 From: Caio Augusto Date: Fri, 21 Jun 2024 11:02:05 -0300 Subject: [PATCH 337/387] fix(docs): invalid snippet code Signed-off-by: Caio Augusto --- docs/plugins/backend-plugin.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/plugins/backend-plugin.md b/docs/plugins/backend-plugin.md index 255ab4f865..7f155f3b05 100644 --- a/docs/plugins/backend-plugin.md +++ b/docs/plugins/backend-plugin.md @@ -281,14 +281,14 @@ export async function createRouter( allow: ['user'], }); - const userInfo = await userInfo.getUserInfo(credentials); + const user = await userInfo.getUserInfo(credentials); res.json({ // The catalog entity ref of the user. - userEntityRef: userInfo.userEntityRef, + userEntityRef: user.userEntityRef, // The list of entities that this user or any teams this user is a part of owns. - ownershipEntityRefs: userInfo.ownershipEntityRefs, + ownershipEntityRefs: user.ownershipEntityRefs, }); }); From e2e320cac00ab7e511bb58c8a299a5b2f9b35bff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20V=C4=82LCIU?= Date: Thu, 20 Jun 2024 19:16:42 +0300 Subject: [PATCH 338/387] backstage-cli (templates): update dependencies of the backend plugins MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * remove unneeded dependencies `winston` and `yn` from the template of backend plugins; * use `msw` v2 on the backend plugins; migrating later from v1 to v2 is not straight forward; it is better to start with v2; Signed-off-by: Valentin VĂLCIU --- .changeset/friendly-stingrays-occur.md | 7 +++++++ .../cli/templates/default-backend-plugin/package.json.hbs | 6 ++---- 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .changeset/friendly-stingrays-occur.md diff --git a/.changeset/friendly-stingrays-occur.md b/.changeset/friendly-stingrays-occur.md new file mode 100644 index 0000000000..3383203b40 --- /dev/null +++ b/.changeset/friendly-stingrays-occur.md @@ -0,0 +1,7 @@ +--- +'@backstage/cli': patch +--- + +- remove unused dependencies `winston` and `yn` from the template of backend plugins; +- update `msw` to version `2.3.1` in the template of backend plugins; + starting with v1 and switching later to v2 is tedious and not straight forward; it's easier to start with v2; diff --git a/packages/cli/templates/default-backend-plugin/package.json.hbs b/packages/cli/templates/default-backend-plugin/package.json.hbs index 6b7aa915aa..c20a1854a2 100644 --- a/packages/cli/templates/default-backend-plugin/package.json.hbs +++ b/packages/cli/templates/default-backend-plugin/package.json.hbs @@ -35,9 +35,7 @@ "@types/express": "{{versionQuery '@types/express' '4.17.6'}}", "express": "{{versionQuery 'express' '4.17.1'}}", "express-promise-router": "{{versionQuery 'express-promise-router' '4.1.0'}}", - "winston": "{{versionQuery 'winston' '3.2.1'}}", - "node-fetch": "{{versionQuery 'node-fetch' '2.6.7'}}", - "yn": "{{versionQuery 'yn' '4.0.0'}}" + "node-fetch": "{{versionQuery 'node-fetch' '2.6.7'}}" }, "devDependencies": { "@backstage/cli": "{{versionQuery '@backstage/cli'}}", @@ -45,7 +43,7 @@ "@backstage/plugin-auth-backend-module-guest-provider": "{{versionQuery '@backstage/plugin-auth-backend-module-guest-provider'}}", "@types/supertest": "{{versionQuery '@types/supertest' '2.0.12'}}", "supertest": "{{versionQuery 'supertest' '6.2.4'}}", - "msw": "{{versionQuery 'msw' '1.0.0'}}" + "msw": "{{versionQuery 'msw' '2.3.1'}}" }, "files": [ "dist" From 89c44b36544499ac1fe4c04f165abf7b603d4a9c Mon Sep 17 00:00:00 2001 From: Matt Benson Date: Fri, 21 Jun 2024 19:23:44 -0500 Subject: [PATCH 339/387] Support catalogFilter array on OwnedEntityPicker; addresses https://github.com/backstage/backstage/issues/25358 Signed-off-by: Matt Benson --- .changeset/silent-moose-eat.md | 5 ++++ .../OwnedEntityPicker/OwnedEntityPicker.tsx | 23 ++++++++++--------- 2 files changed, 17 insertions(+), 11 deletions(-) create mode 100644 .changeset/silent-moose-eat.md diff --git a/.changeset/silent-moose-eat.md b/.changeset/silent-moose-eat.md new file mode 100644 index 0000000000..735afa12f1 --- /dev/null +++ b/.changeset/silent-moose-eat.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder': patch +--- + +Support catalogFilter array on OwnedEntityPicker diff --git a/plugins/scaffolder/src/components/fields/OwnedEntityPicker/OwnedEntityPicker.tsx b/plugins/scaffolder/src/components/fields/OwnedEntityPicker/OwnedEntityPicker.tsx index d5351d54e5..02c437ceb6 100644 --- a/plugins/scaffolder/src/components/fields/OwnedEntityPicker/OwnedEntityPicker.tsx +++ b/plugins/scaffolder/src/components/fields/OwnedEntityPicker/OwnedEntityPicker.tsx @@ -90,17 +90,11 @@ function buildEntityPickerUISchema( uiSchema?.['ui:options'] || {}; const allowedKinds = uiOptions.allowedKinds; - const catalogFilter = { - ...uiOptions.catalogFilter, - ...(allowedKinds - ? { - kind: allowedKinds, - [`relations.${RELATION_OWNED_BY}`]: identityRefs || [], - } - : { - [`relations.${RELATION_OWNED_BY}`]: identityRefs || [], - }), - }; + const catalogFilter = asArray(uiOptions.catalogFilter).map(e => ({ + ...e, + ...(allowedKinds ? { kind: allowedKinds } : {}), + [`relations.${RELATION_OWNED_BY}`]: identityRefs || [], + })); return { 'ui:options': { @@ -108,3 +102,10 @@ function buildEntityPickerUISchema( }, }; } + +function asArray(catalogFilter: any): any[] { + if (catalogFilter) { + return Array.isArray(catalogFilter) ? catalogFilter : [catalogFilter]; + } + return [{}]; +} From ed2786f9f8d5e8699325b2605e6fd32eeac1f2f5 Mon Sep 17 00:00:00 2001 From: Antonio Ereiz Date: Sun, 23 Jun 2024 21:04:03 +0200 Subject: [PATCH 340/387] add comment Signed-off-by: Antonio Ereiz --- docs/tutorials/setup-opentelemetry.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/tutorials/setup-opentelemetry.md b/docs/tutorials/setup-opentelemetry.md index 30dde79db8..7034e99b4c 100644 --- a/docs/tutorials/setup-opentelemetry.md +++ b/docs/tutorials/setup-opentelemetry.md @@ -33,6 +33,7 @@ const { } = require('@opentelemetry/auto-instrumentations-node'); const { PrometheusExporter } = require('@opentelemetry/exporter-prometheus'); +// By default exports the metrics on port 9464 const prometheus = new PrometheusExporter(); const sdk = new NodeSDK({ // You can add a traceExporter field here too From 09c6d445127dd7858a37a58b4b9364f2d8950a2f Mon Sep 17 00:00:00 2001 From: Antonio Ereiz Date: Sun, 23 Jun 2024 21:09:39 +0200 Subject: [PATCH 341/387] 'edit' Signed-off-by: Antonio Ereiz --- docs/tutorials/setup-opentelemetry.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorials/setup-opentelemetry.md b/docs/tutorials/setup-opentelemetry.md index 7034e99b4c..faaeab49f4 100644 --- a/docs/tutorials/setup-opentelemetry.md +++ b/docs/tutorials/setup-opentelemetry.md @@ -33,7 +33,7 @@ const { } = require('@opentelemetry/auto-instrumentations-node'); const { PrometheusExporter } = require('@opentelemetry/exporter-prometheus'); -// By default exports the metrics on port 9464 +// By default exports the metrics on localhost:9464/metrics const prometheus = new PrometheusExporter(); const sdk = new NodeSDK({ // You can add a traceExporter field here too From 01999b3c78944af74640c2f1c9737399b3c8a2f3 Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 24 Jun 2024 10:49:49 +0200 Subject: [PATCH 342/387] chore: enter pre Signed-off-by: blam --- .changeset/pre.json | 190 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 .changeset/pre.json diff --git a/.changeset/pre.json b/.changeset/pre.json new file mode 100644 index 0000000000..dcb909ba99 --- /dev/null +++ b/.changeset/pre.json @@ -0,0 +1,190 @@ +{ + "mode": "pre", + "tag": "next", + "initialVersions": { + "example-app": "0.2.98", + "@backstage/app-defaults": "1.5.6", + "example-app-next": "0.0.12", + "app-next-example-plugin": "0.0.12", + "example-backend": "0.0.27", + "@backstage/backend-app-api": "0.7.6", + "@backstage/backend-common": "0.23.0", + "@backstage/backend-defaults": "0.3.0", + "@backstage/backend-dev-utils": "0.1.4", + "@backstage/backend-dynamic-feature-service": "0.2.11", + "example-backend-legacy": "0.2.99", + "@backstage/backend-openapi-utils": "0.1.12", + "@backstage/backend-plugin-api": "0.6.19", + "@backstage/backend-tasks": "0.5.24", + "@backstage/backend-test-utils": "0.4.0", + "@backstage/catalog-client": "1.6.5", + "@backstage/catalog-model": "1.5.0", + "@backstage/cli": "0.26.7", + "@backstage/cli-common": "0.1.14", + "@backstage/cli-node": "0.2.6", + "@backstage/codemods": "0.1.49", + "@backstage/config": "1.2.0", + "@backstage/config-loader": "1.8.1", + "@backstage/core-app-api": "1.12.6", + "@backstage/core-compat-api": "0.2.6", + "@backstage/core-components": "0.14.8", + "@backstage/core-plugin-api": "1.9.3", + "@backstage/create-app": "0.5.16", + "@backstage/dev-utils": "1.0.33", + "e2e-test": "0.2.17", + "@backstage/e2e-test-utils": "0.1.1", + "@backstage/errors": "1.2.4", + "@backstage/eslint-plugin": "0.1.8", + "@backstage/frontend-app-api": "0.7.1", + "@backstage/frontend-plugin-api": "0.6.6", + "@backstage/frontend-test-utils": "0.1.8", + "@backstage/integration": "1.12.0", + "@backstage/integration-aws-node": "0.1.12", + "@backstage/integration-react": "1.1.28", + "@backstage/release-manifests": "0.0.11", + "@backstage/repo-tools": "0.9.1", + "@techdocs/cli": "1.8.12", + "techdocs-cli-embedded-app": "0.2.97", + "@backstage/test-utils": "1.5.6", + "@backstage/theme": "0.5.6", + "@backstage/types": "1.1.1", + "@backstage/version-bridge": "1.0.8", + "yarn-plugin-backstage": "0.0.1", + "@backstage/plugin-api-docs": "0.11.6", + "@backstage/plugin-api-docs-module-protoc-gen-doc": "0.1.7", + "@backstage/plugin-app-backend": "0.3.68", + "@backstage/plugin-app-node": "0.1.19", + "@backstage/plugin-app-visualizer": "0.1.7", + "@backstage/plugin-auth-backend": "0.22.6", + "@backstage/plugin-auth-backend-module-atlassian-provider": "0.2.0", + "@backstage/plugin-auth-backend-module-aws-alb-provider": "0.1.11", + "@backstage/plugin-auth-backend-module-azure-easyauth-provider": "0.1.2", + "@backstage/plugin-auth-backend-module-bitbucket-provider": "0.1.2", + "@backstage/plugin-auth-backend-module-cloudflare-access-provider": "0.1.2", + "@backstage/plugin-auth-backend-module-gcp-iap-provider": "0.2.14", + "@backstage/plugin-auth-backend-module-github-provider": "0.1.16", + "@backstage/plugin-auth-backend-module-gitlab-provider": "0.1.16", + "@backstage/plugin-auth-backend-module-google-provider": "0.1.16", + "@backstage/plugin-auth-backend-module-guest-provider": "0.1.5", + "@backstage/plugin-auth-backend-module-microsoft-provider": "0.1.14", + "@backstage/plugin-auth-backend-module-oauth2-provider": "0.2.0", + "@backstage/plugin-auth-backend-module-oauth2-proxy-provider": "0.1.12", + "@backstage/plugin-auth-backend-module-oidc-provider": "0.2.0", + "@backstage/plugin-auth-backend-module-okta-provider": "0.0.12", + "@backstage/plugin-auth-backend-module-onelogin-provider": "0.1.0", + "@backstage/plugin-auth-backend-module-pinniped-provider": "0.1.13", + "@backstage/plugin-auth-backend-module-vmware-cloud-provider": "0.2.0", + "@backstage/plugin-auth-node": "0.4.14", + "@backstage/plugin-auth-react": "0.1.3", + "@backstage/plugin-bitbucket-cloud-common": "0.2.20", + "@backstage/plugin-catalog": "1.21.0", + "@backstage/plugin-catalog-backend": "1.23.0", + "@backstage/plugin-catalog-backend-module-aws": "0.3.14", + "@backstage/plugin-catalog-backend-module-azure": "0.1.39", + "@backstage/plugin-catalog-backend-module-backstage-openapi": "0.2.2", + "@backstage/plugin-catalog-backend-module-bitbucket-cloud": "0.2.6", + "@backstage/plugin-catalog-backend-module-bitbucket-server": "0.1.33", + "@backstage/plugin-catalog-backend-module-gcp": "0.1.20", + "@backstage/plugin-catalog-backend-module-gerrit": "0.1.36", + "@backstage/plugin-catalog-backend-module-github": "0.6.2", + "@backstage/plugin-catalog-backend-module-github-org": "0.1.14", + "@backstage/plugin-catalog-backend-module-gitlab": "0.3.18", + "@backstage/plugin-catalog-backend-module-gitlab-org": "0.0.2", + "@backstage/plugin-catalog-backend-module-incremental-ingestion": "0.4.24", + "@backstage/plugin-catalog-backend-module-ldap": "0.6.0", + "@backstage/plugin-catalog-backend-module-msgraph": "0.5.27", + "@backstage/plugin-catalog-backend-module-openapi": "0.1.37", + "@backstage/plugin-catalog-backend-module-puppetdb": "0.1.25", + "@backstage/plugin-catalog-backend-module-scaffolder-entity-model": "0.1.17", + "@backstage/plugin-catalog-backend-module-unprocessed": "0.4.6", + "@backstage/plugin-catalog-common": "1.0.24", + "@backstage/plugin-catalog-graph": "0.4.6", + "@backstage/plugin-catalog-import": "0.12.0", + "@backstage/plugin-catalog-node": "1.12.1", + "@backstage/plugin-catalog-react": "1.12.1", + "@backstage/plugin-catalog-unprocessed-entities": "0.2.5", + "@backstage/plugin-catalog-unprocessed-entities-common": "0.0.2", + "@backstage/plugin-config-schema": "0.1.56", + "@backstage/plugin-devtools": "0.1.15", + "@backstage/plugin-devtools-backend": "0.3.5", + "@backstage/plugin-devtools-common": "0.1.10", + "@backstage/plugin-events-backend": "0.3.6", + "@backstage/plugin-events-backend-module-aws-sqs": "0.3.5", + "@backstage/plugin-events-backend-module-azure": "0.2.5", + "@backstage/plugin-events-backend-module-bitbucket-cloud": "0.2.5", + "@backstage/plugin-events-backend-module-gerrit": "0.2.5", + "@backstage/plugin-events-backend-module-github": "0.2.5", + "@backstage/plugin-events-backend-module-gitlab": "0.2.5", + "@backstage/plugin-events-backend-test-utils": "0.1.29", + "@backstage/plugin-events-node": "0.3.5", + "@internal/plugin-todo-list": "1.0.28", + "@internal/plugin-todo-list-backend": "1.0.28", + "@internal/plugin-todo-list-common": "1.0.19", + "@backstage/plugin-home": "0.7.5", + "@backstage/plugin-home-react": "0.1.14", + "@backstage/plugin-kubernetes": "0.11.11", + "@backstage/plugin-kubernetes-backend": "0.18.0", + "@backstage/plugin-kubernetes-cluster": "0.0.12", + "@backstage/plugin-kubernetes-common": "0.8.0", + "@backstage/plugin-kubernetes-node": "0.1.13", + "@backstage/plugin-kubernetes-react": "0.4.0", + "@backstage/plugin-notifications": "0.2.2", + "@backstage/plugin-notifications-backend": "0.3.0", + "@backstage/plugin-notifications-backend-module-email": "0.1.0", + "@backstage/plugin-notifications-common": "0.0.4", + "@backstage/plugin-notifications-node": "0.2.0", + "@backstage/plugin-org": "0.6.26", + "@backstage/plugin-org-react": "0.1.25", + "@backstage/plugin-permission-backend": "0.5.43", + "@backstage/plugin-permission-backend-module-allow-all-policy": "0.1.16", + "@backstage/plugin-permission-common": "0.7.14", + "@backstage/plugin-permission-node": "0.7.30", + "@backstage/plugin-permission-react": "0.4.23", + "@backstage/plugin-proxy-backend": "0.5.0", + "@backstage/plugin-scaffolder": "1.21.0", + "@backstage/plugin-scaffolder-backend": "1.22.9", + "@backstage/plugin-scaffolder-backend-module-azure": "0.1.11", + "@backstage/plugin-scaffolder-backend-module-bitbucket": "0.2.9", + "@backstage/plugin-scaffolder-backend-module-bitbucket-cloud": "0.1.9", + "@backstage/plugin-scaffolder-backend-module-bitbucket-server": "0.1.9", + "@backstage/plugin-scaffolder-backend-module-confluence-to-markdown": "0.2.20", + "@backstage/plugin-scaffolder-backend-module-cookiecutter": "0.2.43", + "@backstage/plugin-scaffolder-backend-module-gerrit": "0.1.11", + "@backstage/plugin-scaffolder-backend-module-gitea": "0.1.9", + "@backstage/plugin-scaffolder-backend-module-github": "0.3.0", + "@backstage/plugin-scaffolder-backend-module-gitlab": "0.4.1", + "@backstage/plugin-scaffolder-backend-module-notifications": "0.0.2", + "@backstage/plugin-scaffolder-backend-module-rails": "0.4.36", + "@backstage/plugin-scaffolder-backend-module-sentry": "0.1.27", + "@backstage/plugin-scaffolder-backend-module-yeoman": "0.3.2", + "@backstage/plugin-scaffolder-common": "1.5.3", + "@backstage/plugin-scaffolder-node": "0.4.5", + "@backstage/plugin-scaffolder-node-test-utils": "0.1.5", + "@backstage/plugin-scaffolder-react": "1.9.0", + "@backstage/plugin-search": "1.4.12", + "@backstage/plugin-search-backend": "1.5.10", + "@backstage/plugin-search-backend-module-catalog": "0.1.25", + "@backstage/plugin-search-backend-module-elasticsearch": "1.5.0", + "@backstage/plugin-search-backend-module-explore": "0.1.25", + "@backstage/plugin-search-backend-module-pg": "0.5.28", + "@backstage/plugin-search-backend-module-stack-overflow-collator": "0.1.12", + "@backstage/plugin-search-backend-module-techdocs": "0.1.24", + "@backstage/plugin-search-backend-node": "1.2.24", + "@backstage/plugin-search-common": "1.2.12", + "@backstage/plugin-search-react": "1.7.12", + "@backstage/plugin-signals": "0.0.7", + "@backstage/plugin-signals-backend": "0.1.5", + "@backstage/plugin-signals-node": "0.1.5", + "@backstage/plugin-signals-react": "0.0.4", + "@backstage/plugin-techdocs": "1.10.6", + "@backstage/plugin-techdocs-addons-test-utils": "1.0.33", + "@backstage/plugin-techdocs-backend": "1.10.6", + "@backstage/plugin-techdocs-module-addons-contrib": "1.1.11", + "@backstage/plugin-techdocs-node": "1.12.5", + "@backstage/plugin-techdocs-react": "1.2.5", + "@backstage/plugin-user-settings": "0.8.7", + "@backstage/plugin-user-settings-backend": "0.2.18", + "@backstage/plugin-user-settings-common": "0.0.1" + }, + "changesets": [] +} From acda33a75293ff1966a3e1aa3b239e6d32864b34 Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 24 Jun 2024 11:21:34 +0200 Subject: [PATCH 343/387] chore: update yarn.lock Signed-off-by: blam --- yarn.lock | 1 + 1 file changed, 1 insertion(+) diff --git a/yarn.lock b/yarn.lock index f81ce9dabd..225004ba7a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6829,6 +6829,7 @@ __metadata: "@backstage/config": "workspace:^" "@backstage/errors": "workspace:^" "@backstage/integration": "workspace:^" + "@backstage/plugin-bitbucket-cloud-common": "workspace:^" "@backstage/plugin-scaffolder-node": "workspace:^" "@backstage/plugin-scaffolder-node-test-utils": "workspace:^" fs-extra: ^11.2.0 From 0273ae27d34bdf393b10321525d98a837abf3084 Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 24 Jun 2024 11:52:39 +0200 Subject: [PATCH 344/387] feat: fix tests and test confifmr Signed-off-by: blam --- .../src/autocomplete/autocomplete.test.ts | 48 ++++++++--- plugins/scaffolder-backend/package.json | 1 + .../src/service/router.test.ts | 80 +++++++++++++++---- .../scaffolder-backend/src/service/router.ts | 1 + yarn.lock | 1 + 5 files changed, 102 insertions(+), 29 deletions(-) diff --git a/plugins/scaffolder-backend-module-bitbucket-cloud/src/autocomplete/autocomplete.test.ts b/plugins/scaffolder-backend-module-bitbucket-cloud/src/autocomplete/autocomplete.test.ts index 50e218ce85..7367504d93 100644 --- a/plugins/scaffolder-backend-module-bitbucket-cloud/src/autocomplete/autocomplete.test.ts +++ b/plugins/scaffolder-backend-module-bitbucket-cloud/src/autocomplete/autocomplete.test.ts @@ -43,7 +43,11 @@ describe('handleAutocompleteRequest', () => { it('should pass the token to the client', async () => { const accessToken = 'foo'; - await handleAutocompleteRequest(accessToken, 'workspaces', {}); + await handleAutocompleteRequest({ + token: accessToken, + context: {}, + resource: 'workspaces', + }); expect(fromConfig).toHaveBeenCalledWith( expect.objectContaining({ accessToken }), @@ -51,37 +55,57 @@ describe('handleAutocompleteRequest', () => { }); it('should return workspaces', async () => { - const result = await handleAutocompleteRequest('foo', 'workspaces', {}); + const result = await handleAutocompleteRequest({ + token: 'foo', + context: {}, + resource: 'workspaces', + }); - expect(result).toEqual(['workspace1']); + expect(result).toEqual({ results: [{ title: 'workspace1' }] }); }); it('should return projects', async () => { - const result = await handleAutocompleteRequest('foo', 'projects', { - workspace: 'workspace1', + const result = await handleAutocompleteRequest({ + token: 'foo', + context: { + workspace: 'workspace1', + }, + resource: 'projects', }); - expect(result).toEqual(['project1']); + expect(result).toEqual({ results: [{ title: 'project1' }] }); }); it('should return repositories', async () => { - const result = await handleAutocompleteRequest('foo', 'repositories', { - workspace: 'workspace1', - project: 'project1', + const result = await handleAutocompleteRequest({ + token: 'foo', + resource: 'repositories', + context: { + workspace: 'workspace1', + project: 'project1', + }, }); - expect(result).toEqual(['repository1']); + expect(result).toEqual({ results: [{ title: 'repository1' }] }); }); it('should throw an error when passing an invalid resource', async () => { await expect( - handleAutocompleteRequest('token', 'invalid', {}), + handleAutocompleteRequest({ + token: 'token', + resource: 'invalid', + context: {}, + }), ).rejects.toThrow(InputError); }); it('should throw an error when there are missing parameters', async () => { await expect( - handleAutocompleteRequest('token', 'projects', {}), + handleAutocompleteRequest({ + token: 'token', + resource: 'projects', + context: {}, + }), ).rejects.toThrow(InputError); }); }); diff --git a/plugins/scaffolder-backend/package.json b/plugins/scaffolder-backend/package.json index af6625c8b8..eb977787c2 100644 --- a/plugins/scaffolder-backend/package.json +++ b/plugins/scaffolder-backend/package.json @@ -114,6 +114,7 @@ "zod": "^3.22.4" }, "devDependencies": { + "@backstage/backend-app-api": "workspace:^", "@backstage/backend-test-utils": "workspace:^", "@backstage/cli": "workspace:^", "@backstage/plugin-scaffolder-node-test-utils": "workspace:^", diff --git a/plugins/scaffolder-backend/src/service/router.test.ts b/plugins/scaffolder-backend/src/service/router.test.ts index 4bd3847666..f0e78c75c7 100644 --- a/plugins/scaffolder-backend/src/service/router.test.ts +++ b/plugins/scaffolder-backend/src/service/router.test.ts @@ -46,6 +46,8 @@ import { PermissionEvaluator, } from '@backstage/plugin-permission-common'; import { mockCredentials, mockServices } from '@backstage/backend-test-utils'; +import { AutocompleteHandler } from '@backstage/plugin-scaffolder-node/alpha'; +import { MiddlewareFactory } from '@backstage/backend-app-api'; const mockAccess = jest.fn(); @@ -62,8 +64,6 @@ jest.mock('fs-extra', () => ({ remove: jest.fn(), })); -jest.mock('./autocomplete'); - function createDatabase(): PluginDatabaseManager { return DatabaseManager.fromConfig( new ConfigReader({ @@ -1465,26 +1465,72 @@ data: {"id":1,"taskId":"a-random-id","type":"completion","createdAt":"","body":{ }); describe('GET /v2/autocomplete/:provider/:resource', () => { - it('should handle requests for provider bitbucketCloud', async () => { - jest - .mocked(handleBitbucketCloudRequest) - .mockResolvedValue(['resource1']); + let handleAutocompleteRequest: AutocompleteHandler; - const bbToken = 'foo'; - const resource = 'bar'; + beforeEach(async () => { + handleAutocompleteRequest = jest.fn().mockResolvedValue({ + results: [{ title: 'blob' }], + }); + + const logger = mockServices.logger.mock(); + const middleware = MiddlewareFactory.create({ config, logger }); + const router = await createRouter({ + logger: loggerToWinstonLogger(mockServices.logger.mock()), + config: new ConfigReader({}), + database: createDatabase(), + catalogClient, + reader: mockUrlReader, + taskBroker, + permissions: permissionApi, + auth, + httpAuth, + discovery, + autocompleteHandlers: { + 'test-provider': handleAutocompleteRequest, + }, + }); + + app = express().use(router).use(middleware.error()); + }); + + it('should throw an error when the provider is not registered', async () => { + const response = await request(app) + .post('/v2/autocomplete/unknown-provider/resource') + .send({ + token: 'token', + context: {}, + }); + + expect(response.status).toEqual(400); + expect(response.body).toEqual( + expect.objectContaining({ + error: { + message: 'Unsupported provider: unknown-provider', + name: 'InputError', + }, + }), + ); + }); + + it('should call the autocomplete handler', async () => { + const context = { mock: 'context' }; + const mockToken = 'mocktoken'; const response = await request(app) - .get(`/v2/autocomplete/bitbucketCloud/${resource}`) - .query({ token: bbToken, workspace: 'workspace1' }); - - expect(handleBitbucketCloudRequest).toHaveBeenCalledWith( - bbToken, - resource, - { workspace: 'workspace1' }, - ); + .post('/v2/autocomplete/test-provider/resource') + .send({ + token: mockToken, + context, + }); expect(response.status).toEqual(200); - expect(response.body).toEqual(['resource1']); + + expect(response.body).toEqual({ results: [{ title: 'blob' }] }); + expect(handleAutocompleteRequest).toHaveBeenCalledWith({ + token: mockToken, + context, + resource: 'resource', + }); }); }); }); diff --git a/plugins/scaffolder-backend/src/service/router.ts b/plugins/scaffolder-backend/src/service/router.ts index e5f88c3482..9b3f5173c8 100644 --- a/plugins/scaffolder-backend/src/service/router.ts +++ b/plugins/scaffolder-backend/src/service/router.ts @@ -785,6 +785,7 @@ export async function createRouter( if (!autocompleteHandlers[provider]) { throw new InputError(`Unsupported provider: ${provider}`); } + const { results } = await autocompleteHandlers[provider]({ resource, token, diff --git a/yarn.lock b/yarn.lock index 225004ba7a..9952ad2bbd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7083,6 +7083,7 @@ __metadata: version: 0.0.0-use.local resolution: "@backstage/plugin-scaffolder-backend@workspace:plugins/scaffolder-backend" dependencies: + "@backstage/backend-app-api": "workspace:^" "@backstage/backend-common": "workspace:^" "@backstage/backend-plugin-api": "workspace:^" "@backstage/backend-tasks": "workspace:^" From db2bdce0a0cac75fb87dfc26566453e3c404cd46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Pi=C4=85tkiewicz?= Date: Mon, 24 Jun 2024 11:59:31 +0200 Subject: [PATCH 345/387] Update discord channel name in README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Piotr Piątkiewicz --- docs/features/techdocs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/techdocs/README.md b/docs/features/techdocs/README.md index a696b850a8..beec6d1fad 100644 --- a/docs/features/techdocs/README.md +++ b/docs/features/techdocs/README.md @@ -102,7 +102,7 @@ See [TechDocs Architecture](architecture.md) to get an overview of where the bel ## Get involved -Reach out to us in the **#docs-like-code** channel of our +Reach out to us in the **#techdocs** channel of our [Discord chatroom](https://github.com/backstage/backstage#community). ## Done From b8230e475399611128f969b2bd185842b1bf6fcc Mon Sep 17 00:00:00 2001 From: Alper Altay Date: Mon, 24 Jun 2024 12:59:04 +0200 Subject: [PATCH 346/387] feat: matching plugin type to output Signed-off-by: Alper Altay --- packages/cli/src/lib/new/factories/pluginCommon.test.ts | 2 +- packages/cli/src/lib/new/factories/pluginCommon.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/lib/new/factories/pluginCommon.test.ts b/packages/cli/src/lib/new/factories/pluginCommon.test.ts index d85e490510..82c1c87169 100644 --- a/packages/cli/src/lib/new/factories/pluginCommon.test.ts +++ b/packages/cli/src/lib/new/factories/pluginCommon.test.ts @@ -67,7 +67,7 @@ describe('pluginCommon factory', () => { expect(modified).toBe(true); expectLogsToMatch(output, [ - 'Creating backend plugin backstage-plugin-test-common', + 'Creating common plugin package backstage-plugin-test-common', 'Checking Prerequisites:', `availability plugins${sep}test-common`, 'creating temp dir', diff --git a/packages/cli/src/lib/new/factories/pluginCommon.ts b/packages/cli/src/lib/new/factories/pluginCommon.ts index 560386c618..5f694124ea 100644 --- a/packages/cli/src/lib/new/factories/pluginCommon.ts +++ b/packages/cli/src/lib/new/factories/pluginCommon.ts @@ -46,7 +46,7 @@ export const pluginCommon = createFactory({ }); Task.log(); - Task.log(`Creating backend plugin ${chalk.cyan(name)}`); + Task.log(`Creating common plugin package ${chalk.cyan(name)}`); const targetDir = ctx.isMonoRepo ? paths.resolveTargetRoot('plugins', suffix) From 0540c5a6c237f737d4a06af1abf74bf535dd1d98 Mon Sep 17 00:00:00 2001 From: Alper Altay Date: Mon, 24 Jun 2024 13:07:34 +0200 Subject: [PATCH 347/387] feat: changeset Signed-off-by: Alper Altay --- .changeset/funny-laws-tease.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/funny-laws-tease.md diff --git a/.changeset/funny-laws-tease.md b/.changeset/funny-laws-tease.md new file mode 100644 index 0000000000..8ecbc87b65 --- /dev/null +++ b/.changeset/funny-laws-tease.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Updated the scaffolding output message for `plugin-common` in `backstage-cli`. Now, when executing `backstage-cli new` to create a new `plugin-common` package, the output message accurately reflects the action by displaying `Creating common plugin package...` instead of the previous, less accurate `Creating backend plugin...`. From b5a988f0c3a96973d3b667af6b976e0c0192f1c9 Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 24 Jun 2024 13:10:55 +0200 Subject: [PATCH 348/387] chore: updating api-reports Signed-off-by: blam --- plugins/scaffolder-backend/api-report.md | 3 +++ plugins/scaffolder-node/api-report-alpha.md | 30 +++++++++++++++++++++ plugins/scaffolder-react/api-report.md | 16 ++++++----- plugins/scaffolder/api-report.md | 21 ++++++++++----- 4 files changed, 58 insertions(+), 12 deletions(-) diff --git a/plugins/scaffolder-backend/api-report.md b/plugins/scaffolder-backend/api-report.md index 4c7b11ea43..4d75ed8421 100644 --- a/plugins/scaffolder-backend/api-report.md +++ b/plugins/scaffolder-backend/api-report.md @@ -7,6 +7,7 @@ import { ActionContext as ActionContext_2 } from '@backstage/plugin-scaffolder-node'; import { AuthService } from '@backstage/backend-plugin-api'; +import { AutocompleteHandler } from '@backstage/plugin-scaffolder-node/alpha'; import * as azure from '@backstage/plugin-scaffolder-backend-module-azure'; import { BackstageCredentials } from '@backstage/backend-plugin-api'; import * as bitbucket from '@backstage/plugin-scaffolder-backend-module-bitbucket'; @@ -478,6 +479,8 @@ export interface RouterOptions { // (undocumented) auth?: AuthService; // (undocumented) + autocompleteHandlers?: Record; + // (undocumented) catalogClient: CatalogApi; concurrentTasksLimit?: number; // (undocumented) diff --git a/plugins/scaffolder-node/api-report-alpha.md b/plugins/scaffolder-node/api-report-alpha.md index c2a2a1597e..aae32d7203 100644 --- a/plugins/scaffolder-node/api-report-alpha.md +++ b/plugins/scaffolder-node/api-report-alpha.md @@ -9,6 +9,21 @@ import { TemplateAction } from '@backstage/plugin-scaffolder-node'; import { TemplateFilter } from '@backstage/plugin-scaffolder-node'; import { TemplateGlobal } from '@backstage/plugin-scaffolder-node'; +// @alpha +export type AutocompleteHandler = ({ + resource, + token, + context, +}: { + resource: string; + token: string; + context: Record; +}) => Promise<{ + results: { + title: string; + }[]; +}>; + // @alpha export interface ScaffolderActionsExtensionPoint { // (undocumented) @@ -18,6 +33,21 @@ export interface ScaffolderActionsExtensionPoint { // @alpha export const scaffolderActionsExtensionPoint: ExtensionPoint; +// @alpha +export interface ScaffolderAutocompleteExtensionPoint { + // (undocumented) + addAutocompleteProvider({ + id, + handler, + }: { + id: string; + handler: AutocompleteHandler; + }): void; +} + +// @alpha +export const scaffolderAutocompleteExtensionPoint: ExtensionPoint; + // @alpha export interface ScaffolderTaskBrokerExtensionPoint { // (undocumented) diff --git a/plugins/scaffolder-react/api-report.md b/plugins/scaffolder-react/api-report.md index cc6672a8a5..a14490b80c 100644 --- a/plugins/scaffolder-react/api-report.md +++ b/plugins/scaffolder-react/api-report.md @@ -180,12 +180,16 @@ export type ReviewStepProps = { // @public export interface ScaffolderApi { // (undocumented) - autocomplete( - token: string, - provider: string, - resource: string, - params?: Record, - ): Promise; + autocomplete?(options: { + token: string; + provider: string; + resource: string; + context?: Record; + }): Promise<{ + results: { + title: string; + }[]; + }>; cancelTask(taskId: string): Promise; // (undocumented) dryRun?(options: ScaffolderDryRunOptions): Promise; diff --git a/plugins/scaffolder/api-report.md b/plugins/scaffolder/api-report.md index affc69ed93..f479b13ec4 100644 --- a/plugins/scaffolder/api-report.md +++ b/plugins/scaffolder/api-report.md @@ -502,12 +502,21 @@ export class ScaffolderClient implements ScaffolderApi_2 { useLongPollingLogs?: boolean; }); // (undocumented) - autocomplete( - token: string, - provider: string, - resource: string, - params?: Record, - ): Promise; + autocomplete({ + token, + resource, + provider, + context, + }: { + token: string; + provider: string; + resource: string; + context?: Record; + }): Promise<{ + results: { + title: string; + }[]; + }>; // (undocumented) cancelTask(taskId: string): Promise; // (undocumented) From b5deed0c1ba6dc22581e2847a70edecee092fc52 Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 24 Jun 2024 13:18:14 +0200 Subject: [PATCH 349/387] chore: updating changesets and api-reports Signed-off-by: blam --- .changeset/angry-ladybugs-retire.md | 5 ----- .changeset/five-forks-retire.md | 5 ----- .changeset/friendly-masks-type.md | 5 +++++ .changeset/great-colts-enjoy.md | 5 ----- .changeset/light-avocados-worry.md | 6 ++++++ .changeset/nine-seals-sit.md | 5 ----- .changeset/rare-planes-switch.md | 5 ----- .changeset/selfish-turtles-jog.md | 6 ++++++ .changeset/slimy-ties-relate.md | 5 ----- .changeset/tame-geese-run.md | 5 ----- .changeset/young-donuts-swim.md | 6 ++++++ packages/integration/api-report.md | 2 +- packages/integration/src/bitbucketCloud/config.ts | 2 +- plugins/bitbucket-cloud-common/src/BitbucketCloudClient.ts | 5 ++--- .../src/autocomplete/autocomplete.test.ts | 2 +- .../src/autocomplete/autocomplete.ts | 2 +- 16 files changed, 29 insertions(+), 42 deletions(-) delete mode 100644 .changeset/angry-ladybugs-retire.md delete mode 100644 .changeset/five-forks-retire.md create mode 100644 .changeset/friendly-masks-type.md delete mode 100644 .changeset/great-colts-enjoy.md create mode 100644 .changeset/light-avocados-worry.md delete mode 100644 .changeset/nine-seals-sit.md delete mode 100644 .changeset/rare-planes-switch.md create mode 100644 .changeset/selfish-turtles-jog.md delete mode 100644 .changeset/slimy-ties-relate.md delete mode 100644 .changeset/tame-geese-run.md create mode 100644 .changeset/young-donuts-swim.md diff --git a/.changeset/angry-ladybugs-retire.md b/.changeset/angry-ladybugs-retire.md deleted file mode 100644 index ca2b34676b..0000000000 --- a/.changeset/angry-ladybugs-retire.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': minor ---- - -Added autocompletion for Bitbucket Cloud diff --git a/.changeset/five-forks-retire.md b/.changeset/five-forks-retire.md deleted file mode 100644 index 9b9573bfd4..0000000000 --- a/.changeset/five-forks-retire.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-bitbucket-cloud-common': patch ---- - -Added support for access tokens diff --git a/.changeset/friendly-masks-type.md b/.changeset/friendly-masks-type.md new file mode 100644 index 0000000000..6f38ddefa3 --- /dev/null +++ b/.changeset/friendly-masks-type.md @@ -0,0 +1,5 @@ +--- +'@backstage/integration': minor +--- + +Add support for `token` for `bitbucketCloud` integration diff --git a/.changeset/great-colts-enjoy.md b/.changeset/great-colts-enjoy.md deleted file mode 100644 index 6907f661a5..0000000000 --- a/.changeset/great-colts-enjoy.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-bitbucket-cloud-common': patch ---- - -Added method `listProjectsByWorkspace` for retrieving projects by workspace diff --git a/.changeset/light-avocados-worry.md b/.changeset/light-avocados-worry.md new file mode 100644 index 0000000000..a3605a1451 --- /dev/null +++ b/.changeset/light-avocados-worry.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-scaffolder-backend-module-bitbucket-cloud': patch +'@backstage/plugin-bitbucket-cloud-common': patch +--- + +Add support for `autocomplete` handler to provide autocomplete options for `RepoUrlPicker` diff --git a/.changeset/nine-seals-sit.md b/.changeset/nine-seals-sit.md deleted file mode 100644 index 0055a1be24..0000000000 --- a/.changeset/nine-seals-sit.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/integration': minor ---- - -Added support for access tokens to Bitbucket Cloud diff --git a/.changeset/rare-planes-switch.md b/.changeset/rare-planes-switch.md deleted file mode 100644 index 622c6d48d8..0000000000 --- a/.changeset/rare-planes-switch.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-bitbucket-cloud-common': patch ---- - -Added method `listWorkspaces` for retrieving workspaces diff --git a/.changeset/selfish-turtles-jog.md b/.changeset/selfish-turtles-jog.md new file mode 100644 index 0000000000..02506ec068 --- /dev/null +++ b/.changeset/selfish-turtles-jog.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-scaffolder-backend': minor +'@backstage/plugin-scaffolder-node': patch +--- + +Add support for `autocomplete` extension point to provide additional `autocomplete` handlers diff --git a/.changeset/slimy-ties-relate.md b/.changeset/slimy-ties-relate.md deleted file mode 100644 index d4da9972f1..0000000000 --- a/.changeset/slimy-ties-relate.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend': patch ---- - -Added endpoint for autocompleting provider resources (currently only supports Bitbucket) diff --git a/.changeset/tame-geese-run.md b/.changeset/tame-geese-run.md deleted file mode 100644 index 785ae6c7fc..0000000000 --- a/.changeset/tame-geese-run.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-react': patch ---- - -Added method `autocomplete` to interface `ScaffolderApi` diff --git a/.changeset/young-donuts-swim.md b/.changeset/young-donuts-swim.md new file mode 100644 index 0000000000..edd854f6dc --- /dev/null +++ b/.changeset/young-donuts-swim.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-scaffolder-react': minor +'@backstage/plugin-scaffolder': minor +--- + +Add support for `bitbucketCloud` autocomplete in `RepoUrlPicker` diff --git a/packages/integration/api-report.md b/packages/integration/api-report.md index 91abc7473f..4c8e8accf2 100644 --- a/packages/integration/api-report.md +++ b/packages/integration/api-report.md @@ -186,7 +186,7 @@ export type BitbucketCloudIntegrationConfig = { apiBaseUrl: string; username?: string; appPassword?: string; - accessToken?: string; + token?: string; }; // @public @deprecated diff --git a/packages/integration/src/bitbucketCloud/config.ts b/packages/integration/src/bitbucketCloud/config.ts index 2f533480cc..32a2af9313 100644 --- a/packages/integration/src/bitbucketCloud/config.ts +++ b/packages/integration/src/bitbucketCloud/config.ts @@ -50,7 +50,7 @@ export type BitbucketCloudIntegrationConfig = { /** * The access token to use for requests to Bitbucket Cloud (bitbucket.org). */ - accessToken?: string; + token?: string; }; /** diff --git a/plugins/bitbucket-cloud-common/src/BitbucketCloudClient.ts b/plugins/bitbucket-cloud-common/src/BitbucketCloudClient.ts index a06f7425d0..f1b7d60e41 100644 --- a/plugins/bitbucket-cloud-common/src/BitbucketCloudClient.ts +++ b/plugins/bitbucket-cloud-common/src/BitbucketCloudClient.ts @@ -139,11 +139,10 @@ export class BitbucketCloudClient { 'utf8', ); headers.Authorization = `Basic ${buffer.toString('base64')}`; + } else if (this.config.token) { + headers.Authorization = `Bearer ${this.config.token}`; } - if (this.config.accessToken) - headers.Authorization = `Bearer ${this.config.accessToken}`; - return headers; } } diff --git a/plugins/scaffolder-backend-module-bitbucket-cloud/src/autocomplete/autocomplete.test.ts b/plugins/scaffolder-backend-module-bitbucket-cloud/src/autocomplete/autocomplete.test.ts index 7367504d93..0447ff2d28 100644 --- a/plugins/scaffolder-backend-module-bitbucket-cloud/src/autocomplete/autocomplete.test.ts +++ b/plugins/scaffolder-backend-module-bitbucket-cloud/src/autocomplete/autocomplete.test.ts @@ -50,7 +50,7 @@ describe('handleAutocompleteRequest', () => { }); expect(fromConfig).toHaveBeenCalledWith( - expect.objectContaining({ accessToken }), + expect.objectContaining({ token: accessToken }), ); }); diff --git a/plugins/scaffolder-backend-module-bitbucket-cloud/src/autocomplete/autocomplete.ts b/plugins/scaffolder-backend-module-bitbucket-cloud/src/autocomplete/autocomplete.ts index 50723fb41d..31a2103088 100644 --- a/plugins/scaffolder-backend-module-bitbucket-cloud/src/autocomplete/autocomplete.ts +++ b/plugins/scaffolder-backend-module-bitbucket-cloud/src/autocomplete/autocomplete.ts @@ -29,7 +29,7 @@ export async function handleAutocompleteRequest({ const client = BitbucketCloudClient.fromConfig({ host: 'bitbucket.org', apiBaseUrl: 'https://api.bitbucket.org/2.0', - accessToken: token, + token, }); switch (resource) { From cac042618a8f7f4ca7821d938ce9868c8baa7a40 Mon Sep 17 00:00:00 2001 From: Debabrata Panigrahi <50622005+Debanitrkl@users.noreply.github.com> Date: Mon, 24 Jun 2024 11:14:21 +0000 Subject: [PATCH 350/387] Added the HCE plugin to microsite Signed-off-by: Debabrata Panigrahi <50622005+Debanitrkl@users.noreply.github.com> --- microsite/data/plugins/harness-chaos.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 microsite/data/plugins/harness-chaos.yaml diff --git a/microsite/data/plugins/harness-chaos.yaml b/microsite/data/plugins/harness-chaos.yaml new file mode 100644 index 0000000000..41254b5399 --- /dev/null +++ b/microsite/data/plugins/harness-chaos.yaml @@ -0,0 +1,12 @@ +title: Harness Service Reliability Management +author: harness.io +authorUrl: https://github.com/harness/backstage-plugins +category: Chaos Engineering +description: This plugin lets you view the status of Harness Chaos Engineering Resources and launch Chaos Experiments directly inside Backstage. +documentation: https://github.com/harness/backstage-plugins/tree/main/plugins/harness-chaos +iconUrl: https://static.harness.io/ng-static/images/favicon.png +npmPackageName: '@harnessio/backstage-plugin-harness-chaos' +tags: + - chaos-experiments + - resiliency +addedDate: '2024-06-25' \ No newline at end of file From 986199fe4cc277eaa4297d110f9c8ad81649154a Mon Sep 17 00:00:00 2001 From: Debabrata Panigrahi <50622005+Debanitrkl@users.noreply.github.com> Date: Mon, 24 Jun 2024 11:20:31 +0000 Subject: [PATCH 351/387] Added the HCE plugin to microsite Signed-off-by: Debabrata Panigrahi <50622005+Debanitrkl@users.noreply.github.com> --- microsite/data/plugins/harness-chaos.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/microsite/data/plugins/harness-chaos.yaml b/microsite/data/plugins/harness-chaos.yaml index 41254b5399..563f29d6a1 100644 --- a/microsite/data/plugins/harness-chaos.yaml +++ b/microsite/data/plugins/harness-chaos.yaml @@ -9,4 +9,5 @@ npmPackageName: '@harnessio/backstage-plugin-harness-chaos' tags: - chaos-experiments - resiliency + - chaos-engineering addedDate: '2024-06-25' \ No newline at end of file From 04e657d4a083ccdaf948d29cc464c24654b89b15 Mon Sep 17 00:00:00 2001 From: Debabrata Panigrahi <50622005+Debanitrkl@users.noreply.github.com> Date: Mon, 24 Jun 2024 11:22:44 +0000 Subject: [PATCH 352/387] Added signoff Signed-off-by: Debabrata Panigrahi <50622005+Debanitrkl@users.noreply.github.com> From 21c665cbd332efcfce84957dda347091feeecd98 Mon Sep 17 00:00:00 2001 From: Debabrata Panigrahi <50622005+Debanitrkl@users.noreply.github.com> Date: Mon, 24 Jun 2024 11:23:15 +0000 Subject: [PATCH 353/387] Signed-off-by: Debabrata Panigrahi <50622005+Debanitrkl@users.noreply.github.com> Added the sign-off Signed-off-by: Debabrata Panigrahi <50622005+Debanitrkl@users.noreply.github.com> From 030f4b1549408947bd0f6d6bf6d4748f3b473d5b Mon Sep 17 00:00:00 2001 From: Ben Lambert Date: Mon, 24 Jun 2024 13:39:47 +0200 Subject: [PATCH 354/387] Update heavy-moose-pull.md Signed-off-by: blam --- .changeset/heavy-moose-pull.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/heavy-moose-pull.md b/.changeset/heavy-moose-pull.md index 7ba7b1aa39..86b2753a28 100644 --- a/.changeset/heavy-moose-pull.md +++ b/.changeset/heavy-moose-pull.md @@ -2,4 +2,4 @@ '@backstage/plugin-scaffolder': minor --- -Use virtualization with MultiEntityPicker. Fixes performance issues with large data sets. +Use virtualization with `MultiEntityPicker`. Fixes performance issues with large data sets. From c079fc184f8473d3eb0adc63d1eda2e0f7b61622 Mon Sep 17 00:00:00 2001 From: Debabrata Panigrahi <50622005+Debanitrkl@users.noreply.github.com> Date: Mon, 24 Jun 2024 11:57:40 +0000 Subject: [PATCH 355/387] Signed-off-by: Debabrata Panigrahi <50622005+Debanitrkl@users.noreply.github.com> Prettier check completed From 661b354277d71a9a5005930b6b900c4d24601965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Veith=20M=2E=20B=C3=BCrgerhoff?= Date: Mon, 24 Jun 2024 14:17:19 +0200 Subject: [PATCH 356/387] Fixed validation for RepoUrlPicker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Veith M. Bürgerhoff --- .changeset/honest-pears-run.md | 7 ++++ .../src/actions/azure.examples.ts | 6 ++-- .../src/actions/azure.test.ts | 33 +++++++++++-------- .../src/actions/azure.ts | 9 +++-- plugins/scaffolder-node/src/actions/util.ts | 4 +++ .../fields/RepoUrlPicker/validation.ts | 9 ++++- 6 files changed, 47 insertions(+), 21 deletions(-) create mode 100644 .changeset/honest-pears-run.md diff --git a/.changeset/honest-pears-run.md b/.changeset/honest-pears-run.md new file mode 100644 index 0000000000..acf9543997 --- /dev/null +++ b/.changeset/honest-pears-run.md @@ -0,0 +1,7 @@ +--- +'@backstage/plugin-scaffolder-backend-module-azure': patch +'@backstage/plugin-scaffolder-node': patch +'@backstage/plugin-scaffolder': patch +--- + +Fixed a bug where the RepoUrlPicker would still require the 'owner' field after the usage was changed to 'repo'. diff --git a/plugins/scaffolder-backend-module-azure/src/actions/azure.examples.ts b/plugins/scaffolder-backend-module-azure/src/actions/azure.examples.ts index d1459d1820..22c2299b30 100644 --- a/plugins/scaffolder-backend-module-azure/src/actions/azure.examples.ts +++ b/plugins/scaffolder-backend-module-azure/src/actions/azure.examples.ts @@ -29,7 +29,7 @@ export const examples: TemplateExample[] = [ name: 'Publish to Azure', input: { repoUrl: - 'dev.azure.com?organization=organization&owner=project&repo=repo', + 'dev.azure.com?organization=organization&project=project&repo=repo', }, }, ], @@ -45,7 +45,7 @@ export const examples: TemplateExample[] = [ name: 'Publish to Azure', input: { repoUrl: - 'dev.azure.com?organization=organization&owner=project&repo=repo', + 'dev.azure.com?organization=organization&project=project&repo=repo', description: 'Initialize a git repository', }, }, @@ -63,7 +63,7 @@ export const examples: TemplateExample[] = [ name: 'Publish to Azure', input: { repoUrl: - 'dev.azure.com?organization=organization&owner=project&repo=repo', + 'dev.azure.com?organization=organization&project=project&repo=repo', defaultBranch: 'main', }, }, diff --git a/plugins/scaffolder-backend-module-azure/src/actions/azure.test.ts b/plugins/scaffolder-backend-module-azure/src/actions/azure.test.ts index a21520f751..140c77fb52 100644 --- a/plugins/scaffolder-backend-module-azure/src/actions/azure.test.ts +++ b/plugins/scaffolder-backend-module-azure/src/actions/azure.test.ts @@ -55,7 +55,9 @@ describe('publish:azure', () => { const action = createPublishAzureAction({ integrations, config }); const mockContext = createMockActionContext({ - input: { repoUrl: 'dev.azure.com?repo=repo&owner=owner&organization=org' }, + input: { + repoUrl: 'dev.azure.com?repo=repo&project=project&organization=org', + }, }); const mockGitClient = { @@ -77,19 +79,19 @@ describe('publish:azure', () => { ...mockContext, input: { repoUrl: 'dev.azure.com?repo=bob' }, }), - ).rejects.toThrow(/missing owner/); + ).rejects.toThrow(/missing project/); await expect( action.handler({ ...mockContext, - input: { repoUrl: 'dev.azure.com?owner=owner' }, + input: { repoUrl: 'dev.azure.com?project=project' }, }), ).rejects.toThrow(/missing repo/); await expect( action.handler({ ...mockContext, - input: { repoUrl: 'dev.azure.com?owner=owner&repo=repo' }, + input: { repoUrl: 'dev.azure.com?project=project&repo=repo' }, }), ).rejects.toThrow(/missing organization/); }); @@ -98,7 +100,9 @@ describe('publish:azure', () => { await expect( action.handler({ ...mockContext, - input: { repoUrl: 'azure.com?repo=bob&owner=owner&organization=org' }, + input: { + repoUrl: 'azure.com?repo=bob&project=project&organization=org', + }, }), ).rejects.toThrow(/No matching integration configuration/); }); @@ -109,7 +113,7 @@ describe('publish:azure', () => { ...mockContext, input: { repoUrl: - 'myazurehostnotoken.com?repo=bob&owner=owner&organization=org', + 'myazurehostnotoken.com?repo=bob&project=project&organization=org', }, }), ).rejects.toThrow( @@ -122,7 +126,7 @@ describe('publish:azure', () => { action.handler({ ...mockContext, input: { - repoUrl: 'dev.azure.com?repo=bob&owner=owner&organization=org', + repoUrl: 'dev.azure.com?repo=bob&project=project&organization=org', }, }), ).rejects.toThrow(/Unable to create the repository/); @@ -138,7 +142,8 @@ describe('publish:azure', () => { await action.handler({ ...mockContext, input: { - repoUrl: 'myazurehostnotoken.com?repo=bob&owner=owner&organization=org', + repoUrl: + 'myazurehostnotoken.com?repo=bob&project=project&organization=org', token: 'lols', }, }); @@ -152,7 +157,7 @@ describe('publish:azure', () => { { name: 'bob', }, - 'owner', + 'project', ); }); @@ -166,7 +171,7 @@ describe('publish:azure', () => { action.handler({ ...mockContext, input: { - repoUrl: 'dev.azure.com?repo=bob&owner=owner&organization=org', + repoUrl: 'dev.azure.com?repo=bob&project=project&organization=org', }, }), ).rejects.toThrow(/No remote URL returned/); @@ -182,7 +187,7 @@ describe('publish:azure', () => { action.handler({ ...mockContext, input: { - repoUrl: 'dev.azure.com?repo=bob&owner=owner&organization=org', + repoUrl: 'dev.azure.com?repo=bob&project=project&organization=org', }, }), ).rejects.toThrow(/No Id returned/); @@ -198,7 +203,7 @@ describe('publish:azure', () => { action.handler({ ...mockContext, input: { - repoUrl: 'dev.azure.com?repo=bob&owner=owner&organization=org', + repoUrl: 'dev.azure.com?repo=bob&project=project&organization=org', }, }), ).rejects.toThrow(/No web URL returned/); @@ -214,7 +219,7 @@ describe('publish:azure', () => { await action.handler({ ...mockContext, input: { - repoUrl: 'dev.azure.com?repo=bob&owner=owner&organization=org', + repoUrl: 'dev.azure.com?repo=bob&project=project&organization=org', }, }); @@ -227,7 +232,7 @@ describe('publish:azure', () => { { name: 'bob', }, - 'owner', + 'project', ); }); diff --git a/plugins/scaffolder-backend-module-azure/src/actions/azure.ts b/plugins/scaffolder-backend-module-azure/src/actions/azure.ts index bd75cedc65..a284f463a6 100644 --- a/plugins/scaffolder-backend-module-azure/src/actions/azure.ts +++ b/plugins/scaffolder-backend-module-azure/src/actions/azure.ts @@ -136,7 +136,7 @@ export function createPublishAzureAction(options: { gitAuthorEmail, } = ctx.input; - const { owner, repo, host, organization } = parseRepoUrl( + const { project, repo, host, organization } = parseRepoUrl( repoUrl, integrations, ); @@ -166,11 +166,14 @@ export function createPublishAzureAction(options: { const webApi = new WebApi(url, authHandler); const client = await webApi.getGitApi(); const createOptions: GitRepositoryCreateOptions = { name: repo }; - const returnedRepo = await client.createRepository(createOptions, owner); + const returnedRepo = await client.createRepository( + createOptions, + project, + ); if (!returnedRepo) { throw new InputError( - `Unable to create the repository with Organization ${organization}, Project ${owner} and Repo ${repo}. + `Unable to create the repository with Organization ${organization}, Project ${project} and Repo ${repo}. Please make sure that both the Org and Project are typed corrected and exist.`, ); } diff --git a/plugins/scaffolder-node/src/actions/util.ts b/plugins/scaffolder-node/src/actions/util.ts index 2b3a1296bf..5e4ce60a1a 100644 --- a/plugins/scaffolder-node/src/actions/util.ts +++ b/plugins/scaffolder-node/src/actions/util.ts @@ -85,6 +85,10 @@ export const parseRepoUrl = ( checkRequiredParams(parsed, 'project', 'repo'); break; } + case 'azure': { + checkRequiredParams(parsed, 'project', 'repo'); + break; + } case 'gitlab': { // project is the projectID, and if defined, owner and repo won't be needed. if (!project) { diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/validation.ts b/plugins/scaffolder/src/components/fields/RepoUrlPicker/validation.ts index 55ba92abdc..c8dc66ab4c 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/validation.ts +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/validation.ts @@ -54,7 +54,14 @@ export const repoPickerValidation = ( ); } } - // For anything other than bitbucket and gerrit + if (integrationApi?.byHost(host)?.type === 'azure') { + if (!searchParams.get('project')) { + validation.addError( + 'Incomplete repository location provided, project not provided', + ); + } + } + // For anything other than bitbucket, azure, and gerrit else if (integrationApi?.byHost(host)?.type !== 'gerrit') { if (!searchParams.get('owner')) { validation.addError( From 8c09c97c9f5c354661cf75d9a50dcca311cb0433 Mon Sep 17 00:00:00 2001 From: Camila Belo Date: Mon, 24 Jun 2024 14:10:51 +0200 Subject: [PATCH 357/387] refactor: deprecate status check handler Signed-off-by: Camila Belo --- .changeset/chilly-roses-trade.md | 5 +++++ packages/backend-common/api-report.md | 8 ++++---- .../src/deprecated/middleware/index.ts | 1 + .../middleware/statusCheckHandler.test.ts | 0 .../middleware/statusCheckHandler.ts | 3 +++ .../service/createStatusCheckRouter.test.ts | 0 .../service/createStatusCheckRouter.ts | 4 ++-- .../src/deprecated/service/index.ts | 1 + packages/backend-common/src/index.ts | 2 -- packages/backend-common/src/middleware/index.ts | 17 ----------------- packages/backend-common/src/service/index.ts | 17 ----------------- 11 files changed, 16 insertions(+), 42 deletions(-) create mode 100644 .changeset/chilly-roses-trade.md rename packages/backend-common/src/{ => deprecated}/middleware/statusCheckHandler.test.ts (100%) rename packages/backend-common/src/{ => deprecated}/middleware/statusCheckHandler.ts (73%) rename packages/backend-common/src/{ => deprecated}/service/createStatusCheckRouter.test.ts (100%) rename packages/backend-common/src/{ => deprecated}/service/createStatusCheckRouter.ts (85%) delete mode 100644 packages/backend-common/src/middleware/index.ts delete mode 100644 packages/backend-common/src/service/index.ts diff --git a/.changeset/chilly-roses-trade.md b/.changeset/chilly-roses-trade.md new file mode 100644 index 0000000000..73fc3ff766 --- /dev/null +++ b/.changeset/chilly-roses-trade.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-common': patch +--- + +Deprecate legacy status check factory, handler and types. diff --git a/packages/backend-common/api-report.md b/packages/backend-common/api-report.md index de00ef6a5a..52b661bcaf 100644 --- a/packages/backend-common/api-report.md +++ b/packages/backend-common/api-report.md @@ -184,7 +184,7 @@ export function createRootLogger( // @public @deprecated export function createServiceBuilder(_module: NodeModule): ServiceBuilder; -// @public +// @public @deprecated export function createStatusCheckRouter(options: { logger: LoggerService; path?: string; @@ -645,15 +645,15 @@ export type StaticAuthOptions = { logger?: LoggerService; }; -// @public +// @public @deprecated export type StatusCheck = () => Promise; -// @public +// @public @deprecated export function statusCheckHandler( options?: StatusCheckHandlerOptions, ): Promise; -// @public +// @public @deprecated export interface StatusCheckHandlerOptions { statusCheck?: StatusCheck; } diff --git a/packages/backend-common/src/deprecated/middleware/index.ts b/packages/backend-common/src/deprecated/middleware/index.ts index 6c284cc6ec..f4f4fcde0b 100644 --- a/packages/backend-common/src/deprecated/middleware/index.ts +++ b/packages/backend-common/src/deprecated/middleware/index.ts @@ -17,3 +17,4 @@ export * from './errorHandler'; export * from './notFoundHandler'; export * from './requestLoggingHandler'; +export * from './statusCheckHandler'; diff --git a/packages/backend-common/src/middleware/statusCheckHandler.test.ts b/packages/backend-common/src/deprecated/middleware/statusCheckHandler.test.ts similarity index 100% rename from packages/backend-common/src/middleware/statusCheckHandler.test.ts rename to packages/backend-common/src/deprecated/middleware/statusCheckHandler.test.ts diff --git a/packages/backend-common/src/middleware/statusCheckHandler.ts b/packages/backend-common/src/deprecated/middleware/statusCheckHandler.ts similarity index 73% rename from packages/backend-common/src/middleware/statusCheckHandler.ts rename to packages/backend-common/src/deprecated/middleware/statusCheckHandler.ts index 4bd1a701c3..ebaf84c1b9 100644 --- a/packages/backend-common/src/middleware/statusCheckHandler.ts +++ b/packages/backend-common/src/deprecated/middleware/statusCheckHandler.ts @@ -21,6 +21,7 @@ import { NextFunction, Request, Response, RequestHandler } from 'express'; * {@link createStatusCheckRouter}. * * @public + * @deprecated Migrate to the {@link https://backstage.io/docs/backend-system/ | new backend system} and use the {@link https://backstage.io/docs/backend-system/core-services/root-health | Root Health Service} instead. */ export type StatusCheck = () => Promise; @@ -28,6 +29,7 @@ export type StatusCheck = () => Promise; * Options passed to {@link statusCheckHandler}. * * @public + * @deprecated Migrate to the {@link https://backstage.io/docs/backend-system/ | new backend system} and use the {@link https://backstage.io/docs/backend-system/core-services/root-health | Root Health Service} instead. */ export interface StatusCheckHandlerOptions { /** @@ -44,6 +46,7 @@ export interface StatusCheckHandlerOptions { * @public * @param options - An optional configuration object. * @returns An Express error request handler + * @deprecated Migrate to the {@link https://backstage.io/docs/backend-system/ | new backend system} and use the {@link https://backstage.io/docs/backend-system/core-services/root-health | Root Health Service} instead. */ export async function statusCheckHandler( options: StatusCheckHandlerOptions = {}, diff --git a/packages/backend-common/src/service/createStatusCheckRouter.test.ts b/packages/backend-common/src/deprecated/service/createStatusCheckRouter.test.ts similarity index 100% rename from packages/backend-common/src/service/createStatusCheckRouter.test.ts rename to packages/backend-common/src/deprecated/service/createStatusCheckRouter.test.ts diff --git a/packages/backend-common/src/service/createStatusCheckRouter.ts b/packages/backend-common/src/deprecated/service/createStatusCheckRouter.ts similarity index 85% rename from packages/backend-common/src/service/createStatusCheckRouter.ts rename to packages/backend-common/src/deprecated/service/createStatusCheckRouter.ts index 1a5953a748..fdece10ec5 100644 --- a/packages/backend-common/src/service/createStatusCheckRouter.ts +++ b/packages/backend-common/src/deprecated/service/createStatusCheckRouter.ts @@ -17,8 +17,7 @@ import { LoggerService } from '@backstage/backend-plugin-api'; import Router from 'express-promise-router'; import express from 'express'; -import { errorHandler } from '../deprecated'; -import { statusCheckHandler, StatusCheck } from '../middleware'; +import { errorHandler, statusCheckHandler, StatusCheck } from '..'; /** * Creates a default status checking router, that you can add to your express @@ -31,6 +30,7 @@ import { statusCheckHandler, StatusCheck } from '../middleware'; * requests. * * @public + * @deprecated Migrate to the {@link https://backstage.io/docs/backend-system/ | new backend system} and use the {@link https://backstage.io/docs/backend-system/core-services/root-health | Root Health Service} instead. */ export async function createStatusCheckRouter(options: { logger: LoggerService; diff --git a/packages/backend-common/src/deprecated/service/index.ts b/packages/backend-common/src/deprecated/service/index.ts index a9fc43c22a..d01f25fad3 100644 --- a/packages/backend-common/src/deprecated/service/index.ts +++ b/packages/backend-common/src/deprecated/service/index.ts @@ -15,4 +15,5 @@ */ export { createServiceBuilder } from './createServiceBuilder'; +export { createStatusCheckRouter } from './createStatusCheckRouter'; export type { ServiceBuilder, RequestLoggingHandlerFactory } from './types'; diff --git a/packages/backend-common/src/index.ts b/packages/backend-common/src/index.ts index cb5e236888..ad5621b5a9 100644 --- a/packages/backend-common/src/index.ts +++ b/packages/backend-common/src/index.ts @@ -22,5 +22,3 @@ export * from './deprecated'; export * from './compat'; -export * from './middleware'; -export * from './service'; diff --git a/packages/backend-common/src/middleware/index.ts b/packages/backend-common/src/middleware/index.ts deleted file mode 100644 index f1754ef4d8..0000000000 --- a/packages/backend-common/src/middleware/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2020 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. - */ - -export * from './statusCheckHandler'; diff --git a/packages/backend-common/src/service/index.ts b/packages/backend-common/src/service/index.ts deleted file mode 100644 index c2ae6ba87b..0000000000 --- a/packages/backend-common/src/service/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2020 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. - */ - -export { createStatusCheckRouter } from './createStatusCheckRouter'; From ec2fd03122902961bf0c7e7fd02e357d04d62e4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Veith=20M=2E=20B=C3=BCrgerhoff?= Date: Mon, 24 Jun 2024 14:26:02 +0200 Subject: [PATCH 358/387] Use else-if instead MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Veith M. Bürgerhoff --- .../src/components/fields/RepoUrlPicker/validation.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/validation.ts b/plugins/scaffolder/src/components/fields/RepoUrlPicker/validation.ts index c8dc66ab4c..06c2fd5684 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/validation.ts +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/validation.ts @@ -53,8 +53,7 @@ export const repoPickerValidation = ( 'Incomplete repository location provided, project not provided', ); } - } - if (integrationApi?.byHost(host)?.type === 'azure') { + } else if (integrationApi?.byHost(host)?.type === 'azure') { if (!searchParams.get('project')) { validation.addError( 'Incomplete repository location provided, project not provided', From 11eaadec04ca0cb0b3cc7e4e5ec17089b6f9cd42 Mon Sep 17 00:00:00 2001 From: Mattias Folke Date: Mon, 24 Jun 2024 14:38:33 +0200 Subject: [PATCH 359/387] clarified User Photos for userGroupmember for Azure integration Signed-off-by: Mattias Folke --- docs/integrations/azure/org.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/integrations/azure/org.md b/docs/integrations/azure/org.md index 89abd4813b..c3b0dc264f 100644 --- a/docs/integrations/azure/org.md +++ b/docs/integrations/azure/org.md @@ -150,6 +150,18 @@ microsoftGraphOrg: loadPhotos: false ``` +If you are using `userGroupMember`, the configuration for `loadPhotos` should still be managed under `users:` while omitting `search` and `filters`. + +```yaml +microsoftGraphOrg: + providerId: + user: + loadPhotos: false + userGroupMember: + filter: "displayName eq 'Backstage Users'" + search: '"description:One" AND ("displayName:Video" OR "displayName:Drive")' +``` + ## Customizing Transformation Ingested entities can be customized by providing custom transformers. From 574a2b2feed9d33c70d80a497994ef7a26e171ac Mon Sep 17 00:00:00 2001 From: Debabrata Panigrahi <50622005+Debanitrkl@users.noreply.github.com> Date: Mon, 24 Jun 2024 13:18:22 +0000 Subject: [PATCH 360/387] Signed-off-by: Debabrata Panigrahi <50622005+Debanitrkl@users.noreply.github.com> Added some tags --- microsite/data/plugins/harness-chaos.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/microsite/data/plugins/harness-chaos.yaml b/microsite/data/plugins/harness-chaos.yaml index 563f29d6a1..19b91046f6 100644 --- a/microsite/data/plugins/harness-chaos.yaml +++ b/microsite/data/plugins/harness-chaos.yaml @@ -7,7 +7,6 @@ documentation: https://github.com/harness/backstage-plugins/tree/main/plugins/ha iconUrl: https://static.harness.io/ng-static/images/favicon.png npmPackageName: '@harnessio/backstage-plugin-harness-chaos' tags: - - chaos-experiments + - chaosexperiments - resiliency - - chaos-engineering addedDate: '2024-06-25' \ No newline at end of file From 148a6f17b466c7a26468faa6695ff521594a6c31 Mon Sep 17 00:00:00 2001 From: Ben Lambert Date: Mon, 24 Jun 2024 15:28:56 +0200 Subject: [PATCH 361/387] Update silent-moose-eat.md Signed-off-by: Ben Lambert --- .changeset/silent-moose-eat.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/silent-moose-eat.md b/.changeset/silent-moose-eat.md index 735afa12f1..bc66f55181 100644 --- a/.changeset/silent-moose-eat.md +++ b/.changeset/silent-moose-eat.md @@ -2,4 +2,4 @@ '@backstage/plugin-scaffolder': patch --- -Support catalogFilter array on OwnedEntityPicker +Support `catalogFilter` array on `OwnedEntityPicker` From 995b2c56da7bf4f2e58e4b64f3ae29249a3e9e95 Mon Sep 17 00:00:00 2001 From: Debabrata Panigrahi <50622005+Debanitrkl@users.noreply.github.com> Date: Mon, 24 Jun 2024 13:34:39 +0000 Subject: [PATCH 362/387] Signed-off-by: Debabrata Panigrahi <50622005+Debanitrkl@users.noreply.github.com> Ran prettier --- microsite/data/plugins/harness-chaos.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/microsite/data/plugins/harness-chaos.yaml b/microsite/data/plugins/harness-chaos.yaml index 19b91046f6..ade6f9e566 100644 --- a/microsite/data/plugins/harness-chaos.yaml +++ b/microsite/data/plugins/harness-chaos.yaml @@ -7,6 +7,5 @@ documentation: https://github.com/harness/backstage-plugins/tree/main/plugins/ha iconUrl: https://static.harness.io/ng-static/images/favicon.png npmPackageName: '@harnessio/backstage-plugin-harness-chaos' tags: - - chaosexperiments - resiliency -addedDate: '2024-06-25' \ No newline at end of file +addedDate: '2024-06-25' From d3c39fc71c7dfac02e70f2c16f006dad595e3ab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Mon, 24 Jun 2024 15:46:20 +0200 Subject: [PATCH 363/387] declaratively disable external routes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/famous-dodos-crash.md | 15 +++++++ .../src/app/resolveRouteBindings.test.ts | 31 +++++++++++++ .../src/app/resolveRouteBindings.ts | 43 +++++++++++++------ .../src/routing/resolveRouteBindings.test.ts | 27 ++++++++++++ .../src/routing/resolveRouteBindings.ts | 43 +++++++++++++------ 5 files changed, 133 insertions(+), 26 deletions(-) create mode 100644 .changeset/famous-dodos-crash.md diff --git a/.changeset/famous-dodos-crash.md b/.changeset/famous-dodos-crash.md new file mode 100644 index 0000000000..5442c1b378 --- /dev/null +++ b/.changeset/famous-dodos-crash.md @@ -0,0 +1,15 @@ +--- +'@backstage/core-app-api': minor +'@backstage/frontend-app-api': patch +--- + +Allow for the disabling of external routes through config, which was rendered impossible after the introduction of default targets. + +```yaml +app: + routes: + bindings: + # This has the effect of removing the button for registering new + # catalog entities in the scaffolder template list view + scaffolder.registerComponent: false +``` diff --git a/packages/core-app-api/src/app/resolveRouteBindings.test.ts b/packages/core-app-api/src/app/resolveRouteBindings.test.ts index 9dfbbfd452..7d5c649a34 100644 --- a/packages/core-app-api/src/app/resolveRouteBindings.test.ts +++ b/packages/core-app-api/src/app/resolveRouteBindings.test.ts @@ -194,4 +194,35 @@ describe('collectRouteIds', () => { 'test.extRef': extRef, }); }); + + it('can disable external routes that have defaults', () => { + const source = createExternalRouteRef({ + id: 'test', + defaultTarget: 'test.target1', + }); + const target1 = createRouteRef({ id: 'test' }); + const plugin = createPlugin({ + id: 'test', + routes: { target1 }, + externalRoutes: { source }, + }); + + // resolves normally with no config + let result = resolveRouteBindings(() => {}, new MockConfigApi({}), [ + plugin, + ]); + + expect(result.get(source)).toBe(target1); + + // can be disabled + result = resolveRouteBindings( + () => {}, + new MockConfigApi({ + app: { routes: { bindings: { 'test.source': false } } }, + }), + [plugin], + ); + + expect(result.get(source)).toBe(undefined); + }); }); diff --git a/packages/core-app-api/src/app/resolveRouteBindings.ts b/packages/core-app-api/src/app/resolveRouteBindings.ts index 55e1139b29..07dfea43ee 100644 --- a/packages/core-app-api/src/app/resolveRouteBindings.ts +++ b/packages/core-app-api/src/app/resolveRouteBindings.ts @@ -102,11 +102,12 @@ export function resolveRouteBindings( const bindings = config .getOptionalConfig('app.routes.bindings') ?.get(); + const disabledExternalRefs = new Set(); if (bindings) { for (const [externalRefId, targetRefId] of Object.entries(bindings)) { - if (typeof targetRefId !== 'string' || targetRefId === '') { + if (!isValidTargetRefId(targetRefId)) { throw new Error( - `Invalid config at app.routes.bindings['${externalRefId}'], value must be a non-empty string`, + `Invalid config at app.routes.bindings['${externalRefId}'], value must be a non-empty string or false`, ); } @@ -116,23 +117,27 @@ export function resolveRouteBindings( `Invalid config at app.routes.bindings, '${externalRefId}' is not a valid external route`, ); } - if (result.has(externalRef)) { - continue; - } - const targetRef = routesById.routes.get(targetRefId); - if (!targetRef) { - throw new Error( - `Invalid config at app.routes.bindings['${externalRefId}'], '${targetRefId}' is not a valid route`, - ); - } - result.set(externalRef, targetRef); + if (targetRefId === false) { + disabledExternalRefs.add(externalRef); + + result.delete(externalRef); + } else if (!result.has(externalRef)) { + const targetRef = routesById.routes.get(targetRefId); + if (!targetRef) { + throw new Error( + `Invalid config at app.routes.bindings['${externalRefId}'], '${targetRefId}' is not a valid route`, + ); + } + + result.set(externalRef, targetRef); + } } } // Finally fall back to attempting to map defaults, at lowest priority for (const externalRef of routesById.externalRoutes.values()) { - if (!result.has(externalRef)) { + if (!result.has(externalRef) && !disabledExternalRefs.has(externalRef)) { const defaultRefId = 'getDefaultTarget' in externalRef ? (externalRef.getDefaultTarget as () => string | undefined)() @@ -148,3 +153,15 @@ export function resolveRouteBindings( return result; } + +function isValidTargetRefId(value: unknown): value is string | false { + if (value === false) { + return true; + } + + if (typeof value === 'string' && value) { + return true; + } + + return false; +} diff --git a/packages/frontend-app-api/src/routing/resolveRouteBindings.test.ts b/packages/frontend-app-api/src/routing/resolveRouteBindings.test.ts index 9b150eb127..908a99d3aa 100644 --- a/packages/frontend-app-api/src/routing/resolveRouteBindings.test.ts +++ b/packages/frontend-app-api/src/routing/resolveRouteBindings.test.ts @@ -161,4 +161,31 @@ describe('resolveRouteBindings', () => { expect(result.get(source)).toBe(target2); }); + + it('can disable external routes that have defaults', () => { + const source = createExternalRouteRef({ defaultTarget: 'target1' }); + const target1 = createRouteRef(); + const routesById = { + routes: new Map([['target1', target1]]), + externalRoutes: new Map([['source', source]]), + }; + + // resolves normally with no config + let result = resolveRouteBindings( + () => {}, + new ConfigReader({}), + routesById, + ); + + expect(result.get(source)).toBe(target1); + + // can be disabled + result = resolveRouteBindings( + () => {}, + new ConfigReader({ app: { routes: { bindings: { source: false } } } }), + routesById, + ); + + expect(result.get(source)).toBe(undefined); + }); }); diff --git a/packages/frontend-app-api/src/routing/resolveRouteBindings.ts b/packages/frontend-app-api/src/routing/resolveRouteBindings.ts index 49e3b1a1be..81d9eddef3 100644 --- a/packages/frontend-app-api/src/routing/resolveRouteBindings.ts +++ b/packages/frontend-app-api/src/routing/resolveRouteBindings.ts @@ -112,11 +112,12 @@ export function resolveRouteBindings( const bindings = config .getOptionalConfig('app.routes.bindings') ?.get(); + const disabledExternalRefs = new Set(); if (bindings) { for (const [externalRefId, targetRefId] of Object.entries(bindings)) { - if (typeof targetRefId !== 'string' || targetRefId === '') { + if (!isValidTargetRefId(targetRefId)) { throw new Error( - `Invalid config at app.routes.bindings['${externalRefId}'], value must be a non-empty string`, + `Invalid config at app.routes.bindings['${externalRefId}'], value must be a non-empty string or false`, ); } @@ -126,23 +127,27 @@ export function resolveRouteBindings( `Invalid config at app.routes.bindings, '${externalRefId}' is not a valid external route`, ); } - if (result.has(externalRef)) { - continue; - } - const targetRef = routesById.routes.get(targetRefId); - if (!targetRef) { - throw new Error( - `Invalid config at app.routes.bindings['${externalRefId}'], '${targetRefId}' is not a valid route`, - ); - } - result.set(externalRef, targetRef); + if (targetRefId === false) { + disabledExternalRefs.add(externalRef); + + result.delete(externalRef); + } else if (!result.has(externalRef)) { + const targetRef = routesById.routes.get(targetRefId); + if (!targetRef) { + throw new Error( + `Invalid config at app.routes.bindings['${externalRefId}'], '${targetRefId}' is not a valid route`, + ); + } + + result.set(externalRef, targetRef); + } } } // Finally fall back to attempting to map defaults, at lowest priority for (const externalRef of routesById.externalRoutes.values()) { - if (!result.has(externalRef)) { + if (!result.has(externalRef) && !disabledExternalRefs.has(externalRef)) { const defaultRefId = toInternalExternalRouteRef(externalRef).getDefaultTarget(); if (defaultRefId) { @@ -156,3 +161,15 @@ export function resolveRouteBindings( return result; } + +function isValidTargetRefId(value: unknown): value is string | false { + if (value === false) { + return true; + } + + if (typeof value === 'string' && value) { + return true; + } + + return false; +} From 7a5da335ae30c2b15ed44279e40735afccafbb62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Veith=20M=2E=20B=C3=BCrgerhoff?= Date: Mon, 24 Jun 2024 15:51:58 +0200 Subject: [PATCH 364/387] Add tests for azure validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Veith M. Bürgerhoff --- .../fields/RepoUrlPicker/validation.test.ts | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/validation.test.ts b/plugins/scaffolder/src/components/fields/RepoUrlPicker/validation.test.ts index b9c481957c..2b59775d3a 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/validation.test.ts +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/validation.test.ts @@ -36,6 +36,11 @@ describe('RepoPicker Validation', () => { host: 'server.bitbucket.com', }, ], + azure: [ + { + host: 'dev.azure.com', + }, + ], github: [ { host: 'github.com', @@ -201,4 +206,59 @@ describe('RepoPicker Validation', () => { 'Incomplete repository location provided, repo not provided', ); }); + + it('validates properly with proper input for azure', () => { + const mockFieldValidation = fieldValidator(); + + repoPickerValidation( + 'dev.azure.com?project=a&repo=b', + mockFieldValidation, + { + apiHolder: apiHolderMock, + }, + ); + + expect(mockFieldValidation.addError).not.toHaveBeenCalled(); + }); + + it('validates when no project or repo provided for azure', () => { + const mockFieldValidation = fieldValidator(); + + repoPickerValidation('dev.azure.com', mockFieldValidation, { + apiHolder: apiHolderMock, + }); + + expect(mockFieldValidation.addError).toHaveBeenNthCalledWith( + 1, + 'Incomplete repository location provided, project not provided', + ); + expect(mockFieldValidation.addError).toHaveBeenNthCalledWith( + 2, + 'Incomplete repository location provided, repo not provided', + ); + }); + + it('validates when no project provided for azure', () => { + const mockFieldValidation = fieldValidator(); + + repoPickerValidation('dev.azure.com?repo=r', mockFieldValidation, { + apiHolder: apiHolderMock, + }); + + expect(mockFieldValidation.addError).toHaveBeenCalledWith( + 'Incomplete repository location provided, project not provided', + ); + }); + + it('validates when no repo provided for azure', () => { + const mockFieldValidation = fieldValidator(); + + repoPickerValidation('dev.azure.com?project=p', mockFieldValidation, { + apiHolder: apiHolderMock, + }); + + expect(mockFieldValidation.addError).toHaveBeenCalledWith( + 'Incomplete repository location provided, repo not provided', + ); + }); }); From a03b86497b59124967dc4812ccec7de261c74658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Mon, 24 Jun 2024 15:54:14 +0200 Subject: [PATCH 365/387] review comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- packages/frontend-app-api/config.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/frontend-app-api/config.d.ts b/packages/frontend-app-api/config.d.ts index 28355f5376..fc265e8833 100644 --- a/packages/frontend-app-api/config.d.ts +++ b/packages/frontend-app-api/config.d.ts @@ -26,9 +26,14 @@ export interface Config { routes?: { /** + * Maps external route references to regular route references. Both the + * key and the value is expected to be on the form `.`. + * If the value is `false`, the route will be disabled even if it has a + * default mapping. + * * @deepVisibility frontend */ - bindings?: { [externalRouteRefId: string]: string }; + bindings?: { [externalRouteRefId: string]: string | false }; }; /** From 9986ab0a977672498a92829766a5442d1718cda3 Mon Sep 17 00:00:00 2001 From: Ben Lambert Date: Mon, 24 Jun 2024 16:18:56 +0200 Subject: [PATCH 366/387] Update honest-pears-run.md Signed-off-by: Ben Lambert --- .changeset/honest-pears-run.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/honest-pears-run.md b/.changeset/honest-pears-run.md index acf9543997..65ea8d1721 100644 --- a/.changeset/honest-pears-run.md +++ b/.changeset/honest-pears-run.md @@ -4,4 +4,4 @@ '@backstage/plugin-scaffolder': patch --- -Fixed a bug where the RepoUrlPicker would still require the 'owner' field after the usage was changed to 'repo'. +Fixed a bug where the `RepoUrlPicker` would still require the `owner` field for `azure` From 52b6db0922c6d5d636076fe9793e39a8eff79cf9 Mon Sep 17 00:00:00 2001 From: Mikko Korhonen Date: Mon, 24 Jun 2024 21:57:33 +0300 Subject: [PATCH 367/387] feat(scaffolder): use virtualization with EntityPicker Signed-off-by: Mikko Korhonen --- .changeset/calm-jeans-ring.md | 5 ++ .../fields/EntityPicker/EntityPicker.tsx | 2 + .../MultiEntityPicker/MultiEntityPicker.tsx | 36 +------------ .../components/fields/VirtualizedListbox.tsx | 50 +++++++++++++++++++ 4 files changed, 59 insertions(+), 34 deletions(-) create mode 100644 .changeset/calm-jeans-ring.md create mode 100644 plugins/scaffolder/src/components/fields/VirtualizedListbox.tsx diff --git a/.changeset/calm-jeans-ring.md b/.changeset/calm-jeans-ring.md new file mode 100644 index 0000000000..3d1efcf7bd --- /dev/null +++ b/.changeset/calm-jeans-ring.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder': minor +--- + +Use virtualization with `EntityPicker` as done earlier with `MultiEntityPicker` to fix performance issues with large data sets. `VirtualizedListbox` extracted into reusable component. diff --git a/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.tsx b/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.tsx index 176f6e9ce0..9eca3e85c5 100644 --- a/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.tsx +++ b/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.tsx @@ -43,6 +43,7 @@ import { EntityPickerUiOptions, EntityPickerFilterQuery, } from './schema'; +import { VirtualizedListbox } from '../VirtualizedListbox'; export { EntityPickerSchema } from './schema'; @@ -205,6 +206,7 @@ export const EntityPicker = (props: EntityPickerProps) => { entities?.entityRefToPresentation.get(stringifyEntityRef(option)) ?.primaryTitle!, })} + ListboxComponent={VirtualizedListbox} /> ); diff --git a/plugins/scaffolder/src/components/fields/MultiEntityPicker/MultiEntityPicker.tsx b/plugins/scaffolder/src/components/fields/MultiEntityPicker/MultiEntityPicker.tsx index 84a050622a..d800c9b372 100644 --- a/plugins/scaffolder/src/components/fields/MultiEntityPicker/MultiEntityPicker.tsx +++ b/plugins/scaffolder/src/components/fields/MultiEntityPicker/MultiEntityPicker.tsx @@ -35,7 +35,6 @@ import Autocomplete, { AutocompleteChangeReason, } from '@material-ui/lab/Autocomplete'; import React, { useCallback, useEffect } from 'react'; -import { FixedSizeList, ListChildComponentProps } from 'react-window'; import useAsync from 'react-use/esm/useAsync'; import { FieldValidation } from '@rjsf/utils'; import { @@ -44,41 +43,10 @@ import { MultiEntityPickerUiOptions, MultiEntityPickerFilterQuery, } from './schema'; +import { VirtualizedListbox } from '../VirtualizedListbox'; export { MultiEntityPickerSchema } from './schema'; -const renderRow = (props: ListChildComponentProps) => { - const { data, index, style } = props; - return React.cloneElement(data[index], { style }); -}; - -const ListboxComponent = React.forwardRef< - HTMLDivElement, - { children?: React.ReactNode } ->((props, ref) => { - const itemData = React.Children.toArray(props.children); - const itemCount = itemData.length; - - const itemSize = 36; - - const itemsToShow = Math.min(10, itemCount); - const height = Math.max(itemSize, itemsToShow * itemSize - 0.5 * itemSize); - - return ( -
- - {renderRow} - -
- ); -}); - /** * The underlying component that is rendered in the form for the `MultiEntityPicker` * field extension. @@ -210,7 +178,7 @@ export const MultiEntityPicker = (props: MultiEntityPickerProps) => { }} /> )} - ListboxComponent={ListboxComponent} + ListboxComponent={VirtualizedListbox} /> ); diff --git a/plugins/scaffolder/src/components/fields/VirtualizedListbox.tsx b/plugins/scaffolder/src/components/fields/VirtualizedListbox.tsx new file mode 100644 index 0000000000..b0920b626a --- /dev/null +++ b/plugins/scaffolder/src/components/fields/VirtualizedListbox.tsx @@ -0,0 +1,50 @@ +/* + * Copyright 2024 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 React from 'react'; +import { FixedSizeList, ListChildComponentProps } from 'react-window'; + +const renderRow = (props: ListChildComponentProps) => { + const { data, index, style } = props; + return React.cloneElement(data[index], { style }); +}; + +export const VirtualizedListbox = React.forwardRef< + HTMLDivElement, + { children?: React.ReactNode } +>((props, ref) => { + const itemData = React.Children.toArray(props.children); + const itemCount = itemData.length; + + const itemSize = 36; + + const itemsToShow = Math.min(10, itemCount); + const height = Math.max(itemSize, itemsToShow * itemSize - 0.5 * itemSize); + + return ( +
+ + {renderRow} + +
+ ); +}); From 4410fed9d9f10fefc7520bab5d702dd7c3c36913 Mon Sep 17 00:00:00 2001 From: Diego Iglesias Date: Mon, 24 Jun 2024 23:40:01 +0200 Subject: [PATCH 368/387] fix(scaffolder-backend-module-github): createEnvironmentVariable missing owner and repo Signed-off-by: Diego Iglesias --- .changeset/ten-dancers-drum.md | 5 +++++ .../src/actions/githubEnvironment.examples.test.ts | 4 ++++ .../src/actions/githubEnvironment.test.ts | 4 ++++ .../src/actions/githubEnvironment.ts | 2 ++ 4 files changed, 15 insertions(+) create mode 100644 .changeset/ten-dancers-drum.md diff --git a/.changeset/ten-dancers-drum.md b/.changeset/ten-dancers-drum.md new file mode 100644 index 0000000000..427c507c8c --- /dev/null +++ b/.changeset/ten-dancers-drum.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend-module-github': patch +--- + +Fixed issue with octokit call missing owner and repo when creating environment variables using github:environment:create action diff --git a/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.examples.test.ts b/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.examples.test.ts index 9d4395eb7a..0a9242627c 100644 --- a/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.examples.test.ts +++ b/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.examples.test.ts @@ -221,6 +221,8 @@ describe('github:environment:create examples', () => { mockOctokit.rest.actions.createEnvironmentVariable, ).toHaveBeenCalledWith({ repository_id: 'repoid', + owner: 'owner', + repo: 'repository', environment_name: 'envname', name: 'key1', value: 'val1', @@ -229,6 +231,8 @@ describe('github:environment:create examples', () => { mockOctokit.rest.actions.createEnvironmentVariable, ).toHaveBeenCalledWith({ repository_id: 'repoid', + owner: 'owner', + repo: 'repository', environment_name: 'envname', name: 'key2', value: 'val2', diff --git a/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.test.ts b/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.test.ts index a8d8c4ef2e..b0fa08dae4 100644 --- a/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.test.ts +++ b/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.test.ts @@ -240,6 +240,8 @@ describe('github:environment:create', () => { mockOctokit.rest.actions.createEnvironmentVariable, ).toHaveBeenCalledWith({ repository_id: 'repoid', + owner: 'owner', + repo: 'repository', environment_name: 'envname', name: 'key1', value: 'val1', @@ -248,6 +250,8 @@ describe('github:environment:create', () => { mockOctokit.rest.actions.createEnvironmentVariable, ).toHaveBeenCalledWith({ repository_id: 'repoid', + owner: 'owner', + repo: 'repository', environment_name: 'envname', name: 'key2', value: 'val2', diff --git a/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.ts b/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.ts index e821ff0cd6..f6542e3d83 100644 --- a/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.ts +++ b/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.ts @@ -187,6 +187,8 @@ export function createGithubEnvironmentAction(options: { for (const [key, value] of Object.entries(environmentVariables ?? {})) { await client.rest.actions.createEnvironmentVariable({ repository_id: repository.data.id, + owner: owner, + repo: repo, environment_name: name, name: key, value, From 36f3c5e69330e33eb5d0035e86c0817c0557a861 Mon Sep 17 00:00:00 2001 From: Diego Iglesias Date: Tue, 25 Jun 2024 00:24:58 +0200 Subject: [PATCH 369/387] fix(scaffolder-backend-module-github): createOrUpdateEnvironmentSecret missing owner and repo Signed-off-by: Diego Iglesias --- .changeset/ten-dancers-drum.md | 2 +- .../src/actions/githubEnvironment.examples.test.ts | 4 ++++ .../src/actions/githubEnvironment.test.ts | 4 ++++ .../src/actions/githubEnvironment.ts | 2 ++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.changeset/ten-dancers-drum.md b/.changeset/ten-dancers-drum.md index 427c507c8c..3f54a7a6b3 100644 --- a/.changeset/ten-dancers-drum.md +++ b/.changeset/ten-dancers-drum.md @@ -2,4 +2,4 @@ '@backstage/plugin-scaffolder-backend-module-github': patch --- -Fixed issue with octokit call missing owner and repo when creating environment variables using github:environment:create action +Fixed issue with octokit call missing owner and repo when creating environment variables and secrets using github:environment:create action diff --git a/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.examples.test.ts b/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.examples.test.ts index 0a9242627c..e41e642ca0 100644 --- a/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.examples.test.ts +++ b/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.examples.test.ts @@ -245,6 +245,8 @@ describe('github:environment:create examples', () => { mockOctokit.rest.actions.createOrUpdateEnvironmentSecret, ).toHaveBeenCalledWith({ repository_id: 'repoid', + owner: 'owner', + repo: 'repository', environment_name: 'envname', secret_name: 'secret1', key_id: 'keyid', @@ -254,6 +256,8 @@ describe('github:environment:create examples', () => { mockOctokit.rest.actions.createOrUpdateEnvironmentSecret, ).toHaveBeenCalledWith({ repository_id: 'repoid', + owner: 'owner', + repo: 'repository', environment_name: 'envname', secret_name: 'secret2', key_id: 'keyid', diff --git a/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.test.ts b/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.test.ts index b0fa08dae4..c4eae41029 100644 --- a/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.test.ts +++ b/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.test.ts @@ -286,6 +286,8 @@ describe('github:environment:create', () => { mockOctokit.rest.actions.createOrUpdateEnvironmentSecret, ).toHaveBeenCalledWith({ repository_id: 'repoid', + owner: 'owner', + repo: 'repository', environment_name: 'envname', secret_name: 'key1', key_id: 'keyid', @@ -295,6 +297,8 @@ describe('github:environment:create', () => { mockOctokit.rest.actions.createOrUpdateEnvironmentSecret, ).toHaveBeenCalledWith({ repository_id: 'repoid', + owner: 'owner', + repo: 'repository', environment_name: 'envname', secret_name: 'key2', key_id: 'keyid', diff --git a/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.ts b/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.ts index f6542e3d83..98e7cea1a9 100644 --- a/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.ts +++ b/plugins/scaffolder-backend-module-github/src/actions/githubEnvironment.ts @@ -220,6 +220,8 @@ export function createGithubEnvironmentAction(options: { await client.rest.actions.createOrUpdateEnvironmentSecret({ repository_id: repository.data.id, + owner: owner, + repo: repo, environment_name: name, secret_name: key, encrypted_value: encryptedBase64Secret, From d22886250c9ffe16e886f9caa3d467237e74f7bd Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Mon, 24 Jun 2024 23:07:46 -0400 Subject: [PATCH 370/387] Update cli default backend plugin to use non-deprecated imports Signed-off-by: Stephen Glass --- .changeset/khaki-rivers-obey.md | 6 ++++++ .../src/deprecated/middleware/errorHandler.ts | 2 +- .../templates/default-backend-plugin/package.json.hbs | 1 + .../templates/default-backend-plugin/src/plugin.ts.hbs | 3 +++ .../default-backend-plugin/src/service/router.test.ts | 5 +++-- .../default-backend-plugin/src/service/router.ts | 10 +++++++--- 6 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 .changeset/khaki-rivers-obey.md diff --git a/.changeset/khaki-rivers-obey.md b/.changeset/khaki-rivers-obey.md new file mode 100644 index 0000000000..856c8caf09 --- /dev/null +++ b/.changeset/khaki-rivers-obey.md @@ -0,0 +1,6 @@ +--- +'@backstage/backend-common': patch +'@backstage/cli': patch +--- + +Update default backend plugin created by the cli to use non-deprecated error handling middleware diff --git a/packages/backend-common/src/deprecated/middleware/errorHandler.ts b/packages/backend-common/src/deprecated/middleware/errorHandler.ts index 3664ed0e0a..b4f07b9320 100644 --- a/packages/backend-common/src/deprecated/middleware/errorHandler.ts +++ b/packages/backend-common/src/deprecated/middleware/errorHandler.ts @@ -63,7 +63,7 @@ export type ErrorHandlerOptions = { * * @public * @returns An Express error request handler - * @deprecated Use {@link @backstage/backend-app-api#MiddlewareFactory.create.error} instead + * @deprecated Use {@link @backstage/backend-defaults/rootHttpRouter#MiddlewareFactory.create.error} instead */ export function errorHandler( options: ErrorHandlerOptions = {}, diff --git a/packages/cli/templates/default-backend-plugin/package.json.hbs b/packages/cli/templates/default-backend-plugin/package.json.hbs index c20a1854a2..57539d5e29 100644 --- a/packages/cli/templates/default-backend-plugin/package.json.hbs +++ b/packages/cli/templates/default-backend-plugin/package.json.hbs @@ -38,6 +38,7 @@ "node-fetch": "{{versionQuery 'node-fetch' '2.6.7'}}" }, "devDependencies": { + "@backstage/backend-test-utils": "{{versionQuery '@backstage/backend-test-utils'}}", "@backstage/cli": "{{versionQuery '@backstage/cli'}}", "@backstage/plugin-auth-backend": "{{versionQuery '@backstage/plugin-auth-backend'}}", "@backstage/plugin-auth-backend-module-guest-provider": "{{versionQuery '@backstage/plugin-auth-backend-module-guest-provider'}}", diff --git a/packages/cli/templates/default-backend-plugin/src/plugin.ts.hbs b/packages/cli/templates/default-backend-plugin/src/plugin.ts.hbs index 773bd4354f..bf04b43afe 100644 --- a/packages/cli/templates/default-backend-plugin/src/plugin.ts.hbs +++ b/packages/cli/templates/default-backend-plugin/src/plugin.ts.hbs @@ -16,14 +16,17 @@ export const {{pluginVar}} = createBackendPlugin({ deps: { httpRouter: coreServices.httpRouter, logger: coreServices.logger, + config: coreServices.rootConfig, }, async init({ httpRouter, logger, + config, }) { httpRouter.use( await createRouter({ logger, + config, }), ); httpRouter.addAuthPolicy({ diff --git a/packages/cli/templates/default-backend-plugin/src/service/router.test.ts b/packages/cli/templates/default-backend-plugin/src/service/router.test.ts index 4f5079744e..ed19d50d2b 100644 --- a/packages/cli/templates/default-backend-plugin/src/service/router.test.ts +++ b/packages/cli/templates/default-backend-plugin/src/service/router.test.ts @@ -1,4 +1,4 @@ -import { getVoidLogger } from '@backstage/backend-common'; +import { mockServices } from '@backstage/backend-test-utils'; import express from 'express'; import request from 'supertest'; @@ -9,7 +9,8 @@ describe('createRouter', () => { beforeAll(async () => { const router = await createRouter({ - logger: getVoidLogger(), + logger: mockServices.logger.mock(), + config: mockServices.rootConfig(), }); app = express().use(router); }); diff --git a/packages/cli/templates/default-backend-plugin/src/service/router.ts b/packages/cli/templates/default-backend-plugin/src/service/router.ts index ff7134e59d..312d7e252e 100644 --- a/packages/cli/templates/default-backend-plugin/src/service/router.ts +++ b/packages/cli/templates/default-backend-plugin/src/service/router.ts @@ -1,16 +1,18 @@ -import { errorHandler } from '@backstage/backend-common'; +import { MiddlewareFactory } from '@backstage/backend-defaults/rootHttpRouter'; import { LoggerService } from '@backstage/backend-plugin-api'; +import { Config } from '@backstage/config'; import express from 'express'; import Router from 'express-promise-router'; export interface RouterOptions { logger: LoggerService; + config: Config; } export async function createRouter( options: RouterOptions, ): Promise { - const { logger } = options; + const { logger, config } = options; const router = Router(); router.use(express.json()); @@ -20,6 +22,8 @@ export async function createRouter( response.json({ status: 'ok' }); }); - router.use(errorHandler()); + const middleware = MiddlewareFactory.create({ logger, config }); + + router.use(middleware.error()); return router; } From c35be1d21b33a72c3698e980e97d3526fb35c66b Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Tue, 25 Jun 2024 09:28:28 +0200 Subject: [PATCH 371/387] e2e-tests: wait for plugins before start Signed-off-by: Vincenzo Scamporlino --- packages/e2e-test/src/commands/run.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/e2e-test/src/commands/run.ts b/packages/e2e-test/src/commands/run.ts index 111c638146..0a9ac6368c 100644 --- a/packages/e2e-test/src/commands/run.ts +++ b/packages/e2e-test/src/commands/run.ts @@ -537,7 +537,9 @@ async function testBackendStart(appDir: string, ...args: string[]) { try { await waitFor( - () => stdout.includes('Listening on ') || filterStderr(stderr).length > 0, + () => + stdout.includes('Plugin initialization complete') || + filterStderr(stderr).length > 0, ); const stderrLines = filterStderr(stderr); if (stderrLines.length > 0) { From d14795bd0587a52b87284628d8364ddf570d09f9 Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 25 Jun 2024 10:31:38 +0200 Subject: [PATCH 372/387] chore: fixing tests Signed-off-by: blam --- .../fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx index 18ce8d2c76..2ae89233ff 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx @@ -27,11 +27,9 @@ import { act } from 'react-dom/test-utils'; describe('BitbucketRepoPicker', () => { const scaffolderApiMock: Partial = { - autocomplete: jest - .fn() - .mockImplementation((_token, _provider, resource) => [ - `${resource}_example`, - ]), + autocomplete: jest.fn().mockImplementation(opts => ({ + results: [{ title: `${opts.resource}_example` }], + })), }; it('renders a select if there is a list of allowed owners', async () => { From 2030962c7677f5f13b52eac8862a919ad1ec94dd Mon Sep 17 00:00:00 2001 From: Fernando Cordeiro de Lemos Date: Mon, 24 Jun 2024 09:33:29 +0200 Subject: [PATCH 373/387] Make useFacetsEntities fetches full entities from entity references EntityOwnerPicker will then display title or displayName if present for mode='owners-only'. Fixes #25348 Signed-off-by: Fernando Cordeiro de Lemos --- .changeset/metal-jokes-add.md | 5 + .../EntityOwnerPicker.test.tsx | 28 ++-- .../useFacetsEntities.test.ts | 152 ++++++++++++++---- .../EntityOwnerPicker/useFacetsEntities.ts | 43 +++-- .../CatalogPage/DefaultCatalogPage.test.tsx | 20 +++ 5 files changed, 192 insertions(+), 56 deletions(-) create mode 100644 .changeset/metal-jokes-add.md diff --git a/.changeset/metal-jokes-add.md b/.changeset/metal-jokes-add.md new file mode 100644 index 0000000000..faef714d87 --- /dev/null +++ b/.changeset/metal-jokes-add.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-react': patch +--- + +Make EntityOwnerPicker display metadata.title or spec.profile.displayName for mode=only-owners instead of metadata.name diff --git a/plugins/catalog-react/src/components/EntityOwnerPicker/EntityOwnerPicker.test.tsx b/plugins/catalog-react/src/components/EntityOwnerPicker/EntityOwnerPicker.test.tsx index a7b98e890f..4eb957cc16 100644 --- a/plugins/catalog-react/src/components/EntityOwnerPicker/EntityOwnerPicker.test.tsx +++ b/plugins/catalog-react/src/components/EntityOwnerPicker/EntityOwnerPicker.test.tsx @@ -395,6 +395,10 @@ describe('', () => { ], }, }); + + mockedGetEntitiesByRef.mockResolvedValue({ + items: [...ownerEntitiesBatch1, ...ownerEntitiesBatch2], + }); }); it('renders all users and groups', async () => { @@ -410,14 +414,16 @@ describe('', () => { fireEvent.click(screen.getByTestId('owner-picker-expand')); await waitFor(() => - expect(screen.getByText('another-owner')).toBeInTheDocument(), + expect(screen.getByText('Another Owner')).toBeInTheDocument(), ); - ['some-owner', 'some-owner-2', 'test-namespace/another-owner-2'].forEach( - owner => { - expect(screen.getByText(owner)).toBeInTheDocument(); - }, - ); + [ + 'some-owner', + 'Some Owner 2', + 'Another Owner in Another Namespace', + ].forEach(owner => { + expect(screen.getByText(owner)).toBeInTheDocument(); + }); expect(mockedGetEntityFacets).toHaveBeenCalledTimes(1); @@ -429,8 +435,8 @@ describe('', () => { [ 'some-owner-batch-2', - 'some-owner-2-batch-2', - 'test-namespace/another-owner-2-batch-2', + 'Some Owner Batch 2', + 'Another Owner in Another Namespace Batch 2', ].forEach(owner => { expect(screen.getByText(owner)).toBeInTheDocument(); }); @@ -470,7 +476,11 @@ describe('', () => { , ); - expect(mockedGetEntitiesByRef).not.toHaveBeenCalled(); + expect(mockedGetEntitiesByRef).toHaveBeenCalledWith({ + entityRefs: [...ownerEntitiesBatch1, ...ownerEntitiesBatch2].map(entity => + stringifyEntityRef(entity), + ), + }); expect(updateFilters).toHaveBeenLastCalledWith({ owners: undefined, }); diff --git a/plugins/catalog-react/src/components/EntityOwnerPicker/useFacetsEntities.test.ts b/plugins/catalog-react/src/components/EntityOwnerPicker/useFacetsEntities.test.ts index 1d0d1130a6..742efaab9f 100644 --- a/plugins/catalog-react/src/components/EntityOwnerPicker/useFacetsEntities.test.ts +++ b/plugins/catalog-react/src/components/EntityOwnerPicker/useFacetsEntities.test.ts @@ -16,12 +16,17 @@ import { renderHook, waitFor } from '@testing-library/react'; import { useFacetsEntities } from './useFacetsEntities'; import { CatalogApi } from '@backstage/catalog-client'; +import { Entity, parseEntityRef } from '@backstage/catalog-model'; const mockedGetEntityFacets: jest.MockedFn = jest.fn(); +const mockedGetEntitiesByRefs: jest.MockedFn = + jest.fn(); + const mockCatalogApi: Partial = { getEntityFacets: mockedGetEntityFacets, + getEntitiesByRefs: mockedGetEntitiesByRefs, }; jest.mock('@backstage/core-plugin-api', () => ({ @@ -34,6 +39,31 @@ describe('useFacetsEntities', () => { jest.resetAllMocks(); }); + const facetsFromEntityRefs = (entityRefs: string[]) => ({ + facets: { + 'relations.ownedBy': entityRefs.map(value => ({ count: 1, value })), + }, + }); + + const entitiesFromEntityRefs = ( + entityRefs: string[], + enrichedEntities: { [key: string]: Entity } = {}, + ) => ({ + items: entityRefs.map(ref => { + const compoundRef = parseEntityRef(ref); + return ( + enrichedEntities[ref] || { + apiVersion: 'backstage.io/v1beta1', + kind: compoundRef.kind, + metadata: { + name: compoundRef.name, + namespace: compoundRef.namespace, + }, + } + ); + }), + }); + it(`should return empty items when facets are loading`, () => { mockedGetEntityFacets.mockReturnValue(new Promise(() => {})); const { result } = renderHook(() => useFacetsEntities({ enabled: true })); @@ -41,14 +71,11 @@ describe('useFacetsEntities', () => { }); it(`should return the owners`, async () => { - mockedGetEntityFacets.mockResolvedValue({ - facets: { - 'relations.ownedBy': [ - { count: 1, value: 'component:default/e2' }, - { count: 1, value: 'component:default/e1' }, - ], - }, - }); + const entityRefs = ['component:default/e1', 'component:default/e2']; + mockedGetEntityFacets.mockResolvedValue(facetsFromEntityRefs(entityRefs)); + mockedGetEntitiesByRefs.mockResolvedValue( + entitiesFromEntityRefs(entityRefs), + ); const { result } = renderHook(() => useFacetsEntities({ enabled: true })); @@ -74,20 +101,46 @@ describe('useFacetsEntities', () => { }); }); - it(`should return the owners sorted by namespace, name and kind`, async () => { + it(`should return the owners sorted by namespace, (displayName or title or name) and kind`, async () => { const entityRefs = [ 'group:namespace/team-b', 'component:default/c', 'group:default/a', 'component:default/a', 'component:default/b', + 'group:default/d', + 'group:default/e', ]; - mockedGetEntityFacets.mockResolvedValue({ - facets: { - 'relations.ownedBy': entityRefs.map(value => ({ count: 1, value })), + const enrichedEntities: { [key: string]: Entity } = { + 'group:default/a': { + apiVersion: 'backstage.io/v1beta1', + kind: 'group', + metadata: { name: 'a', namespace: 'default', title: 'My title A' }, }, - }); + 'component:default/a': { + apiVersion: 'backstage.io/v1beta1', + kind: 'component', + metadata: { name: 'a', namespace: 'default', title: 'My title B' }, + }, + 'group:default/d': { + apiVersion: 'backstage.io/v1beta1', + kind: 'group', + metadata: { name: 'd', namespace: 'default' }, + spec: { profile: { displayName: 'My display name D' } }, + }, + 'group:default/e': { + apiVersion: 'backstage.io/v1beta1', + kind: 'group', + metadata: { name: 'e', namespace: 'default' }, + spec: { profile: { displayName: 'My display name E' } }, + }, + }; + + mockedGetEntityFacets.mockResolvedValue(facetsFromEntityRefs(entityRefs)); + mockedGetEntitiesByRefs.mockResolvedValue( + entitiesFromEntityRefs(entityRefs, enrichedEntities), + ); const { result } = renderHook(() => useFacetsEntities({ enabled: true })); @@ -96,16 +149,6 @@ describe('useFacetsEntities', () => { expect(result.current[0]).toEqual({ value: { items: [ - { - apiVersion: 'backstage.io/v1beta1', - kind: 'component', - metadata: { name: 'a', namespace: 'default' }, - }, - { - apiVersion: 'backstage.io/v1beta1', - kind: 'group', - metadata: { name: 'a', namespace: 'default' }, - }, { apiVersion: 'backstage.io/v1beta1', kind: 'component', @@ -116,6 +159,36 @@ describe('useFacetsEntities', () => { kind: 'component', metadata: { name: 'c', namespace: 'default' }, }, + { + apiVersion: 'backstage.io/v1beta1', + kind: 'group', + metadata: { name: 'd', namespace: 'default' }, + spec: { profile: { displayName: 'My display name D' } }, + }, + { + apiVersion: 'backstage.io/v1beta1', + kind: 'group', + metadata: { name: 'e', namespace: 'default' }, + spec: { profile: { displayName: 'My display name E' } }, + }, + { + apiVersion: 'backstage.io/v1beta1', + kind: 'group', + metadata: { + name: 'a', + namespace: 'default', + title: 'My title A', + }, + }, + { + apiVersion: 'backstage.io/v1beta1', + kind: 'component', + metadata: { + name: 'a', + namespace: 'default', + title: 'My title B', + }, + }, { apiVersion: 'backstage.io/v1beta1', kind: 'group', @@ -137,11 +210,10 @@ describe('useFacetsEntities', () => { 'component:default/b', ]; - mockedGetEntityFacets.mockResolvedValue({ - facets: { - 'relations.ownedBy': entityRefs.map(value => ({ count: 1, value })), - }, - }); + mockedGetEntityFacets.mockResolvedValue(facetsFromEntityRefs(entityRefs)); + mockedGetEntitiesByRefs.mockResolvedValue( + entitiesFromEntityRefs(entityRefs), + ); const { result } = renderHook(() => useFacetsEntities({ enabled: true })); @@ -249,11 +321,25 @@ describe('useFacetsEntities', () => { 'component:default/nade', ]; - mockedGetEntityFacets.mockResolvedValue({ - facets: { - 'relations.ownedBy': entityRefs.map(value => ({ count: 1, value })), + mockedGetEntityFacets.mockResolvedValue(facetsFromEntityRefs(entityRefs)); + const enrichedEntities: { [key: string]: Entity } = { + 'group:default/go': { + apiVersion: 'backstage.io/v1beta1', + kind: 'group', + metadata: { name: 'go', namespace: 'default', title: 'Hidden Spider' }, }, - }); + 'component:default/lemon': { + apiVersion: 'backstage.io/v1beta1', + kind: 'component', + metadata: { name: 'lemon', namespace: 'default' }, + spec: { + profile: { displayName: 'Lemon Spider' }, + }, + }, + }; + mockedGetEntitiesByRefs.mockResolvedValue( + entitiesFromEntityRefs(entityRefs, enrichedEntities), + ); const { result } = renderHook(() => useFacetsEntities({ enabled: true })); @@ -262,6 +348,8 @@ describe('useFacetsEntities', () => { expect(result.current[0]).toEqual({ value: { items: [ + enrichedEntities['group:default/go'], + enrichedEntities['component:default/lemon'], { apiVersion: 'backstage.io/v1beta1', kind: 'component', diff --git a/plugins/catalog-react/src/components/EntityOwnerPicker/useFacetsEntities.ts b/plugins/catalog-react/src/components/EntityOwnerPicker/useFacetsEntities.ts index 33b96d2494..10a5c5a8c2 100644 --- a/plugins/catalog-react/src/components/EntityOwnerPicker/useFacetsEntities.ts +++ b/plugins/catalog-react/src/components/EntityOwnerPicker/useFacetsEntities.ts @@ -17,7 +17,8 @@ import { useApi } from '@backstage/core-plugin-api'; import useAsyncFn from 'react-use/esm/useAsyncFn'; import { catalogApiRef } from '../../api'; import { useState } from 'react'; -import { Entity, parseEntityRef } from '@backstage/catalog-model'; +import { Entity } from '@backstage/catalog-model'; +import get from 'lodash/get'; type FacetsCursor = { start: number; @@ -48,29 +49,37 @@ export function useFacetsEntities({ enabled }: { enabled: boolean }) { return []; } const facet = 'relations.ownedBy'; + const facetsResponse = await catalogApi.getEntityFacets({ + facets: [facet], + }); + const entityRefs = facetsResponse.facets[facet].map(e => e.value); + return catalogApi - .getEntityFacets({ facets: [facet] }) - .then(response => - response.facets[facet] - .map(e => e.value) - .map(ref => { - const { kind, name, namespace } = parseEntityRef(ref); - return { - apiVersion: 'backstage.io/v1beta1', - kind, - metadata: { name, namespace }, - }; - }) + .getEntitiesByRefs({ entityRefs }) + .then(resp => + resp.items + .filter(entity => entity !== undefined) + .map(entity => entity as Entity) .sort( (a, b) => (a.metadata.namespace || '').localeCompare( b.metadata.namespace || '', 'en-US', ) || - a.metadata.name.localeCompare(b.metadata.name, 'en-US') || + ( + get(a, 'spec.profile.displayName') || + a.metadata.title || + a.metadata.name + ).localeCompare( + get(b, 'spec.profile.displayName') || + b.metadata.title || + b.metadata.name, + 'en-US', + ) || a.kind.localeCompare(b.kind, 'en-US'), ), ) + .then(entities => entities) .catch(() => []); }); @@ -149,6 +158,10 @@ function filterEntity(text: string, entity: Entity) { return ( entity.kind.includes(normalizedText) || entity.metadata.namespace?.includes(normalizedText) || - entity.metadata.name.includes(normalizedText) + entity.metadata.name.includes(normalizedText) || + entity.metadata.title?.includes(normalizedText) || + (get(entity, 'spec.profile.displayName') as unknown as string)?.includes( + normalizedText, + ) ); } diff --git a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx index 8caaef3563..23c681a145 100644 --- a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx +++ b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx @@ -121,6 +121,26 @@ describe('DefaultCatalogPage', () => { ], }, })), + getEntitiesByRefs: jest.fn().mockImplementation(async () => ({ + items: [ + { + apiVersion: 'backstage.io/v1alpha1', + kind: 'Group', + metadata: { + name: 'not-tools', + namespace: 'default', + }, + }, + { + apiVersion: 'backstage.io/v1alpha1', + kind: 'Group', + metadata: { + name: 'tools', + namespace: 'default', + }, + }, + ], + })), queryEntities: jest .fn() .mockImplementation(async (request: QueryEntitiesInitialRequest) => { From 4df96964b2014956d8b0f1dcbc12a50be4ef925f Mon Sep 17 00:00:00 2001 From: bnechyporenko Date: Tue, 4 Jun 2024 10:54:22 +0200 Subject: [PATCH 374/387] Storing the serialized workspace into google cloud bucket Signed-off-by: bnechyporenko --- .../src/scaffolder/tasks/StorageTaskBroker.ts | 28 ++---- .../src/scaffolder/tasks/WorkspaceService.ts | 90 +++++++++++++++++++ 2 files changed, 96 insertions(+), 22 deletions(-) create mode 100644 plugins/scaffolder-backend/src/scaffolder/tasks/WorkspaceService.ts diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/StorageTaskBroker.ts b/plugins/scaffolder-backend/src/scaffolder/tasks/StorageTaskBroker.ts index 03a2833938..4177780e06 100644 --- a/plugins/scaffolder-backend/src/scaffolder/tasks/StorageTaskBroker.ts +++ b/plugins/scaffolder-backend/src/scaffolder/tasks/StorageTaskBroker.ts @@ -34,6 +34,7 @@ import { AuthService, BackstageCredentials, } from '@backstage/backend-plugin-api'; +import { DefaultWorkspaceService, WorkspaceService } from './WorkspaceService'; type TaskState = { checkpoints: { @@ -71,8 +72,8 @@ export class TaskManager implements TaskContext { storage, abortSignal, logger, + DefaultWorkspaceService.create(task, storage, config), auth, - config, ); agent.startTimeout(); return agent; @@ -84,8 +85,8 @@ export class TaskManager implements TaskContext { private readonly storage: TaskStore, private readonly signal: AbortSignal, private readonly logger: Logger, + private readonly workspaceService: WorkspaceService, private readonly auth?: AuthService, - private readonly config?: Config, ) {} get spec() { @@ -112,9 +113,7 @@ export class TaskManager implements TaskContext { taskId: string; targetPath: string; }): Promise { - if (this.isWorkspaceSerializationEnabled()) { - this.storage.rehydrateWorkspace?.(options); - } + await this.workspaceService.rehydrateWorkspace(options); } get done() { @@ -163,18 +162,11 @@ export class TaskManager implements TaskContext { } async serializeWorkspace?(options: { path: string }): Promise { - if (this.isWorkspaceSerializationEnabled()) { - await this.storage.serializeWorkspace?.({ - path: options.path, - taskId: this.task.taskId, - }); - } + await this.workspaceService.serializeWorkspace(options); } async cleanWorkspace?(): Promise { - if (this.isWorkspaceSerializationEnabled()) { - await this.storage.cleanWorkspace?.({ taskId: this.task.taskId }); - } + await this.workspaceService.cleanWorkspace(); } async complete( @@ -211,14 +203,6 @@ export class TaskManager implements TaskContext { }, 1000); } - private isWorkspaceSerializationEnabled(): boolean { - return ( - this.config?.getOptionalBoolean( - 'scaffolder.EXPERIMENTAL_workspaceSerialization', - ) ?? false - ); - } - async getInitiatorCredentials(): Promise { const secrets = this.task.secrets as InternalTaskSecrets; diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/WorkspaceService.ts b/plugins/scaffolder-backend/src/scaffolder/tasks/WorkspaceService.ts new file mode 100644 index 0000000000..15de15859d --- /dev/null +++ b/plugins/scaffolder-backend/src/scaffolder/tasks/WorkspaceService.ts @@ -0,0 +1,90 @@ +/* + * 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 { TaskStore } from './types'; + +import { CurrentClaimedTask } from './StorageTaskBroker'; +import { Config } from '@backstage/config'; + +type WorkspaceSerializationProvider = 'database' | 'googleCloudBucket'; + +export interface WorkspaceService { + serializeWorkspace(options: { path: string }): Promise; + + cleanWorkspace(): Promise; + + rehydrateWorkspace(options: { + taskId: string; + targetPath: string; + }): Promise; +} + +export class DefaultWorkspaceService implements WorkspaceService { + static create(task: CurrentClaimedTask, storage: TaskStore, config?: Config) { + return new DefaultWorkspaceService(task, storage, config); + } + + private constructor( + private readonly task: CurrentClaimedTask, + private readonly storage: TaskStore, + private readonly config?: Config, + ) {} + + public async serializeWorkspace(options: { path: string }): Promise { + if (this.isWorkspaceSerializationEnabled()) { + const provider = this.getWorkspaceSerializationProvider(); + switch (provider) { + case 'database': + this.storage.serializeWorkspace?.({ + path: options.path, + taskId: this.task.taskId, + }); + return; + case 'googleCloudBucket': + return; + default: + throw new Error( + `Workspace serialization provider ${provider} is not supported`, + ); + } + } + } + + public async rehydrateWorkspace(options: { + taskId: string; + targetPath: string; + }): Promise { + if (this.isWorkspaceSerializationEnabled()) { + this.storage.rehydrateWorkspace?.(options); + } + } + + public async cleanWorkspace(): Promise {} + + private isWorkspaceSerializationEnabled(): boolean { + return ( + this.config?.getOptionalBoolean( + 'scaffolder.EXPERIMENTAL_workspaceSerialization', + ) ?? false + ); + } + + private getWorkspaceSerializationProvider(): WorkspaceSerializationProvider { + return (this.config?.getOptionalString( + 'scaffolder.EXPERIMENTAL_workspaceSerializationProvider', + ) ?? 'database') as WorkspaceSerializationProvider; + } +} From 38875ed1c18cb8ec29720a95789411c5b986d819 Mon Sep 17 00:00:00 2001 From: bnechyporenko Date: Sun, 9 Jun 2024 23:03:25 +0200 Subject: [PATCH 375/387] Storing the serialized workspace into google cloud bucket Signed-off-by: bnechyporenko --- .../.eslintrc.js | 1 + .../CHANGELOG.md | 3 + .../README.md | 5 + .../catalog-info.yaml | 10 ++ .../knip-report.md | 2 + .../package.json | 55 +++++++++++ .../src/index.ts | 23 +++++ .../src/module.ts | 44 +++++++++ .../providers/GcpBucketWorkspaceProvider.ts | 93 +++++++++++++++++++ plugins/scaffolder-backend/config.d.ts | 9 ++ .../src/ScaffolderPlugin.ts | 10 ++ .../src/scaffolder/tasks/DatabaseTaskStore.ts | 5 +- .../tasks/DatabaseWorkspaceProvider.ts | 45 +++++++++ .../src/scaffolder/tasks/StorageTaskBroker.ts | 16 +++- .../src/scaffolder/tasks/WorkspaceService.ts | 64 +++++++------ .../scaffolder-backend/src/service/router.ts | 15 ++- plugins/scaffolder-node/api-report-alpha.md | 28 ++++++ plugins/scaffolder-node/api-report.md | 6 ++ plugins/scaffolder-node/package.json | 2 + plugins/scaffolder-node/src/alpha.ts | 44 ++++++++- plugins/scaffolder-node/src/tasks/index.ts | 2 + .../src}/tasks/serializer.test.ts | 0 .../src}/tasks/serializer.ts | 13 ++- yarn.lock | 43 +++++---- 24 files changed, 482 insertions(+), 56 deletions(-) create mode 100644 plugins/scaffolder-backend-module-gcp-bucket/.eslintrc.js create mode 100644 plugins/scaffolder-backend-module-gcp-bucket/CHANGELOG.md create mode 100644 plugins/scaffolder-backend-module-gcp-bucket/README.md create mode 100644 plugins/scaffolder-backend-module-gcp-bucket/catalog-info.yaml create mode 100644 plugins/scaffolder-backend-module-gcp-bucket/knip-report.md create mode 100644 plugins/scaffolder-backend-module-gcp-bucket/package.json create mode 100644 plugins/scaffolder-backend-module-gcp-bucket/src/index.ts create mode 100644 plugins/scaffolder-backend-module-gcp-bucket/src/module.ts create mode 100644 plugins/scaffolder-backend-module-gcp-bucket/src/providers/GcpBucketWorkspaceProvider.ts create mode 100644 plugins/scaffolder-backend/src/scaffolder/tasks/DatabaseWorkspaceProvider.ts rename plugins/{scaffolder-backend/src/scaffolder => scaffolder-node/src}/tasks/serializer.test.ts (100%) rename plugins/{scaffolder-backend/src/scaffolder => scaffolder-node/src}/tasks/serializer.ts (84%) diff --git a/plugins/scaffolder-backend-module-gcp-bucket/.eslintrc.js b/plugins/scaffolder-backend-module-gcp-bucket/.eslintrc.js new file mode 100644 index 0000000000..e2a53a6ad2 --- /dev/null +++ b/plugins/scaffolder-backend-module-gcp-bucket/.eslintrc.js @@ -0,0 +1 @@ +module.exports = require('@backstage/cli/config/eslint-factory')(__dirname); diff --git a/plugins/scaffolder-backend-module-gcp-bucket/CHANGELOG.md b/plugins/scaffolder-backend-module-gcp-bucket/CHANGELOG.md new file mode 100644 index 0000000000..b659b67db4 --- /dev/null +++ b/plugins/scaffolder-backend-module-gcp-bucket/CHANGELOG.md @@ -0,0 +1,3 @@ +# @backstage/plugin-scaffolder-backend-module-gcp-bucket + +## 0.0.1 diff --git a/plugins/scaffolder-backend-module-gcp-bucket/README.md b/plugins/scaffolder-backend-module-gcp-bucket/README.md new file mode 100644 index 0000000000..683dd70c01 --- /dev/null +++ b/plugins/scaffolder-backend-module-gcp-bucket/README.md @@ -0,0 +1,5 @@ +# @backstage/plugin-scaffolder-backend-module-gcp-bucket + +The GCP bucket module for [@backstage/plugin-scaffolder-backend](https://www.npmjs.com/package/@backstage/plugin-scaffolder-backend). + +_This plugin was created through the Backstage CLI_ diff --git a/plugins/scaffolder-backend-module-gcp-bucket/catalog-info.yaml b/plugins/scaffolder-backend-module-gcp-bucket/catalog-info.yaml new file mode 100644 index 0000000000..8fac6a1a2b --- /dev/null +++ b/plugins/scaffolder-backend-module-gcp-bucket/catalog-info.yaml @@ -0,0 +1,10 @@ +apiVersion: backstage.io/v1alpha1 +kind: Component +metadata: + name: backstage-plugin-scaffolder-backend-module-gcp-bucket + title: '@backstage/plugin-scaffolder-backend-module-gcp-bucket' + description: The GCP bucket module for @backstage/plugin-scaffolder-backend +spec: + lifecycle: experimental + type: backstage-backend-plugin-module + owner: maintainers diff --git a/plugins/scaffolder-backend-module-gcp-bucket/knip-report.md b/plugins/scaffolder-backend-module-gcp-bucket/knip-report.md new file mode 100644 index 0000000000..2661c35327 --- /dev/null +++ b/plugins/scaffolder-backend-module-gcp-bucket/knip-report.md @@ -0,0 +1,2 @@ +# Knip report + diff --git a/plugins/scaffolder-backend-module-gcp-bucket/package.json b/plugins/scaffolder-backend-module-gcp-bucket/package.json new file mode 100644 index 0000000000..426d43df16 --- /dev/null +++ b/plugins/scaffolder-backend-module-gcp-bucket/package.json @@ -0,0 +1,55 @@ +{ + "name": "@backstage/plugin-scaffolder-backend-module-gcp-bucket", + "version": "0.0.1", + "description": "The GCP Bucket module for @backstage/plugin-scaffolder-backend", + "backstage": { + "role": "backend-plugin-module" + }, + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/scaffolder-backend-module-gcp-bucket" + }, + "license": "Apache-2.0", + "exports": { + ".": "./src/index.ts", + "./package.json": "./package.json" + }, + "main": "src/index.ts", + "types": "src/index.ts", + "typesVersions": { + "*": { + "package.json": [ + "package.json" + ] + } + }, + "files": [ + "dist" + ], + "scripts": { + "build": "backstage-cli package build", + "clean": "backstage-cli package clean", + "lint": "backstage-cli package lint", + "prepack": "backstage-cli package prepack", + "postpack": "backstage-cli package postpack", + "start": "backstage-cli package start", + "test": "backstage-cli package test" + }, + "dependencies": { + "@backstage/backend-plugin-api": "workspace:^", + "@backstage/config": "workspace:^", + "@backstage/errors": "workspace:^", + "@backstage/integration": "workspace:^", + "@backstage/plugin-scaffolder-node": "workspace:^", + "@google-cloud/storage": "^7.11.2", + "raw-body": "^2.4.1" + }, + "devDependencies": { + "@backstage/cli": "workspace:^", + "@backstage/plugin-scaffolder-node-test-utils": "workspace:^" + } +} diff --git a/plugins/scaffolder-backend-module-gcp-bucket/src/index.ts b/plugins/scaffolder-backend-module-gcp-bucket/src/index.ts new file mode 100644 index 0000000000..05498e3edd --- /dev/null +++ b/plugins/scaffolder-backend-module-gcp-bucket/src/index.ts @@ -0,0 +1,23 @@ +/* + * 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. + */ + +/** + * A module for the scaffolder backend that lets you interact with azure + * + * @packageDocumentation + */ + +export { gcpBucketModule as default } from './module'; diff --git a/plugins/scaffolder-backend-module-gcp-bucket/src/module.ts b/plugins/scaffolder-backend-module-gcp-bucket/src/module.ts new file mode 100644 index 0000000000..3d48b7f708 --- /dev/null +++ b/plugins/scaffolder-backend-module-gcp-bucket/src/module.ts @@ -0,0 +1,44 @@ +/* + * Copyright 2024 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 { + coreServices, + createBackendModule, +} from '@backstage/backend-plugin-api'; +import { scaffolderWorkspaceProviderExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha'; +import { GcpBucketWorkspaceProvider } from './providers/GcpBucketWorkspaceProvider'; + +/** + * @public + * The Azure Module for the Scaffolder Backend + */ +export const gcpBucketModule = createBackendModule({ + moduleId: 'gcp-bucket', + pluginId: 'scaffolder', + register({ registerInit }) { + registerInit({ + deps: { + scaffolderWorkspaceProviders: scaffolderWorkspaceProviderExtensionPoint, + config: coreServices.rootConfig, + logger: coreServices.logger, + }, + async init({ config, logger, scaffolderWorkspaceProviders }) { + scaffolderWorkspaceProviders.addProviders({ + gcpBucket: GcpBucketWorkspaceProvider.create(logger, config), + }); + }, + }); + }, +}); diff --git a/plugins/scaffolder-backend-module-gcp-bucket/src/providers/GcpBucketWorkspaceProvider.ts b/plugins/scaffolder-backend-module-gcp-bucket/src/providers/GcpBucketWorkspaceProvider.ts new file mode 100644 index 0000000000..8c132e0374 --- /dev/null +++ b/plugins/scaffolder-backend-module-gcp-bucket/src/providers/GcpBucketWorkspaceProvider.ts @@ -0,0 +1,93 @@ +/* + * 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 { Config } from '@backstage/config'; +import { WorkspaceProvider } from '@backstage/plugin-scaffolder-node/alpha'; + +import getRawBody from 'raw-body'; +import { Storage } from '@google-cloud/storage'; +import { LoggerService } from '@backstage/backend-plugin-api'; + +import { + serializeWorkspace, + restoreWorkspace, +} from '@backstage/plugin-scaffolder-node'; + +export class GcpBucketWorkspaceProvider implements WorkspaceProvider { + static create(logger: LoggerService, config?: Config) { + return new GcpBucketWorkspaceProvider(new Storage(), logger, config); + } + + private constructor( + private readonly storage: Storage, + private readonly logger: LoggerService, + private readonly config?: Config, + ) {} + + public async cleanWorkspace(options: { taskId: string }): Promise { + await this.storage + .bucket(this.getGcpBucketName()) + .file(options.taskId) + .delete(); + } + + public async serializeWorkspace(options: { + path: string; + taskId: string; + }): Promise { + const fileCloud = this.storage + .bucket(this.getGcpBucketName()) + .file(options.taskId); + const workspace = await serializeWorkspace(options.path); + fileCloud.save( + workspace, + { + contentType: 'application/x-tar', + }, + err => { + if (err) { + this.logger.error( + `An error occurred during uploading the workspace of task ${ + options.taskId + } into GCP bucket ${this.getGcpBucketName()}`, + ); + } + }, + ); + } + + public async rehydrateWorkspace(options: { + taskId: string; + targetPath: string; + }): Promise { + const bucket = this.storage.bucket(this.getGcpBucketName()); + const file = bucket.file(options.taskId); + const workspace = getRawBody(file.createReadStream()); + await restoreWorkspace(options.targetPath, await workspace); + } + + private getGcpBucketName(): string { + const bucketName = this.config?.getOptionalString( + 'scaffolder.EXPERIMENTAL_gcpBucketName', + ); + if (!bucketName) { + throw new Error( + `You've missed to configure scaffolder.EXPERIMENTAL_gcpBucketName in app-config.yaml file`, + ); + } + return bucketName; + } +} diff --git a/plugins/scaffolder-backend/config.d.ts b/plugins/scaffolder-backend/config.d.ts index 754eedb55b..2e36922355 100644 --- a/plugins/scaffolder-backend/config.d.ts +++ b/plugins/scaffolder-backend/config.d.ts @@ -52,6 +52,15 @@ export interface Config { */ EXPERIMENTAL_workspaceSerialization?: boolean; + /** + * Sets the provider for workspace serialization. + * + * By default, it is your database. + */ + EXPERIMENTAL_workspaceSerializationProvider?: + | 'database' + | 'googleCloudBucket'; + /** * Every task which is in progress state and having a last heartbeat longer than a specified timeout is going to * be attempted to recover. diff --git a/plugins/scaffolder-backend/src/ScaffolderPlugin.ts b/plugins/scaffolder-backend/src/ScaffolderPlugin.ts index c83c6d437d..50e0dff9c0 100644 --- a/plugins/scaffolder-backend/src/ScaffolderPlugin.ts +++ b/plugins/scaffolder-backend/src/ScaffolderPlugin.ts @@ -33,6 +33,8 @@ import { scaffolderAutocompleteExtensionPoint, scaffolderTaskBrokerExtensionPoint, scaffolderTemplatingExtensionPoint, + scaffolderWorkspaceProviderExtensionPoint, + WorkspaceProvider, } from '@backstage/plugin-scaffolder-node/alpha'; import { createCatalogRegisterAction, @@ -84,10 +86,17 @@ export const scaffolderPlugin = createBackendPlugin({ }, }); +<<<<<<< HEAD const autocompleteHandlers: Record = {}; env.registerExtensionPoint(scaffolderAutocompleteExtensionPoint, { addAutocompleteProvider(provider) { autocompleteHandlers[provider.id] = provider.handler; +======= + const additionalWorkspaceProviders: Record = {}; + env.registerExtensionPoint(scaffolderWorkspaceProviderExtensionPoint, { + addProviders(provider) { + Object.assign(additionalWorkspaceProviders, provider); +>>>>>>> 801e5ff2007a (Storing the serialized workspace into google cloud bucket) }, }); @@ -172,6 +181,7 @@ export const scaffolderPlugin = createBackendPlugin({ discovery, permissions, autocompleteHandlers, + additionalWorkspaceProviders, }); httpRouter.use(router); }, diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/DatabaseTaskStore.ts b/plugins/scaffolder-backend/src/scaffolder/tasks/DatabaseTaskStore.ts index 9c95c11017..02b657032a 100644 --- a/plugins/scaffolder-backend/src/scaffolder/tasks/DatabaseTaskStore.ts +++ b/plugins/scaffolder-backend/src/scaffolder/tasks/DatabaseTaskStore.ts @@ -40,7 +40,10 @@ import { DateTime, Duration } from 'luxon'; import { TaskRecovery, TaskSpec } from '@backstage/plugin-scaffolder-common'; import { trimEventsTillLastRecovery } from './taskRecoveryHelper'; import { intervalFromNowTill } from './dbUtil'; -import { restoreWorkspace, serializeWorkspace } from './serializer'; +import { + restoreWorkspace, + serializeWorkspace, +} from '@backstage/plugin-scaffolder-node'; const migrationsDir = resolvePackagePath( '@backstage/plugin-scaffolder-backend', diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/DatabaseWorkspaceProvider.ts b/plugins/scaffolder-backend/src/scaffolder/tasks/DatabaseWorkspaceProvider.ts new file mode 100644 index 0000000000..69f90b3d7e --- /dev/null +++ b/plugins/scaffolder-backend/src/scaffolder/tasks/DatabaseWorkspaceProvider.ts @@ -0,0 +1,45 @@ +/* + * 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 { TaskStore } from './types'; + +import { WorkspaceProvider } from '@backstage/plugin-scaffolder-node/alpha'; + +export class DatabaseWorkspaceProvider implements WorkspaceProvider { + static create(storage: TaskStore) { + return new DatabaseWorkspaceProvider(storage); + } + + private constructor(private readonly storage: TaskStore) {} + + public async serializeWorkspace(options: { + path: string; + taskId: string; + }): Promise { + this.storage.serializeWorkspace?.(options); + } + + public async rehydrateWorkspace(options: { + taskId: string; + targetPath: string; + }): Promise { + return this.storage.rehydrateWorkspace?.(options); + } + + public async cleanWorkspace(options: { taskId: string }): Promise { + return this.storage.cleanWorkspace?.(options); + } +} diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/StorageTaskBroker.ts b/plugins/scaffolder-backend/src/scaffolder/tasks/StorageTaskBroker.ts index 4177780e06..f4946e6652 100644 --- a/plugins/scaffolder-backend/src/scaffolder/tasks/StorageTaskBroker.ts +++ b/plugins/scaffolder-backend/src/scaffolder/tasks/StorageTaskBroker.ts @@ -35,6 +35,7 @@ import { BackstageCredentials, } from '@backstage/backend-plugin-api'; import { DefaultWorkspaceService, WorkspaceService } from './WorkspaceService'; +import { WorkspaceProvider } from '@backstage/plugin-scaffolder-node/alpha'; type TaskState = { checkpoints: { @@ -66,13 +67,21 @@ export class TaskManager implements TaskContext { logger: Logger, auth?: AuthService, config?: Config, + additionalWorkspaceProviders?: Record, ) { + const workspaceService = DefaultWorkspaceService.create( + task, + storage, + additionalWorkspaceProviders, + config, + ); + const agent = new TaskManager( task, storage, abortSignal, logger, - DefaultWorkspaceService.create(task, storage, config), + workspaceService, auth, ); agent.startTimeout(); @@ -262,6 +271,10 @@ export class StorageTaskBroker implements TaskBroker { private readonly logger: Logger, private readonly config?: Config, private readonly auth?: AuthService, + private readonly additionalWorkspaceProviders?: Record< + string, + WorkspaceProvider + >, ) {} async list(options?: { @@ -350,6 +363,7 @@ export class StorageTaskBroker implements TaskBroker { this.logger, this.auth, this.config, + this.additionalWorkspaceProviders, ); } diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/WorkspaceService.ts b/plugins/scaffolder-backend/src/scaffolder/tasks/WorkspaceService.ts index 15de15859d..69deb1c333 100644 --- a/plugins/scaffolder-backend/src/scaffolder/tasks/WorkspaceService.ts +++ b/plugins/scaffolder-backend/src/scaffolder/tasks/WorkspaceService.ts @@ -1,5 +1,5 @@ /* - * Copyright 2021 The Backstage Authors + * Copyright 2024 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. @@ -14,12 +14,11 @@ * limitations under the License. */ -import { TaskStore } from './types'; - -import { CurrentClaimedTask } from './StorageTaskBroker'; import { Config } from '@backstage/config'; - -type WorkspaceSerializationProvider = 'database' | 'googleCloudBucket'; +import { CurrentClaimedTask } from './StorageTaskBroker'; +import { WorkspaceProvider } from '@backstage/plugin-scaffolder-node/alpha'; +import { DatabaseWorkspaceProvider } from './DatabaseWorkspaceProvider'; +import { TaskStore } from './types'; export interface WorkspaceService { serializeWorkspace(options: { path: string }): Promise; @@ -33,33 +32,40 @@ export interface WorkspaceService { } export class DefaultWorkspaceService implements WorkspaceService { - static create(task: CurrentClaimedTask, storage: TaskStore, config?: Config) { - return new DefaultWorkspaceService(task, storage, config); + static create( + task: CurrentClaimedTask, + storage: TaskStore, + additionalWorkspaceProviders?: Record, + config?: Config, + ) { + const workspaceProviderName = + config?.getOptionalString( + 'scaffolder.EXPERIMENTAL_workspaceSerializationProvider', + ) ?? 'database'; + const workspaceProvider = + additionalWorkspaceProviders?.[workspaceProviderName] ?? + DatabaseWorkspaceProvider.create(storage); + return new DefaultWorkspaceService(task, workspaceProvider); } private constructor( private readonly task: CurrentClaimedTask, - private readonly storage: TaskStore, + private readonly workspaceProvider: WorkspaceProvider, private readonly config?: Config, ) {} public async serializeWorkspace(options: { path: string }): Promise { if (this.isWorkspaceSerializationEnabled()) { - const provider = this.getWorkspaceSerializationProvider(); - switch (provider) { - case 'database': - this.storage.serializeWorkspace?.({ - path: options.path, - taskId: this.task.taskId, - }); - return; - case 'googleCloudBucket': - return; - default: - throw new Error( - `Workspace serialization provider ${provider} is not supported`, - ); - } + await this.workspaceProvider.serializeWorkspace({ + path: options.path, + taskId: this.task.taskId, + }); + } + } + + public async cleanWorkspace(): Promise { + if (this.isWorkspaceSerializationEnabled()) { + await this.workspaceProvider.cleanWorkspace({ taskId: this.task.taskId }); } } @@ -68,12 +74,10 @@ export class DefaultWorkspaceService implements WorkspaceService { targetPath: string; }): Promise { if (this.isWorkspaceSerializationEnabled()) { - this.storage.rehydrateWorkspace?.(options); + await this.workspaceProvider.rehydrateWorkspace(options); } } - public async cleanWorkspace(): Promise {} - private isWorkspaceSerializationEnabled(): boolean { return ( this.config?.getOptionalBoolean( @@ -81,10 +85,4 @@ export class DefaultWorkspaceService implements WorkspaceService { ) ?? false ); } - - private getWorkspaceSerializationProvider(): WorkspaceSerializationProvider { - return (this.config?.getOptionalString( - 'scaffolder.EXPERIMENTAL_workspaceSerializationProvider', - ) ?? 'database') as WorkspaceSerializationProvider; - } } diff --git a/plugins/scaffolder-backend/src/service/router.ts b/plugins/scaffolder-backend/src/service/router.ts index 3d5e49b400..769a042a78 100644 --- a/plugins/scaffolder-backend/src/service/router.ts +++ b/plugins/scaffolder-backend/src/service/router.ts @@ -94,7 +94,10 @@ import { } from '@backstage/plugin-auth-node'; import { InternalTaskSecrets } from '../scaffolder/tasks/types'; import { checkPermission } from '../util/checkPermissions'; -import { AutocompleteHandler } from '@backstage/plugin-scaffolder-node/alpha'; +import { + AutocompleteHandler, + WorkspaceProvider, +} from '@backstage/plugin-scaffolder-node/alpha'; /** * @@ -159,6 +162,7 @@ export interface RouterOptions { taskBroker?: TaskBroker; additionalTemplateFilters?: Record; additionalTemplateGlobals?: Record; + additionalWorkspaceProviders?: Record; permissions?: PermissionsService; permissionRules?: Array< TemplatePermissionRuleInput | ActionPermissionRuleInput @@ -272,6 +276,7 @@ export async function createRouter( scheduler, additionalTemplateFilters, additionalTemplateGlobals, + additionalWorkspaceProviders, permissions, permissionRules, discovery = HostDiscovery.fromConfig(config), @@ -297,7 +302,13 @@ export async function createRouter( let taskBroker: TaskBroker; if (!options.taskBroker) { const databaseTaskStore = await DatabaseTaskStore.create({ database }); - taskBroker = new StorageTaskBroker(databaseTaskStore, logger, config, auth); + taskBroker = new StorageTaskBroker( + databaseTaskStore, + logger, + config, + auth, + additionalWorkspaceProviders, + ); if (scheduler && databaseTaskStore.listStaleTasks) { await scheduler.scheduleTask({ diff --git a/plugins/scaffolder-node/api-report-alpha.md b/plugins/scaffolder-node/api-report-alpha.md index aae32d7203..9601d73215 100644 --- a/plugins/scaffolder-node/api-report-alpha.md +++ b/plugins/scaffolder-node/api-report-alpha.md @@ -68,5 +68,33 @@ export interface ScaffolderTemplatingExtensionPoint { // @alpha export const scaffolderTemplatingExtensionPoint: ExtensionPoint; +// @alpha +export interface ScaffolderWorkspaceProviderExtensionPoint { + // (undocumented) + addProviders(providers: Record): void; +} + +// @alpha +export const scaffolderWorkspaceProviderExtensionPoint: ExtensionPoint; + +// @alpha +export interface WorkspaceProvider { + // (undocumented) + cleanWorkspace(options: { taskId: string }): Promise; + // (undocumented) + rehydrateWorkspace(options: { + taskId: string; + targetPath: string; + }): Promise; + // (undocumented) + serializeWorkspace({ + path, + taskId, + }: { + path: string; + taskId: string; + }): Promise; +} + // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/scaffolder-node/api-report.md b/plugins/scaffolder-node/api-report.md index 66e8ccd678..9e9a31a991 100644 --- a/plugins/scaffolder-node/api-report.md +++ b/plugins/scaffolder-node/api-report.md @@ -256,6 +256,9 @@ export const parseRepoUrl: ( project?: string | undefined; }; +// @public +export const restoreWorkspace: (path: string, buffer?: Buffer) => Promise; + // @public (undocumented) export interface SerializedFile { // (undocumented) @@ -298,6 +301,9 @@ export type SerializedTaskEvent = { createdAt: string; }; +// @public +export const serializeWorkspace: (path: string) => Promise; + // @public export interface TaskBroker { // (undocumented) diff --git a/plugins/scaffolder-node/package.json b/plugins/scaffolder-node/package.json index ed3c016257..29dc022be1 100644 --- a/plugins/scaffolder-node/package.json +++ b/plugins/scaffolder-node/package.json @@ -61,11 +61,13 @@ "@backstage/integration": "workspace:^", "@backstage/plugin-scaffolder-common": "workspace:^", "@backstage/types": "workspace:^", + "concat-stream": "^2.0.0", "fs-extra": "^11.2.0", "globby": "^11.0.0", "isomorphic-git": "^1.23.0", "jsonschema": "^1.2.6", "p-limit": "^3.1.0", + "tar": "^6.1.12", "winston": "^3.2.1", "zod": "^3.22.4", "zod-to-json-schema": "^3.20.4" diff --git a/plugins/scaffolder-node/src/alpha.ts b/plugins/scaffolder-node/src/alpha.ts index ef4d5ab289..1bb013832c 100644 --- a/plugins/scaffolder-node/src/alpha.ts +++ b/plugins/scaffolder-node/src/alpha.ts @@ -67,6 +67,7 @@ export const scaffolderTaskBrokerExtensionPoint = */ export interface ScaffolderTemplatingExtensionPoint { addTemplateFilters(filters: Record): void; + addTemplateGlobals(filters: Record): void; } @@ -109,7 +110,7 @@ export interface ScaffolderAutocompleteExtensionPoint { } /** - * Extension point for adding template filters and globals. + * Extension point for adding autocomplete handlers. * * @alpha */ @@ -117,3 +118,44 @@ export const scaffolderAutocompleteExtensionPoint = createExtensionPoint({ id: 'scaffolder.autocomplete', }); + +/** + * This provider has to be implemented to make it possible to serialize/deserialize scaffolder workspace. + * + * @alpha + */ +export interface WorkspaceProvider { + serializeWorkspace({ + path, + taskId, + }: { + path: string; + taskId: string; + }): Promise; + + cleanWorkspace(options: { taskId: string }): Promise; + + rehydrateWorkspace(options: { + taskId: string; + targetPath: string; + }): Promise; +} + +/** + * Extension point for adding workspace providers. + * + * @alpha + */ +export interface ScaffolderWorkspaceProviderExtensionPoint { + addProviders(providers: Record): void; +} + +/** + * Extension point for adding workspace providers. + * + * @alpha + */ +export const scaffolderWorkspaceProviderExtensionPoint = + createExtensionPoint({ + id: 'scaffolder.workspace.provider', + }); diff --git a/plugins/scaffolder-node/src/tasks/index.ts b/plugins/scaffolder-node/src/tasks/index.ts index 930de95237..b1754a1f78 100644 --- a/plugins/scaffolder-node/src/tasks/index.ts +++ b/plugins/scaffolder-node/src/tasks/index.ts @@ -26,3 +26,5 @@ export type { TaskEventType, TaskStatus, } from './types'; + +export * from './serializer'; diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/serializer.test.ts b/plugins/scaffolder-node/src/tasks/serializer.test.ts similarity index 100% rename from plugins/scaffolder-backend/src/scaffolder/tasks/serializer.test.ts rename to plugins/scaffolder-node/src/tasks/serializer.test.ts diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/serializer.ts b/plugins/scaffolder-node/src/tasks/serializer.ts similarity index 84% rename from plugins/scaffolder-backend/src/scaffolder/tasks/serializer.ts rename to plugins/scaffolder-node/src/tasks/serializer.ts index 69c48fb769..f9a55a68f4 100644 --- a/plugins/scaffolder-backend/src/scaffolder/tasks/serializer.ts +++ b/plugins/scaffolder-node/src/tasks/serializer.ts @@ -20,13 +20,22 @@ import { promisify } from 'util'; import { pipeline as pipelineCb, Readable } from 'stream'; const pipeline = promisify(pipelineCb); - +/** + * Serializes provided path into tar archive + * + * @public + */ export const serializeWorkspace = async (path: string): Promise => { - return await new Promise(async resolve => { + return new Promise(async resolve => { await pipeline(tar.create({ cwd: path }, ['']), concatStream(resolve)); }); }; +/** + * Rehydrates the provided buffer of tar archive into the provide destination path + * + * @public + */ export const restoreWorkspace = async (path: string, buffer?: Buffer) => { if (buffer) { await pipeline( diff --git a/yarn.lock b/yarn.lock index e3cec34102..8a1a84b970 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6779,6 +6779,22 @@ __metadata: languageName: unknown linkType: soft +"@backstage/plugin-scaffolder-backend-module-gcp-bucket@workspace:plugins/scaffolder-backend-module-gcp-bucket": + version: 0.0.0-use.local + resolution: "@backstage/plugin-scaffolder-backend-module-gcp-bucket@workspace:plugins/scaffolder-backend-module-gcp-bucket" + dependencies: + "@backstage/backend-plugin-api": "workspace:^" + "@backstage/cli": "workspace:^" + "@backstage/config": "workspace:^" + "@backstage/errors": "workspace:^" + "@backstage/integration": "workspace:^" + "@backstage/plugin-scaffolder-node": "workspace:^" + "@backstage/plugin-scaffolder-node-test-utils": "workspace:^" + "@google-cloud/storage": ^7.11.2 + raw-body: ^2.4.1 + languageName: unknown + linkType: soft + "@backstage/plugin-scaffolder-backend-module-gerrit@workspace:^, @backstage/plugin-scaffolder-backend-module-gerrit@workspace:plugins/scaffolder-backend-module-gerrit": version: 0.0.0-use.local resolution: "@backstage/plugin-scaffolder-backend-module-gerrit@workspace:plugins/scaffolder-backend-module-gerrit" @@ -7042,11 +7058,13 @@ __metadata: "@backstage/integration": "workspace:^" "@backstage/plugin-scaffolder-common": "workspace:^" "@backstage/types": "workspace:^" + concat-stream: ^2.0.0 fs-extra: ^11.2.0 globby: ^11.0.0 isomorphic-git: ^1.23.0 jsonschema: ^1.2.6 p-limit: ^3.1.0 + tar: ^6.1.12 winston: ^3.2.1 zod: ^3.22.4 zod-to-json-schema: ^3.20.4 @@ -9354,9 +9372,9 @@ __metadata: languageName: node linkType: hard -"@google-cloud/storage@npm:^7.0.0": - version: 7.10.1 - resolution: "@google-cloud/storage@npm:7.10.1" +"@google-cloud/storage@npm:^7.0.0, @google-cloud/storage@npm:^7.11.2": + version: 7.11.2 + resolution: "@google-cloud/storage@npm:7.11.2" dependencies: "@google-cloud/paginator": ^5.0.0 "@google-cloud/projectify": ^4.0.0 @@ -9364,16 +9382,16 @@ __metadata: abort-controller: ^3.0.0 async-retry: ^1.3.3 duplexify: ^4.1.3 - ent: ^2.2.0 fast-xml-parser: ^4.3.0 gaxios: ^6.0.2 google-auth-library: ^9.6.3 + html-entities: ^2.5.2 mime: ^3.0.0 p-limit: ^3.0.1 retry-request: ^7.0.0 teeny-request: ^9.0.0 uuid: ^8.0.0 - checksum: 0605f8abf67cde98bc48b05c749b569416af821fcc3eb8ed3fac6dc5ade9c1f2f3210404c85e30525260ea4f34785d7436f7684e6eacd083613237669badff25 + checksum: 763cd560245006e11a060fdbd5edff5d6bfe22b0c0b06dfe88af43b7b14458598c00a71c4e1b079e9ab09096d7d262bdc27fa77d76a8969af0765f23c93f8405 languageName: node linkType: hard @@ -25281,13 +25299,6 @@ __metadata: languageName: node linkType: hard -"ent@npm:^2.2.0": - version: 2.2.0 - resolution: "ent@npm:2.2.0" - checksum: f588b5707d6fef36011ea10d530645912a69530a1eb0831f8708c498ac028363a7009f45cfadd28ceb4dafd9ac17ec15213f88d09ce239cd033cfe1328dd7d7d - languageName: node - linkType: hard - "entities@npm:^2.0.0": version: 2.2.0 resolution: "entities@npm:2.2.0" @@ -28821,10 +28832,10 @@ __metadata: languageName: node linkType: hard -"html-entities@npm:^2.1.0, html-entities@npm:^2.4.0": - version: 2.4.0 - resolution: "html-entities@npm:2.4.0" - checksum: 25bea32642ce9ebd0eedc4d24381883ecb0335ccb8ac26379a0958b9b16652fdbaa725d70207ce54a51db24103436a698a8e454397d3ba8ad81460224751f1dc +"html-entities@npm:^2.1.0, html-entities@npm:^2.4.0, html-entities@npm:^2.5.2": + version: 2.5.2 + resolution: "html-entities@npm:2.5.2" + checksum: b23f4a07d33d49ade1994069af4e13d31650e3fb62621e92ae10ecdf01d1a98065c78fd20fdc92b4c7881612210b37c275f2c9fba9777650ab0d6f2ceb3b99b6 languageName: node linkType: hard From 34e70a0fbcdd9c5b6d3880711cb19fb676d3daad Mon Sep 17 00:00:00 2001 From: bnechyporenko Date: Mon, 10 Jun 2024 08:44:03 +0200 Subject: [PATCH 376/387] Storing the serialized workspace into google cloud bucket Signed-off-by: bnechyporenko --- .../api-report.md | 11 +++++++++++ plugins/scaffolder-backend/api-report.md | 4 ++++ 2 files changed, 15 insertions(+) create mode 100644 plugins/scaffolder-backend-module-gcp-bucket/api-report.md diff --git a/plugins/scaffolder-backend-module-gcp-bucket/api-report.md b/plugins/scaffolder-backend-module-gcp-bucket/api-report.md new file mode 100644 index 0000000000..b7fbc1cec1 --- /dev/null +++ b/plugins/scaffolder-backend-module-gcp-bucket/api-report.md @@ -0,0 +1,11 @@ +## API Report File for "@backstage/plugin-scaffolder-backend-module-gcp-bucket" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import { BackendFeature } from '@backstage/backend-plugin-api'; + +// @public +const gcpBucketModule: () => BackendFeature; +export default gcpBucketModule; +``` diff --git a/plugins/scaffolder-backend/api-report.md b/plugins/scaffolder-backend/api-report.md index 4d75ed8421..a3beee2b53 100644 --- a/plugins/scaffolder-backend/api-report.md +++ b/plugins/scaffolder-backend/api-report.md @@ -64,6 +64,7 @@ import { TemplateFilter as TemplateFilter_2 } from '@backstage/plugin-scaffolder import { TemplateGlobal as TemplateGlobal_2 } from '@backstage/plugin-scaffolder-node'; import { TemplateParametersV1beta3 } from '@backstage/plugin-scaffolder-common'; import { UrlReader } from '@backstage/backend-common'; +import { WorkspaceProvider } from '@backstage/plugin-scaffolder-node/alpha'; import { ZodType } from 'zod'; import { ZodTypeDef } from 'zod'; @@ -477,6 +478,8 @@ export interface RouterOptions { // (undocumented) additionalTemplateGlobals?: Record; // (undocumented) + additionalWorkspaceProviders?: Record; + // (undocumented) auth?: AuthService; // (undocumented) autocompleteHandlers?: Record; @@ -559,6 +562,7 @@ export class TaskManager implements TaskContext_2 { logger: Logger, auth?: AuthService, config?: Config, + additionalWorkspaceProviders?: Record, ): TaskManager; // (undocumented) get createdBy(): string | undefined; From 80ca08eba2cdf560c25c09d1cd5833b923574a63 Mon Sep 17 00:00:00 2001 From: bnechyporenko Date: Tue, 11 Jun 2024 22:32:54 +0200 Subject: [PATCH 377/387] wip Signed-off-by: bnechyporenko --- .../scaffolder-backend/src/scaffolder/tasks/WorkspaceService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/WorkspaceService.ts b/plugins/scaffolder-backend/src/scaffolder/tasks/WorkspaceService.ts index 69deb1c333..ab424806bf 100644 --- a/plugins/scaffolder-backend/src/scaffolder/tasks/WorkspaceService.ts +++ b/plugins/scaffolder-backend/src/scaffolder/tasks/WorkspaceService.ts @@ -45,7 +45,7 @@ export class DefaultWorkspaceService implements WorkspaceService { const workspaceProvider = additionalWorkspaceProviders?.[workspaceProviderName] ?? DatabaseWorkspaceProvider.create(storage); - return new DefaultWorkspaceService(task, workspaceProvider); + return new DefaultWorkspaceService(task, workspaceProvider, config); } private constructor( From 182f6f78c1de4140a15fbf2718513dc87e010dcc Mon Sep 17 00:00:00 2001 From: bnechyporenko Date: Tue, 11 Jun 2024 23:03:42 +0200 Subject: [PATCH 378/387] wip Signed-off-by: bnechyporenko --- .../providers/GcpBucketWorkspaceProvider.ts | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/plugins/scaffolder-backend-module-gcp-bucket/src/providers/GcpBucketWorkspaceProvider.ts b/plugins/scaffolder-backend-module-gcp-bucket/src/providers/GcpBucketWorkspaceProvider.ts index 8c132e0374..5afa267041 100644 --- a/plugins/scaffolder-backend-module-gcp-bucket/src/providers/GcpBucketWorkspaceProvider.ts +++ b/plugins/scaffolder-backend-module-gcp-bucket/src/providers/GcpBucketWorkspaceProvider.ts @@ -38,10 +38,14 @@ export class GcpBucketWorkspaceProvider implements WorkspaceProvider { ) {} public async cleanWorkspace(options: { taskId: string }): Promise { - await this.storage + const file = this.storage .bucket(this.getGcpBucketName()) - .file(options.taskId) - .delete(); + .file(options.taskId); + + const result = await file.exists(); + if (result[0]) { + await file.delete(); + } } public async serializeWorkspace(options: { @@ -52,20 +56,19 @@ export class GcpBucketWorkspaceProvider implements WorkspaceProvider { .bucket(this.getGcpBucketName()) .file(options.taskId); const workspace = await serializeWorkspace(options.path); - fileCloud.save( - workspace, - { + try { + await fileCloud.save(workspace, { contentType: 'application/x-tar', - }, - err => { - if (err) { - this.logger.error( - `An error occurred during uploading the workspace of task ${ - options.taskId - } into GCP bucket ${this.getGcpBucketName()}`, - ); - } - }, + }); + } catch (err) { + this.logger.error( + `An error occurred during uploading the workspace of task ${ + options.taskId + } into GCP bucket ${this.getGcpBucketName()}`, + ); + } + this.logger.info( + `Workspace for task ${options.taskId} has been serialized.`, ); } @@ -75,8 +78,11 @@ export class GcpBucketWorkspaceProvider implements WorkspaceProvider { }): Promise { const bucket = this.storage.bucket(this.getGcpBucketName()); const file = bucket.file(options.taskId); - const workspace = getRawBody(file.createReadStream()); - await restoreWorkspace(options.targetPath, await workspace); + const result = await file.exists(); + if (result[0]) { + const workspace = getRawBody(file.createReadStream()); + await restoreWorkspace(options.targetPath, await workspace); + } } private getGcpBucketName(): string { From 0b52438d36160776339a5ac677b7f8b56c122dc9 Mon Sep 17 00:00:00 2001 From: bnechyporenko Date: Tue, 11 Jun 2024 23:13:13 +0200 Subject: [PATCH 379/387] wip Signed-off-by: bnechyporenko --- .changeset/tough-lies-mate.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changeset/tough-lies-mate.md diff --git a/.changeset/tough-lies-mate.md b/.changeset/tough-lies-mate.md new file mode 100644 index 0000000000..cbe228a65f --- /dev/null +++ b/.changeset/tough-lies-mate.md @@ -0,0 +1,7 @@ +--- +'@backstage/plugin-scaffolder-backend-module-gcp-bucket': minor +'@backstage/plugin-scaffolder-backend': minor +'@backstage/plugin-scaffolder-node': patch +--- + +Serialization of the scaffolder workspace into GCP bucket From f61f26d60899306adc7e41a110c478b42666bd12 Mon Sep 17 00:00:00 2001 From: bnechyporenko Date: Thu, 13 Jun 2024 18:02:07 +0200 Subject: [PATCH 380/387] wip Signed-off-by: bnechyporenko --- .changeset/tough-lies-mate.md | 2 +- .../CHANGELOG.md | 3 --- .../catalog-info.yaml | 10 ---------- .../.eslintrc.js | 0 plugins/scaffolder-backend-module-gcp/CHANGELOG.md | 3 +++ .../README.md | 2 +- .../api-report.md | 2 +- .../scaffolder-backend-module-gcp/catalog-info.yaml | 10 ++++++++++ .../knip-report.md | 0 .../package.json | 12 +++++++----- .../src/index.ts | 0 .../src/module.ts | 2 +- .../src/providers/GcpBucketWorkspaceProvider.ts | 0 plugins/scaffolder-backend/config.d.ts | 4 +--- yarn.lock | 8 ++++---- 15 files changed, 29 insertions(+), 29 deletions(-) delete mode 100644 plugins/scaffolder-backend-module-gcp-bucket/CHANGELOG.md delete mode 100644 plugins/scaffolder-backend-module-gcp-bucket/catalog-info.yaml rename plugins/{scaffolder-backend-module-gcp-bucket => scaffolder-backend-module-gcp}/.eslintrc.js (100%) create mode 100644 plugins/scaffolder-backend-module-gcp/CHANGELOG.md rename plugins/{scaffolder-backend-module-gcp-bucket => scaffolder-backend-module-gcp}/README.md (76%) rename plugins/{scaffolder-backend-module-gcp-bucket => scaffolder-backend-module-gcp}/api-report.md (95%) create mode 100644 plugins/scaffolder-backend-module-gcp/catalog-info.yaml rename plugins/{scaffolder-backend-module-gcp-bucket => scaffolder-backend-module-gcp}/knip-report.md (100%) rename plugins/{scaffolder-backend-module-gcp-bucket => scaffolder-backend-module-gcp}/package.json (80%) rename plugins/{scaffolder-backend-module-gcp-bucket => scaffolder-backend-module-gcp}/src/index.ts (100%) rename plugins/{scaffolder-backend-module-gcp-bucket => scaffolder-backend-module-gcp}/src/module.ts (98%) rename plugins/{scaffolder-backend-module-gcp-bucket => scaffolder-backend-module-gcp}/src/providers/GcpBucketWorkspaceProvider.ts (100%) diff --git a/.changeset/tough-lies-mate.md b/.changeset/tough-lies-mate.md index cbe228a65f..99edcf3616 100644 --- a/.changeset/tough-lies-mate.md +++ b/.changeset/tough-lies-mate.md @@ -1,5 +1,5 @@ --- -'@backstage/plugin-scaffolder-backend-module-gcp-bucket': minor +'@backstage/plugin-scaffolder-backend-module-gcp': minor '@backstage/plugin-scaffolder-backend': minor '@backstage/plugin-scaffolder-node': patch --- diff --git a/plugins/scaffolder-backend-module-gcp-bucket/CHANGELOG.md b/plugins/scaffolder-backend-module-gcp-bucket/CHANGELOG.md deleted file mode 100644 index b659b67db4..0000000000 --- a/plugins/scaffolder-backend-module-gcp-bucket/CHANGELOG.md +++ /dev/null @@ -1,3 +0,0 @@ -# @backstage/plugin-scaffolder-backend-module-gcp-bucket - -## 0.0.1 diff --git a/plugins/scaffolder-backend-module-gcp-bucket/catalog-info.yaml b/plugins/scaffolder-backend-module-gcp-bucket/catalog-info.yaml deleted file mode 100644 index 8fac6a1a2b..0000000000 --- a/plugins/scaffolder-backend-module-gcp-bucket/catalog-info.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: backstage.io/v1alpha1 -kind: Component -metadata: - name: backstage-plugin-scaffolder-backend-module-gcp-bucket - title: '@backstage/plugin-scaffolder-backend-module-gcp-bucket' - description: The GCP bucket module for @backstage/plugin-scaffolder-backend -spec: - lifecycle: experimental - type: backstage-backend-plugin-module - owner: maintainers diff --git a/plugins/scaffolder-backend-module-gcp-bucket/.eslintrc.js b/plugins/scaffolder-backend-module-gcp/.eslintrc.js similarity index 100% rename from plugins/scaffolder-backend-module-gcp-bucket/.eslintrc.js rename to plugins/scaffolder-backend-module-gcp/.eslintrc.js diff --git a/plugins/scaffolder-backend-module-gcp/CHANGELOG.md b/plugins/scaffolder-backend-module-gcp/CHANGELOG.md new file mode 100644 index 0000000000..f633c5b8cd --- /dev/null +++ b/plugins/scaffolder-backend-module-gcp/CHANGELOG.md @@ -0,0 +1,3 @@ +# @backstage/plugin-scaffolder-backend-module-gcp + +## 0.0.1 diff --git a/plugins/scaffolder-backend-module-gcp-bucket/README.md b/plugins/scaffolder-backend-module-gcp/README.md similarity index 76% rename from plugins/scaffolder-backend-module-gcp-bucket/README.md rename to plugins/scaffolder-backend-module-gcp/README.md index 683dd70c01..a9ce86cc6b 100644 --- a/plugins/scaffolder-backend-module-gcp-bucket/README.md +++ b/plugins/scaffolder-backend-module-gcp/README.md @@ -1,4 +1,4 @@ -# @backstage/plugin-scaffolder-backend-module-gcp-bucket +# @backstage/plugin-scaffolder-backend-module-gcp The GCP bucket module for [@backstage/plugin-scaffolder-backend](https://www.npmjs.com/package/@backstage/plugin-scaffolder-backend). diff --git a/plugins/scaffolder-backend-module-gcp-bucket/api-report.md b/plugins/scaffolder-backend-module-gcp/api-report.md similarity index 95% rename from plugins/scaffolder-backend-module-gcp-bucket/api-report.md rename to plugins/scaffolder-backend-module-gcp/api-report.md index b7fbc1cec1..4a3b9ebee4 100644 --- a/plugins/scaffolder-backend-module-gcp-bucket/api-report.md +++ b/plugins/scaffolder-backend-module-gcp/api-report.md @@ -1,4 +1,4 @@ -## API Report File for "@backstage/plugin-scaffolder-backend-module-gcp-bucket" +## API Report File for "@backstage/plugin-scaffolder-backend-module-gcp" > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). diff --git a/plugins/scaffolder-backend-module-gcp/catalog-info.yaml b/plugins/scaffolder-backend-module-gcp/catalog-info.yaml new file mode 100644 index 0000000000..175f9860d1 --- /dev/null +++ b/plugins/scaffolder-backend-module-gcp/catalog-info.yaml @@ -0,0 +1,10 @@ +apiVersion: backstage.io/v1alpha1 +kind: Component +metadata: + name: backstage-plugin-scaffolder-backend-module-gcp + title: '@backstage/plugin-scaffolder-backend-module-gcp' + description: The GCP module for @backstage/plugin-scaffolder-backend +spec: + lifecycle: experimental + type: backstage-backend-plugin-module + owner: maintainers diff --git a/plugins/scaffolder-backend-module-gcp-bucket/knip-report.md b/plugins/scaffolder-backend-module-gcp/knip-report.md similarity index 100% rename from plugins/scaffolder-backend-module-gcp-bucket/knip-report.md rename to plugins/scaffolder-backend-module-gcp/knip-report.md diff --git a/plugins/scaffolder-backend-module-gcp-bucket/package.json b/plugins/scaffolder-backend-module-gcp/package.json similarity index 80% rename from plugins/scaffolder-backend-module-gcp-bucket/package.json rename to plugins/scaffolder-backend-module-gcp/package.json index 426d43df16..9cb86801ef 100644 --- a/plugins/scaffolder-backend-module-gcp-bucket/package.json +++ b/plugins/scaffolder-backend-module-gcp/package.json @@ -1,9 +1,11 @@ { - "name": "@backstage/plugin-scaffolder-backend-module-gcp-bucket", - "version": "0.0.1", + "name": "@backstage/plugin-scaffolder-backend-module-gcp", + "version": "0.0.1-next.1", "description": "The GCP Bucket module for @backstage/plugin-scaffolder-backend", "backstage": { - "role": "backend-plugin-module" + "role": "backend-plugin-module", + "pluginId": "scaffolder", + "pluginPackage": "@backstage/plugin-scaffolder-backend" }, "publishConfig": { "access": "public" @@ -11,7 +13,7 @@ "repository": { "type": "git", "url": "https://github.com/backstage/backstage", - "directory": "plugins/scaffolder-backend-module-gcp-bucket" + "directory": "plugins/scaffolder-backend-module-gcp" }, "license": "Apache-2.0", "exports": { @@ -45,7 +47,7 @@ "@backstage/errors": "workspace:^", "@backstage/integration": "workspace:^", "@backstage/plugin-scaffolder-node": "workspace:^", - "@google-cloud/storage": "^7.11.2", + "@google-cloud/storage": "^7.0.0", "raw-body": "^2.4.1" }, "devDependencies": { diff --git a/plugins/scaffolder-backend-module-gcp-bucket/src/index.ts b/plugins/scaffolder-backend-module-gcp/src/index.ts similarity index 100% rename from plugins/scaffolder-backend-module-gcp-bucket/src/index.ts rename to plugins/scaffolder-backend-module-gcp/src/index.ts diff --git a/plugins/scaffolder-backend-module-gcp-bucket/src/module.ts b/plugins/scaffolder-backend-module-gcp/src/module.ts similarity index 98% rename from plugins/scaffolder-backend-module-gcp-bucket/src/module.ts rename to plugins/scaffolder-backend-module-gcp/src/module.ts index 3d48b7f708..0f2f37f5af 100644 --- a/plugins/scaffolder-backend-module-gcp-bucket/src/module.ts +++ b/plugins/scaffolder-backend-module-gcp/src/module.ts @@ -25,7 +25,7 @@ import { GcpBucketWorkspaceProvider } from './providers/GcpBucketWorkspaceProvid * The Azure Module for the Scaffolder Backend */ export const gcpBucketModule = createBackendModule({ - moduleId: 'gcp-bucket', + moduleId: 'gcp', pluginId: 'scaffolder', register({ registerInit }) { registerInit({ diff --git a/plugins/scaffolder-backend-module-gcp-bucket/src/providers/GcpBucketWorkspaceProvider.ts b/plugins/scaffolder-backend-module-gcp/src/providers/GcpBucketWorkspaceProvider.ts similarity index 100% rename from plugins/scaffolder-backend-module-gcp-bucket/src/providers/GcpBucketWorkspaceProvider.ts rename to plugins/scaffolder-backend-module-gcp/src/providers/GcpBucketWorkspaceProvider.ts diff --git a/plugins/scaffolder-backend/config.d.ts b/plugins/scaffolder-backend/config.d.ts index 2e36922355..f6b9522575 100644 --- a/plugins/scaffolder-backend/config.d.ts +++ b/plugins/scaffolder-backend/config.d.ts @@ -57,9 +57,7 @@ export interface Config { * * By default, it is your database. */ - EXPERIMENTAL_workspaceSerializationProvider?: - | 'database' - | 'googleCloudBucket'; + EXPERIMENTAL_workspaceSerializationProvider?: string; /** * Every task which is in progress state and having a last heartbeat longer than a specified timeout is going to diff --git a/yarn.lock b/yarn.lock index 8a1a84b970..3671d290fc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6779,9 +6779,9 @@ __metadata: languageName: unknown linkType: soft -"@backstage/plugin-scaffolder-backend-module-gcp-bucket@workspace:plugins/scaffolder-backend-module-gcp-bucket": +"@backstage/plugin-scaffolder-backend-module-gcp@workspace:plugins/scaffolder-backend-module-gcp": version: 0.0.0-use.local - resolution: "@backstage/plugin-scaffolder-backend-module-gcp-bucket@workspace:plugins/scaffolder-backend-module-gcp-bucket" + resolution: "@backstage/plugin-scaffolder-backend-module-gcp@workspace:plugins/scaffolder-backend-module-gcp" dependencies: "@backstage/backend-plugin-api": "workspace:^" "@backstage/cli": "workspace:^" @@ -6790,7 +6790,7 @@ __metadata: "@backstage/integration": "workspace:^" "@backstage/plugin-scaffolder-node": "workspace:^" "@backstage/plugin-scaffolder-node-test-utils": "workspace:^" - "@google-cloud/storage": ^7.11.2 + "@google-cloud/storage": ^7.0.0 raw-body: ^2.4.1 languageName: unknown linkType: soft @@ -9372,7 +9372,7 @@ __metadata: languageName: node linkType: hard -"@google-cloud/storage@npm:^7.0.0, @google-cloud/storage@npm:^7.11.2": +"@google-cloud/storage@npm:^7.0.0": version: 7.11.2 resolution: "@google-cloud/storage@npm:7.11.2" dependencies: From c1ce17501144d5a74e70762ca9728b61d57aa33e Mon Sep 17 00:00:00 2001 From: bnechyporenko Date: Sun, 16 Jun 2024 10:15:20 +0200 Subject: [PATCH 381/387] wip Signed-off-by: bnechyporenko --- .../scaffolder-backend-module-gcp/config.d.ts | 25 +++++++++++++++++++ .../package.json | 3 ++- .../providers/GcpBucketWorkspaceProvider.ts | 4 +-- 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 plugins/scaffolder-backend-module-gcp/config.d.ts diff --git a/plugins/scaffolder-backend-module-gcp/config.d.ts b/plugins/scaffolder-backend-module-gcp/config.d.ts new file mode 100644 index 0000000000..acd3eebdd9 --- /dev/null +++ b/plugins/scaffolder-backend-module-gcp/config.d.ts @@ -0,0 +1,25 @@ +/* + * Copyright 2020 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. + */ + +export interface Config { + /** Configuration options for the scaffolder plugin */ + scaffolder?: { + /** + * Sets GCP bucket name to store serialized workspace for scaffolder tasks. + */ + EXPERIMENTAL_workspaceSerializationGcpBucketName?: string; + }; +} diff --git a/plugins/scaffolder-backend-module-gcp/package.json b/plugins/scaffolder-backend-module-gcp/package.json index 9cb86801ef..9d5efa2891 100644 --- a/plugins/scaffolder-backend-module-gcp/package.json +++ b/plugins/scaffolder-backend-module-gcp/package.json @@ -30,7 +30,8 @@ } }, "files": [ - "dist" + "dist", + "config.d.ts" ], "scripts": { "build": "backstage-cli package build", diff --git a/plugins/scaffolder-backend-module-gcp/src/providers/GcpBucketWorkspaceProvider.ts b/plugins/scaffolder-backend-module-gcp/src/providers/GcpBucketWorkspaceProvider.ts index 5afa267041..cd2beb2073 100644 --- a/plugins/scaffolder-backend-module-gcp/src/providers/GcpBucketWorkspaceProvider.ts +++ b/plugins/scaffolder-backend-module-gcp/src/providers/GcpBucketWorkspaceProvider.ts @@ -87,11 +87,11 @@ export class GcpBucketWorkspaceProvider implements WorkspaceProvider { private getGcpBucketName(): string { const bucketName = this.config?.getOptionalString( - 'scaffolder.EXPERIMENTAL_gcpBucketName', + 'scaffolder.EXPERIMENTAL_workspaceSerializationGcpBucketName', ); if (!bucketName) { throw new Error( - `You've missed to configure scaffolder.EXPERIMENTAL_gcpBucketName in app-config.yaml file`, + `You've missed to configure scaffolder.EXPERIMENTAL_workspaceSerializationGcpBucketName in app-config.yaml file`, ); } return bucketName; From e27d30c99c64356d68e70bd60049d255f88e6c92 Mon Sep 17 00:00:00 2001 From: bnechyporenko Date: Sun, 16 Jun 2024 11:45:48 +0200 Subject: [PATCH 382/387] wip Signed-off-by: bnechyporenko --- .../src/scaffolder/tasks/NunjucksWorkflowRunner.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/NunjucksWorkflowRunner.ts b/plugins/scaffolder-backend/src/scaffolder/tasks/NunjucksWorkflowRunner.ts index e9b1d78e36..3b88fd0f10 100644 --- a/plugins/scaffolder-backend/src/scaffolder/tasks/NunjucksWorkflowRunner.ts +++ b/plugins/scaffolder-backend/src/scaffolder/tasks/NunjucksWorkflowRunner.ts @@ -443,7 +443,6 @@ export class NunjucksWorkflowRunner implements WorkflowRunner { throw new Error(`Step ${step.name} has been cancelled.`); } - await task.cleanWorkspace?.(); await stepTrack.markSuccessful(); } catch (err) { await taskTrack.markFailed(step, err); @@ -513,6 +512,7 @@ export class NunjucksWorkflowRunner implements WorkflowRunner { return { output }; } finally { if (workspacePath) { + await task.cleanWorkspace?.(); await fs.remove(workspacePath); } } From d9a907b062fb018ae976c548ba9d5c2cd8876128 Mon Sep 17 00:00:00 2001 From: bnechyporenko Date: Mon, 24 Jun 2024 20:14:34 +0200 Subject: [PATCH 383/387] wip Signed-off-by: bnechyporenko --- plugins/scaffolder-backend-module-gcp/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/scaffolder-backend-module-gcp/package.json b/plugins/scaffolder-backend-module-gcp/package.json index 9d5efa2891..7fb3e08b34 100644 --- a/plugins/scaffolder-backend-module-gcp/package.json +++ b/plugins/scaffolder-backend-module-gcp/package.json @@ -54,5 +54,6 @@ "devDependencies": { "@backstage/cli": "workspace:^", "@backstage/plugin-scaffolder-node-test-utils": "workspace:^" - } + }, + "configSchema": "config.d.ts" } From a190944647549e0444902e267c0474ef45ed0879 Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 25 Jun 2024 10:25:52 +0200 Subject: [PATCH 384/387] chore: fixing api reports Signed-off-by: blam --- plugins/scaffolder-backend-module-gcp/api-report.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/scaffolder-backend-module-gcp/api-report.md b/plugins/scaffolder-backend-module-gcp/api-report.md index 4a3b9ebee4..d75a6ce155 100644 --- a/plugins/scaffolder-backend-module-gcp/api-report.md +++ b/plugins/scaffolder-backend-module-gcp/api-report.md @@ -3,9 +3,9 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureCompat } from '@backstage/backend-plugin-api'; // @public -const gcpBucketModule: () => BackendFeature; +const gcpBucketModule: BackendFeatureCompat; export default gcpBucketModule; ``` From 47b7ac5adefd8c9039e12d3850b5e0c500286930 Mon Sep 17 00:00:00 2001 From: bnechyporenko Date: Tue, 25 Jun 2024 11:43:45 +0200 Subject: [PATCH 385/387] wip Signed-off-by: bnechyporenko --- .../providers/GcpBucketWorkspaceProvider.ts | 6 ++--- .../src/scaffolder/tasks/DatabaseTaskStore.ts | 7 ++++-- .../src/tasks/serializer.test.ts | 7 ++++-- .../scaffolder-node/src/tasks/serializer.ts | 23 ++++++++++++++----- 4 files changed, 30 insertions(+), 13 deletions(-) diff --git a/plugins/scaffolder-backend-module-gcp/src/providers/GcpBucketWorkspaceProvider.ts b/plugins/scaffolder-backend-module-gcp/src/providers/GcpBucketWorkspaceProvider.ts index cd2beb2073..3d269f690e 100644 --- a/plugins/scaffolder-backend-module-gcp/src/providers/GcpBucketWorkspaceProvider.ts +++ b/plugins/scaffolder-backend-module-gcp/src/providers/GcpBucketWorkspaceProvider.ts @@ -55,7 +55,7 @@ export class GcpBucketWorkspaceProvider implements WorkspaceProvider { const fileCloud = this.storage .bucket(this.getGcpBucketName()) .file(options.taskId); - const workspace = await serializeWorkspace(options.path); + const { contents: workspace } = await serializeWorkspace(options); try { await fileCloud.save(workspace, { contentType: 'application/x-tar', @@ -80,8 +80,8 @@ export class GcpBucketWorkspaceProvider implements WorkspaceProvider { const file = bucket.file(options.taskId); const result = await file.exists(); if (result[0]) { - const workspace = getRawBody(file.createReadStream()); - await restoreWorkspace(options.targetPath, await workspace); + const workspace = await getRawBody(file.createReadStream()); + await restoreWorkspace({ path: options.targetPath, buffer: workspace }); } } diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/DatabaseTaskStore.ts b/plugins/scaffolder-backend/src/scaffolder/tasks/DatabaseTaskStore.ts index 02b657032a..a4447c5dc0 100644 --- a/plugins/scaffolder-backend/src/scaffolder/tasks/DatabaseTaskStore.ts +++ b/plugins/scaffolder-backend/src/scaffolder/tasks/DatabaseTaskStore.ts @@ -520,7 +520,10 @@ export class DatabaseTaskStore implements TaskStore { .where({ id: options.taskId }) .select('workspace'); - await restoreWorkspace(options.targetPath, result.workspace); + await restoreWorkspace({ + path: options.targetPath, + buffer: result.workspace, + }); } async cleanWorkspace({ taskId }: { taskId: string }): Promise { @@ -537,7 +540,7 @@ export class DatabaseTaskStore implements TaskStore { await this.db('tasks') .where({ id: options.taskId }) .update({ - workspace: await serializeWorkspace(options.path), + workspace: (await serializeWorkspace(options)).contents, }); } } diff --git a/plugins/scaffolder-node/src/tasks/serializer.test.ts b/plugins/scaffolder-node/src/tasks/serializer.test.ts index bec5398e28..a0ddfa624d 100644 --- a/plugins/scaffolder-node/src/tasks/serializer.test.ts +++ b/plugins/scaffolder-node/src/tasks/serializer.test.ts @@ -72,8 +72,11 @@ describe('serializer', () => { const restoredWorkspaceDir = createMockDirectory(); it('should be able to archive and restore the workspace', async () => { - const workspaceBuffer = await serializeWorkspace(workspaceDir.path); - await restoreWorkspace(restoredWorkspaceDir.path, workspaceBuffer); + const workspaceBuffer = await serializeWorkspace(workspaceDir); + await restoreWorkspace({ + path: restoredWorkspaceDir.path, + buffer: workspaceBuffer.contents, + }); expect( fs.existsSync(`${restoredWorkspaceDir.path}/\$\{ESCAPE_ME\}.txt`), diff --git a/plugins/scaffolder-node/src/tasks/serializer.ts b/plugins/scaffolder-node/src/tasks/serializer.ts index f9a55a68f4..baf1b42157 100644 --- a/plugins/scaffolder-node/src/tasks/serializer.ts +++ b/plugins/scaffolder-node/src/tasks/serializer.ts @@ -23,20 +23,31 @@ const pipeline = promisify(pipelineCb); /** * Serializes provided path into tar archive * - * @public + * @alpha */ -export const serializeWorkspace = async (path: string): Promise => { - return new Promise(async resolve => { - await pipeline(tar.create({ cwd: path }, ['']), concatStream(resolve)); +export const serializeWorkspace = async (opts: { + path: string; +}): Promise<{ contents: Buffer }> => { + return new Promise<{ contents: Buffer }>(async resolve => { + await pipeline( + tar.create({ cwd: opts.path }, ['']), + concatStream(buffer => { + return resolve({ contents: buffer }); + }), + ); }); }; /** * Rehydrates the provided buffer of tar archive into the provide destination path * - * @public + * @alpha */ -export const restoreWorkspace = async (path: string, buffer?: Buffer) => { +export const restoreWorkspace = async (opts: { + path: string; + buffer?: Buffer; +}): Promise => { + const { buffer, path } = opts; if (buffer) { await pipeline( Readable.from(buffer), From b61503b2ba0ca8c75045db71713611586c143cec Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 25 Jun 2024 14:41:42 +0200 Subject: [PATCH 386/387] feat: fix up the branch Signed-off-by: blam --- .../src/providers/GcpBucketWorkspaceProvider.ts | 2 +- .../scaffolder-backend/src/ScaffolderPlugin.ts | 6 +++--- .../src/scaffolder/tasks/DatabaseTaskStore.ts | 2 +- plugins/scaffolder-node/api-report-alpha.md | 13 +++++++++++++ plugins/scaffolder-node/api-report.md | 6 ------ plugins/scaffolder-node/src/alpha.ts | 2 ++ plugins/scaffolder-node/src/tasks/alpha.ts | 16 ++++++++++++++++ plugins/scaffolder-node/src/tasks/index.ts | 2 -- 8 files changed, 36 insertions(+), 13 deletions(-) create mode 100644 plugins/scaffolder-node/src/tasks/alpha.ts diff --git a/plugins/scaffolder-backend-module-gcp/src/providers/GcpBucketWorkspaceProvider.ts b/plugins/scaffolder-backend-module-gcp/src/providers/GcpBucketWorkspaceProvider.ts index 3d269f690e..3529073648 100644 --- a/plugins/scaffolder-backend-module-gcp/src/providers/GcpBucketWorkspaceProvider.ts +++ b/plugins/scaffolder-backend-module-gcp/src/providers/GcpBucketWorkspaceProvider.ts @@ -24,7 +24,7 @@ import { LoggerService } from '@backstage/backend-plugin-api'; import { serializeWorkspace, restoreWorkspace, -} from '@backstage/plugin-scaffolder-node'; +} from '@backstage/plugin-scaffolder-node/alpha'; export class GcpBucketWorkspaceProvider implements WorkspaceProvider { static create(logger: LoggerService, config?: Config) { diff --git a/plugins/scaffolder-backend/src/ScaffolderPlugin.ts b/plugins/scaffolder-backend/src/ScaffolderPlugin.ts index 50e0dff9c0..27b4f6b196 100644 --- a/plugins/scaffolder-backend/src/ScaffolderPlugin.ts +++ b/plugins/scaffolder-backend/src/ScaffolderPlugin.ts @@ -86,17 +86,17 @@ export const scaffolderPlugin = createBackendPlugin({ }, }); -<<<<<<< HEAD const autocompleteHandlers: Record = {}; env.registerExtensionPoint(scaffolderAutocompleteExtensionPoint, { addAutocompleteProvider(provider) { autocompleteHandlers[provider.id] = provider.handler; -======= + }, + }); + const additionalWorkspaceProviders: Record = {}; env.registerExtensionPoint(scaffolderWorkspaceProviderExtensionPoint, { addProviders(provider) { Object.assign(additionalWorkspaceProviders, provider); ->>>>>>> 801e5ff2007a (Storing the serialized workspace into google cloud bucket) }, }); diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/DatabaseTaskStore.ts b/plugins/scaffolder-backend/src/scaffolder/tasks/DatabaseTaskStore.ts index a4447c5dc0..fe62572af9 100644 --- a/plugins/scaffolder-backend/src/scaffolder/tasks/DatabaseTaskStore.ts +++ b/plugins/scaffolder-backend/src/scaffolder/tasks/DatabaseTaskStore.ts @@ -43,7 +43,7 @@ import { intervalFromNowTill } from './dbUtil'; import { restoreWorkspace, serializeWorkspace, -} from '@backstage/plugin-scaffolder-node'; +} from '@backstage/plugin-scaffolder-node/alpha'; const migrationsDir = resolvePackagePath( '@backstage/plugin-scaffolder-backend', diff --git a/plugins/scaffolder-node/api-report-alpha.md b/plugins/scaffolder-node/api-report-alpha.md index 9601d73215..c9b8130f0e 100644 --- a/plugins/scaffolder-node/api-report-alpha.md +++ b/plugins/scaffolder-node/api-report-alpha.md @@ -3,6 +3,8 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// + import { ExtensionPoint } from '@backstage/backend-plugin-api'; import { TaskBroker } from '@backstage/plugin-scaffolder-node'; import { TemplateAction } from '@backstage/plugin-scaffolder-node'; @@ -24,6 +26,12 @@ export type AutocompleteHandler = ({ }[]; }>; +// @alpha +export const restoreWorkspace: (opts: { + path: string; + buffer?: Buffer; +}) => Promise; + // @alpha export interface ScaffolderActionsExtensionPoint { // (undocumented) @@ -77,6 +85,11 @@ export interface ScaffolderWorkspaceProviderExtensionPoint { // @alpha export const scaffolderWorkspaceProviderExtensionPoint: ExtensionPoint; +// @alpha +export const serializeWorkspace: (opts: { path: string }) => Promise<{ + contents: Buffer; +}>; + // @alpha export interface WorkspaceProvider { // (undocumented) diff --git a/plugins/scaffolder-node/api-report.md b/plugins/scaffolder-node/api-report.md index 9e9a31a991..66e8ccd678 100644 --- a/plugins/scaffolder-node/api-report.md +++ b/plugins/scaffolder-node/api-report.md @@ -256,9 +256,6 @@ export const parseRepoUrl: ( project?: string | undefined; }; -// @public -export const restoreWorkspace: (path: string, buffer?: Buffer) => Promise; - // @public (undocumented) export interface SerializedFile { // (undocumented) @@ -301,9 +298,6 @@ export type SerializedTaskEvent = { createdAt: string; }; -// @public -export const serializeWorkspace: (path: string) => Promise; - // @public export interface TaskBroker { // (undocumented) diff --git a/plugins/scaffolder-node/src/alpha.ts b/plugins/scaffolder-node/src/alpha.ts index 1bb013832c..6a0e34faf7 100644 --- a/plugins/scaffolder-node/src/alpha.ts +++ b/plugins/scaffolder-node/src/alpha.ts @@ -22,6 +22,8 @@ import { TaskBroker, } from '@backstage/plugin-scaffolder-node'; +export * from './tasks/alpha'; + /** * Extension point for managing scaffolder actions. * diff --git a/plugins/scaffolder-node/src/tasks/alpha.ts b/plugins/scaffolder-node/src/tasks/alpha.ts new file mode 100644 index 0000000000..fb6b09026c --- /dev/null +++ b/plugins/scaffolder-node/src/tasks/alpha.ts @@ -0,0 +1,16 @@ +/* + * Copyright 2024 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. + */ +export * from './serializer'; diff --git a/plugins/scaffolder-node/src/tasks/index.ts b/plugins/scaffolder-node/src/tasks/index.ts index b1754a1f78..930de95237 100644 --- a/plugins/scaffolder-node/src/tasks/index.ts +++ b/plugins/scaffolder-node/src/tasks/index.ts @@ -26,5 +26,3 @@ export type { TaskEventType, TaskStatus, } from './types'; - -export * from './serializer'; From f03d12aff20b7f536a76f664fe53f9bcd6ffdcc3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 25 Jun 2024 13:05:56 +0000 Subject: [PATCH 387/387] Version Packages (next) --- .changeset/create-app-1719320674.md | 5 + .changeset/pre.json | 48 +- docs/releases/v1.29.0-next.0-changelog.md | 2161 +++++++++++++++++ package.json | 2 +- packages/app-defaults/CHANGELOG.md | 11 + packages/app-defaults/package.json | 2 +- packages/app-next-example-plugin/CHANGELOG.md | 8 + packages/app-next-example-plugin/package.json | 2 +- packages/app-next/CHANGELOG.md | 43 + packages/app-next/package.json | 2 +- packages/app/CHANGELOG.md | 41 + packages/app/package.json | 2 +- packages/backend-app-api/CHANGELOG.md | 19 + packages/backend-app-api/package.json | 2 +- packages/backend-common/CHANGELOG.md | 20 + packages/backend-common/package.json | 2 +- packages/backend-defaults/CHANGELOG.md | 23 + packages/backend-defaults/package.json | 2 +- .../CHANGELOG.md | 26 + .../package.json | 2 +- packages/backend-legacy/CHANGELOG.md | 42 + packages/backend-legacy/package.json | 2 +- packages/backend-openapi-utils/CHANGELOG.md | 8 + packages/backend-openapi-utils/package.json | 2 +- packages/backend-plugin-api/CHANGELOG.md | 14 + packages/backend-plugin-api/package.json | 2 +- packages/backend-tasks/CHANGELOG.md | 12 + packages/backend-tasks/package.json | 2 +- packages/backend-test-utils/CHANGELOG.md | 15 + packages/backend-test-utils/package.json | 2 +- packages/backend/CHANGELOG.md | 37 + packages/backend/package.json | 2 +- packages/cli/CHANGELOG.md | 26 + packages/cli/package.json | 2 +- packages/core-app-api/CHANGELOG.md | 23 + packages/core-app-api/package.json | 2 +- packages/core-compat-api/CHANGELOG.md | 9 + packages/core-compat-api/package.json | 2 +- packages/core-components/CHANGELOG.md | 12 + packages/core-components/package.json | 2 +- packages/create-app/CHANGELOG.md | 8 + packages/create-app/package.json | 2 +- packages/dev-utils/CHANGELOG.md | 14 + packages/dev-utils/package.json | 2 +- packages/e2e-test/CHANGELOG.md | 9 + packages/e2e-test/package.json | 2 +- packages/frontend-app-api/CHANGELOG.md | 26 + packages/frontend-app-api/package.json | 2 +- packages/frontend-plugin-api/CHANGELOG.md | 10 + packages/frontend-plugin-api/package.json | 2 +- packages/frontend-test-utils/CHANGELOG.md | 10 + packages/frontend-test-utils/package.json | 2 +- packages/integration-react/CHANGELOG.md | 9 + packages/integration-react/package.json | 2 +- packages/integration/CHANGELOG.md | 12 + packages/integration/package.json | 2 +- packages/repo-tools/CHANGELOG.md | 12 + packages/repo-tools/package.json | 2 +- .../techdocs-cli-embedded-app/CHANGELOG.md | 19 + .../techdocs-cli-embedded-app/package.json | 2 +- packages/techdocs-cli/CHANGELOG.md | 12 + packages/techdocs-cli/package.json | 2 +- packages/test-utils/CHANGELOG.md | 13 + packages/test-utils/package.json | 2 +- plugins/api-docs/CHANGELOG.md | 15 + plugins/api-docs/package.json | 2 +- plugins/app-backend/CHANGELOG.md | 14 + plugins/app-backend/package.json | 2 +- plugins/app-node/CHANGELOG.md | 8 + plugins/app-node/package.json | 2 +- plugins/app-visualizer/CHANGELOG.md | 9 + plugins/app-visualizer/package.json | 2 +- .../CHANGELOG.md | 8 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 10 + .../package.json | 2 +- .../CHANGELOG.md | 8 + .../package.json | 2 +- .../CHANGELOG.md | 10 + .../package.json | 2 +- .../CHANGELOG.md | 10 + .../package.json | 2 +- .../CHANGELOG.md | 8 + .../package.json | 2 +- .../CHANGELOG.md | 8 + .../package.json | 2 +- .../CHANGELOG.md | 8 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 8 + .../package.json | 2 +- .../CHANGELOG.md | 8 + .../package.json | 2 +- .../CHANGELOG.md | 9 + .../package.json | 2 +- .../CHANGELOG.md | 10 + .../package.json | 2 +- .../CHANGELOG.md | 8 + .../package.json | 2 +- .../CHANGELOG.md | 8 + .../package.json | 2 +- .../CHANGELOG.md | 9 + .../package.json | 2 +- .../CHANGELOG.md | 9 + .../package.json | 2 +- plugins/auth-backend/CHANGELOG.md | 30 + plugins/auth-backend/package.json | 2 +- plugins/auth-node/CHANGELOG.md | 13 + plugins/auth-node/package.json | 2 +- plugins/auth-react/CHANGELOG.md | 9 + plugins/auth-react/package.json | 2 +- plugins/bitbucket-cloud-common/CHANGELOG.md | 8 + plugins/bitbucket-cloud-common/package.json | 2 +- .../catalog-backend-module-aws/CHANGELOG.md | 17 + .../catalog-backend-module-aws/package.json | 2 +- .../catalog-backend-module-azure/CHANGELOG.md | 13 + .../catalog-backend-module-azure/package.json | 2 +- .../CHANGELOG.md | 13 + .../package.json | 2 +- .../CHANGELOG.md | 17 + .../package.json | 2 +- .../CHANGELOG.md | 14 + .../package.json | 2 +- .../catalog-backend-module-gcp/CHANGELOG.md | 13 + .../catalog-backend-module-gcp/package.json | 2 +- .../CHANGELOG.md | 13 + .../package.json | 2 +- .../CHANGELOG.md | 13 + .../package.json | 2 +- .../CHANGELOG.md | 17 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 16 + .../package.json | 2 +- .../CHANGELOG.md | 16 + .../package.json | 2 +- .../catalog-backend-module-ldap/CHANGELOG.md | 15 + .../catalog-backend-module-ldap/package.json | 2 +- .../catalog-backend-module-logs/CHANGELOG.md | 15 + .../catalog-backend-module-logs/package.json | 2 +- .../CHANGELOG.md | 13 + .../package.json | 2 +- .../CHANGELOG.md | 15 + .../package.json | 2 +- .../CHANGELOG.md | 14 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 14 + .../package.json | 2 +- plugins/catalog-backend/CHANGELOG.md | 22 + plugins/catalog-backend/package.json | 2 +- plugins/catalog-graph/CHANGELOG.md | 14 + plugins/catalog-graph/package.json | 2 +- plugins/catalog-import/CHANGELOG.md | 18 + plugins/catalog-import/package.json | 2 +- plugins/catalog-node/CHANGELOG.md | 14 + plugins/catalog-node/package.json | 2 +- plugins/catalog-react/CHANGELOG.md | 19 + plugins/catalog-react/package.json | 2 +- .../catalog-unprocessed-entities/CHANGELOG.md | 10 + .../catalog-unprocessed-entities/package.json | 2 +- plugins/catalog/CHANGELOG.md | 22 + plugins/catalog/package.json | 2 +- plugins/config-schema/CHANGELOG.md | 10 + plugins/config-schema/package.json | 2 +- plugins/devtools-backend/CHANGELOG.md | 16 + plugins/devtools-backend/package.json | 2 +- plugins/devtools/CHANGELOG.md | 13 + plugins/devtools/package.json | 2 +- .../CHANGELOG.md | 12 + .../package.json | 2 +- .../events-backend-module-azure/CHANGELOG.md | 8 + .../events-backend-module-azure/package.json | 2 +- .../CHANGELOG.md | 8 + .../package.json | 2 +- .../events-backend-module-gerrit/CHANGELOG.md | 8 + .../events-backend-module-gerrit/package.json | 2 +- .../events-backend-module-github/CHANGELOG.md | 9 + .../events-backend-module-github/package.json | 2 +- .../events-backend-module-gitlab/CHANGELOG.md | 9 + .../events-backend-module-gitlab/package.json | 2 +- .../events-backend-test-utils/CHANGELOG.md | 7 + .../events-backend-test-utils/package.json | 2 +- plugins/events-backend/CHANGELOG.md | 10 + plugins/events-backend/package.json | 2 +- plugins/events-node/CHANGELOG.md | 7 + plugins/events-node/package.json | 2 +- .../example-todo-list-backend/CHANGELOG.md | 10 + .../example-todo-list-backend/package.json | 2 +- plugins/example-todo-list/CHANGELOG.md | 8 + plugins/example-todo-list/package.json | 2 +- plugins/home-react/CHANGELOG.md | 8 + plugins/home-react/package.json | 2 +- plugins/home/CHANGELOG.md | 17 + plugins/home/package.json | 2 +- plugins/kubernetes-backend/CHANGELOG.md | 20 + plugins/kubernetes-backend/package.json | 2 +- plugins/kubernetes-cluster/CHANGELOG.md | 12 + plugins/kubernetes-cluster/package.json | 2 +- plugins/kubernetes-node/CHANGELOG.md | 10 + plugins/kubernetes-node/package.json | 2 +- plugins/kubernetes-react/CHANGELOG.md | 12 + plugins/kubernetes-react/package.json | 2 +- plugins/kubernetes/CHANGELOG.md | 12 + plugins/kubernetes/package.json | 2 +- .../CHANGELOG.md | 15 + .../package.json | 2 +- plugins/notifications-backend/CHANGELOG.md | 18 + plugins/notifications-backend/package.json | 2 +- plugins/notifications-node/CHANGELOG.md | 12 + plugins/notifications-node/package.json | 2 +- plugins/notifications/CHANGELOG.md | 13 + plugins/notifications/package.json | 2 +- plugins/org-react/CHANGELOG.md | 11 + plugins/org-react/package.json | 2 +- plugins/org/CHANGELOG.md | 17 + plugins/org/package.json | 2 +- .../CHANGELOG.md | 10 + .../package.json | 2 +- plugins/permission-backend/CHANGELOG.md | 13 + plugins/permission-backend/package.json | 2 +- plugins/permission-node/CHANGELOG.md | 12 + plugins/permission-node/package.json | 2 +- plugins/proxy-backend/CHANGELOG.md | 10 + plugins/proxy-backend/package.json | 2 +- .../CHANGELOG.md | 12 + .../package.json | 2 +- .../CHANGELOG.md | 13 + .../package.json | 2 +- .../CHANGELOG.md | 13 + .../package.json | 2 +- .../CHANGELOG.md | 13 + .../package.json | 2 +- .../CHANGELOG.md | 12 + .../package.json | 2 +- .../CHANGELOG.md | 14 + .../package.json | 2 +- .../CHANGELOG.md | 15 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 17 + .../package.json | 2 +- .../CHANGELOG.md | 13 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 14 + .../package.json | 2 +- .../CHANGELOG.md | 10 + .../package.json | 2 +- .../CHANGELOG.md | 10 + .../package.json | 2 +- plugins/scaffolder-backend/CHANGELOG.md | 38 + plugins/scaffolder-backend/package.json | 2 +- .../scaffolder-node-test-utils/CHANGELOG.md | 10 + .../scaffolder-node-test-utils/package.json | 2 +- plugins/scaffolder-node/CHANGELOG.md | 16 + plugins/scaffolder-node/package.json | 2 +- plugins/scaffolder-react/CHANGELOG.md | 20 + plugins/scaffolder-react/package.json | 2 +- plugins/scaffolder/CHANGELOG.md | 29 + plugins/scaffolder/package.json | 2 +- .../CHANGELOG.md | 18 + .../package.json | 2 +- .../CHANGELOG.md | 12 + .../package.json | 2 +- .../CHANGELOG.md | 12 + .../package.json | 2 +- plugins/search-backend-module-pg/CHANGELOG.md | 12 + plugins/search-backend-module-pg/package.json | 2 +- .../CHANGELOG.md | 12 + .../package.json | 2 +- .../CHANGELOG.md | 18 + .../package.json | 2 +- plugins/search-backend-node/CHANGELOG.md | 13 + plugins/search-backend-node/package.json | 2 +- plugins/search-backend/CHANGELOG.md | 17 + plugins/search-backend/package.json | 2 +- plugins/search-react/CHANGELOG.md | 13 + plugins/search-react/package.json | 2 +- plugins/search/CHANGELOG.md | 16 + plugins/search/package.json | 2 +- plugins/signals-backend/CHANGELOG.md | 13 + plugins/signals-backend/package.json | 2 +- plugins/signals-node/CHANGELOG.md | 12 + plugins/signals-node/package.json | 2 +- plugins/signals/CHANGELOG.md | 11 + plugins/signals/package.json | 2 +- .../techdocs-addons-test-utils/CHANGELOG.md | 15 + .../techdocs-addons-test-utils/package.json | 2 +- plugins/techdocs-backend/CHANGELOG.md | 17 + plugins/techdocs-backend/package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- plugins/techdocs-node/CHANGELOG.md | 14 + plugins/techdocs-node/package.json | 2 +- plugins/techdocs-react/CHANGELOG.md | 12 + plugins/techdocs-react/package.json | 2 +- plugins/techdocs/CHANGELOG.md | 22 + plugins/techdocs/package.json | 2 +- plugins/user-settings-backend/CHANGELOG.md | 14 + plugins/user-settings-backend/package.json | 2 +- plugins/user-settings/CHANGELOG.md | 17 + plugins/user-settings/package.json | 2 +- yarn.lock | 264 +- 313 files changed, 4728 insertions(+), 219 deletions(-) create mode 100644 .changeset/create-app-1719320674.md create mode 100644 docs/releases/v1.29.0-next.0-changelog.md create mode 100644 plugins/catalog-backend-module-logs/CHANGELOG.md diff --git a/.changeset/create-app-1719320674.md b/.changeset/create-app-1719320674.md new file mode 100644 index 0000000000..b50d431d4b --- /dev/null +++ b/.changeset/create-app-1719320674.md @@ -0,0 +1,5 @@ +--- +'@backstage/create-app': patch +--- + +Bumped create-app version. diff --git a/.changeset/pre.json b/.changeset/pre.json index dcb909ba99..df3592a582 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -184,7 +184,51 @@ "@backstage/plugin-techdocs-react": "1.2.5", "@backstage/plugin-user-settings": "0.8.7", "@backstage/plugin-user-settings-backend": "0.2.18", - "@backstage/plugin-user-settings-common": "0.0.1" + "@backstage/plugin-user-settings-common": "0.0.1", + "@backstage/plugin-catalog-backend-module-logs": "0.0.0", + "@backstage/plugin-scaffolder-backend-module-gcp": "0.0.1-next.1" }, - "changesets": [] + "changesets": [ + "bright-panthers-leave", + "calm-jeans-ring", + "chilly-roses-trade", + "clever-waves-judge", + "create-app-1719320674", + "curvy-teachers-smell", + "eighty-games-wink", + "fair-pillows-know", + "fair-rockets-leave", + "famous-dodos-crash", + "fifty-pumpkins-smell", + "friendly-masks-type", + "friendly-stingrays-occur", + "funny-laws-tease", + "gentle-avocados-obey", + "grumpy-wolves-hang", + "heavy-moose-pull", + "honest-pears-run", + "khaki-rivers-obey", + "light-avocados-worry", + "little-games-fail", + "metal-jokes-add", + "moody-llamas-breathe", + "rare-peas-dream", + "renovate-7b61228", + "rich-bears-march", + "selfish-turtles-jog", + "serious-kings-trade", + "short-flowers-cry", + "shy-hounds-battle", + "silent-experts-move", + "silent-moose-eat", + "soft-clocks-bake", + "sour-jokes-sneeze", + "ten-dancers-drum", + "ten-pots-walk", + "thick-lizards-divide", + "tough-lies-mate", + "young-donuts-swim", + "young-fishes-lie", + "young-houses-unite" + ] } diff --git a/docs/releases/v1.29.0-next.0-changelog.md b/docs/releases/v1.29.0-next.0-changelog.md new file mode 100644 index 0000000000..1ab1cfc547 --- /dev/null +++ b/docs/releases/v1.29.0-next.0-changelog.md @@ -0,0 +1,2161 @@ +# Release v1.29.0-next.0 + +Upgrade Helper: [https://backstage.github.io/upgrade-helper/?to=1.29.0-next.0](https://backstage.github.io/upgrade-helper/?to=1.29.0-next.0) + +## @backstage/core-app-api@1.13.0-next.0 + +### Minor Changes + +- d3c39fc: Allow for the disabling of external routes through config, which was rendered impossible after the introduction of default targets. + + ```yaml + app: + routes: + bindings: + # This has the effect of removing the button for registering new + # catalog entities in the scaffolder template list view + scaffolder.registerComponent: false + ``` + +### Patch Changes + +- Updated dependencies + - @backstage/core-plugin-api@1.9.3 + - @backstage/config@1.2.0 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + +## @backstage/integration@1.13.0-next.0 + +### Minor Changes + +- b5deed0: Add support for `token` for `bitbucketCloud` integration + +### Patch Changes + +- Updated dependencies + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-scaffolder@1.22.0-next.0 + +### Minor Changes + +- 52b6db0: Use virtualization with `EntityPicker` as done earlier with `MultiEntityPicker` to fix performance issues with large data sets. `VirtualizedListbox` extracted into reusable component. +- 3583ce5: Use virtualization with `MultiEntityPicker`. Fixes performance issues with large data sets. +- b5deed0: Add support for `bitbucketCloud` autocomplete in `RepoUrlPicker` + +### Patch Changes + +- 661b354: Fixed a bug where the `RepoUrlPicker` would still require the `owner` field for `azure` +- 89c44b3: Support `catalogFilter` array on `OwnedEntityPicker` +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-catalog-react@1.12.2-next.0 + - @backstage/plugin-scaffolder-react@1.10.0-next.0 + - @backstage/frontend-plugin-api@0.6.7-next.0 + - @backstage/integration-react@1.1.29-next.0 + - @backstage/core-compat-api@0.2.7-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-permission-react@0.4.23 + - @backstage/plugin-scaffolder-common@1.5.3 + +## @backstage/plugin-scaffolder-backend@1.23.0-next.0 + +### Minor Changes + +- b5deed0: Add support for `autocomplete` extension point to provide additional `autocomplete` handlers +- 0b52438: Serialization of the scaffolder workspace into GCP bucket + +### Patch Changes + +- da90cce: Updated dependency `esbuild` to `^0.21.0`. +- 62d1fe3: Fix user entity not being fetched for scaffolder dry runner +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/plugin-scaffolder-backend-module-gitlab@0.4.3-next.0 + - @backstage/plugin-scaffolder-backend-module-bitbucket-server@0.1.11-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-scaffolder-backend-module-azure@0.1.13-next.0 + - @backstage/plugin-scaffolder-node@0.4.7-next.0 + - @backstage/plugin-scaffolder-backend-module-bitbucket-cloud@0.1.11-next.0 + - @backstage/plugin-bitbucket-cloud-common@0.2.21-next.0 + - @backstage/plugin-scaffolder-backend-module-github@0.4.0-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/plugin-catalog-backend-module-scaffolder-entity-model@0.1.19-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/plugin-permission-node@0.7.32-next.0 + - @backstage/plugin-scaffolder-backend-module-bitbucket@0.2.11-next.0 + - @backstage/plugin-scaffolder-backend-module-gerrit@0.1.13-next.0 + - @backstage/plugin-scaffolder-backend-module-gitea@0.1.11-next.0 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-scaffolder-common@1.5.3 + +## @backstage/plugin-scaffolder-backend-module-gcp@0.1.0-next.2 + +### Minor Changes + +- 0b52438: Serialization of the scaffolder workspace into GCP bucket + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-scaffolder-node@0.4.7-next.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-scaffolder-backend-module-github@0.4.0-next.0 + +### Minor Changes + +- 70c4b36: Adds support for custom tag policies when creating GitHub environments. + +### Patch Changes + +- 4410fed: Fixed issue with octokit call missing owner and repo when creating environment variables and secrets using github:environment:create action +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-scaffolder-node@0.4.7-next.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + +## @backstage/plugin-scaffolder-react@1.10.0-next.0 + +### Minor Changes + +- b5deed0: Add support for `bitbucketCloud` autocomplete in `RepoUrlPicker` + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/plugin-catalog-react@1.12.2-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/theme@0.5.6 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + - @backstage/plugin-permission-react@0.4.23 + - @backstage/plugin-scaffolder-common@1.5.3 + +## @backstage/app-defaults@1.5.7-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/core-app-api@1.13.0-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/plugin-permission-react@0.4.23 + +## @backstage/backend-app-api@0.7.9-next.0 + +### Patch Changes + +- b60db08: Fixing exporting of classes properly from new packages +- a63c4b6: Fixing issue with `MiddlewareFactory` deprecation wrapping +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/plugin-permission-node@0.7.32-next.0 + - @backstage/cli-common@0.1.14 + - @backstage/cli-node@0.2.6 + - @backstage/config@1.2.0 + - @backstage/config-loader@1.8.1 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/backend-common@0.23.2-next.0 + +### Patch Changes + +- 8c09c97: Deprecate legacy status check factory, handler and types. +- d228862: Update default backend plugin created by the cli to use non-deprecated error handling middleware +- c964a3d: Add dependencies that are needed by cross-imports from backend-defaults +- b60db08: Fixing exporting of classes properly from new packages +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/backend-dev-utils@0.1.4 + - @backstage/cli-common@0.1.14 + - @backstage/config@1.2.0 + - @backstage/config-loader@1.8.1 + - @backstage/errors@1.2.4 + - @backstage/integration-aws-node@0.1.12 + - @backstage/types@1.1.1 + +## @backstage/backend-defaults@0.3.3-next.0 + +### Patch Changes + +- 53ced70: Added a new Root Health Service which adds new endpoints for health checks. +- 083eaf9: Fix bug where ISO durations could no longer be used for schedules +- cb14a05: Repack the package to fix issues with typescript with named exports +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/backend-app-api@0.7.9-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/plugin-events-node@0.3.7-next.0 + - @backstage/plugin-permission-node@0.7.32-next.0 + - @backstage/backend-dev-utils@0.1.4 + - @backstage/cli-common@0.1.14 + - @backstage/config@1.2.0 + - @backstage/config-loader@1.8.1 + - @backstage/errors@1.2.4 + - @backstage/integration-aws-node@0.1.12 + - @backstage/types@1.1.1 + +## @backstage/backend-dynamic-feature-service@0.2.14-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/plugin-scaffolder-node@0.4.7-next.0 + - @backstage/backend-app-api@0.7.9-next.0 + - @backstage/plugin-app-node@0.1.21-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/plugin-catalog-backend@1.23.2-next.0 + - @backstage/plugin-events-backend@0.3.8-next.0 + - @backstage/plugin-events-node@0.3.7-next.0 + - @backstage/plugin-permission-node@0.7.32-next.0 + - @backstage/plugin-search-backend-node@1.2.26-next.0 + - @backstage/cli-common@0.1.14 + - @backstage/cli-node@0.2.6 + - @backstage/config@1.2.0 + - @backstage/config-loader@1.8.1 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-search-common@1.2.12 + +## @backstage/backend-openapi-utils@0.1.14-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/errors@1.2.4 + +## @backstage/backend-plugin-api@0.6.21-next.0 + +### Patch Changes + +- 53ced70: Added a new Root Health Service which adds new endpoints for health checks. +- 083eaf9: Fix bug where ISO durations could no longer be used for schedules +- Updated dependencies + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/cli-common@0.1.14 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/plugin-permission-common@0.7.14 + +## @backstage/backend-tasks@0.5.26-next.0 + +### Patch Changes + +- 083eaf9: Fix bug where ISO durations could no longer be used for schedules +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/backend-test-utils@0.4.3-next.0 + +### Patch Changes + +- fce7887: Added mock for the Root Health Service in `mockServices`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-defaults@0.3.3-next.0 + - @backstage/backend-app-api@0.7.9-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/plugin-events-node@0.3.7-next.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + +## @backstage/cli@0.26.10-next.0 + +### Patch Changes + +- e2e320c: - remove unused dependencies `winston` and `yn` from the template of backend plugins; + - update `msw` to version `2.3.1` in the template of backend plugins; + starting with v1 and switching later to v2 is tedious and not straight forward; it's easier to start with v2; +- 0540c5a: Updated the scaffolding output message for `plugin-common` in `backstage-cli`. Now, when executing `backstage-cli new` to create a new `plugin-common` package, the output message accurately reflects the action by displaying `Creating common plugin package...` instead of the previous, less accurate `Creating backend plugin...`. +- 7652db4: Only bootstrap global-agent if it's actually being used +- f0c0039: Fix issue with CLI that was preventing upgrading from 1.28 +- d228862: Update default backend plugin created by the cli to use non-deprecated error handling middleware +- da90cce: Updated dependency `esbuild` to `^0.21.0`. +- a60d73b: Fix a few minor issues with the backend template that were causing failing linting checks in the main repo. +- 0510d98: Subpath export `package.json` should be of a unique name to avoid typescript resolution issues +- Updated dependencies + - @backstage/integration@1.13.0-next.0 + - @backstage/catalog-model@1.5.0 + - @backstage/cli-common@0.1.14 + - @backstage/cli-node@0.2.6 + - @backstage/config@1.2.0 + - @backstage/config-loader@1.8.1 + - @backstage/errors@1.2.4 + - @backstage/eslint-plugin@0.1.8 + - @backstage/release-manifests@0.0.11 + - @backstage/types@1.1.1 + +## @backstage/core-compat-api@0.2.7-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/frontend-plugin-api@0.6.7-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/version-bridge@1.0.8 + +## @backstage/core-components@0.14.9-next.0 + +### Patch Changes + +- d4ffdbb: Fixed bug where `` component with empty string as placeholder gave an error +- Updated dependencies + - @backstage/core-plugin-api@1.9.3 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/theme@0.5.6 + - @backstage/version-bridge@1.0.8 + ## 0.14.8 ### Patch Changes diff --git a/packages/core-components/package.json b/packages/core-components/package.json index 74cb0d7fbb..72f733e1a9 100644 --- a/packages/core-components/package.json +++ b/packages/core-components/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/core-components", "description": "Core components used by Backstage plugins and apps", - "version": "0.14.8", + "version": "0.14.9-next.0", "publishConfig": { "access": "public" }, diff --git a/packages/create-app/CHANGELOG.md b/packages/create-app/CHANGELOG.md index 6ab3cb0882..d6ccf478a4 100644 --- a/packages/create-app/CHANGELOG.md +++ b/packages/create-app/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/create-app +## 0.5.17-next.0 + +### Patch Changes + +- Bumped create-app version. +- Updated dependencies + - @backstage/cli-common@0.1.14 + ## 0.5.16 ### Patch Changes diff --git a/packages/create-app/package.json b/packages/create-app/package.json index 066dad2b57..bcbb1c5899 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/create-app", "description": "A CLI that helps you create your own Backstage app", - "version": "0.5.16", + "version": "0.5.17-next.0", "publishConfig": { "access": "public" }, diff --git a/packages/dev-utils/CHANGELOG.md b/packages/dev-utils/CHANGELOG.md index b28267c160..d44d840187 100644 --- a/packages/dev-utils/CHANGELOG.md +++ b/packages/dev-utils/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/dev-utils +## 1.0.34-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/core-app-api@1.13.0-next.0 + - @backstage/plugin-catalog-react@1.12.2-next.0 + - @backstage/app-defaults@1.5.7-next.0 + - @backstage/integration-react@1.1.29-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/catalog-model@1.5.0 + - @backstage/theme@0.5.6 + ## 1.0.33 ### Patch Changes diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json index ed887bce11..43f05d62ae 100644 --- a/packages/dev-utils/package.json +++ b/packages/dev-utils/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/dev-utils", - "version": "1.0.33", + "version": "1.0.34-next.0", "description": "Utilities for developing Backstage plugins.", "backstage": { "role": "web-library" diff --git a/packages/e2e-test/CHANGELOG.md b/packages/e2e-test/CHANGELOG.md index 4a4edf005e..74e22bcb63 100644 --- a/packages/e2e-test/CHANGELOG.md +++ b/packages/e2e-test/CHANGELOG.md @@ -1,5 +1,14 @@ # e2e-test +## 0.2.18-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/create-app@0.5.17-next.0 + - @backstage/cli-common@0.1.14 + - @backstage/errors@1.2.4 + ## 0.2.17 ### Patch Changes diff --git a/packages/e2e-test/package.json b/packages/e2e-test/package.json index 63536bc4a3..d63b93a7ba 100644 --- a/packages/e2e-test/package.json +++ b/packages/e2e-test/package.json @@ -1,7 +1,7 @@ { "name": "e2e-test", "description": "E2E test for verifying Backstage packages", - "version": "0.2.17", + "version": "0.2.18-next.0", "private": true, "backstage": { "role": "cli" diff --git a/packages/frontend-app-api/CHANGELOG.md b/packages/frontend-app-api/CHANGELOG.md index be9eab1863..94fffd0397 100644 --- a/packages/frontend-app-api/CHANGELOG.md +++ b/packages/frontend-app-api/CHANGELOG.md @@ -1,5 +1,31 @@ # @backstage/frontend-app-api +## 0.7.2-next.0 + +### Patch Changes + +- d3c39fc: Allow for the disabling of external routes through config, which was rendered impossible after the introduction of default targets. + + ```yaml + app: + routes: + bindings: + # This has the effect of removing the button for registering new + # catalog entities in the scaffolder template list view + scaffolder.registerComponent: false + ``` + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/core-app-api@1.13.0-next.0 + - @backstage/frontend-plugin-api@0.6.7-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/theme@0.5.6 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + ## 0.7.1 ### Patch Changes diff --git a/packages/frontend-app-api/package.json b/packages/frontend-app-api/package.json index 401fcfc529..f4290b70cc 100644 --- a/packages/frontend-app-api/package.json +++ b/packages/frontend-app-api/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/frontend-app-api", - "version": "0.7.1", + "version": "0.7.2-next.0", "backstage": { "role": "web-library" }, diff --git a/packages/frontend-plugin-api/CHANGELOG.md b/packages/frontend-plugin-api/CHANGELOG.md index 0ac7968290..15e3c06bd6 100644 --- a/packages/frontend-plugin-api/CHANGELOG.md +++ b/packages/frontend-plugin-api/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/frontend-plugin-api +## 0.6.7-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + ## 0.6.6 ### Patch Changes diff --git a/packages/frontend-plugin-api/package.json b/packages/frontend-plugin-api/package.json index ad8cb41ca9..be603e2611 100644 --- a/packages/frontend-plugin-api/package.json +++ b/packages/frontend-plugin-api/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/frontend-plugin-api", - "version": "0.6.6", + "version": "0.6.7-next.0", "backstage": { "role": "web-library" }, diff --git a/packages/frontend-test-utils/CHANGELOG.md b/packages/frontend-test-utils/CHANGELOG.md index db6adef523..04c896d246 100644 --- a/packages/frontend-test-utils/CHANGELOG.md +++ b/packages/frontend-test-utils/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/frontend-test-utils +## 0.1.9-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/frontend-app-api@0.7.2-next.0 + - @backstage/frontend-plugin-api@0.6.7-next.0 + - @backstage/test-utils@1.5.7-next.0 + - @backstage/types@1.1.1 + ## 0.1.8 ### Patch Changes diff --git a/packages/frontend-test-utils/package.json b/packages/frontend-test-utils/package.json index f51df52828..c7d28e99e3 100644 --- a/packages/frontend-test-utils/package.json +++ b/packages/frontend-test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/frontend-test-utils", - "version": "0.1.8", + "version": "0.1.9-next.0", "backstage": { "role": "web-library" }, diff --git a/packages/integration-react/CHANGELOG.md b/packages/integration-react/CHANGELOG.md index 5952b43cbd..e5e5759f1e 100644 --- a/packages/integration-react/CHANGELOG.md +++ b/packages/integration-react/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/integration-react +## 1.1.29-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/integration@1.13.0-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/config@1.2.0 + ## 1.1.28 ### Patch Changes diff --git a/packages/integration-react/package.json b/packages/integration-react/package.json index 34e91e0110..375f99fba6 100644 --- a/packages/integration-react/package.json +++ b/packages/integration-react/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/integration-react", - "version": "1.1.28", + "version": "1.1.29-next.0", "description": "Frontend package for managing integrations towards external systems", "backstage": { "role": "web-library" diff --git a/packages/integration/CHANGELOG.md b/packages/integration/CHANGELOG.md index f50b992f3c..a76d031e35 100644 --- a/packages/integration/CHANGELOG.md +++ b/packages/integration/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/integration +## 1.13.0-next.0 + +### Minor Changes + +- b5deed0: Add support for `token` for `bitbucketCloud` integration + +### Patch Changes + +- Updated dependencies + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 1.12.0 ### Minor Changes diff --git a/packages/integration/package.json b/packages/integration/package.json index 56b7b1bd82..6f4743fd13 100644 --- a/packages/integration/package.json +++ b/packages/integration/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/integration", - "version": "1.12.0", + "version": "1.13.0-next.0", "description": "Helpers for managing integrations towards external systems", "backstage": { "role": "common-library" diff --git a/packages/repo-tools/CHANGELOG.md b/packages/repo-tools/CHANGELOG.md index aa65b502a0..204437551d 100644 --- a/packages/repo-tools/CHANGELOG.md +++ b/packages/repo-tools/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/repo-tools +## 0.9.3-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/catalog-model@1.5.0 + - @backstage/cli-common@0.1.14 + - @backstage/cli-node@0.2.6 + - @backstage/config-loader@1.8.1 + - @backstage/errors@1.2.4 + ## 0.9.1 ### Patch Changes diff --git a/packages/repo-tools/package.json b/packages/repo-tools/package.json index 30f003aea5..4eca696aea 100644 --- a/packages/repo-tools/package.json +++ b/packages/repo-tools/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/repo-tools", "description": "CLI for Backstage repo tooling ", - "version": "0.9.1", + "version": "0.9.3-next.0", "publishConfig": { "access": "public" }, diff --git a/packages/techdocs-cli-embedded-app/CHANGELOG.md b/packages/techdocs-cli-embedded-app/CHANGELOG.md index da77dd57ad..99af9b8ad0 100644 --- a/packages/techdocs-cli-embedded-app/CHANGELOG.md +++ b/packages/techdocs-cli-embedded-app/CHANGELOG.md @@ -1,5 +1,24 @@ # techdocs-cli-embedded-app +## 0.2.98-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-techdocs-react@1.2.6-next.0 + - @backstage/plugin-techdocs@1.10.7-next.0 + - @backstage/core-components@0.14.9-next.0 + - @backstage/core-app-api@1.13.0-next.0 + - @backstage/cli@0.26.10-next.0 + - @backstage/plugin-catalog@1.21.1-next.0 + - @backstage/app-defaults@1.5.7-next.0 + - @backstage/integration-react@1.1.29-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/test-utils@1.5.7-next.0 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/theme@0.5.6 + ## 0.2.97 ### Patch Changes diff --git a/packages/techdocs-cli-embedded-app/package.json b/packages/techdocs-cli-embedded-app/package.json index ad2da35606..ef762bc3e2 100644 --- a/packages/techdocs-cli-embedded-app/package.json +++ b/packages/techdocs-cli-embedded-app/package.json @@ -1,6 +1,6 @@ { "name": "techdocs-cli-embedded-app", - "version": "0.2.97", + "version": "0.2.98-next.0", "private": true, "backstage": { "role": "frontend" diff --git a/packages/techdocs-cli/CHANGELOG.md b/packages/techdocs-cli/CHANGELOG.md index 5ff165c4a9..9fa6485f0d 100644 --- a/packages/techdocs-cli/CHANGELOG.md +++ b/packages/techdocs-cli/CHANGELOG.md @@ -1,5 +1,17 @@ # @techdocs/cli +## 1.8.15-next.0 + +### Patch Changes + +- c964a3d: Import discovery from backend-defaults instead of backend-common +- Updated dependencies + - @backstage/backend-defaults@0.3.3-next.0 + - @backstage/plugin-techdocs-node@1.12.7-next.0 + - @backstage/catalog-model@1.5.0 + - @backstage/cli-common@0.1.14 + - @backstage/config@1.2.0 + ## 1.8.12 ### Patch Changes diff --git a/packages/techdocs-cli/package.json b/packages/techdocs-cli/package.json index 9c87235af7..e1f00726af 100644 --- a/packages/techdocs-cli/package.json +++ b/packages/techdocs-cli/package.json @@ -1,7 +1,7 @@ { "name": "@techdocs/cli", "description": "Utility CLI for managing TechDocs sites in Backstage.", - "version": "1.8.12", + "version": "1.8.15-next.0", "publishConfig": { "access": "public" }, diff --git a/packages/test-utils/CHANGELOG.md b/packages/test-utils/CHANGELOG.md index 893316d288..c19d0cd4af 100644 --- a/packages/test-utils/CHANGELOG.md +++ b/packages/test-utils/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/test-utils +## 1.5.7-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-app-api@1.13.0-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/config@1.2.0 + - @backstage/theme@0.5.6 + - @backstage/types@1.1.1 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-permission-react@0.4.23 + ## 1.5.6 ### Patch Changes diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index d2294c27b6..a1e642dd89 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/test-utils", - "version": "1.5.6", + "version": "1.5.7-next.0", "description": "Utilities to test Backstage plugins and apps.", "backstage": { "role": "web-library" diff --git a/plugins/api-docs/CHANGELOG.md b/plugins/api-docs/CHANGELOG.md index 5b8e039c4e..80aaf0dbc7 100644 --- a/plugins/api-docs/CHANGELOG.md +++ b/plugins/api-docs/CHANGELOG.md @@ -1,5 +1,20 @@ # @backstage/plugin-api-docs +## 0.11.7-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/plugin-catalog-react@1.12.2-next.0 + - @backstage/plugin-catalog@1.21.1-next.0 + - @backstage/frontend-plugin-api@0.6.7-next.0 + - @backstage/core-compat-api@0.2.7-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/catalog-model@1.5.0 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-permission-react@0.4.23 + ## 0.11.6 ### Patch Changes diff --git a/plugins/api-docs/package.json b/plugins/api-docs/package.json index b8aed9f360..5a64e41e19 100644 --- a/plugins/api-docs/package.json +++ b/plugins/api-docs/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-api-docs", - "version": "0.11.6", + "version": "0.11.7-next.0", "description": "A Backstage plugin that helps represent API entities in the frontend", "backstage": { "role": "frontend-plugin", diff --git a/plugins/app-backend/CHANGELOG.md b/plugins/app-backend/CHANGELOG.md index 90e9a080dd..a898805ef2 100644 --- a/plugins/app-backend/CHANGELOG.md +++ b/plugins/app-backend/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-app-backend +## 0.3.70-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/plugin-app-node@0.1.21-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/config@1.2.0 + - @backstage/config-loader@1.8.1 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.3.68 ### Patch Changes diff --git a/plugins/app-backend/package.json b/plugins/app-backend/package.json index 5071bdaf86..50c7d98d55 100644 --- a/plugins/app-backend/package.json +++ b/plugins/app-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-app-backend", - "version": "0.3.68", + "version": "0.3.70-next.0", "description": "A Backstage backend plugin that serves the Backstage frontend app", "backstage": { "role": "backend-plugin", diff --git a/plugins/app-node/CHANGELOG.md b/plugins/app-node/CHANGELOG.md index d16d233b2c..71d34825c0 100644 --- a/plugins/app-node/CHANGELOG.md +++ b/plugins/app-node/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/plugin-app-node +## 0.1.21-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/config-loader@1.8.1 + ## 0.1.19 ### Patch Changes diff --git a/plugins/app-node/package.json b/plugins/app-node/package.json index d008a82284..e7d639d620 100644 --- a/plugins/app-node/package.json +++ b/plugins/app-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-app-node", - "version": "0.1.19", + "version": "0.1.21-next.0", "description": "Node.js library for the app plugin", "backstage": { "role": "node-library", diff --git a/plugins/app-visualizer/CHANGELOG.md b/plugins/app-visualizer/CHANGELOG.md index d30dbfc0ca..d4a23d79f2 100644 --- a/plugins/app-visualizer/CHANGELOG.md +++ b/plugins/app-visualizer/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-app-visualizer +## 0.1.8-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/frontend-plugin-api@0.6.7-next.0 + - @backstage/core-plugin-api@1.9.3 + ## 0.1.7 ### Patch Changes diff --git a/plugins/app-visualizer/package.json b/plugins/app-visualizer/package.json index 5d8f9b2649..31c7dfd87e 100644 --- a/plugins/app-visualizer/package.json +++ b/plugins/app-visualizer/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-app-visualizer", - "version": "0.1.7", + "version": "0.1.8-next.0", "description": "Visualizes the Backstage app structure", "backstage": { "role": "frontend-plugin", diff --git a/plugins/auth-backend-module-atlassian-provider/CHANGELOG.md b/plugins/auth-backend-module-atlassian-provider/CHANGELOG.md index ee68bd7df5..aadbd252ed 100644 --- a/plugins/auth-backend-module-atlassian-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-atlassian-provider/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/plugin-auth-backend-module-atlassian-provider +## 0.2.2-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + ## 0.2.0 ### Minor Changes diff --git a/plugins/auth-backend-module-atlassian-provider/package.json b/plugins/auth-backend-module-atlassian-provider/package.json index c961892674..9ceec32602 100644 --- a/plugins/auth-backend-module-atlassian-provider/package.json +++ b/plugins/auth-backend-module-atlassian-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-atlassian-provider", - "version": "0.2.0", + "version": "0.2.2-next.0", "description": "The atlassian-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-aws-alb-provider/CHANGELOG.md b/plugins/auth-backend-module-aws-alb-provider/CHANGELOG.md index f96de94fa6..747f13b972 100644 --- a/plugins/auth-backend-module-aws-alb-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-aws-alb-provider/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/plugin-auth-backend-module-aws-alb-provider +## 0.1.13-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/plugin-auth-backend@0.22.8-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/errors@1.2.4 + ## 0.1.11 ### Patch Changes diff --git a/plugins/auth-backend-module-aws-alb-provider/package.json b/plugins/auth-backend-module-aws-alb-provider/package.json index c65df9e16e..500914eb64 100644 --- a/plugins/auth-backend-module-aws-alb-provider/package.json +++ b/plugins/auth-backend-module-aws-alb-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-aws-alb-provider", - "version": "0.1.11", + "version": "0.1.13-next.0", "description": "The aws-alb provider module for the Backstage auth backend.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-azure-easyauth-provider/CHANGELOG.md b/plugins/auth-backend-module-azure-easyauth-provider/CHANGELOG.md index 2771262546..7067eb6b14 100644 --- a/plugins/auth-backend-module-azure-easyauth-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-azure-easyauth-provider/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-auth-backend-module-azure-easyauth-provider +## 0.1.4-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + ## 0.1.2 ### Patch Changes diff --git a/plugins/auth-backend-module-azure-easyauth-provider/package.json b/plugins/auth-backend-module-azure-easyauth-provider/package.json index 8303ada7a9..b505a45804 100644 --- a/plugins/auth-backend-module-azure-easyauth-provider/package.json +++ b/plugins/auth-backend-module-azure-easyauth-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-azure-easyauth-provider", - "version": "0.1.2", + "version": "0.1.4-next.0", "description": "The azure-easyauth-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-bitbucket-provider/CHANGELOG.md b/plugins/auth-backend-module-bitbucket-provider/CHANGELOG.md index 3c21cc0498..f337ee2c87 100644 --- a/plugins/auth-backend-module-bitbucket-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-bitbucket-provider/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/plugin-auth-backend-module-bitbucket-provider +## 0.1.4-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + ## 0.1.2 ### Patch Changes diff --git a/plugins/auth-backend-module-bitbucket-provider/package.json b/plugins/auth-backend-module-bitbucket-provider/package.json index 21653b691a..70a5265b87 100644 --- a/plugins/auth-backend-module-bitbucket-provider/package.json +++ b/plugins/auth-backend-module-bitbucket-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-bitbucket-provider", - "version": "0.1.2", + "version": "0.1.4-next.0", "description": "The bitbucket-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-cloudflare-access-provider/CHANGELOG.md b/plugins/auth-backend-module-cloudflare-access-provider/CHANGELOG.md index 781c1e2a7d..e94bb32963 100644 --- a/plugins/auth-backend-module-cloudflare-access-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-cloudflare-access-provider/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-auth-backend-module-cloudflare-access-provider +## 0.1.4-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.1.2 ### Patch Changes diff --git a/plugins/auth-backend-module-cloudflare-access-provider/package.json b/plugins/auth-backend-module-cloudflare-access-provider/package.json index 1d99725963..076c94b37c 100644 --- a/plugins/auth-backend-module-cloudflare-access-provider/package.json +++ b/plugins/auth-backend-module-cloudflare-access-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-cloudflare-access-provider", - "version": "0.1.2", + "version": "0.1.4-next.0", "description": "The cloudflare-access-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-gcp-iap-provider/CHANGELOG.md b/plugins/auth-backend-module-gcp-iap-provider/CHANGELOG.md index f42462e619..c593dbacf8 100644 --- a/plugins/auth-backend-module-gcp-iap-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-gcp-iap-provider/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-auth-backend-module-gcp-iap-provider +## 0.2.16-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.2.14 ### Patch Changes diff --git a/plugins/auth-backend-module-gcp-iap-provider/package.json b/plugins/auth-backend-module-gcp-iap-provider/package.json index e8932d908c..bd97b9094d 100644 --- a/plugins/auth-backend-module-gcp-iap-provider/package.json +++ b/plugins/auth-backend-module-gcp-iap-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-gcp-iap-provider", - "version": "0.2.14", + "version": "0.2.16-next.0", "description": "A GCP IAP auth provider module for the Backstage auth backend", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-github-provider/CHANGELOG.md b/plugins/auth-backend-module-github-provider/CHANGELOG.md index 8a050e26c3..8461d67843 100644 --- a/plugins/auth-backend-module-github-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-github-provider/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/plugin-auth-backend-module-github-provider +## 0.1.18-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + ## 0.1.16 ### Patch Changes diff --git a/plugins/auth-backend-module-github-provider/package.json b/plugins/auth-backend-module-github-provider/package.json index d8d115454e..8a813883ce 100644 --- a/plugins/auth-backend-module-github-provider/package.json +++ b/plugins/auth-backend-module-github-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-github-provider", - "version": "0.1.16", + "version": "0.1.18-next.0", "description": "The github-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-gitlab-provider/CHANGELOG.md b/plugins/auth-backend-module-gitlab-provider/CHANGELOG.md index e448079c05..5d84c75f92 100644 --- a/plugins/auth-backend-module-gitlab-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-gitlab-provider/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/plugin-auth-backend-module-gitlab-provider +## 0.1.18-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + ## 0.1.16 ### Patch Changes diff --git a/plugins/auth-backend-module-gitlab-provider/package.json b/plugins/auth-backend-module-gitlab-provider/package.json index 4b7117e863..4dd9548f98 100644 --- a/plugins/auth-backend-module-gitlab-provider/package.json +++ b/plugins/auth-backend-module-gitlab-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-gitlab-provider", - "version": "0.1.16", + "version": "0.1.18-next.0", "description": "The gitlab-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-google-provider/CHANGELOG.md b/plugins/auth-backend-module-google-provider/CHANGELOG.md index 412e50d6aa..0cef76c81c 100644 --- a/plugins/auth-backend-module-google-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-google-provider/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/plugin-auth-backend-module-google-provider +## 0.1.18-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + ## 0.1.16 ### Patch Changes diff --git a/plugins/auth-backend-module-google-provider/package.json b/plugins/auth-backend-module-google-provider/package.json index 48271c34b9..fdf8eb6728 100644 --- a/plugins/auth-backend-module-google-provider/package.json +++ b/plugins/auth-backend-module-google-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-google-provider", - "version": "0.1.16", + "version": "0.1.18-next.0", "description": "A Google auth provider module for the Backstage auth backend", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-guest-provider/CHANGELOG.md b/plugins/auth-backend-module-guest-provider/CHANGELOG.md index 79f9767571..5d9a1ac2c8 100644 --- a/plugins/auth-backend-module-guest-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-guest-provider/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/plugin-auth-backend-module-guest-provider +## 0.1.7-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + ## 0.1.5 ### Patch Changes diff --git a/plugins/auth-backend-module-guest-provider/package.json b/plugins/auth-backend-module-guest-provider/package.json index cf7491adf4..7f569c1f74 100644 --- a/plugins/auth-backend-module-guest-provider/package.json +++ b/plugins/auth-backend-module-guest-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-guest-provider", - "version": "0.1.5", + "version": "0.1.7-next.0", "description": "The guest-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-microsoft-provider/CHANGELOG.md b/plugins/auth-backend-module-microsoft-provider/CHANGELOG.md index 2cb76d0866..48ea704e10 100644 --- a/plugins/auth-backend-module-microsoft-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-microsoft-provider/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/plugin-auth-backend-module-microsoft-provider +## 0.1.16-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + ## 0.1.14 ### Patch Changes diff --git a/plugins/auth-backend-module-microsoft-provider/package.json b/plugins/auth-backend-module-microsoft-provider/package.json index 598c69118c..abdb555bb1 100644 --- a/plugins/auth-backend-module-microsoft-provider/package.json +++ b/plugins/auth-backend-module-microsoft-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-microsoft-provider", - "version": "0.1.14", + "version": "0.1.16-next.0", "description": "The microsoft-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-oauth2-provider/CHANGELOG.md b/plugins/auth-backend-module-oauth2-provider/CHANGELOG.md index acec3a3065..b0d7371bbe 100644 --- a/plugins/auth-backend-module-oauth2-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-oauth2-provider/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/plugin-auth-backend-module-oauth2-provider +## 0.2.2-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + ## 0.2.0 ### Minor Changes diff --git a/plugins/auth-backend-module-oauth2-provider/package.json b/plugins/auth-backend-module-oauth2-provider/package.json index 99a8e04c65..b3f7d2ddfe 100644 --- a/plugins/auth-backend-module-oauth2-provider/package.json +++ b/plugins/auth-backend-module-oauth2-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-oauth2-provider", - "version": "0.2.0", + "version": "0.2.2-next.0", "description": "The oauth2-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-oauth2-proxy-provider/CHANGELOG.md b/plugins/auth-backend-module-oauth2-proxy-provider/CHANGELOG.md index 0223e64d35..52480f24f3 100644 --- a/plugins/auth-backend-module-oauth2-proxy-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-oauth2-proxy-provider/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-auth-backend-module-oauth2-proxy-provider +## 0.1.14-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/errors@1.2.4 + ## 0.1.12 ### Patch Changes diff --git a/plugins/auth-backend-module-oauth2-proxy-provider/package.json b/plugins/auth-backend-module-oauth2-proxy-provider/package.json index c865a15f47..717d4ba09a 100644 --- a/plugins/auth-backend-module-oauth2-proxy-provider/package.json +++ b/plugins/auth-backend-module-oauth2-proxy-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-oauth2-proxy-provider", - "version": "0.1.12", + "version": "0.1.14-next.0", "description": "The oauth2-proxy-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-oidc-provider/CHANGELOG.md b/plugins/auth-backend-module-oidc-provider/CHANGELOG.md index 0a10e2e98b..a9f175f316 100644 --- a/plugins/auth-backend-module-oidc-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-oidc-provider/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-auth-backend-module-oidc-provider +## 0.2.2-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/plugin-auth-backend@0.22.8-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + ## 0.2.0 ### Minor Changes diff --git a/plugins/auth-backend-module-oidc-provider/package.json b/plugins/auth-backend-module-oidc-provider/package.json index c42d85652c..95c5ff49f8 100644 --- a/plugins/auth-backend-module-oidc-provider/package.json +++ b/plugins/auth-backend-module-oidc-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-oidc-provider", - "version": "0.2.0", + "version": "0.2.2-next.0", "description": "The oidc-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-okta-provider/CHANGELOG.md b/plugins/auth-backend-module-okta-provider/CHANGELOG.md index d1da6db5fa..c2fb212b1c 100644 --- a/plugins/auth-backend-module-okta-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-okta-provider/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/plugin-auth-backend-module-okta-provider +## 0.0.14-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + ## 0.0.12 ### Patch Changes diff --git a/plugins/auth-backend-module-okta-provider/package.json b/plugins/auth-backend-module-okta-provider/package.json index fa9dcf1ee5..16bbb79a44 100644 --- a/plugins/auth-backend-module-okta-provider/package.json +++ b/plugins/auth-backend-module-okta-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-okta-provider", - "version": "0.0.12", + "version": "0.0.14-next.0", "description": "The okta-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-onelogin-provider/CHANGELOG.md b/plugins/auth-backend-module-onelogin-provider/CHANGELOG.md index 685ce0f1ff..ed302347c4 100644 --- a/plugins/auth-backend-module-onelogin-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-onelogin-provider/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/plugin-auth-backend-module-onelogin-provider +## 0.1.2-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + ## 0.1.0 ### Minor Changes diff --git a/plugins/auth-backend-module-onelogin-provider/package.json b/plugins/auth-backend-module-onelogin-provider/package.json index 6724e51cb7..54606d26f3 100644 --- a/plugins/auth-backend-module-onelogin-provider/package.json +++ b/plugins/auth-backend-module-onelogin-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-onelogin-provider", - "version": "0.1.0", + "version": "0.1.2-next.0", "description": "The onelogin-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-pinniped-provider/CHANGELOG.md b/plugins/auth-backend-module-pinniped-provider/CHANGELOG.md index ed5fdd4819..175d786367 100644 --- a/plugins/auth-backend-module-pinniped-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-pinniped-provider/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-auth-backend-module-pinniped-provider +## 0.1.15-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/config@1.2.0 + ## 0.1.13 ### Patch Changes diff --git a/plugins/auth-backend-module-pinniped-provider/package.json b/plugins/auth-backend-module-pinniped-provider/package.json index f99d1baabd..0b78dc7dd1 100644 --- a/plugins/auth-backend-module-pinniped-provider/package.json +++ b/plugins/auth-backend-module-pinniped-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-pinniped-provider", - "version": "0.1.13", + "version": "0.1.15-next.0", "description": "The pinniped-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend-module-vmware-cloud-provider/CHANGELOG.md b/plugins/auth-backend-module-vmware-cloud-provider/CHANGELOG.md index 5d323e0319..c6b724bdd6 100644 --- a/plugins/auth-backend-module-vmware-cloud-provider/CHANGELOG.md +++ b/plugins/auth-backend-module-vmware-cloud-provider/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-auth-backend-module-vmware-cloud-provider +## 0.2.2-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/catalog-model@1.5.0 + ## 0.2.0 ### Minor Changes diff --git a/plugins/auth-backend-module-vmware-cloud-provider/package.json b/plugins/auth-backend-module-vmware-cloud-provider/package.json index ff29719d22..78fbccdd1f 100644 --- a/plugins/auth-backend-module-vmware-cloud-provider/package.json +++ b/plugins/auth-backend-module-vmware-cloud-provider/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend-module-vmware-cloud-provider", - "version": "0.2.0", + "version": "0.2.2-next.0", "description": "The vmware-cloud-provider backend module for the auth plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/auth-backend/CHANGELOG.md b/plugins/auth-backend/CHANGELOG.md index 6900d56b24..98454b2c65 100644 --- a/plugins/auth-backend/CHANGELOG.md +++ b/plugins/auth-backend/CHANGELOG.md @@ -1,5 +1,35 @@ # @backstage/plugin-auth-backend +## 0.22.8-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/plugin-auth-backend-module-atlassian-provider@0.2.2-next.0 + - @backstage/plugin-auth-backend-module-aws-alb-provider@0.1.13-next.0 + - @backstage/plugin-auth-backend-module-azure-easyauth-provider@0.1.4-next.0 + - @backstage/plugin-auth-backend-module-bitbucket-provider@0.1.4-next.0 + - @backstage/plugin-auth-backend-module-cloudflare-access-provider@0.1.4-next.0 + - @backstage/plugin-auth-backend-module-gcp-iap-provider@0.2.16-next.0 + - @backstage/plugin-auth-backend-module-github-provider@0.1.18-next.0 + - @backstage/plugin-auth-backend-module-gitlab-provider@0.1.18-next.0 + - @backstage/plugin-auth-backend-module-google-provider@0.1.18-next.0 + - @backstage/plugin-auth-backend-module-microsoft-provider@0.1.16-next.0 + - @backstage/plugin-auth-backend-module-oauth2-provider@0.2.2-next.0 + - @backstage/plugin-auth-backend-module-oauth2-proxy-provider@0.1.14-next.0 + - @backstage/plugin-auth-backend-module-oidc-provider@0.2.2-next.0 + - @backstage/plugin-auth-backend-module-okta-provider@0.0.14-next.0 + - @backstage/plugin-auth-backend-module-onelogin-provider@0.1.2-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.22.6 ### Patch Changes diff --git a/plugins/auth-backend/package.json b/plugins/auth-backend/package.json index 85dd17d311..e14d4de6b0 100644 --- a/plugins/auth-backend/package.json +++ b/plugins/auth-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend", - "version": "0.22.6", + "version": "0.22.8-next.0", "description": "A Backstage backend plugin that handles authentication", "backstage": { "role": "backend-plugin", diff --git a/plugins/auth-node/CHANGELOG.md b/plugins/auth-node/CHANGELOG.md index b91ce2141c..5c775a6bc3 100644 --- a/plugins/auth-node/CHANGELOG.md +++ b/plugins/auth-node/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-auth-node +## 0.4.16-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.4.14 ### Patch Changes diff --git a/plugins/auth-node/package.json b/plugins/auth-node/package.json index 4f42e80c92..c9b956def6 100644 --- a/plugins/auth-node/package.json +++ b/plugins/auth-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-node", - "version": "0.4.14", + "version": "0.4.16-next.0", "backstage": { "role": "node-library", "pluginId": "auth", diff --git a/plugins/auth-react/CHANGELOG.md b/plugins/auth-react/CHANGELOG.md index c36109cb91..668f751352 100644 --- a/plugins/auth-react/CHANGELOG.md +++ b/plugins/auth-react/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-auth-react +## 0.1.4-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/errors@1.2.4 + ## 0.1.3 ### Patch Changes diff --git a/plugins/auth-react/package.json b/plugins/auth-react/package.json index c48438d465..114ecd1d55 100644 --- a/plugins/auth-react/package.json +++ b/plugins/auth-react/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-react", - "version": "0.1.3", + "version": "0.1.4-next.0", "description": "Web library for the auth plugin", "backstage": { "role": "web-library", diff --git a/plugins/bitbucket-cloud-common/CHANGELOG.md b/plugins/bitbucket-cloud-common/CHANGELOG.md index ccd47aa5e4..73060ebd4a 100644 --- a/plugins/bitbucket-cloud-common/CHANGELOG.md +++ b/plugins/bitbucket-cloud-common/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/plugin-bitbucket-cloud-common +## 0.2.21-next.0 + +### Patch Changes + +- b5deed0: Add support for `autocomplete` handler to provide autocomplete options for `RepoUrlPicker` +- Updated dependencies + - @backstage/integration@1.13.0-next.0 + ## 0.2.20 ### Patch Changes diff --git a/plugins/bitbucket-cloud-common/package.json b/plugins/bitbucket-cloud-common/package.json index a08b0f31bf..0e98fcc505 100644 --- a/plugins/bitbucket-cloud-common/package.json +++ b/plugins/bitbucket-cloud-common/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-bitbucket-cloud-common", - "version": "0.2.20", + "version": "0.2.21-next.0", "description": "Common functionalities for bitbucket-cloud plugins", "backstage": { "role": "common-library", diff --git a/plugins/catalog-backend-module-aws/CHANGELOG.md b/plugins/catalog-backend-module-aws/CHANGELOG.md index e925fa7de3..bd5663758a 100644 --- a/plugins/catalog-backend-module-aws/CHANGELOG.md +++ b/plugins/catalog-backend-module-aws/CHANGELOG.md @@ -1,5 +1,22 @@ # @backstage/plugin-catalog-backend-module-aws +## 0.3.16-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/integration-aws-node@0.1.12 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-kubernetes-common@0.8.0 + ## 0.3.14 ### Patch Changes diff --git a/plugins/catalog-backend-module-aws/package.json b/plugins/catalog-backend-module-aws/package.json index 299da7d302..3b75c3cfcd 100644 --- a/plugins/catalog-backend-module-aws/package.json +++ b/plugins/catalog-backend-module-aws/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-aws", - "version": "0.3.14", + "version": "0.3.16-next.0", "description": "A Backstage catalog backend module that helps integrate towards AWS", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-azure/CHANGELOG.md b/plugins/catalog-backend-module-azure/CHANGELOG.md index dce335f353..598636a239 100644 --- a/plugins/catalog-backend-module-azure/CHANGELOG.md +++ b/plugins/catalog-backend-module-azure/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-catalog-backend-module-azure +## 0.1.41-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/config@1.2.0 + - @backstage/plugin-catalog-common@1.0.24 + ## 0.1.39 ### Patch Changes diff --git a/plugins/catalog-backend-module-azure/package.json b/plugins/catalog-backend-module-azure/package.json index aa66f869a6..bf0b69f177 100644 --- a/plugins/catalog-backend-module-azure/package.json +++ b/plugins/catalog-backend-module-azure/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-azure", - "version": "0.1.39", + "version": "0.1.41-next.0", "description": "A Backstage catalog backend module that helps integrate towards Azure", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-backstage-openapi/CHANGELOG.md b/plugins/catalog-backend-module-backstage-openapi/CHANGELOG.md index 7081965cc9..fa23d67c67 100644 --- a/plugins/catalog-backend-module-backstage-openapi/CHANGELOG.md +++ b/plugins/catalog-backend-module-backstage-openapi/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-catalog-backend-module-backstage-openapi +## 0.2.4-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/backend-openapi-utils@0.1.14-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.2.2 ### Patch Changes diff --git a/plugins/catalog-backend-module-backstage-openapi/package.json b/plugins/catalog-backend-module-backstage-openapi/package.json index b85332a6f0..4d06de5ddb 100644 --- a/plugins/catalog-backend-module-backstage-openapi/package.json +++ b/plugins/catalog-backend-module-backstage-openapi/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-backstage-openapi", - "version": "0.2.2", + "version": "0.2.4-next.0", "backstage": { "role": "backend-plugin-module", "pluginId": "catalog", diff --git a/plugins/catalog-backend-module-bitbucket-cloud/CHANGELOG.md b/plugins/catalog-backend-module-bitbucket-cloud/CHANGELOG.md index 89f45366fa..2a977a4f7b 100644 --- a/plugins/catalog-backend-module-bitbucket-cloud/CHANGELOG.md +++ b/plugins/catalog-backend-module-bitbucket-cloud/CHANGELOG.md @@ -1,5 +1,22 @@ # @backstage/plugin-catalog-backend-module-bitbucket-cloud +## 0.2.8-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-bitbucket-cloud-common@0.2.21-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/plugin-events-node@0.3.7-next.0 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/plugin-catalog-common@1.0.24 + ## 0.2.6 ### Patch Changes diff --git a/plugins/catalog-backend-module-bitbucket-cloud/package.json b/plugins/catalog-backend-module-bitbucket-cloud/package.json index 41285c1e49..d0261ad01f 100644 --- a/plugins/catalog-backend-module-bitbucket-cloud/package.json +++ b/plugins/catalog-backend-module-bitbucket-cloud/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-bitbucket-cloud", - "version": "0.2.6", + "version": "0.2.8-next.0", "description": "A Backstage catalog backend module that helps integrate towards Bitbucket Cloud", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-bitbucket-server/CHANGELOG.md b/plugins/catalog-backend-module-bitbucket-server/CHANGELOG.md index 0724dcffab..f395e731ec 100644 --- a/plugins/catalog-backend-module-bitbucket-server/CHANGELOG.md +++ b/plugins/catalog-backend-module-bitbucket-server/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-catalog-backend-module-bitbucket-server +## 0.1.35-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.1.33 ### Patch Changes diff --git a/plugins/catalog-backend-module-bitbucket-server/package.json b/plugins/catalog-backend-module-bitbucket-server/package.json index bff2adee0a..4d2e0a1e78 100644 --- a/plugins/catalog-backend-module-bitbucket-server/package.json +++ b/plugins/catalog-backend-module-bitbucket-server/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-bitbucket-server", - "version": "0.1.33", + "version": "0.1.35-next.0", "backstage": { "role": "backend-plugin-module", "pluginId": "catalog", diff --git a/plugins/catalog-backend-module-gcp/CHANGELOG.md b/plugins/catalog-backend-module-gcp/CHANGELOG.md index 756c77cd24..5948b92338 100644 --- a/plugins/catalog-backend-module-gcp/CHANGELOG.md +++ b/plugins/catalog-backend-module-gcp/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-catalog-backend-module-gcp +## 0.1.22-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/plugin-kubernetes-common@0.8.0 + ## 0.1.20 ### Patch Changes diff --git a/plugins/catalog-backend-module-gcp/package.json b/plugins/catalog-backend-module-gcp/package.json index 3f144c7a9c..5cfcca3ba9 100644 --- a/plugins/catalog-backend-module-gcp/package.json +++ b/plugins/catalog-backend-module-gcp/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-gcp", - "version": "0.1.20", + "version": "0.1.22-next.0", "description": "A Backstage catalog backend module that helps integrate towards GCP", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-gerrit/CHANGELOG.md b/plugins/catalog-backend-module-gerrit/CHANGELOG.md index b241cbe499..5cab7509bc 100644 --- a/plugins/catalog-backend-module-gerrit/CHANGELOG.md +++ b/plugins/catalog-backend-module-gerrit/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-catalog-backend-module-gerrit +## 0.1.38-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.1.36 ### Patch Changes diff --git a/plugins/catalog-backend-module-gerrit/package.json b/plugins/catalog-backend-module-gerrit/package.json index 207eefd381..7bac2566da 100644 --- a/plugins/catalog-backend-module-gerrit/package.json +++ b/plugins/catalog-backend-module-gerrit/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-gerrit", - "version": "0.1.36", + "version": "0.1.38-next.0", "backstage": { "role": "backend-plugin-module", "pluginId": "catalog", diff --git a/plugins/catalog-backend-module-github-org/CHANGELOG.md b/plugins/catalog-backend-module-github-org/CHANGELOG.md index bac2b053aa..950185b415 100644 --- a/plugins/catalog-backend-module-github-org/CHANGELOG.md +++ b/plugins/catalog-backend-module-github-org/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-catalog-backend-module-github-org +## 0.1.16-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/plugin-catalog-backend-module-github@0.6.4-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/plugin-events-node@0.3.7-next.0 + - @backstage/config@1.2.0 + ## 0.1.14 ### Patch Changes diff --git a/plugins/catalog-backend-module-github-org/package.json b/plugins/catalog-backend-module-github-org/package.json index 3946f1878c..31daeea5ee 100644 --- a/plugins/catalog-backend-module-github-org/package.json +++ b/plugins/catalog-backend-module-github-org/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-github-org", - "version": "0.1.14", + "version": "0.1.16-next.0", "description": "The github-org backend module for the catalog plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-github/CHANGELOG.md b/plugins/catalog-backend-module-github/CHANGELOG.md index fb15cb0de4..d9dc710268 100644 --- a/plugins/catalog-backend-module-github/CHANGELOG.md +++ b/plugins/catalog-backend-module-github/CHANGELOG.md @@ -1,5 +1,22 @@ # @backstage/plugin-catalog-backend-module-github +## 0.6.4-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-catalog-backend@1.23.2-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/plugin-events-node@0.3.7-next.0 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/plugin-catalog-common@1.0.24 + ## 0.6.2 ### Patch Changes diff --git a/plugins/catalog-backend-module-github/package.json b/plugins/catalog-backend-module-github/package.json index 7d3bd62281..3528786e6d 100644 --- a/plugins/catalog-backend-module-github/package.json +++ b/plugins/catalog-backend-module-github/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-github", - "version": "0.6.2", + "version": "0.6.4-next.0", "description": "A Backstage catalog backend module that helps integrate towards GitHub", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-gitlab-org/CHANGELOG.md b/plugins/catalog-backend-module-gitlab-org/CHANGELOG.md index 92dc47ec69..3ce5fef0b4 100644 --- a/plugins/catalog-backend-module-gitlab-org/CHANGELOG.md +++ b/plugins/catalog-backend-module-gitlab-org/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/plugin-catalog-backend-module-gitlab-org +## 0.0.4-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/plugin-catalog-backend-module-gitlab@0.3.20-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/plugin-events-node@0.3.7-next.0 + ## 0.0.2 ### Patch Changes diff --git a/plugins/catalog-backend-module-gitlab-org/package.json b/plugins/catalog-backend-module-gitlab-org/package.json index 781dc54706..0861d4ec92 100644 --- a/plugins/catalog-backend-module-gitlab-org/package.json +++ b/plugins/catalog-backend-module-gitlab-org/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-gitlab-org", - "version": "0.0.2", + "version": "0.0.4-next.0", "description": "The gitlab-org backend module for the catalog plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-gitlab/CHANGELOG.md b/plugins/catalog-backend-module-gitlab/CHANGELOG.md index ec7bbc1c27..6fd86bb15d 100644 --- a/plugins/catalog-backend-module-gitlab/CHANGELOG.md +++ b/plugins/catalog-backend-module-gitlab/CHANGELOG.md @@ -1,5 +1,21 @@ # @backstage/plugin-catalog-backend-module-gitlab +## 0.3.20-next.0 + +### Patch Changes + +- 8db30ad: The Gitlab configuration supports an additional optional boolean key `catalog.providers.gitlab..restrictUsersToGroup`. Setting this to `true` will make Backstage only import users from the group defined in the `group` key, instead of all users in the organisation (self-hosted) or of the root group (SaaS). It will default to false, keeping the original implementation intact, when not explicitly set. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/plugin-events-node@0.3.7-next.0 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/plugin-catalog-common@1.0.24 + ## 0.3.18 ### Patch Changes diff --git a/plugins/catalog-backend-module-gitlab/package.json b/plugins/catalog-backend-module-gitlab/package.json index d52b452122..51538cc178 100644 --- a/plugins/catalog-backend-module-gitlab/package.json +++ b/plugins/catalog-backend-module-gitlab/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-gitlab", - "version": "0.3.18", + "version": "0.3.20-next.0", "description": "A Backstage catalog backend module that helps integrate towards GitLab", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-incremental-ingestion/CHANGELOG.md b/plugins/catalog-backend-module-incremental-ingestion/CHANGELOG.md index 424baa2321..04da7cc46e 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/CHANGELOG.md +++ b/plugins/catalog-backend-module-incremental-ingestion/CHANGELOG.md @@ -1,5 +1,21 @@ # @backstage/plugin-catalog-backend-module-incremental-ingestion +## 0.4.26-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/plugin-catalog-backend@1.23.2-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/plugin-events-node@0.3.7-next.0 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/plugin-permission-common@0.7.14 + ## 0.4.24 ### Patch Changes diff --git a/plugins/catalog-backend-module-incremental-ingestion/package.json b/plugins/catalog-backend-module-incremental-ingestion/package.json index eba5fc86c1..2941fcd3f4 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/package.json +++ b/plugins/catalog-backend-module-incremental-ingestion/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-incremental-ingestion", - "version": "0.4.24", + "version": "0.4.26-next.0", "description": "An entity provider for streaming large asset sources into the catalog", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-ldap/CHANGELOG.md b/plugins/catalog-backend-module-ldap/CHANGELOG.md index 62b8849ced..b975322d0d 100644 --- a/plugins/catalog-backend-module-ldap/CHANGELOG.md +++ b/plugins/catalog-backend-module-ldap/CHANGELOG.md @@ -1,5 +1,20 @@ # @backstage/plugin-catalog-backend-module-ldap +## 0.6.2-next.0 + +### Patch Changes + +- 083eaf9: Fix bug where ISO durations could no longer be used for schedules +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/plugin-catalog-common@1.0.24 + ## 0.6.0 ### Minor Changes diff --git a/plugins/catalog-backend-module-ldap/package.json b/plugins/catalog-backend-module-ldap/package.json index beacc5e37f..f719673682 100644 --- a/plugins/catalog-backend-module-ldap/package.json +++ b/plugins/catalog-backend-module-ldap/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-ldap", - "version": "0.6.0", + "version": "0.6.2-next.0", "description": "A Backstage catalog backend module that helps integrate towards LDAP", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-logs/CHANGELOG.md b/plugins/catalog-backend-module-logs/CHANGELOG.md new file mode 100644 index 0000000000..7e5ae51a99 --- /dev/null +++ b/plugins/catalog-backend-module-logs/CHANGELOG.md @@ -0,0 +1,15 @@ +# @backstage/plugin-catalog-backend-module-logs + +## 0.0.1-next.0 + +### Patch Changes + +- 97caf55: Creates a new module to make logging catalog errors simple. This module subscribes to catalog events and logs them. + + See [Backstage documentation](https://backstage.io/docs/features/software-catalog/configuration#subscribing-to-catalog-errors) for details on how to install + and configure the plugin. + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-catalog-backend@1.23.2-next.0 + - @backstage/plugin-events-node@0.3.7-next.0 diff --git a/plugins/catalog-backend-module-logs/package.json b/plugins/catalog-backend-module-logs/package.json index 858f7ec198..e0d2e46c78 100644 --- a/plugins/catalog-backend-module-logs/package.json +++ b/plugins/catalog-backend-module-logs/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-logs", - "version": "0.0.0", + "version": "0.0.1-next.0", "description": "A module that subscribes to catalog releated events and logs them.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-msgraph/CHANGELOG.md b/plugins/catalog-backend-module-msgraph/CHANGELOG.md index 998f9aacd0..0f74e4591b 100644 --- a/plugins/catalog-backend-module-msgraph/CHANGELOG.md +++ b/plugins/catalog-backend-module-msgraph/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-catalog-backend-module-msgraph +## 0.5.29-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/plugin-catalog-common@1.0.24 + ## 0.5.27 ### Patch Changes diff --git a/plugins/catalog-backend-module-msgraph/package.json b/plugins/catalog-backend-module-msgraph/package.json index bdaa470dea..7ba2b7e1e6 100644 --- a/plugins/catalog-backend-module-msgraph/package.json +++ b/plugins/catalog-backend-module-msgraph/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-msgraph", - "version": "0.5.27", + "version": "0.5.29-next.0", "description": "A Backstage catalog backend module that helps integrate towards Microsoft Graph", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-openapi/CHANGELOG.md b/plugins/catalog-backend-module-openapi/CHANGELOG.md index f60ec12844..8003dc39ac 100644 --- a/plugins/catalog-backend-module-openapi/CHANGELOG.md +++ b/plugins/catalog-backend-module-openapi/CHANGELOG.md @@ -1,5 +1,20 @@ # @backstage/plugin-catalog-backend-module-openapi +## 0.1.39-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-catalog-backend@1.23.2-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/types@1.1.1 + - @backstage/plugin-catalog-common@1.0.24 + ## 0.1.37 ### Patch Changes diff --git a/plugins/catalog-backend-module-openapi/package.json b/plugins/catalog-backend-module-openapi/package.json index c05d8dcec4..7016701fc0 100644 --- a/plugins/catalog-backend-module-openapi/package.json +++ b/plugins/catalog-backend-module-openapi/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-openapi", - "version": "0.1.37", + "version": "0.1.39-next.0", "description": "A Backstage catalog backend module that helps with OpenAPI specifications", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-puppetdb/CHANGELOG.md b/plugins/catalog-backend-module-puppetdb/CHANGELOG.md index e990331ee9..4e5b25479a 100644 --- a/plugins/catalog-backend-module-puppetdb/CHANGELOG.md +++ b/plugins/catalog-backend-module-puppetdb/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-catalog-backend-module-puppetdb +## 0.1.27-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.1.25 ### Patch Changes diff --git a/plugins/catalog-backend-module-puppetdb/package.json b/plugins/catalog-backend-module-puppetdb/package.json index 3407a6dedd..1759eebb14 100644 --- a/plugins/catalog-backend-module-puppetdb/package.json +++ b/plugins/catalog-backend-module-puppetdb/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-puppetdb", - "version": "0.1.25", + "version": "0.1.27-next.0", "description": "A Backstage catalog backend module that helps integrate towards PuppetDB", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-scaffolder-entity-model/CHANGELOG.md b/plugins/catalog-backend-module-scaffolder-entity-model/CHANGELOG.md index a73ea9fbaf..df4e93de73 100644 --- a/plugins/catalog-backend-module-scaffolder-entity-model/CHANGELOG.md +++ b/plugins/catalog-backend-module-scaffolder-entity-model/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/plugin-catalog-backend-module-scaffolder-entity-model +## 0.1.19-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/catalog-model@1.5.0 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-scaffolder-common@1.5.3 + ## 0.1.17 ### Patch Changes diff --git a/plugins/catalog-backend-module-scaffolder-entity-model/package.json b/plugins/catalog-backend-module-scaffolder-entity-model/package.json index 247dc999db..a2891d2d4d 100644 --- a/plugins/catalog-backend-module-scaffolder-entity-model/package.json +++ b/plugins/catalog-backend-module-scaffolder-entity-model/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-scaffolder-entity-model", - "version": "0.1.17", + "version": "0.1.19-next.0", "description": "Adds support for the scaffolder specific entity model (e.g. the Template kind) to the catalog backend plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend-module-unprocessed/CHANGELOG.md b/plugins/catalog-backend-module-unprocessed/CHANGELOG.md index c07c7ef7a3..6940a04db9 100644 --- a/plugins/catalog-backend-module-unprocessed/CHANGELOG.md +++ b/plugins/catalog-backend-module-unprocessed/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-catalog-backend-module-unprocessed +## 0.4.8-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + - @backstage/plugin-catalog-unprocessed-entities-common@0.0.2 + - @backstage/plugin-permission-common@0.7.14 + ## 0.4.6 ### Patch Changes diff --git a/plugins/catalog-backend-module-unprocessed/package.json b/plugins/catalog-backend-module-unprocessed/package.json index 845f5aa9c6..582be2ffe8 100644 --- a/plugins/catalog-backend-module-unprocessed/package.json +++ b/plugins/catalog-backend-module-unprocessed/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend-module-unprocessed", - "version": "0.4.6", + "version": "0.4.8-next.0", "description": "Backstage Catalog module to view unprocessed entities", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/catalog-backend/CHANGELOG.md b/plugins/catalog-backend/CHANGELOG.md index 7b83c21930..16442df3c1 100644 --- a/plugins/catalog-backend/CHANGELOG.md +++ b/plugins/catalog-backend/CHANGELOG.md @@ -1,5 +1,27 @@ # @backstage/plugin-catalog-backend +## 1.23.2-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/backend-openapi-utils@0.1.14-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/plugin-events-node@0.3.7-next.0 + - @backstage/plugin-permission-node@0.7.32-next.0 + - @backstage/plugin-search-backend-module-catalog@0.1.27-next.0 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-permission-common@0.7.14 + ## 1.23.0 ### Minor Changes diff --git a/plugins/catalog-backend/package.json b/plugins/catalog-backend/package.json index 574e1c99ea..d9bc71ae91 100644 --- a/plugins/catalog-backend/package.json +++ b/plugins/catalog-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend", - "version": "1.23.0", + "version": "1.23.2-next.0", "description": "The Backstage backend plugin that provides the Backstage catalog", "backstage": { "role": "backend-plugin", diff --git a/plugins/catalog-graph/CHANGELOG.md b/plugins/catalog-graph/CHANGELOG.md index 9f39daa276..c632769632 100644 --- a/plugins/catalog-graph/CHANGELOG.md +++ b/plugins/catalog-graph/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-catalog-graph +## 0.4.7-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/plugin-catalog-react@1.12.2-next.0 + - @backstage/frontend-plugin-api@0.6.7-next.0 + - @backstage/core-compat-api@0.2.7-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/types@1.1.1 + ## 0.4.6 ### Patch Changes diff --git a/plugins/catalog-graph/package.json b/plugins/catalog-graph/package.json index 17013d199a..82f3e5d171 100644 --- a/plugins/catalog-graph/package.json +++ b/plugins/catalog-graph/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-graph", - "version": "0.4.6", + "version": "0.4.7-next.0", "backstage": { "role": "frontend-plugin", "pluginId": "catalog-graph", diff --git a/plugins/catalog-import/CHANGELOG.md b/plugins/catalog-import/CHANGELOG.md index 9bee65367a..bbb56b6f08 100644 --- a/plugins/catalog-import/CHANGELOG.md +++ b/plugins/catalog-import/CHANGELOG.md @@ -1,5 +1,23 @@ # @backstage/plugin-catalog-import +## 0.12.1-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-catalog-react@1.12.2-next.0 + - @backstage/frontend-plugin-api@0.6.7-next.0 + - @backstage/integration-react@1.1.29-next.0 + - @backstage/core-compat-api@0.2.7-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/plugin-catalog-common@1.0.24 + ## 0.12.0 ### Minor Changes diff --git a/plugins/catalog-import/package.json b/plugins/catalog-import/package.json index 2b93e0a7c0..1082f08113 100644 --- a/plugins/catalog-import/package.json +++ b/plugins/catalog-import/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-import", - "version": "0.12.0", + "version": "0.12.1-next.0", "description": "A Backstage plugin the helps you import entities into your catalog", "backstage": { "role": "frontend-plugin", diff --git a/plugins/catalog-node/CHANGELOG.md b/plugins/catalog-node/CHANGELOG.md index f476ca301a..f23bfa9917 100644 --- a/plugins/catalog-node/CHANGELOG.md +++ b/plugins/catalog-node/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-catalog-node +## 1.12.3-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-permission-node@0.7.32-next.0 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-permission-common@0.7.14 + ## 1.12.1 ### Patch Changes diff --git a/plugins/catalog-node/package.json b/plugins/catalog-node/package.json index c6bb7854b6..293b915eea 100644 --- a/plugins/catalog-node/package.json +++ b/plugins/catalog-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-node", - "version": "1.12.1", + "version": "1.12.3-next.0", "description": "The plugin-catalog-node module for @backstage/plugin-catalog-backend", "backstage": { "role": "node-library", diff --git a/plugins/catalog-react/CHANGELOG.md b/plugins/catalog-react/CHANGELOG.md index f4e0b0c708..892bfe306d 100644 --- a/plugins/catalog-react/CHANGELOG.md +++ b/plugins/catalog-react/CHANGELOG.md @@ -1,5 +1,24 @@ # @backstage/plugin-catalog-react +## 1.12.2-next.0 + +### Patch Changes + +- 2030962: Make EntityOwnerPicker display metadata.title or spec.profile.displayName for mode=only-owners instead of metadata.name +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/frontend-plugin-api@0.6.7-next.0 + - @backstage/integration-react@1.1.29-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-permission-react@0.4.23 + ## 1.12.1 ### Patch Changes diff --git a/plugins/catalog-react/package.json b/plugins/catalog-react/package.json index 961dad0e0e..8267047b2d 100644 --- a/plugins/catalog-react/package.json +++ b/plugins/catalog-react/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-react", - "version": "1.12.1", + "version": "1.12.2-next.0", "description": "A frontend library that helps other Backstage plugins interact with the catalog", "backstage": { "role": "web-library", diff --git a/plugins/catalog-unprocessed-entities/CHANGELOG.md b/plugins/catalog-unprocessed-entities/CHANGELOG.md index 8d39848d54..ab22634257 100644 --- a/plugins/catalog-unprocessed-entities/CHANGELOG.md +++ b/plugins/catalog-unprocessed-entities/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-catalog-unprocessed-entities +## 0.2.6-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + ## 0.2.5 ### Patch Changes diff --git a/plugins/catalog-unprocessed-entities/package.json b/plugins/catalog-unprocessed-entities/package.json index 32abaa1bbb..f32ff293df 100644 --- a/plugins/catalog-unprocessed-entities/package.json +++ b/plugins/catalog-unprocessed-entities/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-unprocessed-entities", - "version": "0.2.5", + "version": "0.2.6-next.0", "backstage": { "role": "frontend-plugin", "pluginId": "catalog-unprocessed-entities", diff --git a/plugins/catalog/CHANGELOG.md b/plugins/catalog/CHANGELOG.md index f74c71e66c..9c6031799c 100644 --- a/plugins/catalog/CHANGELOG.md +++ b/plugins/catalog/CHANGELOG.md @@ -1,5 +1,27 @@ # @backstage/plugin-catalog +## 1.21.1-next.0 + +### Patch Changes + +- d133eaa: Added small notes to AboutCard to discourage customizability PRs +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/plugin-catalog-react@1.12.2-next.0 + - @backstage/frontend-plugin-api@0.6.7-next.0 + - @backstage/integration-react@1.1.29-next.0 + - @backstage/plugin-search-react@1.7.13-next.0 + - @backstage/core-compat-api@0.2.7-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-permission-react@0.4.23 + - @backstage/plugin-scaffolder-common@1.5.3 + - @backstage/plugin-search-common@1.2.12 + ## 1.21.0 ### Minor Changes diff --git a/plugins/catalog/package.json b/plugins/catalog/package.json index 5b7aea1449..7cafc9cf92 100644 --- a/plugins/catalog/package.json +++ b/plugins/catalog/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog", - "version": "1.21.0", + "version": "1.21.1-next.0", "description": "The Backstage plugin for browsing the Backstage catalog", "backstage": { "role": "frontend-plugin", diff --git a/plugins/config-schema/CHANGELOG.md b/plugins/config-schema/CHANGELOG.md index 582368aca4..76472b69b4 100644 --- a/plugins/config-schema/CHANGELOG.md +++ b/plugins/config-schema/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-config-schema +## 0.1.57-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.1.56 ### Patch Changes diff --git a/plugins/config-schema/package.json b/plugins/config-schema/package.json index 0aa4d1dc6c..38db6a21d5 100644 --- a/plugins/config-schema/package.json +++ b/plugins/config-schema/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-config-schema", - "version": "0.1.56", + "version": "0.1.57-next.0", "description": "A Backstage plugin that lets you browse the configuration schema of your app", "backstage": { "role": "frontend-plugin", diff --git a/plugins/devtools-backend/CHANGELOG.md b/plugins/devtools-backend/CHANGELOG.md index fbcae07d37..94c827d2f3 100644 --- a/plugins/devtools-backend/CHANGELOG.md +++ b/plugins/devtools-backend/CHANGELOG.md @@ -1,5 +1,21 @@ # @backstage/plugin-devtools-backend +## 0.3.7-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/plugin-permission-node@0.7.32-next.0 + - @backstage/cli-common@0.1.14 + - @backstage/config@1.2.0 + - @backstage/config-loader@1.8.1 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/plugin-devtools-common@0.1.10 + - @backstage/plugin-permission-common@0.7.14 + ## 0.3.5 ### Patch Changes diff --git a/plugins/devtools-backend/package.json b/plugins/devtools-backend/package.json index 106950a4a4..f15e205bca 100644 --- a/plugins/devtools-backend/package.json +++ b/plugins/devtools-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-devtools-backend", - "version": "0.3.5", + "version": "0.3.7-next.0", "backstage": { "role": "backend-plugin", "pluginId": "devtools", diff --git a/plugins/devtools/CHANGELOG.md b/plugins/devtools/CHANGELOG.md index db8e1701f1..977e9cd73f 100644 --- a/plugins/devtools/CHANGELOG.md +++ b/plugins/devtools/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-devtools +## 0.1.16-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/frontend-plugin-api@0.6.7-next.0 + - @backstage/core-compat-api@0.2.7-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/errors@1.2.4 + - @backstage/plugin-devtools-common@0.1.10 + - @backstage/plugin-permission-react@0.4.23 + ## 0.1.15 ### Patch Changes diff --git a/plugins/devtools/package.json b/plugins/devtools/package.json index 3e9d697965..2749bbeef2 100644 --- a/plugins/devtools/package.json +++ b/plugins/devtools/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-devtools", - "version": "0.1.15", + "version": "0.1.16-next.0", "backstage": { "role": "frontend-plugin", "pluginId": "devtools", diff --git a/plugins/events-backend-module-aws-sqs/CHANGELOG.md b/plugins/events-backend-module-aws-sqs/CHANGELOG.md index 0c80bac266..677cdddcfc 100644 --- a/plugins/events-backend-module-aws-sqs/CHANGELOG.md +++ b/plugins/events-backend-module-aws-sqs/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-events-backend-module-aws-sqs +## 0.3.7-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/plugin-events-node@0.3.7-next.0 + - @backstage/config@1.2.0 + - @backstage/types@1.1.1 + ## 0.3.5 ### Patch Changes diff --git a/plugins/events-backend-module-aws-sqs/package.json b/plugins/events-backend-module-aws-sqs/package.json index 6d58fe4436..9cba8e76e3 100644 --- a/plugins/events-backend-module-aws-sqs/package.json +++ b/plugins/events-backend-module-aws-sqs/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-events-backend-module-aws-sqs", - "version": "0.3.5", + "version": "0.3.7-next.0", "backstage": { "role": "backend-plugin-module", "pluginId": "events", diff --git a/plugins/events-backend-module-azure/CHANGELOG.md b/plugins/events-backend-module-azure/CHANGELOG.md index 22171cbd33..cea3fab2b6 100644 --- a/plugins/events-backend-module-azure/CHANGELOG.md +++ b/plugins/events-backend-module-azure/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/plugin-events-backend-module-azure +## 0.2.7-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-events-node@0.3.7-next.0 + ## 0.2.5 ### Patch Changes diff --git a/plugins/events-backend-module-azure/package.json b/plugins/events-backend-module-azure/package.json index bb0bce7753..74573116d7 100644 --- a/plugins/events-backend-module-azure/package.json +++ b/plugins/events-backend-module-azure/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-events-backend-module-azure", - "version": "0.2.5", + "version": "0.2.7-next.0", "backstage": { "role": "backend-plugin-module", "pluginId": "events", diff --git a/plugins/events-backend-module-bitbucket-cloud/CHANGELOG.md b/plugins/events-backend-module-bitbucket-cloud/CHANGELOG.md index b71ef0dadf..eac1919f41 100644 --- a/plugins/events-backend-module-bitbucket-cloud/CHANGELOG.md +++ b/plugins/events-backend-module-bitbucket-cloud/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/plugin-events-backend-module-bitbucket-cloud +## 0.2.7-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-events-node@0.3.7-next.0 + ## 0.2.5 ### Patch Changes diff --git a/plugins/events-backend-module-bitbucket-cloud/package.json b/plugins/events-backend-module-bitbucket-cloud/package.json index 83e5f3528b..471ecb4ae2 100644 --- a/plugins/events-backend-module-bitbucket-cloud/package.json +++ b/plugins/events-backend-module-bitbucket-cloud/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-events-backend-module-bitbucket-cloud", - "version": "0.2.5", + "version": "0.2.7-next.0", "backstage": { "role": "backend-plugin-module", "pluginId": "events", diff --git a/plugins/events-backend-module-gerrit/CHANGELOG.md b/plugins/events-backend-module-gerrit/CHANGELOG.md index 4ff865f60b..cb5ac5662f 100644 --- a/plugins/events-backend-module-gerrit/CHANGELOG.md +++ b/plugins/events-backend-module-gerrit/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/plugin-events-backend-module-gerrit +## 0.2.7-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-events-node@0.3.7-next.0 + ## 0.2.5 ### Patch Changes diff --git a/plugins/events-backend-module-gerrit/package.json b/plugins/events-backend-module-gerrit/package.json index 5fbc339191..dbff36987a 100644 --- a/plugins/events-backend-module-gerrit/package.json +++ b/plugins/events-backend-module-gerrit/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-events-backend-module-gerrit", - "version": "0.2.5", + "version": "0.2.7-next.0", "backstage": { "role": "backend-plugin-module", "pluginId": "events", diff --git a/plugins/events-backend-module-github/CHANGELOG.md b/plugins/events-backend-module-github/CHANGELOG.md index 77882e3711..e2511f76ba 100644 --- a/plugins/events-backend-module-github/CHANGELOG.md +++ b/plugins/events-backend-module-github/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-events-backend-module-github +## 0.2.7-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-events-node@0.3.7-next.0 + - @backstage/config@1.2.0 + ## 0.2.5 ### Patch Changes diff --git a/plugins/events-backend-module-github/package.json b/plugins/events-backend-module-github/package.json index cf1bb2c7a5..126da9f29c 100644 --- a/plugins/events-backend-module-github/package.json +++ b/plugins/events-backend-module-github/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-events-backend-module-github", - "version": "0.2.5", + "version": "0.2.7-next.0", "backstage": { "role": "backend-plugin-module", "pluginId": "events", diff --git a/plugins/events-backend-module-gitlab/CHANGELOG.md b/plugins/events-backend-module-gitlab/CHANGELOG.md index ec96ba8f73..89d2f47c10 100644 --- a/plugins/events-backend-module-gitlab/CHANGELOG.md +++ b/plugins/events-backend-module-gitlab/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-events-backend-module-gitlab +## 0.2.7-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-events-node@0.3.7-next.0 + - @backstage/config@1.2.0 + ## 0.2.5 ### Patch Changes diff --git a/plugins/events-backend-module-gitlab/package.json b/plugins/events-backend-module-gitlab/package.json index e6ed2d9b16..45a9637a24 100644 --- a/plugins/events-backend-module-gitlab/package.json +++ b/plugins/events-backend-module-gitlab/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-events-backend-module-gitlab", - "version": "0.2.5", + "version": "0.2.7-next.0", "backstage": { "role": "backend-plugin-module", "pluginId": "events", diff --git a/plugins/events-backend-test-utils/CHANGELOG.md b/plugins/events-backend-test-utils/CHANGELOG.md index 4f04a9c277..e0f42a6f24 100644 --- a/plugins/events-backend-test-utils/CHANGELOG.md +++ b/plugins/events-backend-test-utils/CHANGELOG.md @@ -1,5 +1,12 @@ # @backstage/plugin-events-backend-test-utils +## 0.1.31-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-events-node@0.3.7-next.0 + ## 0.1.29 ### Patch Changes diff --git a/plugins/events-backend-test-utils/package.json b/plugins/events-backend-test-utils/package.json index 89dffd2e2c..931cb89248 100644 --- a/plugins/events-backend-test-utils/package.json +++ b/plugins/events-backend-test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-events-backend-test-utils", - "version": "0.1.29", + "version": "0.1.31-next.0", "description": "The plugin-events-backend-test-utils for @backstage/plugin-events-node", "backstage": { "role": "node-library", diff --git a/plugins/events-backend/CHANGELOG.md b/plugins/events-backend/CHANGELOG.md index a5699c8d9f..a0e1f91a23 100644 --- a/plugins/events-backend/CHANGELOG.md +++ b/plugins/events-backend/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-events-backend +## 0.3.8-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/plugin-events-node@0.3.7-next.0 + - @backstage/config@1.2.0 + ## 0.3.6 ### Patch Changes diff --git a/plugins/events-backend/package.json b/plugins/events-backend/package.json index d3ff69d254..b176044bf9 100644 --- a/plugins/events-backend/package.json +++ b/plugins/events-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-events-backend", - "version": "0.3.6", + "version": "0.3.8-next.0", "backstage": { "role": "backend-plugin", "pluginId": "events", diff --git a/plugins/events-node/CHANGELOG.md b/plugins/events-node/CHANGELOG.md index 18da615383..1c5025b788 100644 --- a/plugins/events-node/CHANGELOG.md +++ b/plugins/events-node/CHANGELOG.md @@ -1,5 +1,12 @@ # @backstage/plugin-events-node +## 0.3.7-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + ## 0.3.5 ### Patch Changes diff --git a/plugins/events-node/package.json b/plugins/events-node/package.json index 5e0e375d48..58790c4e02 100644 --- a/plugins/events-node/package.json +++ b/plugins/events-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-events-node", - "version": "0.3.5", + "version": "0.3.7-next.0", "description": "The plugin-events-node module for @backstage/plugin-events-backend", "backstage": { "role": "node-library", diff --git a/plugins/example-todo-list-backend/CHANGELOG.md b/plugins/example-todo-list-backend/CHANGELOG.md index c3bb326175..f42ba59723 100644 --- a/plugins/example-todo-list-backend/CHANGELOG.md +++ b/plugins/example-todo-list-backend/CHANGELOG.md @@ -1,5 +1,15 @@ # @internal/plugin-todo-list-backend +## 1.0.29-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/errors@1.2.4 + ## 1.0.28 ### Patch Changes diff --git a/plugins/example-todo-list-backend/package.json b/plugins/example-todo-list-backend/package.json index 36bd9f86c6..ec37ce2843 100644 --- a/plugins/example-todo-list-backend/package.json +++ b/plugins/example-todo-list-backend/package.json @@ -1,6 +1,6 @@ { "name": "@internal/plugin-todo-list-backend", - "version": "1.0.28", + "version": "1.0.29-next.0", "backstage": { "role": "backend-plugin", "pluginId": "todo-list", diff --git a/plugins/example-todo-list/CHANGELOG.md b/plugins/example-todo-list/CHANGELOG.md index 43873757cf..2f392e6c33 100644 --- a/plugins/example-todo-list/CHANGELOG.md +++ b/plugins/example-todo-list/CHANGELOG.md @@ -1,5 +1,13 @@ # @internal/plugin-todo-list +## 1.0.29-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/core-plugin-api@1.9.3 + ## 1.0.28 ### Patch Changes diff --git a/plugins/example-todo-list/package.json b/plugins/example-todo-list/package.json index 5e5f76ec6b..c0ef80b3de 100644 --- a/plugins/example-todo-list/package.json +++ b/plugins/example-todo-list/package.json @@ -1,6 +1,6 @@ { "name": "@internal/plugin-todo-list", - "version": "1.0.28", + "version": "1.0.29-next.0", "backstage": { "role": "frontend-plugin", "pluginId": "todo-list", diff --git a/plugins/home-react/CHANGELOG.md b/plugins/home-react/CHANGELOG.md index 4ac5fa4b93..62f3d98623 100644 --- a/plugins/home-react/CHANGELOG.md +++ b/plugins/home-react/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/plugin-home-react +## 0.1.15-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/core-plugin-api@1.9.3 + ## 0.1.14 ### Patch Changes diff --git a/plugins/home-react/package.json b/plugins/home-react/package.json index ad2bf6c7b2..819c87e20d 100644 --- a/plugins/home-react/package.json +++ b/plugins/home-react/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-home-react", - "version": "0.1.14", + "version": "0.1.15-next.0", "description": "A Backstage plugin that contains react components helps you build a home page", "backstage": { "role": "web-library", diff --git a/plugins/home/CHANGELOG.md b/plugins/home/CHANGELOG.md index fc163b8757..b6ff8061f2 100644 --- a/plugins/home/CHANGELOG.md +++ b/plugins/home/CHANGELOG.md @@ -1,5 +1,22 @@ # @backstage/plugin-home +## 0.7.6-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/core-app-api@1.13.0-next.0 + - @backstage/plugin-catalog-react@1.12.2-next.0 + - @backstage/frontend-plugin-api@0.6.7-next.0 + - @backstage/plugin-home-react@0.1.15-next.0 + - @backstage/core-compat-api@0.2.7-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/theme@0.5.6 + ## 0.7.5 ### Patch Changes diff --git a/plugins/home/package.json b/plugins/home/package.json index 6dda6cbfc2..d6fbc13d29 100644 --- a/plugins/home/package.json +++ b/plugins/home/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-home", - "version": "0.7.5", + "version": "0.7.6-next.0", "description": "A Backstage plugin that helps you build a home page", "backstage": { "role": "frontend-plugin", diff --git a/plugins/kubernetes-backend/CHANGELOG.md b/plugins/kubernetes-backend/CHANGELOG.md index 5d0b4c6f37..ea2049d73c 100644 --- a/plugins/kubernetes-backend/CHANGELOG.md +++ b/plugins/kubernetes-backend/CHANGELOG.md @@ -1,5 +1,25 @@ # @backstage/plugin-kubernetes-backend +## 0.18.2-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/plugin-kubernetes-node@0.1.15-next.0 + - @backstage/plugin-permission-node@0.7.32-next.0 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/integration-aws-node@0.1.12 + - @backstage/types@1.1.1 + - @backstage/plugin-kubernetes-common@0.8.0 + - @backstage/plugin-permission-common@0.7.14 + ## 0.18.0 ### Minor Changes diff --git a/plugins/kubernetes-backend/package.json b/plugins/kubernetes-backend/package.json index ad05c481c0..d0de031d9d 100644 --- a/plugins/kubernetes-backend/package.json +++ b/plugins/kubernetes-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-kubernetes-backend", - "version": "0.18.0", + "version": "0.18.2-next.0", "description": "A Backstage backend plugin that integrates towards Kubernetes", "backstage": { "role": "backend-plugin", diff --git a/plugins/kubernetes-cluster/CHANGELOG.md b/plugins/kubernetes-cluster/CHANGELOG.md index e27d874ccc..cef2c059d1 100644 --- a/plugins/kubernetes-cluster/CHANGELOG.md +++ b/plugins/kubernetes-cluster/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-kubernetes-cluster +## 0.0.13-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/plugin-catalog-react@1.12.2-next.0 + - @backstage/plugin-kubernetes-react@0.4.1-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/catalog-model@1.5.0 + - @backstage/plugin-kubernetes-common@0.8.0 + ## 0.0.12 ### Patch Changes diff --git a/plugins/kubernetes-cluster/package.json b/plugins/kubernetes-cluster/package.json index 9555fdbf79..ce1fa2bc63 100644 --- a/plugins/kubernetes-cluster/package.json +++ b/plugins/kubernetes-cluster/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-kubernetes-cluster", - "version": "0.0.12", + "version": "0.0.13-next.0", "description": "A Backstage plugin that shows details of Kubernetes clusters", "backstage": { "role": "frontend-plugin", diff --git a/plugins/kubernetes-node/CHANGELOG.md b/plugins/kubernetes-node/CHANGELOG.md index 47a7fbba76..6f6306cda6 100644 --- a/plugins/kubernetes-node/CHANGELOG.md +++ b/plugins/kubernetes-node/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-kubernetes-node +## 0.1.15-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/catalog-model@1.5.0 + - @backstage/types@1.1.1 + - @backstage/plugin-kubernetes-common@0.8.0 + ## 0.1.13 ### Patch Changes diff --git a/plugins/kubernetes-node/package.json b/plugins/kubernetes-node/package.json index 90fb172405..2b4d061ba7 100644 --- a/plugins/kubernetes-node/package.json +++ b/plugins/kubernetes-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-kubernetes-node", - "version": "0.1.13", + "version": "0.1.15-next.0", "description": "Node.js library for the kubernetes plugin", "backstage": { "role": "node-library", diff --git a/plugins/kubernetes-react/CHANGELOG.md b/plugins/kubernetes-react/CHANGELOG.md index 8ebe85459a..81b5c62fad 100644 --- a/plugins/kubernetes-react/CHANGELOG.md +++ b/plugins/kubernetes-react/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-kubernetes-react +## 0.4.1-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/plugin-kubernetes-common@0.8.0 + ## 0.4.0 ### Minor Changes diff --git a/plugins/kubernetes-react/package.json b/plugins/kubernetes-react/package.json index 481b264d27..0cc34da7db 100644 --- a/plugins/kubernetes-react/package.json +++ b/plugins/kubernetes-react/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-kubernetes-react", - "version": "0.4.0", + "version": "0.4.1-next.0", "description": "Web library for the kubernetes-react plugin", "backstage": { "role": "web-library", diff --git a/plugins/kubernetes/CHANGELOG.md b/plugins/kubernetes/CHANGELOG.md index 2320219483..5c8c4d6d4b 100644 --- a/plugins/kubernetes/CHANGELOG.md +++ b/plugins/kubernetes/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-kubernetes +## 0.11.12-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/plugin-catalog-react@1.12.2-next.0 + - @backstage/plugin-kubernetes-react@0.4.1-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/catalog-model@1.5.0 + - @backstage/plugin-kubernetes-common@0.8.0 + ## 0.11.11 ### Patch Changes diff --git a/plugins/kubernetes/package.json b/plugins/kubernetes/package.json index 339e26a246..998bae3626 100644 --- a/plugins/kubernetes/package.json +++ b/plugins/kubernetes/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-kubernetes", - "version": "0.11.11", + "version": "0.11.12-next.0", "description": "A Backstage plugin that integrates towards Kubernetes", "backstage": { "role": "frontend-plugin", diff --git a/plugins/notifications-backend-module-email/CHANGELOG.md b/plugins/notifications-backend-module-email/CHANGELOG.md index 30862ed64e..60725d15ee 100644 --- a/plugins/notifications-backend-module-email/CHANGELOG.md +++ b/plugins/notifications-backend-module-email/CHANGELOG.md @@ -1,5 +1,20 @@ # @backstage/plugin-notifications-backend-module-email +## 0.1.2-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/plugin-notifications-node@0.2.2-next.0 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/integration-aws-node@0.1.12 + - @backstage/types@1.1.1 + - @backstage/plugin-notifications-common@0.0.4 + ## 0.1.0 ### Minor Changes diff --git a/plugins/notifications-backend-module-email/package.json b/plugins/notifications-backend-module-email/package.json index 4f2c8a6876..76bf5432e2 100644 --- a/plugins/notifications-backend-module-email/package.json +++ b/plugins/notifications-backend-module-email/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-notifications-backend-module-email", - "version": "0.1.0", + "version": "0.1.2-next.0", "description": "The email backend module for the notifications plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/notifications-backend/CHANGELOG.md b/plugins/notifications-backend/CHANGELOG.md index 66885a07bd..c42aa95a2e 100644 --- a/plugins/notifications-backend/CHANGELOG.md +++ b/plugins/notifications-backend/CHANGELOG.md @@ -1,5 +1,23 @@ # @backstage/plugin-notifications-backend +## 0.3.2-next.0 + +### Patch Changes + +- d7b8ca5: Added an option to filter notifications by topic +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/plugin-events-node@0.3.7-next.0 + - @backstage/plugin-notifications-node@0.2.2-next.0 + - @backstage/plugin-signals-node@0.1.7-next.0 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/plugin-notifications-common@0.0.4 + ## 0.3.0 ### Minor Changes diff --git a/plugins/notifications-backend/package.json b/plugins/notifications-backend/package.json index 34fe472f42..63b3b263b1 100644 --- a/plugins/notifications-backend/package.json +++ b/plugins/notifications-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-notifications-backend", - "version": "0.3.0", + "version": "0.3.2-next.0", "backstage": { "role": "backend-plugin", "pluginId": "notifications", diff --git a/plugins/notifications-node/CHANGELOG.md b/plugins/notifications-node/CHANGELOG.md index 5611c7c6c4..041d0c355f 100644 --- a/plugins/notifications-node/CHANGELOG.md +++ b/plugins/notifications-node/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-notifications-node +## 0.2.2-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/plugin-signals-node@0.1.7-next.0 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/plugin-notifications-common@0.0.4 + ## 0.2.0 ### Minor Changes diff --git a/plugins/notifications-node/package.json b/plugins/notifications-node/package.json index 973182be4e..e79b457965 100644 --- a/plugins/notifications-node/package.json +++ b/plugins/notifications-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-notifications-node", - "version": "0.2.0", + "version": "0.2.2-next.0", "description": "Node.js library for the notifications plugin", "backstage": { "role": "node-library", diff --git a/plugins/notifications/CHANGELOG.md b/plugins/notifications/CHANGELOG.md index 3b3def49cc..ebcacf97f6 100644 --- a/plugins/notifications/CHANGELOG.md +++ b/plugins/notifications/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-notifications +## 0.2.3-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/errors@1.2.4 + - @backstage/theme@0.5.6 + - @backstage/types@1.1.1 + - @backstage/plugin-notifications-common@0.0.4 + - @backstage/plugin-signals-react@0.0.4 + ## 0.2.2 ### Patch Changes diff --git a/plugins/notifications/package.json b/plugins/notifications/package.json index f375ae702e..bc868c56a1 100644 --- a/plugins/notifications/package.json +++ b/plugins/notifications/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-notifications", - "version": "0.2.2", + "version": "0.2.3-next.0", "backstage": { "role": "frontend-plugin", "pluginId": "notifications", diff --git a/plugins/org-react/CHANGELOG.md b/plugins/org-react/CHANGELOG.md index 9d0ffacd97..8c2ea470da 100644 --- a/plugins/org-react/CHANGELOG.md +++ b/plugins/org-react/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/plugin-org-react +## 0.1.26-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/plugin-catalog-react@1.12.2-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + ## 0.1.25 ### Patch Changes diff --git a/plugins/org-react/package.json b/plugins/org-react/package.json index 32d46ef1a3..7bde5d9e9a 100644 --- a/plugins/org-react/package.json +++ b/plugins/org-react/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-org-react", - "version": "0.1.25", + "version": "0.1.26-next.0", "backstage": { "role": "web-library", "pluginId": "org", diff --git a/plugins/org/CHANGELOG.md b/plugins/org/CHANGELOG.md index e14b1afcec..fe82d2c948 100644 --- a/plugins/org/CHANGELOG.md +++ b/plugins/org/CHANGELOG.md @@ -1,5 +1,22 @@ # @backstage/plugin-org +## 0.6.27-next.0 + +### Patch Changes + +- c307ef4: Added `relationType` property to EntityMembersListCard component that allows for display users related to a group via some other relationship aside from `memberOf`. + + Also, as a side effect, the `relationsType` property has been deprecated in favor of a more accurately named `relationAggregation` property. + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/plugin-catalog-react@1.12.2-next.0 + - @backstage/frontend-plugin-api@0.6.7-next.0 + - @backstage/core-compat-api@0.2.7-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/catalog-model@1.5.0 + - @backstage/plugin-catalog-common@1.0.24 + ## 0.6.26 ### Patch Changes diff --git a/plugins/org/package.json b/plugins/org/package.json index af3c54f1a2..5b749ac215 100644 --- a/plugins/org/package.json +++ b/plugins/org/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-org", - "version": "0.6.26", + "version": "0.6.27-next.0", "description": "A Backstage plugin that helps you create entity pages for your organization", "backstage": { "role": "frontend-plugin", diff --git a/plugins/permission-backend-module-policy-allow-all/CHANGELOG.md b/plugins/permission-backend-module-policy-allow-all/CHANGELOG.md index 3c0a8d1bcb..9192850893 100644 --- a/plugins/permission-backend-module-policy-allow-all/CHANGELOG.md +++ b/plugins/permission-backend-module-policy-allow-all/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-permission-backend-module-allow-all-policy +## 0.1.18-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/plugin-permission-node@0.7.32-next.0 + - @backstage/plugin-permission-common@0.7.14 + ## 0.1.16 ### Patch Changes diff --git a/plugins/permission-backend-module-policy-allow-all/package.json b/plugins/permission-backend-module-policy-allow-all/package.json index e0108c6541..62a3f6d101 100644 --- a/plugins/permission-backend-module-policy-allow-all/package.json +++ b/plugins/permission-backend-module-policy-allow-all/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-permission-backend-module-allow-all-policy", - "version": "0.1.16", + "version": "0.1.18-next.0", "description": "Allow all policy backend module for the permission plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/permission-backend/CHANGELOG.md b/plugins/permission-backend/CHANGELOG.md index baaaefef70..d7190f15ee 100644 --- a/plugins/permission-backend/CHANGELOG.md +++ b/plugins/permission-backend/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-permission-backend +## 0.5.45-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/plugin-permission-node@0.7.32-next.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/plugin-permission-common@0.7.14 + ## 0.5.43 ### Patch Changes diff --git a/plugins/permission-backend/package.json b/plugins/permission-backend/package.json index a3020e1dd3..24b62d1358 100644 --- a/plugins/permission-backend/package.json +++ b/plugins/permission-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-permission-backend", - "version": "0.5.43", + "version": "0.5.45-next.0", "backstage": { "role": "backend-plugin", "pluginId": "permission", diff --git a/plugins/permission-node/CHANGELOG.md b/plugins/permission-node/CHANGELOG.md index 2e12639437..7255dbe266 100644 --- a/plugins/permission-node/CHANGELOG.md +++ b/plugins/permission-node/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-permission-node +## 0.7.32-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/plugin-permission-common@0.7.14 + ## 0.7.30 ### Patch Changes diff --git a/plugins/permission-node/package.json b/plugins/permission-node/package.json index 1c29b97db0..695e28f30b 100644 --- a/plugins/permission-node/package.json +++ b/plugins/permission-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-permission-node", - "version": "0.7.30", + "version": "0.7.32-next.0", "description": "Common permission and authorization utilities for backend plugins", "backstage": { "role": "node-library", diff --git a/plugins/proxy-backend/CHANGELOG.md b/plugins/proxy-backend/CHANGELOG.md index deeaf2621b..d57f4936fb 100644 --- a/plugins/proxy-backend/CHANGELOG.md +++ b/plugins/proxy-backend/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-proxy-backend +## 0.5.2-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/config@1.2.0 + - @backstage/types@1.1.1 + ## 0.5.0 ### Minor Changes diff --git a/plugins/proxy-backend/package.json b/plugins/proxy-backend/package.json index 4b990e57f7..18ad338131 100644 --- a/plugins/proxy-backend/package.json +++ b/plugins/proxy-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-proxy-backend", - "version": "0.5.0", + "version": "0.5.2-next.0", "description": "A Backstage backend plugin that helps you set up proxy endpoints in the backend", "backstage": { "role": "backend-plugin", diff --git a/plugins/scaffolder-backend-module-azure/CHANGELOG.md b/plugins/scaffolder-backend-module-azure/CHANGELOG.md index 7c1115e7fa..99ff7bd723 100644 --- a/plugins/scaffolder-backend-module-azure/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-azure/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-scaffolder-backend-module-azure +## 0.1.13-next.0 + +### Patch Changes + +- 661b354: Fixed a bug where the `RepoUrlPicker` would still require the `owner` field for `azure` +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-scaffolder-node@0.4.7-next.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.1.11 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-azure/package.json b/plugins/scaffolder-backend-module-azure/package.json index ece29a8866..672689ef73 100644 --- a/plugins/scaffolder-backend-module-azure/package.json +++ b/plugins/scaffolder-backend-module-azure/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-azure", - "version": "0.1.11", + "version": "0.1.13-next.0", "description": "The azure module for @backstage/plugin-scaffolder-backend", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/scaffolder-backend-module-bitbucket-cloud/CHANGELOG.md b/plugins/scaffolder-backend-module-bitbucket-cloud/CHANGELOG.md index 01bcce124f..f4453bab7a 100644 --- a/plugins/scaffolder-backend-module-bitbucket-cloud/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-bitbucket-cloud/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-scaffolder-backend-module-bitbucket-cloud +## 0.1.11-next.0 + +### Patch Changes + +- b5deed0: Add support for `autocomplete` handler to provide autocomplete options for `RepoUrlPicker` +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-scaffolder-node@0.4.7-next.0 + - @backstage/plugin-bitbucket-cloud-common@0.2.21-next.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.1.9 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-bitbucket-cloud/package.json b/plugins/scaffolder-backend-module-bitbucket-cloud/package.json index e54f255094..d4432ee3d5 100644 --- a/plugins/scaffolder-backend-module-bitbucket-cloud/package.json +++ b/plugins/scaffolder-backend-module-bitbucket-cloud/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-bitbucket-cloud", - "version": "0.1.9", + "version": "0.1.11-next.0", "description": "The Bitbucket Cloud module for @backstage/plugin-scaffolder-backend", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/scaffolder-backend-module-bitbucket-server/CHANGELOG.md b/plugins/scaffolder-backend-module-bitbucket-server/CHANGELOG.md index 3eefd69ab7..f614b16994 100644 --- a/plugins/scaffolder-backend-module-bitbucket-server/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-bitbucket-server/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-scaffolder-backend-module-bitbucket-server +## 0.1.11-next.0 + +### Patch Changes + +- 6a4ad4e: Instead of using hardcoded `targetBranch` now fetch the default branch from Bitbucket repository. + This prevents from errors when no `targetBranch` is provided and the default repository branch is different from `master`, for example: `main`. +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-scaffolder-node@0.4.7-next.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.1.9 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-bitbucket-server/package.json b/plugins/scaffolder-backend-module-bitbucket-server/package.json index cc321ccd33..16ce106570 100644 --- a/plugins/scaffolder-backend-module-bitbucket-server/package.json +++ b/plugins/scaffolder-backend-module-bitbucket-server/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-bitbucket-server", - "version": "0.1.9", + "version": "0.1.11-next.0", "description": "The Bitbucket Server module for @backstage/plugin-scaffolder-backend", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/scaffolder-backend-module-bitbucket/CHANGELOG.md b/plugins/scaffolder-backend-module-bitbucket/CHANGELOG.md index 97b68baf15..dc3a0f1597 100644 --- a/plugins/scaffolder-backend-module-bitbucket/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-bitbucket/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-scaffolder-backend-module-bitbucket +## 0.2.11-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-scaffolder-backend-module-bitbucket-server@0.1.11-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-scaffolder-node@0.4.7-next.0 + - @backstage/plugin-scaffolder-backend-module-bitbucket-cloud@0.1.11-next.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.2.9 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-bitbucket/package.json b/plugins/scaffolder-backend-module-bitbucket/package.json index bc3a578fdb..35b23e39d9 100644 --- a/plugins/scaffolder-backend-module-bitbucket/package.json +++ b/plugins/scaffolder-backend-module-bitbucket/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-bitbucket", - "version": "0.2.9", + "version": "0.2.11-next.0", "description": "The bitbucket module for @backstage/plugin-scaffolder-backend", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/scaffolder-backend-module-confluence-to-markdown/CHANGELOG.md b/plugins/scaffolder-backend-module-confluence-to-markdown/CHANGELOG.md index 45cb0bc6fc..d24746f67a 100644 --- a/plugins/scaffolder-backend-module-confluence-to-markdown/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-confluence-to-markdown/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-scaffolder-backend-module-confluence-to-markdown +## 0.2.22-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-scaffolder-node@0.4.7-next.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.2.20 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-confluence-to-markdown/package.json b/plugins/scaffolder-backend-module-confluence-to-markdown/package.json index 02fa559e56..34e49f740f 100644 --- a/plugins/scaffolder-backend-module-confluence-to-markdown/package.json +++ b/plugins/scaffolder-backend-module-confluence-to-markdown/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-confluence-to-markdown", - "version": "0.2.20", + "version": "0.2.22-next.0", "description": "The confluence-to-markdown module for @backstage/plugin-scaffolder-backend", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/scaffolder-backend-module-cookiecutter/CHANGELOG.md b/plugins/scaffolder-backend-module-cookiecutter/CHANGELOG.md index 8df8ef83e5..dfa740b4a6 100644 --- a/plugins/scaffolder-backend-module-cookiecutter/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-cookiecutter/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-scaffolder-backend-module-cookiecutter +## 0.2.45-next.0 + +### Patch Changes + +- 0ac124b: Updated configuration instructions +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-scaffolder-node@0.4.7-next.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.2.43 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-cookiecutter/package.json b/plugins/scaffolder-backend-module-cookiecutter/package.json index a6e9cfbf66..ea0a7fad77 100644 --- a/plugins/scaffolder-backend-module-cookiecutter/package.json +++ b/plugins/scaffolder-backend-module-cookiecutter/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-cookiecutter", - "version": "0.2.43", + "version": "0.2.45-next.0", "description": "A module for the scaffolder backend that lets you template projects using cookiecutter", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/scaffolder-backend-module-gcp/CHANGELOG.md b/plugins/scaffolder-backend-module-gcp/CHANGELOG.md index f633c5b8cd..5afcde9965 100644 --- a/plugins/scaffolder-backend-module-gcp/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-gcp/CHANGELOG.md @@ -1,3 +1,18 @@ # @backstage/plugin-scaffolder-backend-module-gcp +## 0.1.0-next.2 + +### Minor Changes + +- 0b52438: Serialization of the scaffolder workspace into GCP bucket + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-scaffolder-node@0.4.7-next.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.0.1 diff --git a/plugins/scaffolder-backend-module-gcp/package.json b/plugins/scaffolder-backend-module-gcp/package.json index 7fb3e08b34..2f8f130d39 100644 --- a/plugins/scaffolder-backend-module-gcp/package.json +++ b/plugins/scaffolder-backend-module-gcp/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-gcp", - "version": "0.0.1-next.1", + "version": "0.1.0-next.2", "description": "The GCP Bucket module for @backstage/plugin-scaffolder-backend", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/scaffolder-backend-module-gerrit/CHANGELOG.md b/plugins/scaffolder-backend-module-gerrit/CHANGELOG.md index 2703b15871..cc4d9612a1 100644 --- a/plugins/scaffolder-backend-module-gerrit/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-gerrit/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/plugin-scaffolder-backend-module-gerrit +## 0.1.13-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-scaffolder-node@0.4.7-next.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.1.11 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-gerrit/package.json b/plugins/scaffolder-backend-module-gerrit/package.json index 15aac0cceb..06c5d063d4 100644 --- a/plugins/scaffolder-backend-module-gerrit/package.json +++ b/plugins/scaffolder-backend-module-gerrit/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-gerrit", - "version": "0.1.11", + "version": "0.1.13-next.0", "description": "The gerrit module for @backstage/plugin-scaffolder-backend", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/scaffolder-backend-module-gitea/CHANGELOG.md b/plugins/scaffolder-backend-module-gitea/CHANGELOG.md index d2604729c2..5f26aa6a2d 100644 --- a/plugins/scaffolder-backend-module-gitea/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-gitea/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/plugin-scaffolder-backend-module-gitea +## 0.1.11-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-scaffolder-node@0.4.7-next.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.1.9 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-gitea/package.json b/plugins/scaffolder-backend-module-gitea/package.json index 55f948b87e..f6563795cd 100644 --- a/plugins/scaffolder-backend-module-gitea/package.json +++ b/plugins/scaffolder-backend-module-gitea/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-gitea", - "version": "0.1.9", + "version": "0.1.11-next.0", "description": "The gitea module for @backstage/plugin-scaffolder-backend", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/scaffolder-backend-module-github/CHANGELOG.md b/plugins/scaffolder-backend-module-github/CHANGELOG.md index 16d121113e..e3cd0904aa 100644 --- a/plugins/scaffolder-backend-module-github/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-github/CHANGELOG.md @@ -1,5 +1,22 @@ # @backstage/plugin-scaffolder-backend-module-github +## 0.4.0-next.0 + +### Minor Changes + +- 70c4b36: Adds support for custom tag policies when creating GitHub environments. + +### Patch Changes + +- 4410fed: Fixed issue with octokit call missing owner and repo when creating environment variables and secrets using github:environment:create action +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-scaffolder-node@0.4.7-next.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.3.0 ### Minor Changes diff --git a/plugins/scaffolder-backend-module-github/package.json b/plugins/scaffolder-backend-module-github/package.json index c86a10fb49..1fd404c6f9 100644 --- a/plugins/scaffolder-backend-module-github/package.json +++ b/plugins/scaffolder-backend-module-github/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-github", - "version": "0.3.0", + "version": "0.4.0-next.0", "description": "The github module for @backstage/plugin-scaffolder-backend", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/scaffolder-backend-module-gitlab/CHANGELOG.md b/plugins/scaffolder-backend-module-gitlab/CHANGELOG.md index eb1386679c..c64aa0ca32 100644 --- a/plugins/scaffolder-backend-module-gitlab/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-gitlab/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-scaffolder-backend-module-gitlab +## 0.4.3-next.0 + +### Patch Changes + +- 0ac124b: Updated configuration instructions +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-scaffolder-node@0.4.7-next.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.4.1 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-gitlab/package.json b/plugins/scaffolder-backend-module-gitlab/package.json index 096cf9d077..7444bde77d 100644 --- a/plugins/scaffolder-backend-module-gitlab/package.json +++ b/plugins/scaffolder-backend-module-gitlab/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-gitlab", - "version": "0.4.1", + "version": "0.4.3-next.0", "backstage": { "role": "backend-plugin-module", "pluginId": "scaffolder", diff --git a/plugins/scaffolder-backend-module-notifications/CHANGELOG.md b/plugins/scaffolder-backend-module-notifications/CHANGELOG.md index a1828b9546..948770e600 100644 --- a/plugins/scaffolder-backend-module-notifications/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-notifications/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/plugin-scaffolder-backend-module-notifications +## 0.0.4-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/plugin-scaffolder-node@0.4.7-next.0 + - @backstage/plugin-notifications-node@0.2.2-next.0 + - @backstage/plugin-notifications-common@0.0.4 + ## 0.0.2 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-notifications/package.json b/plugins/scaffolder-backend-module-notifications/package.json index 8f9c150d1b..bb8b7807e8 100644 --- a/plugins/scaffolder-backend-module-notifications/package.json +++ b/plugins/scaffolder-backend-module-notifications/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-notifications", - "version": "0.0.2", + "version": "0.0.4-next.0", "description": "The notifications backend module for the scaffolder plugin.", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/scaffolder-backend-module-rails/CHANGELOG.md b/plugins/scaffolder-backend-module-rails/CHANGELOG.md index 5bf7ac953b..afaebde648 100644 --- a/plugins/scaffolder-backend-module-rails/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-rails/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-scaffolder-backend-module-rails +## 0.4.38-next.0 + +### Patch Changes + +- 0ac124b: Updated configuration instructions +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-scaffolder-node@0.4.7-next.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + ## 0.4.36 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-rails/package.json b/plugins/scaffolder-backend-module-rails/package.json index 9da87efa1d..a736106df1 100644 --- a/plugins/scaffolder-backend-module-rails/package.json +++ b/plugins/scaffolder-backend-module-rails/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-rails", - "version": "0.4.36", + "version": "0.4.38-next.0", "description": "A module for the scaffolder backend that lets you template projects using Rails", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/scaffolder-backend-module-sentry/CHANGELOG.md b/plugins/scaffolder-backend-module-sentry/CHANGELOG.md index 922b8fd274..fa7712e500 100644 --- a/plugins/scaffolder-backend-module-sentry/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-sentry/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-scaffolder-backend-module-sentry +## 0.1.29-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-scaffolder-node@0.4.7-next.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + ## 0.1.27 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-sentry/package.json b/plugins/scaffolder-backend-module-sentry/package.json index efde9aa2fe..7943de9b5c 100644 --- a/plugins/scaffolder-backend-module-sentry/package.json +++ b/plugins/scaffolder-backend-module-sentry/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-sentry", - "version": "0.1.27", + "version": "0.1.29-next.0", "backstage": { "role": "backend-plugin-module", "pluginId": "scaffolder", diff --git a/plugins/scaffolder-backend-module-yeoman/CHANGELOG.md b/plugins/scaffolder-backend-module-yeoman/CHANGELOG.md index 7be229cdea..c3c2322b9a 100644 --- a/plugins/scaffolder-backend-module-yeoman/CHANGELOG.md +++ b/plugins/scaffolder-backend-module-yeoman/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-scaffolder-backend-module-yeoman +## 0.3.5-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/plugin-scaffolder-node@0.4.7-next.0 + - @backstage/plugin-scaffolder-node-test-utils@0.1.8-next.0 + - @backstage/types@1.1.1 + ## 0.3.2 ### Patch Changes diff --git a/plugins/scaffolder-backend-module-yeoman/package.json b/plugins/scaffolder-backend-module-yeoman/package.json index be380ac160..70133616ef 100644 --- a/plugins/scaffolder-backend-module-yeoman/package.json +++ b/plugins/scaffolder-backend-module-yeoman/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend-module-yeoman", - "version": "0.3.2", + "version": "0.3.5-next.0", "backstage": { "role": "backend-plugin-module", "pluginId": "scaffolder", diff --git a/plugins/scaffolder-backend/CHANGELOG.md b/plugins/scaffolder-backend/CHANGELOG.md index fa81406ba0..5737dc0165 100644 --- a/plugins/scaffolder-backend/CHANGELOG.md +++ b/plugins/scaffolder-backend/CHANGELOG.md @@ -1,5 +1,43 @@ # @backstage/plugin-scaffolder-backend +## 1.23.0-next.0 + +### Minor Changes + +- b5deed0: Add support for `autocomplete` extension point to provide additional `autocomplete` handlers +- 0b52438: Serialization of the scaffolder workspace into GCP bucket + +### Patch Changes + +- da90cce: Updated dependency `esbuild` to `^0.21.0`. +- 62d1fe3: Fix user entity not being fetched for scaffolder dry runner +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/plugin-scaffolder-backend-module-gitlab@0.4.3-next.0 + - @backstage/plugin-scaffolder-backend-module-bitbucket-server@0.1.11-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-scaffolder-backend-module-azure@0.1.13-next.0 + - @backstage/plugin-scaffolder-node@0.4.7-next.0 + - @backstage/plugin-scaffolder-backend-module-bitbucket-cloud@0.1.11-next.0 + - @backstage/plugin-bitbucket-cloud-common@0.2.21-next.0 + - @backstage/plugin-scaffolder-backend-module-github@0.4.0-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/plugin-catalog-backend-module-scaffolder-entity-model@0.1.19-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/plugin-permission-node@0.7.32-next.0 + - @backstage/plugin-scaffolder-backend-module-bitbucket@0.2.11-next.0 + - @backstage/plugin-scaffolder-backend-module-gerrit@0.1.13-next.0 + - @backstage/plugin-scaffolder-backend-module-gitea@0.1.11-next.0 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-scaffolder-common@1.5.3 + ## 1.22.9 ### Patch Changes diff --git a/plugins/scaffolder-backend/package.json b/plugins/scaffolder-backend/package.json index 9730ee78bb..c9c19d9983 100644 --- a/plugins/scaffolder-backend/package.json +++ b/plugins/scaffolder-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend", - "version": "1.22.9", + "version": "1.23.0-next.0", "description": "The Backstage backend plugin that helps you create new things", "backstage": { "role": "backend-plugin", diff --git a/plugins/scaffolder-node-test-utils/CHANGELOG.md b/plugins/scaffolder-node-test-utils/CHANGELOG.md index ebdf3092b7..1136cce04b 100644 --- a/plugins/scaffolder-node-test-utils/CHANGELOG.md +++ b/plugins/scaffolder-node-test-utils/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-scaffolder-node-test-utils +## 0.1.8-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-common@0.23.2-next.0 + - @backstage/plugin-scaffolder-node@0.4.7-next.0 + - @backstage/backend-test-utils@0.4.3-next.0 + - @backstage/types@1.1.1 + ## 0.1.5 ### Patch Changes diff --git a/plugins/scaffolder-node-test-utils/package.json b/plugins/scaffolder-node-test-utils/package.json index e15b33dad3..87f895efc3 100644 --- a/plugins/scaffolder-node-test-utils/package.json +++ b/plugins/scaffolder-node-test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-node-test-utils", - "version": "0.1.5", + "version": "0.1.8-next.0", "backstage": { "role": "node-library", "pluginId": "scaffolder", diff --git a/plugins/scaffolder-node/CHANGELOG.md b/plugins/scaffolder-node/CHANGELOG.md index f5da44ae1e..f0deb319ff 100644 --- a/plugins/scaffolder-node/CHANGELOG.md +++ b/plugins/scaffolder-node/CHANGELOG.md @@ -1,5 +1,21 @@ # @backstage/plugin-scaffolder-node +## 0.4.7-next.0 + +### Patch Changes + +- 661b354: Fixed a bug where the `RepoUrlPicker` would still require the `owner` field for `azure` +- b5deed0: Add support for `autocomplete` extension point to provide additional `autocomplete` handlers +- 0b52438: Serialization of the scaffolder workspace into GCP bucket +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/plugin-scaffolder-common@1.5.3 + ## 0.4.5 ### Patch Changes diff --git a/plugins/scaffolder-node/package.json b/plugins/scaffolder-node/package.json index 29dc022be1..2568809647 100644 --- a/plugins/scaffolder-node/package.json +++ b/plugins/scaffolder-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-node", - "version": "0.4.5", + "version": "0.4.7-next.0", "description": "The plugin-scaffolder-node module for @backstage/plugin-scaffolder-backend", "backstage": { "role": "node-library", diff --git a/plugins/scaffolder-react/CHANGELOG.md b/plugins/scaffolder-react/CHANGELOG.md index 666fe36e24..baa34dbc5b 100644 --- a/plugins/scaffolder-react/CHANGELOG.md +++ b/plugins/scaffolder-react/CHANGELOG.md @@ -1,5 +1,25 @@ # @backstage/plugin-scaffolder-react +## 1.10.0-next.0 + +### Minor Changes + +- b5deed0: Add support for `bitbucketCloud` autocomplete in `RepoUrlPicker` + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/plugin-catalog-react@1.12.2-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/theme@0.5.6 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + - @backstage/plugin-permission-react@0.4.23 + - @backstage/plugin-scaffolder-common@1.5.3 + ## 1.9.0 ### Minor Changes diff --git a/plugins/scaffolder-react/package.json b/plugins/scaffolder-react/package.json index 4bb86ca98d..6e37ff3e71 100644 --- a/plugins/scaffolder-react/package.json +++ b/plugins/scaffolder-react/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-react", - "version": "1.9.0", + "version": "1.10.0-next.0", "description": "A frontend library that helps other Backstage plugins interact with the Scaffolder", "backstage": { "role": "web-library", diff --git a/plugins/scaffolder/CHANGELOG.md b/plugins/scaffolder/CHANGELOG.md index 43e1d5eab7..55d7271807 100644 --- a/plugins/scaffolder/CHANGELOG.md +++ b/plugins/scaffolder/CHANGELOG.md @@ -1,5 +1,34 @@ # @backstage/plugin-scaffolder +## 1.22.0-next.0 + +### Minor Changes + +- 52b6db0: Use virtualization with `EntityPicker` as done earlier with `MultiEntityPicker` to fix performance issues with large data sets. `VirtualizedListbox` extracted into reusable component. +- 3583ce5: Use virtualization with `MultiEntityPicker`. Fixes performance issues with large data sets. +- b5deed0: Add support for `bitbucketCloud` autocomplete in `RepoUrlPicker` + +### Patch Changes + +- 661b354: Fixed a bug where the `RepoUrlPicker` would still require the `owner` field for `azure` +- 89c44b3: Support `catalogFilter` array on `OwnedEntityPicker` +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-catalog-react@1.12.2-next.0 + - @backstage/plugin-scaffolder-react@1.10.0-next.0 + - @backstage/frontend-plugin-api@0.6.7-next.0 + - @backstage/integration-react@1.1.29-next.0 + - @backstage/core-compat-api@0.2.7-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-permission-react@0.4.23 + - @backstage/plugin-scaffolder-common@1.5.3 + ## 1.21.0 ### Minor Changes diff --git a/plugins/scaffolder/package.json b/plugins/scaffolder/package.json index 50cbda8e31..4cce0a83ce 100644 --- a/plugins/scaffolder/package.json +++ b/plugins/scaffolder/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder", - "version": "1.21.0", + "version": "1.22.0-next.0", "description": "The Backstage plugin that helps you create new things", "backstage": { "role": "frontend-plugin", diff --git a/plugins/search-backend-module-catalog/CHANGELOG.md b/plugins/search-backend-module-catalog/CHANGELOG.md index 7e14c40bd6..e2d6440c94 100644 --- a/plugins/search-backend-module-catalog/CHANGELOG.md +++ b/plugins/search-backend-module-catalog/CHANGELOG.md @@ -1,5 +1,23 @@ # @backstage/plugin-search-backend-module-catalog +## 0.1.27-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/plugin-search-backend-node@1.2.26-next.0 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-search-common@1.2.12 + ## 0.1.25 ### Patch Changes diff --git a/plugins/search-backend-module-catalog/package.json b/plugins/search-backend-module-catalog/package.json index 7c1d8cb0c0..d46e220029 100644 --- a/plugins/search-backend-module-catalog/package.json +++ b/plugins/search-backend-module-catalog/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-search-backend-module-catalog", - "version": "0.1.25", + "version": "0.1.27-next.0", "description": "A module for the search backend that exports catalog modules", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/search-backend-module-elasticsearch/CHANGELOG.md b/plugins/search-backend-module-elasticsearch/CHANGELOG.md index 5a2d59e43e..16cf473283 100644 --- a/plugins/search-backend-module-elasticsearch/CHANGELOG.md +++ b/plugins/search-backend-module-elasticsearch/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-search-backend-module-elasticsearch +## 1.5.2-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/plugin-search-backend-node@1.2.26-next.0 + - @backstage/config@1.2.0 + - @backstage/integration-aws-node@0.1.12 + - @backstage/plugin-search-common@1.2.12 + ## 1.5.0 ### Minor Changes diff --git a/plugins/search-backend-module-elasticsearch/package.json b/plugins/search-backend-module-elasticsearch/package.json index 6f5d8e3b02..57414ec6e5 100644 --- a/plugins/search-backend-module-elasticsearch/package.json +++ b/plugins/search-backend-module-elasticsearch/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-search-backend-module-elasticsearch", - "version": "1.5.0", + "version": "1.5.2-next.0", "description": "A module for the search backend that implements search using ElasticSearch", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/search-backend-module-explore/CHANGELOG.md b/plugins/search-backend-module-explore/CHANGELOG.md index f16e3019c3..4b75d163f9 100644 --- a/plugins/search-backend-module-explore/CHANGELOG.md +++ b/plugins/search-backend-module-explore/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-search-backend-module-explore +## 0.1.27-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/plugin-search-backend-node@1.2.26-next.0 + - @backstage/config@1.2.0 + - @backstage/plugin-search-common@1.2.12 + ## 0.1.25 ### Patch Changes diff --git a/plugins/search-backend-module-explore/package.json b/plugins/search-backend-module-explore/package.json index d1960f1f01..13cba189e5 100644 --- a/plugins/search-backend-module-explore/package.json +++ b/plugins/search-backend-module-explore/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-search-backend-module-explore", - "version": "0.1.25", + "version": "0.1.27-next.0", "description": "A module for the search backend that exports explore modules", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/search-backend-module-pg/CHANGELOG.md b/plugins/search-backend-module-pg/CHANGELOG.md index bd0d338f71..376d266f8f 100644 --- a/plugins/search-backend-module-pg/CHANGELOG.md +++ b/plugins/search-backend-module-pg/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-search-backend-module-pg +## 0.5.31-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-app-api@0.7.9-next.0 + - @backstage/plugin-search-backend-node@1.2.26-next.0 + - @backstage/config@1.2.0 + - @backstage/plugin-search-common@1.2.12 + ## 0.5.28 ### Patch Changes diff --git a/plugins/search-backend-module-pg/package.json b/plugins/search-backend-module-pg/package.json index 114fde5f37..3319d85dbb 100644 --- a/plugins/search-backend-module-pg/package.json +++ b/plugins/search-backend-module-pg/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-search-backend-module-pg", - "version": "0.5.28", + "version": "0.5.31-next.0", "description": "A module for the search backend that implements search using PostgreSQL", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/search-backend-module-stack-overflow-collator/CHANGELOG.md b/plugins/search-backend-module-stack-overflow-collator/CHANGELOG.md index a435215096..91652d5543 100644 --- a/plugins/search-backend-module-stack-overflow-collator/CHANGELOG.md +++ b/plugins/search-backend-module-stack-overflow-collator/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-search-backend-module-stack-overflow-collator +## 0.1.14-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/plugin-search-backend-node@1.2.26-next.0 + - @backstage/config@1.2.0 + - @backstage/plugin-search-common@1.2.12 + ## 0.1.12 ### Patch Changes diff --git a/plugins/search-backend-module-stack-overflow-collator/package.json b/plugins/search-backend-module-stack-overflow-collator/package.json index c817100356..60b658a34a 100644 --- a/plugins/search-backend-module-stack-overflow-collator/package.json +++ b/plugins/search-backend-module-stack-overflow-collator/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-search-backend-module-stack-overflow-collator", - "version": "0.1.12", + "version": "0.1.14-next.0", "description": "A module for the search backend that exports stack overflow modules", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/search-backend-module-techdocs/CHANGELOG.md b/plugins/search-backend-module-techdocs/CHANGELOG.md index e6ec7acec3..4e7e3c4baa 100644 --- a/plugins/search-backend-module-techdocs/CHANGELOG.md +++ b/plugins/search-backend-module-techdocs/CHANGELOG.md @@ -1,5 +1,23 @@ # @backstage/plugin-search-backend-module-techdocs +## 0.1.26-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/plugin-catalog-node@1.12.3-next.0 + - @backstage/plugin-search-backend-node@1.2.26-next.0 + - @backstage/plugin-techdocs-node@1.12.7-next.0 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-search-common@1.2.12 + ## 0.1.24 ### Patch Changes diff --git a/plugins/search-backend-module-techdocs/package.json b/plugins/search-backend-module-techdocs/package.json index ffb4eb0042..1650012d93 100644 --- a/plugins/search-backend-module-techdocs/package.json +++ b/plugins/search-backend-module-techdocs/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-search-backend-module-techdocs", - "version": "0.1.24", + "version": "0.1.26-next.0", "description": "A module for the search backend that exports techdocs modules", "backstage": { "role": "backend-plugin-module", diff --git a/plugins/search-backend-node/CHANGELOG.md b/plugins/search-backend-node/CHANGELOG.md index 9ff9f409e7..5209cb8753 100644 --- a/plugins/search-backend-node/CHANGELOG.md +++ b/plugins/search-backend-node/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-search-backend-node +## 1.2.26-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-tasks@0.5.26-next.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-search-common@1.2.12 + ## 1.2.24 ### Patch Changes diff --git a/plugins/search-backend-node/package.json b/plugins/search-backend-node/package.json index 4298ea10ff..ef655ac566 100644 --- a/plugins/search-backend-node/package.json +++ b/plugins/search-backend-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-search-backend-node", - "version": "1.2.24", + "version": "1.2.26-next.0", "description": "A library for Backstage backend plugins that want to interact with the search backend plugin", "backstage": { "role": "node-library", diff --git a/plugins/search-backend/CHANGELOG.md b/plugins/search-backend/CHANGELOG.md index 56191eb595..ea4142e583 100644 --- a/plugins/search-backend/CHANGELOG.md +++ b/plugins/search-backend/CHANGELOG.md @@ -1,5 +1,22 @@ # @backstage/plugin-search-backend +## 1.5.13-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-defaults@0.3.3-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/backend-openapi-utils@0.1.14-next.0 + - @backstage/plugin-permission-node@0.7.32-next.0 + - @backstage/plugin-search-backend-node@1.2.26-next.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/plugin-permission-common@0.7.14 + - @backstage/plugin-search-common@1.2.12 + ## 1.5.10 ### Patch Changes diff --git a/plugins/search-backend/package.json b/plugins/search-backend/package.json index 513446f170..c1d536d4d4 100644 --- a/plugins/search-backend/package.json +++ b/plugins/search-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-search-backend", - "version": "1.5.10", + "version": "1.5.13-next.0", "description": "The Backstage backend plugin that provides your backstage app with search", "backstage": { "role": "backend-plugin", diff --git a/plugins/search-react/CHANGELOG.md b/plugins/search-react/CHANGELOG.md index a8e19d9649..19ace29f0c 100644 --- a/plugins/search-react/CHANGELOG.md +++ b/plugins/search-react/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-search-react +## 1.7.13-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/frontend-plugin-api@0.6.7-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + - @backstage/plugin-search-common@1.2.12 + ## 1.7.12 ### Patch Changes diff --git a/plugins/search-react/package.json b/plugins/search-react/package.json index d2496923d3..25bc946bd4 100644 --- a/plugins/search-react/package.json +++ b/plugins/search-react/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-search-react", - "version": "1.7.12", + "version": "1.7.13-next.0", "backstage": { "role": "web-library", "pluginId": "search", diff --git a/plugins/search/CHANGELOG.md b/plugins/search/CHANGELOG.md index 97f03fb61e..effe205170 100644 --- a/plugins/search/CHANGELOG.md +++ b/plugins/search/CHANGELOG.md @@ -1,5 +1,21 @@ # @backstage/plugin-search +## 1.4.13-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/plugin-catalog-react@1.12.2-next.0 + - @backstage/frontend-plugin-api@0.6.7-next.0 + - @backstage/plugin-search-react@1.7.13-next.0 + - @backstage/core-compat-api@0.2.7-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/version-bridge@1.0.8 + - @backstage/plugin-search-common@1.2.12 + ## 1.4.12 ### Patch Changes diff --git a/plugins/search/package.json b/plugins/search/package.json index 68279bfab6..f25bff3e26 100644 --- a/plugins/search/package.json +++ b/plugins/search/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-search", - "version": "1.4.12", + "version": "1.4.13-next.0", "description": "The Backstage plugin that provides your backstage app with search", "backstage": { "role": "frontend-plugin", diff --git a/plugins/signals-backend/CHANGELOG.md b/plugins/signals-backend/CHANGELOG.md index 068c2be032..1e9c57e1da 100644 --- a/plugins/signals-backend/CHANGELOG.md +++ b/plugins/signals-backend/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/plugin-signals-backend +## 0.1.7-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/plugin-events-node@0.3.7-next.0 + - @backstage/plugin-signals-node@0.1.7-next.0 + - @backstage/config@1.2.0 + - @backstage/types@1.1.1 + ## 0.1.5 ### Patch Changes diff --git a/plugins/signals-backend/package.json b/plugins/signals-backend/package.json index 420a5f7a93..9501878d87 100644 --- a/plugins/signals-backend/package.json +++ b/plugins/signals-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-signals-backend", - "version": "0.1.5", + "version": "0.1.7-next.0", "backstage": { "role": "backend-plugin", "pluginId": "signals", diff --git a/plugins/signals-node/CHANGELOG.md b/plugins/signals-node/CHANGELOG.md index 825a9f9e04..28db4b57fa 100644 --- a/plugins/signals-node/CHANGELOG.md +++ b/plugins/signals-node/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-signals-node +## 0.1.7-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/plugin-events-node@0.3.7-next.0 + - @backstage/config@1.2.0 + - @backstage/types@1.1.1 + ## 0.1.5 ### Patch Changes diff --git a/plugins/signals-node/package.json b/plugins/signals-node/package.json index 3a000d8fdd..8185c27d6b 100644 --- a/plugins/signals-node/package.json +++ b/plugins/signals-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-signals-node", - "version": "0.1.5", + "version": "0.1.7-next.0", "description": "Node.js library for the signals plugin", "backstage": { "role": "node-library", diff --git a/plugins/signals/CHANGELOG.md b/plugins/signals/CHANGELOG.md index 406f2d5a2d..f5992789c5 100644 --- a/plugins/signals/CHANGELOG.md +++ b/plugins/signals/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/plugin-signals +## 0.0.8-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/theme@0.5.6 + - @backstage/types@1.1.1 + - @backstage/plugin-signals-react@0.0.4 + ## 0.0.7 ### Patch Changes diff --git a/plugins/signals/package.json b/plugins/signals/package.json index bda5c4bcac..18345295b5 100644 --- a/plugins/signals/package.json +++ b/plugins/signals/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-signals", - "version": "0.0.7", + "version": "0.0.8-next.0", "backstage": { "role": "frontend-plugin", "pluginId": "signals", diff --git a/plugins/techdocs-addons-test-utils/CHANGELOG.md b/plugins/techdocs-addons-test-utils/CHANGELOG.md index 323053ee29..93552868b9 100644 --- a/plugins/techdocs-addons-test-utils/CHANGELOG.md +++ b/plugins/techdocs-addons-test-utils/CHANGELOG.md @@ -1,5 +1,20 @@ # @backstage/plugin-techdocs-addons-test-utils +## 1.0.34-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-techdocs-react@1.2.6-next.0 + - @backstage/plugin-techdocs@1.10.7-next.0 + - @backstage/core-app-api@1.13.0-next.0 + - @backstage/plugin-catalog-react@1.12.2-next.0 + - @backstage/plugin-catalog@1.21.1-next.0 + - @backstage/integration-react@1.1.29-next.0 + - @backstage/plugin-search-react@1.7.13-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/test-utils@1.5.7-next.0 + ## 1.0.33 ### Patch Changes diff --git a/plugins/techdocs-addons-test-utils/package.json b/plugins/techdocs-addons-test-utils/package.json index e21b7efdab..a18bfea16f 100644 --- a/plugins/techdocs-addons-test-utils/package.json +++ b/plugins/techdocs-addons-test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-techdocs-addons-test-utils", - "version": "1.0.33", + "version": "1.0.34-next.0", "backstage": { "role": "web-library", "pluginId": "techdocs-addons", diff --git a/plugins/techdocs-backend/CHANGELOG.md b/plugins/techdocs-backend/CHANGELOG.md index 2bfb317da5..286ea77341 100644 --- a/plugins/techdocs-backend/CHANGELOG.md +++ b/plugins/techdocs-backend/CHANGELOG.md @@ -1,5 +1,22 @@ # @backstage/plugin-techdocs-backend +## 1.10.8-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-search-backend-module-techdocs@0.1.26-next.0 + - @backstage/plugin-techdocs-node@1.12.7-next.0 + - @backstage/catalog-client@1.6.5 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/plugin-catalog-common@1.0.24 + - @backstage/plugin-permission-common@0.7.14 + ## 1.10.6 ### Patch Changes diff --git a/plugins/techdocs-backend/package.json b/plugins/techdocs-backend/package.json index 081b8ab46d..01891b83d4 100644 --- a/plugins/techdocs-backend/package.json +++ b/plugins/techdocs-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-techdocs-backend", - "version": "1.10.6", + "version": "1.10.8-next.0", "description": "The Backstage backend plugin that renders technical documentation for your components", "backstage": { "role": "backend-plugin", diff --git a/plugins/techdocs-module-addons-contrib/CHANGELOG.md b/plugins/techdocs-module-addons-contrib/CHANGELOG.md index 50fc80dc51..da76210708 100644 --- a/plugins/techdocs-module-addons-contrib/CHANGELOG.md +++ b/plugins/techdocs-module-addons-contrib/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/plugin-techdocs-module-addons-contrib +## 1.1.12-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-techdocs-react@1.2.6-next.0 + - @backstage/core-components@0.14.9-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/integration-react@1.1.29-next.0 + - @backstage/core-plugin-api@1.9.3 + ## 1.1.11 ### Patch Changes diff --git a/plugins/techdocs-module-addons-contrib/package.json b/plugins/techdocs-module-addons-contrib/package.json index 1bc6b81393..f0b2301dfb 100644 --- a/plugins/techdocs-module-addons-contrib/package.json +++ b/plugins/techdocs-module-addons-contrib/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-techdocs-module-addons-contrib", - "version": "1.1.11", + "version": "1.1.12-next.0", "description": "Plugin module for contributed TechDocs Addons", "backstage": { "role": "frontend-plugin-module", diff --git a/plugins/techdocs-node/CHANGELOG.md b/plugins/techdocs-node/CHANGELOG.md index 5eb1e136d5..0093f6a1eb 100644 --- a/plugins/techdocs-node/CHANGELOG.md +++ b/plugins/techdocs-node/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-techdocs-node +## 1.12.7-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/integration-aws-node@0.1.12 + - @backstage/plugin-search-common@1.2.12 + ## 1.12.5 ### Patch Changes diff --git a/plugins/techdocs-node/package.json b/plugins/techdocs-node/package.json index ea88766af8..ae11fcb1df 100644 --- a/plugins/techdocs-node/package.json +++ b/plugins/techdocs-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-techdocs-node", - "version": "1.12.5", + "version": "1.12.7-next.0", "description": "Common node.js functionalities for TechDocs, to be shared between techdocs-backend plugin and techdocs-cli", "backstage": { "role": "node-library", diff --git a/plugins/techdocs-react/CHANGELOG.md b/plugins/techdocs-react/CHANGELOG.md index 19fce86d6f..d07ed27eb0 100644 --- a/plugins/techdocs-react/CHANGELOG.md +++ b/plugins/techdocs-react/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-techdocs-react +## 1.2.6-next.0 + +### Patch Changes + +- 8ac9ce5: Fixed a bug with the TechDocsReaderPageProvider not re-rendering when setShadowDom is called, meaning that the useShadowDom hooks were inconsistent. This issue caused the TextSize addon changes not to reapply during navigation. +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/version-bridge@1.0.8 + ## 1.2.5 ### Patch Changes diff --git a/plugins/techdocs-react/package.json b/plugins/techdocs-react/package.json index 05bd66a014..d002db68d1 100644 --- a/plugins/techdocs-react/package.json +++ b/plugins/techdocs-react/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-techdocs-react", - "version": "1.2.5", + "version": "1.2.6-next.0", "description": "Shared frontend utilities for TechDocs and Addons", "backstage": { "role": "web-library", diff --git a/plugins/techdocs/CHANGELOG.md b/plugins/techdocs/CHANGELOG.md index 3701cb652d..fd35205da8 100644 --- a/plugins/techdocs/CHANGELOG.md +++ b/plugins/techdocs/CHANGELOG.md @@ -1,5 +1,27 @@ # @backstage/plugin-techdocs +## 1.10.7-next.0 + +### Patch Changes + +- 8ac9ce5: Fixed a bug with the TechDocsReaderPageProvider not re-rendering when setShadowDom is called, meaning that the useShadowDom hooks were inconsistent. This issue caused the TextSize addon changes not to reapply during navigation. +- Updated dependencies + - @backstage/plugin-techdocs-react@1.2.6-next.0 + - @backstage/core-components@0.14.9-next.0 + - @backstage/integration@1.13.0-next.0 + - @backstage/plugin-catalog-react@1.12.2-next.0 + - @backstage/frontend-plugin-api@0.6.7-next.0 + - @backstage/integration-react@1.1.29-next.0 + - @backstage/plugin-auth-react@0.1.4-next.0 + - @backstage/plugin-search-react@1.7.13-next.0 + - @backstage/core-compat-api@0.2.7-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/catalog-model@1.5.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/theme@0.5.6 + - @backstage/plugin-search-common@1.2.12 + ## 1.10.6 ### Patch Changes diff --git a/plugins/techdocs/package.json b/plugins/techdocs/package.json index 194a8575d0..8212246aab 100644 --- a/plugins/techdocs/package.json +++ b/plugins/techdocs/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-techdocs", - "version": "1.10.6", + "version": "1.10.7-next.0", "description": "The Backstage plugin that renders technical documentation for your components", "backstage": { "role": "frontend-plugin", diff --git a/plugins/user-settings-backend/CHANGELOG.md b/plugins/user-settings-backend/CHANGELOG.md index 489315b458..cbd2ab7536 100644 --- a/plugins/user-settings-backend/CHANGELOG.md +++ b/plugins/user-settings-backend/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-user-settings-backend +## 0.2.20-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@0.6.21-next.0 + - @backstage/backend-common@0.23.2-next.0 + - @backstage/plugin-auth-node@0.4.16-next.0 + - @backstage/plugin-signals-node@0.1.7-next.0 + - @backstage/config@1.2.0 + - @backstage/errors@1.2.4 + - @backstage/types@1.1.1 + - @backstage/plugin-user-settings-common@0.0.1 + ## 0.2.18 ### Patch Changes diff --git a/plugins/user-settings-backend/package.json b/plugins/user-settings-backend/package.json index 556b0d3e4a..d8dc0770a5 100644 --- a/plugins/user-settings-backend/package.json +++ b/plugins/user-settings-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-user-settings-backend", - "version": "0.2.18", + "version": "0.2.20-next.0", "description": "The Backstage backend plugin to manage user settings", "backstage": { "role": "backend-plugin", diff --git a/plugins/user-settings/CHANGELOG.md b/plugins/user-settings/CHANGELOG.md index bde8fa4408..20ef229a2d 100644 --- a/plugins/user-settings/CHANGELOG.md +++ b/plugins/user-settings/CHANGELOG.md @@ -1,5 +1,22 @@ # @backstage/plugin-user-settings +## 0.8.8-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.14.9-next.0 + - @backstage/core-app-api@1.13.0-next.0 + - @backstage/plugin-catalog-react@1.12.2-next.0 + - @backstage/frontend-plugin-api@0.6.7-next.0 + - @backstage/core-compat-api@0.2.7-next.0 + - @backstage/core-plugin-api@1.9.3 + - @backstage/errors@1.2.4 + - @backstage/theme@0.5.6 + - @backstage/types@1.1.1 + - @backstage/plugin-signals-react@0.0.4 + - @backstage/plugin-user-settings-common@0.0.1 + ## 0.8.7 ### Patch Changes diff --git a/plugins/user-settings/package.json b/plugins/user-settings/package.json index 05d594d85e..3257de8072 100644 --- a/plugins/user-settings/package.json +++ b/plugins/user-settings/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-user-settings", - "version": "0.8.7", + "version": "0.8.8-next.0", "description": "A Backstage plugin that provides a settings page", "backstage": { "role": "frontend-plugin", diff --git a/yarn.lock b/yarn.lock index 3671d290fc..d396102ee2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3838,7 +3838,7 @@ __metadata: languageName: unknown linkType: soft -"@backstage/catalog-client@workspace:^, @backstage/catalog-client@workspace:packages/catalog-client": +"@backstage/catalog-client@^1.6.5, @backstage/catalog-client@workspace:^, @backstage/catalog-client@workspace:packages/catalog-client": version: 0.0.0-use.local resolution: "@backstage/catalog-client@workspace:packages/catalog-client" dependencies: @@ -3851,7 +3851,7 @@ __metadata: languageName: unknown linkType: soft -"@backstage/catalog-model@^1.4.3, @backstage/catalog-model@^1.4.5, @backstage/catalog-model@workspace:^, @backstage/catalog-model@workspace:packages/catalog-model": +"@backstage/catalog-model@^1.4.3, @backstage/catalog-model@^1.4.5, @backstage/catalog-model@^1.5.0, @backstage/catalog-model@workspace:^, @backstage/catalog-model@workspace:packages/catalog-model": version: 0.0.0-use.local resolution: "@backstage/catalog-model@workspace:packages/catalog-model" dependencies: @@ -4103,7 +4103,7 @@ __metadata: languageName: unknown linkType: soft -"@backstage/config@^1.1.1, @backstage/config@workspace:^, @backstage/config@workspace:packages/config": +"@backstage/config@^1.1.1, @backstage/config@^1.2.0, @backstage/config@workspace:^, @backstage/config@workspace:packages/config": version: 0.0.0-use.local resolution: "@backstage/config@workspace:packages/config" dependencies: @@ -4175,7 +4175,107 @@ __metadata: languageName: unknown linkType: soft -"@backstage/core-components@^0.14.4, @backstage/core-components@workspace:^, @backstage/core-components@workspace:packages/core-components": +"@backstage/core-components@npm:^0.13.10": + version: 0.13.10 + resolution: "@backstage/core-components@npm:0.13.10" + dependencies: + "@backstage/config": ^1.1.1 + "@backstage/core-plugin-api": ^1.8.2 + "@backstage/errors": ^1.2.3 + "@backstage/theme": ^0.5.0 + "@backstage/version-bridge": ^1.0.7 + "@date-io/core": ^1.3.13 + "@material-table/core": ^3.1.0 + "@material-ui/core": ^4.12.2 + "@material-ui/icons": ^4.9.1 + "@material-ui/lab": 4.0.0-alpha.61 + "@react-hookz/web": ^23.0.0 + "@types/react": ^16.13.1 || ^17.0.0 + "@types/react-sparklines": ^1.7.0 + "@types/react-text-truncate": ^0.14.0 + ansi-regex: ^6.0.1 + classnames: ^2.2.6 + d3-selection: ^3.0.0 + d3-shape: ^3.0.0 + d3-zoom: ^3.0.0 + dagre: ^0.8.5 + linkify-react: 4.1.3 + linkifyjs: 4.1.3 + lodash: ^4.17.21 + pluralize: ^8.0.0 + qs: ^6.9.4 + rc-progress: 3.5.1 + react-helmet: 6.1.0 + react-hook-form: ^7.12.2 + react-idle-timer: 5.6.2 + react-markdown: ^8.0.0 + react-sparklines: ^1.7.0 + react-syntax-highlighter: ^15.4.5 + react-text-truncate: ^0.19.0 + react-use: ^17.3.2 + react-virtualized-auto-sizer: ^1.0.11 + react-window: ^1.8.6 + remark-gfm: ^3.0.1 + zen-observable: ^0.10.0 + zod: ^3.22.4 + peerDependencies: + react: ^16.13.1 || ^17.0.0 || ^18.0.0 + react-dom: ^16.13.1 || ^17.0.0 || ^18.0.0 + react-router-dom: 6.0.0-beta.0 || ^6.3.0 + checksum: ec2a0d0a27bc4d6b9d4da97f0b4df600148529ee51bf2c8e7d3adc45c3950adac662535d3beabc451db346f2c7e3c412ceaa756fc774012b43dff5e2695f2271 + languageName: node + linkType: hard + +"@backstage/core-components@npm:^0.14.4, @backstage/core-components@npm:^0.14.8": + version: 0.14.8 + resolution: "@backstage/core-components@npm:0.14.8" + dependencies: + "@backstage/config": ^1.2.0 + "@backstage/core-plugin-api": ^1.9.3 + "@backstage/errors": ^1.2.4 + "@backstage/theme": ^0.5.6 + "@backstage/version-bridge": ^1.0.8 + "@date-io/core": ^1.3.13 + "@material-table/core": ^3.1.0 + "@material-ui/core": ^4.12.2 + "@material-ui/icons": ^4.9.1 + "@material-ui/lab": 4.0.0-alpha.61 + "@react-hookz/web": ^24.0.0 + "@types/react": ^16.13.1 || ^17.0.0 || ^18.0.0 + "@types/react-sparklines": ^1.7.0 + ansi-regex: ^6.0.1 + classnames: ^2.2.6 + d3-selection: ^3.0.0 + d3-shape: ^3.0.0 + d3-zoom: ^3.0.0 + dagre: ^0.8.5 + linkify-react: 4.1.3 + linkifyjs: 4.1.3 + lodash: ^4.17.21 + pluralize: ^8.0.0 + qs: ^6.9.4 + rc-progress: 3.5.1 + react-helmet: 6.1.0 + react-hook-form: ^7.12.2 + react-idle-timer: 5.7.2 + react-markdown: ^8.0.0 + react-sparklines: ^1.7.0 + react-syntax-highlighter: ^15.4.5 + react-use: ^17.3.2 + react-virtualized-auto-sizer: ^1.0.11 + react-window: ^1.8.6 + remark-gfm: ^3.0.1 + zen-observable: ^0.10.0 + zod: ^3.22.4 + peerDependencies: + react: ^16.13.1 || ^17.0.0 || ^18.0.0 + react-dom: ^16.13.1 || ^17.0.0 || ^18.0.0 + react-router-dom: 6.0.0-beta.0 || ^6.3.0 + checksum: b833e833c83f72e0cc695fe2726cbf01b58819ad062ed9ab1e604514bb398ade20e1abb208d2e39ab1f746fdbd4547486e3935bacb44b457a47070f9c77895dc + languageName: node + linkType: hard + +"@backstage/core-components@workspace:^, @backstage/core-components@workspace:packages/core-components": version: 0.0.0-use.local resolution: "@backstage/core-components@workspace:packages/core-components" dependencies: @@ -4246,58 +4346,7 @@ __metadata: languageName: unknown linkType: soft -"@backstage/core-components@npm:^0.13.10": - version: 0.13.10 - resolution: "@backstage/core-components@npm:0.13.10" - dependencies: - "@backstage/config": ^1.1.1 - "@backstage/core-plugin-api": ^1.8.2 - "@backstage/errors": ^1.2.3 - "@backstage/theme": ^0.5.0 - "@backstage/version-bridge": ^1.0.7 - "@date-io/core": ^1.3.13 - "@material-table/core": ^3.1.0 - "@material-ui/core": ^4.12.2 - "@material-ui/icons": ^4.9.1 - "@material-ui/lab": 4.0.0-alpha.61 - "@react-hookz/web": ^23.0.0 - "@types/react": ^16.13.1 || ^17.0.0 - "@types/react-sparklines": ^1.7.0 - "@types/react-text-truncate": ^0.14.0 - ansi-regex: ^6.0.1 - classnames: ^2.2.6 - d3-selection: ^3.0.0 - d3-shape: ^3.0.0 - d3-zoom: ^3.0.0 - dagre: ^0.8.5 - linkify-react: 4.1.3 - linkifyjs: 4.1.3 - lodash: ^4.17.21 - pluralize: ^8.0.0 - qs: ^6.9.4 - rc-progress: 3.5.1 - react-helmet: 6.1.0 - react-hook-form: ^7.12.2 - react-idle-timer: 5.6.2 - react-markdown: ^8.0.0 - react-sparklines: ^1.7.0 - react-syntax-highlighter: ^15.4.5 - react-text-truncate: ^0.19.0 - react-use: ^17.3.2 - react-virtualized-auto-sizer: ^1.0.11 - react-window: ^1.8.6 - remark-gfm: ^3.0.1 - zen-observable: ^0.10.0 - zod: ^3.22.4 - peerDependencies: - react: ^16.13.1 || ^17.0.0 || ^18.0.0 - react-dom: ^16.13.1 || ^17.0.0 || ^18.0.0 - react-router-dom: 6.0.0-beta.0 || ^6.3.0 - checksum: ec2a0d0a27bc4d6b9d4da97f0b4df600148529ee51bf2c8e7d3adc45c3950adac662535d3beabc451db346f2c7e3c412ceaa756fc774012b43dff5e2695f2271 - languageName: node - linkType: hard - -"@backstage/core-plugin-api@^1.8.2, @backstage/core-plugin-api@^1.9.2, @backstage/core-plugin-api@workspace:^, @backstage/core-plugin-api@workspace:packages/core-plugin-api": +"@backstage/core-plugin-api@^1.8.2, @backstage/core-plugin-api@^1.9.2, @backstage/core-plugin-api@^1.9.3, @backstage/core-plugin-api@workspace:^, @backstage/core-plugin-api@workspace:packages/core-plugin-api": version: 0.0.0-use.local resolution: "@backstage/core-plugin-api@workspace:packages/core-plugin-api" dependencies: @@ -4444,6 +4493,26 @@ __metadata: languageName: unknown linkType: soft +"@backstage/frontend-plugin-api@npm:^0.6.6": + version: 0.6.6 + resolution: "@backstage/frontend-plugin-api@npm:0.6.6" + dependencies: + "@backstage/core-components": ^0.14.8 + "@backstage/core-plugin-api": ^1.9.3 + "@backstage/types": ^1.1.1 + "@backstage/version-bridge": ^1.0.8 + "@material-ui/core": ^4.12.4 + "@types/react": ^16.13.1 || ^17.0.0 || ^18.0.0 + lodash: ^4.17.21 + zod: ^3.22.4 + zod-to-json-schema: ^3.21.4 + peerDependencies: + react: ^16.13.1 || ^17.0.0 || ^18.0.0 + react-router-dom: 6.0.0-beta.0 || ^6.3.0 + checksum: c2af07bb73751f050937ba0f34941cc21639defdf13c6e219069ff4143324404229113874caef28f41b9a92a00121991da2a88782595e5221b48910e2f8be7c7 + languageName: node + linkType: hard + "@backstage/frontend-plugin-api@workspace:^, @backstage/frontend-plugin-api@workspace:packages/frontend-plugin-api": version: 0.0.0-use.local resolution: "@backstage/frontend-plugin-api@workspace:packages/frontend-plugin-api" @@ -4507,6 +4576,24 @@ __metadata: languageName: unknown linkType: soft +"@backstage/integration-react@npm:^1.1.28": + version: 1.1.28 + resolution: "@backstage/integration-react@npm:1.1.28" + dependencies: + "@backstage/config": ^1.2.0 + "@backstage/core-plugin-api": ^1.9.3 + "@backstage/integration": ^1.12.0 + "@material-ui/core": ^4.12.2 + "@material-ui/icons": ^4.9.1 + "@types/react": ^16.13.1 || ^17.0.0 + peerDependencies: + react: ^16.13.1 || ^17.0.0 || ^18.0.0 + react-dom: ^16.13.1 || ^17.0.0 || ^18.0.0 + react-router-dom: 6.0.0-beta.0 || ^6.3.0 + checksum: 15443a7ebc457114715651e652a40472085ca18ec10da078bad1e71e3aa9cac33d10704b164d09108f6195a9cb4d2eae11751d853598ef0dd0e4c160858f782d + languageName: node + linkType: hard + "@backstage/integration-react@workspace:^, @backstage/integration-react@workspace:packages/integration-react": version: 0.0.0-use.local resolution: "@backstage/integration-react@workspace:packages/integration-react" @@ -4531,6 +4618,23 @@ __metadata: languageName: unknown linkType: soft +"@backstage/integration@npm:^1.12.0": + version: 1.12.0 + resolution: "@backstage/integration@npm:1.12.0" + dependencies: + "@azure/identity": ^4.0.0 + "@backstage/config": ^1.2.0 + "@backstage/errors": ^1.2.4 + "@octokit/auth-app": ^4.0.0 + "@octokit/rest": ^19.0.3 + cross-fetch: ^4.0.0 + git-url-parse: ^14.0.0 + lodash: ^4.17.21 + luxon: ^3.0.0 + checksum: 603c08058dadfe54b5d1788db87bab951b53ea4d1b19f609873717e0ab514859cc8608d0d60755c91eaea000ad71f817c5dd50892a3215443d7eed5a1d24a849 + languageName: node + linkType: hard + "@backstage/integration@workspace:^, @backstage/integration@workspace:packages/integration": version: 0.0.0-use.local resolution: "@backstage/integration@workspace:packages/integration" @@ -5616,7 +5720,7 @@ __metadata: languageName: unknown linkType: soft -"@backstage/plugin-catalog-common@^1.0.20, @backstage/plugin-catalog-common@workspace:^, @backstage/plugin-catalog-common@workspace:plugins/catalog-common": +"@backstage/plugin-catalog-common@^1.0.20, @backstage/plugin-catalog-common@^1.0.24, @backstage/plugin-catalog-common@workspace:^, @backstage/plugin-catalog-common@workspace:plugins/catalog-common": version: 0.0.0-use.local resolution: "@backstage/plugin-catalog-common@workspace:plugins/catalog-common" dependencies: @@ -5725,7 +5829,43 @@ __metadata: languageName: unknown linkType: soft -"@backstage/plugin-catalog-react@^1.11.3, @backstage/plugin-catalog-react@^1.9.3, @backstage/plugin-catalog-react@workspace:^, @backstage/plugin-catalog-react@workspace:plugins/catalog-react": +"@backstage/plugin-catalog-react@npm:^1.11.3, @backstage/plugin-catalog-react@npm:^1.9.3": + version: 1.12.1 + resolution: "@backstage/plugin-catalog-react@npm:1.12.1" + dependencies: + "@backstage/catalog-client": ^1.6.5 + "@backstage/catalog-model": ^1.5.0 + "@backstage/core-components": ^0.14.8 + "@backstage/core-plugin-api": ^1.9.3 + "@backstage/errors": ^1.2.4 + "@backstage/frontend-plugin-api": ^0.6.6 + "@backstage/integration-react": ^1.1.28 + "@backstage/plugin-catalog-common": ^1.0.24 + "@backstage/plugin-permission-common": ^0.7.14 + "@backstage/plugin-permission-react": ^0.4.23 + "@backstage/types": ^1.1.1 + "@backstage/version-bridge": ^1.0.8 + "@material-ui/core": ^4.12.2 + "@material-ui/icons": ^4.9.1 + "@material-ui/lab": 4.0.0-alpha.61 + "@react-hookz/web": ^24.0.0 + "@types/react": ^16.13.1 || ^17.0.0 || ^18.0.0 + classnames: ^2.2.6 + lodash: ^4.17.21 + material-ui-popup-state: ^1.9.3 + qs: ^6.9.4 + react-use: ^17.2.4 + yaml: ^2.0.0 + zen-observable: ^0.10.0 + peerDependencies: + react: ^16.13.1 || ^17.0.0 || ^18.0.0 + react-dom: ^16.13.1 || ^17.0.0 || ^18.0.0 + react-router-dom: 6.0.0-beta.0 || ^6.3.0 + checksum: adbf967e978fa6bb4798d0620853e41f64cc08c39dd0056fc01b2146ca427d1bfab401b8972d7b551d4188b90f80f69db9254799bca095608b7079cec73da9c5 + languageName: node + linkType: hard + +"@backstage/plugin-catalog-react@workspace:^, @backstage/plugin-catalog-react@workspace:plugins/catalog-react": version: 0.0.0-use.local resolution: "@backstage/plugin-catalog-react@workspace:plugins/catalog-react" dependencies: @@ -6568,7 +6708,7 @@ __metadata: languageName: unknown linkType: soft -"@backstage/plugin-permission-common@workspace:^, @backstage/plugin-permission-common@workspace:plugins/permission-common": +"@backstage/plugin-permission-common@^0.7.14, @backstage/plugin-permission-common@workspace:^, @backstage/plugin-permission-common@workspace:plugins/permission-common": version: 0.0.0-use.local resolution: "@backstage/plugin-permission-common@workspace:plugins/permission-common" dependencies: @@ -6606,7 +6746,7 @@ __metadata: languageName: unknown linkType: soft -"@backstage/plugin-permission-react@workspace:^, @backstage/plugin-permission-react@workspace:plugins/permission-react": +"@backstage/plugin-permission-react@^0.4.23, @backstage/plugin-permission-react@workspace:^, @backstage/plugin-permission-react@workspace:plugins/permission-react": version: 0.0.0-use.local resolution: "@backstage/plugin-permission-react@workspace:plugins/permission-react" dependencies: @@ -7927,7 +8067,7 @@ __metadata: languageName: unknown linkType: soft -"@backstage/theme@^0.5.0, @backstage/theme@workspace:^, @backstage/theme@workspace:packages/theme": +"@backstage/theme@^0.5.0, @backstage/theme@^0.5.6, @backstage/theme@workspace:^, @backstage/theme@workspace:packages/theme": version: 0.0.0-use.local resolution: "@backstage/theme@workspace:packages/theme" dependencies: @@ -7958,7 +8098,7 @@ __metadata: languageName: unknown linkType: soft -"@backstage/version-bridge@^1.0.7, @backstage/version-bridge@workspace:^, @backstage/version-bridge@workspace:packages/version-bridge": +"@backstage/version-bridge@^1.0.7, @backstage/version-bridge@^1.0.8, @backstage/version-bridge@workspace:^, @backstage/version-bridge@workspace:packages/version-bridge": version: 0.0.0-use.local resolution: "@backstage/version-bridge@workspace:packages/version-bridge" dependencies: