From 0898076bf093a73e83eff44f9563e63d5ce4b926 Mon Sep 17 00:00:00 2001 From: Erik Engervall Date: Mon, 23 Aug 2021 15:02:50 +0200 Subject: [PATCH 01/10] Expose GRM constants, helpers and components via an 'internal' variable Signed-off-by: Erik Engervall --- .../src/components/index.tsx | 24 +++++++++++++++++++ .../src/helpers/getBumpedTag.ts | 12 ++++++++++ .../git-release-manager/src/helpers/index.tsx | 24 +++++++++++++++++++ .../src/helpers/tagParts/getTagParts.ts | 4 ++++ plugins/git-release-manager/src/index.ts | 1 + plugins/git-release-manager/src/plugin.ts | 16 +++++++++---- 6 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 plugins/git-release-manager/src/components/index.tsx create mode 100644 plugins/git-release-manager/src/helpers/index.tsx diff --git a/plugins/git-release-manager/src/components/index.tsx b/plugins/git-release-manager/src/components/index.tsx new file mode 100644 index 0000000000..2ce1edc6d2 --- /dev/null +++ b/plugins/git-release-manager/src/components/index.tsx @@ -0,0 +1,24 @@ +/* + * 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 { Differ } from './Differ'; +export { Divider } from './Divider'; +export { InfoCardPlus } from './InfoCardPlus'; +export { LinearProgressWithLabel } from './ResponseStepDialog/LinearProgressWithLabel'; +export { NoLatestRelease } from './NoLatestRelease'; +export { ResponseStepDialog } from './ResponseStepDialog/ResponseStepDialog'; +export { ResponseStepList } from './ResponseStepDialog/ResponseStepList'; +export { ResponseStepListItem } from './ResponseStepDialog/ResponseStepListItem'; diff --git a/plugins/git-release-manager/src/helpers/getBumpedTag.ts b/plugins/git-release-manager/src/helpers/getBumpedTag.ts index c368047635..dbfb00818e 100644 --- a/plugins/git-release-manager/src/helpers/getBumpedTag.ts +++ b/plugins/git-release-manager/src/helpers/getBumpedTag.ts @@ -21,6 +21,14 @@ import { Project } from '../contexts/ProjectContext'; import { SEMVER_PARTS } from '../constants/constants'; import { SemverTagParts } from './tagParts/getSemverTagParts'; +/** + * Calculates the next version for the project + * + * For calendar versioning this means a bump in patch + * + * For semantic versioning this means either a minor or a patch bump + * depending on the value of `bumpLevel` + */ export function getBumpedTag({ project, tag, @@ -74,6 +82,10 @@ function getBumpedSemverTag( }; } +/** + * Calculates the next semantic version, taking into account + * whether or not it's a minor or patch + */ export function getBumpedSemverTagParts( tagParts: SemverTagParts, semverBumpLevel: keyof typeof SEMVER_PARTS, diff --git a/plugins/git-release-manager/src/helpers/index.tsx b/plugins/git-release-manager/src/helpers/index.tsx new file mode 100644 index 0000000000..1516e192a1 --- /dev/null +++ b/plugins/git-release-manager/src/helpers/index.tsx @@ -0,0 +1,24 @@ +/* + * 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 { calverRegexp, getCalverTagParts } from './tagParts/getCalverTagParts'; +export { getBumpedSemverTagParts, getBumpedTag } from './getBumpedTag'; +export { getSemverTagParts, semverRegexp } from './tagParts/getSemverTagParts'; +export { getShortCommitHash } from './getShortCommitHash'; +export { getTagParts } from './tagParts/getTagParts'; +export { isCalverTagParts } from './isCalverTagParts'; +export { isProjectValid } from './isProjectValid'; +export { validateTagName } from './tagParts/validateTagName'; diff --git a/plugins/git-release-manager/src/helpers/tagParts/getTagParts.ts b/plugins/git-release-manager/src/helpers/tagParts/getTagParts.ts index acedf2e8d1..750e4e23c5 100644 --- a/plugins/git-release-manager/src/helpers/tagParts/getTagParts.ts +++ b/plugins/git-release-manager/src/helpers/tagParts/getTagParts.ts @@ -18,6 +18,10 @@ import { getCalverTagParts } from './getCalverTagParts'; import { getSemverTagParts } from './getSemverTagParts'; import { Project } from '../../contexts/ProjectContext'; +/** + * Tag parts are the individual parts of a version, e.g. .. + * are the parts of a semantic version + */ export function getTagParts({ project, tag, diff --git a/plugins/git-release-manager/src/index.ts b/plugins/git-release-manager/src/index.ts index 767dc5c6e1..5646a2f61a 100644 --- a/plugins/git-release-manager/src/index.ts +++ b/plugins/git-release-manager/src/index.ts @@ -18,4 +18,5 @@ export { gitReleaseManagerPlugin, GitReleaseManagerPage, gitReleaseManagerApiRef, + internals, } from './plugin'; diff --git a/plugins/git-release-manager/src/plugin.ts b/plugins/git-release-manager/src/plugin.ts index 511fd4b92e..943102f188 100644 --- a/plugins/git-release-manager/src/plugin.ts +++ b/plugins/git-release-manager/src/plugin.ts @@ -14,10 +14,6 @@ * limitations under the License. */ -import { gitReleaseManagerApiRef } from './api/serviceApiRef'; - -import { GitReleaseClient } from './api/GitReleaseClient'; -import { rootRouteRef } from './routes'; import { configApiRef, createPlugin, @@ -26,7 +22,19 @@ import { createRoutableExtension, } from '@backstage/core-plugin-api'; +import { GitReleaseClient } from './api/GitReleaseClient'; +import { gitReleaseManagerApiRef } from './api/serviceApiRef'; +import { rootRouteRef } from './routes'; +import * as constants from './constants/constants'; +import * as helpers from './helpers'; +import * as components from './components'; + export { gitReleaseManagerApiRef }; +export const internals = { + constants, + helpers, + components, +}; export const gitReleaseManagerPlugin = createPlugin({ id: 'git-release-manager', From c9e61d909d20478513bb0340d9b5d812aa912dc5 Mon Sep 17 00:00:00 2001 From: Erik Engervall Date: Mon, 23 Aug 2021 15:06:29 +0200 Subject: [PATCH 02/10] Add changeset Signed-off-by: Erik Engervall --- .changeset/forty-peaches-cry.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/forty-peaches-cry.md diff --git a/.changeset/forty-peaches-cry.md b/.changeset/forty-peaches-cry.md new file mode 100644 index 0000000000..f388c8a0cd --- /dev/null +++ b/.changeset/forty-peaches-cry.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-git-release-manager': patch +--- + +Expose internal constants, helpers and components to make it easier for users to build custom features for GRM. From 70256a29a6cde652cef418ad4c7a520032d03e7d Mon Sep 17 00:00:00 2001 From: Erik Engervall Date: Mon, 23 Aug 2021 15:16:17 +0200 Subject: [PATCH 03/10] Fix ae-forgotten-export error Signed-off-by: Erik Engervall --- plugins/git-release-manager/src/index.ts | 9 ++++++++- plugins/git-release-manager/src/plugin.ts | 11 +++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/plugins/git-release-manager/src/index.ts b/plugins/git-release-manager/src/index.ts index 5646a2f61a..cb903044f4 100644 --- a/plugins/git-release-manager/src/index.ts +++ b/plugins/git-release-manager/src/index.ts @@ -18,5 +18,12 @@ export { gitReleaseManagerPlugin, GitReleaseManagerPage, gitReleaseManagerApiRef, - internals, } from './plugin'; + +import { components, constants, helpers } from './plugin'; + +export const internals = { + components, + constants, + helpers, +}; diff --git a/plugins/git-release-manager/src/plugin.ts b/plugins/git-release-manager/src/plugin.ts index 943102f188..a2d9623118 100644 --- a/plugins/git-release-manager/src/plugin.ts +++ b/plugins/git-release-manager/src/plugin.ts @@ -25,16 +25,11 @@ import { import { GitReleaseClient } from './api/GitReleaseClient'; import { gitReleaseManagerApiRef } from './api/serviceApiRef'; import { rootRouteRef } from './routes'; -import * as constants from './constants/constants'; -import * as helpers from './helpers'; -import * as components from './components'; +export * as constants from './constants/constants'; +export * as helpers from './helpers'; +export * as components from './components'; export { gitReleaseManagerApiRef }; -export const internals = { - constants, - helpers, - components, -}; export const gitReleaseManagerPlugin = createPlugin({ id: 'git-release-manager', From d1be40f0cc70f6abc58dde8f821a1a69c0815133 Mon Sep 17 00:00:00 2001 From: Erik Engervall Date: Mon, 23 Aug 2021 15:24:28 +0200 Subject: [PATCH 04/10] Fix linting errors Signed-off-by: Erik Engervall --- plugins/git-release-manager/src/plugin.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/git-release-manager/src/plugin.ts b/plugins/git-release-manager/src/plugin.ts index a2d9623118..03027a5369 100644 --- a/plugins/git-release-manager/src/plugin.ts +++ b/plugins/git-release-manager/src/plugin.ts @@ -25,11 +25,11 @@ import { import { GitReleaseClient } from './api/GitReleaseClient'; import { gitReleaseManagerApiRef } from './api/serviceApiRef'; import { rootRouteRef } from './routes'; +import * as constants from './constants/constants'; +import * as helpers from './helpers'; +import * as components from './components'; -export * as constants from './constants/constants'; -export * as helpers from './helpers'; -export * as components from './components'; -export { gitReleaseManagerApiRef }; +export { gitReleaseManagerApiRef, constants, helpers, components }; export const gitReleaseManagerPlugin = createPlugin({ id: 'git-release-manager', From 73ccf148c20936336f6b746cfba883103f1a6c0d Mon Sep 17 00:00:00 2001 From: Erik Engervall Date: Mon, 23 Aug 2021 15:38:09 +0200 Subject: [PATCH 05/10] Update api-report.md for GRM Signed-off-by: Erik Engervall --- plugins/git-release-manager/api-report.md | 252 ++++++++++++++++++++++ 1 file changed, 252 insertions(+) diff --git a/plugins/git-release-manager/api-report.md b/plugins/git-release-manager/api-report.md index 018a0f4be8..44fafd7387 100644 --- a/plugins/git-release-manager/api-report.md +++ b/plugins/git-release-manager/api-report.md @@ -7,9 +7,131 @@ import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { PropsWithChildren } from 'react'; import { default as React_2 } from 'react'; +import { ReactNode } from 'react'; import { RouteRef } from '@backstage/core-plugin-api'; +// Warning: (ae-missing-release-tag) "calverRegexp" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const calverRegexp: RegExp; + +// Warning: (ae-forgotten-export) The symbol "DifferProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "Differ" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const Differ: ({ current, next, icon }: DifferProps) => JSX.Element; + +// Warning: (ae-missing-release-tag) "DISABLE_CACHE" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const DISABLE_CACHE: { + readonly headers: { + readonly 'If-None-Match': ''; + }; +}; + +// Warning: (ae-missing-release-tag) "Divider" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const Divider: () => JSX.Element; + +// Warning: (ae-forgotten-export) The symbol "SemverTagParts" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "getBumpedSemverTagParts" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +function getBumpedSemverTagParts( + tagParts: SemverTagParts, + semverBumpLevel: keyof typeof SEMVER_PARTS, +): { + bumpedTagParts: { + prefix: string; + major: number; + minor: number; + patch: number; + }; +}; + +// Warning: (ae-missing-release-tag) "getBumpedTag" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +function getBumpedTag({ + project, + tag, + bumpLevel, +}: { + project: Project; + tag: string; + bumpLevel: keyof typeof SEMVER_PARTS; +}): + | { + bumpedTag: string; + tagParts: CalverTagParts; + error: undefined; + } + | { + bumpedTag: string; + tagParts: { + prefix: string; + major: number; + minor: number; + patch: number; + }; + error: undefined; + } + | { + error: AlertError; + }; + +// Warning: (ae-missing-release-tag) "getCalverTagParts" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +function getCalverTagParts(tag: string): + | { + error: AlertError; + tagParts?: undefined; + } + | { + tagParts: CalverTagParts; + error?: undefined; + }; + +// Warning: (ae-missing-release-tag) "getSemverTagParts" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +function getSemverTagParts(tag: string): + | { + error: AlertError; + tagParts?: undefined; + } + | { + tagParts: SemverTagParts; + error?: undefined; + }; + +// Warning: (ae-missing-release-tag) "getShortCommitHash" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +function getShortCommitHash(hash: string): string; + +// Warning: (ae-missing-release-tag) "getTagParts" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +function getTagParts({ project, tag }: { project: Project; tag: string }): + | { + error: AlertError; + tagParts?: undefined; + } + | { + tagParts: CalverTagParts; + error?: undefined; + } + | { + tagParts: SemverTagParts; + error?: undefined; + }; + // Warning: (ae-forgotten-export) The symbol "GitReleaseApi" needs to be exported by the entry point index.d.ts // Warning: (ae-missing-release-tag) "gitReleaseManagerApiRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // @@ -32,5 +154,135 @@ export const gitReleaseManagerPlugin: BackstagePlugin< {} >; +// Warning: (ae-missing-release-tag) "InfoCardPlus" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const InfoCardPlus: ({ + children, +}: { + children?: React_2.ReactNode; +}) => JSX.Element; + +// Warning: (ae-missing-release-tag) "internals" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const internals: { + components: typeof components; + constants: typeof constants; + helpers: typeof helpers; +}; + +// Warning: (ae-missing-release-tag) "isCalverTagParts" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +function isCalverTagParts( + project: Project, + _tagParts: unknown, +): _tagParts is CalverTagParts; + +// Warning: (ae-missing-release-tag) "isProjectValid" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +function isProjectValid(project: any): project is Project; + +// Warning: (ae-missing-release-tag) "LinearProgressWithLabel" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +function LinearProgressWithLabel(props: { + progress: number; + responseSteps: ResponseStep[]; +}): JSX.Element; + +// Warning: (ae-missing-release-tag) "NoLatestRelease" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const NoLatestRelease: () => JSX.Element; + +// Warning: (ae-forgotten-export) The symbol "DialogProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "ResponseStepDialog" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const ResponseStepDialog: ({ + progress, + responseSteps, + title, +}: DialogProps) => JSX.Element; + +// Warning: (ae-forgotten-export) The symbol "ResponseStepListProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "ResponseStepList" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const ResponseStepList: ({ + responseSteps, + animationDelay, + loading, + denseList, + children, +}: PropsWithChildren) => JSX.Element; + +// Warning: (ae-forgotten-export) The symbol "ResponseStepListItemProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "ResponseStepListItem" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const ResponseStepListItem: ({ + responseStep, + animationDelay, +}: ResponseStepListItemProps) => JSX.Element; + +// Warning: (ae-missing-release-tag) "SEMVER_PARTS" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const SEMVER_PARTS: { + major: 'major'; + minor: 'minor'; + patch: 'patch'; +}; + +// Warning: (ae-missing-release-tag) "semverRegexp" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const semverRegexp: RegExp; + +// Warning: (ae-missing-release-tag) "TAG_OBJECT_MESSAGE" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const TAG_OBJECT_MESSAGE = + 'Tag generated by your friendly neighborhood Backstage Release Manager'; + +// Warning: (ae-missing-release-tag) "validateTagName" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const validateTagName: ({ + project, + tagName, +}: { + project: Project; + tagName?: string | undefined; +}) => + | { + tagNameError: null; + } + | { + tagNameError: AlertError | undefined; + }; + +// Warning: (ae-missing-release-tag) "VERSIONING_STRATEGIES" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const VERSIONING_STRATEGIES: { + semver: 'semver'; + calver: 'calver'; +}; + +// Warnings were encountered during analysis: +// +// src/components/ResponseStepDialog/LinearProgressWithLabel.d.ts:5:5 - (ae-forgotten-export) The symbol "ResponseStep" needs to be exported by the entry point index.d.ts +// src/helpers/getBumpedTag.d.ts:14:5 - (ae-forgotten-export) The symbol "Project" needs to be exported by the entry point index.d.ts +// src/helpers/getBumpedTag.d.ts:19:5 - (ae-forgotten-export) The symbol "CalverTagParts" needs to be exported by the entry point index.d.ts +// src/helpers/getBumpedTag.d.ts:31:5 - (ae-forgotten-export) The symbol "AlertError" needs to be exported by the entry point index.d.ts +// src/index.d.ts:4:5 - (ae-forgotten-export) The symbol "components" needs to be exported by the entry point index.d.ts +// src/index.d.ts:5:5 - (ae-forgotten-export) The symbol "constants" needs to be exported by the entry point index.d.ts +// src/index.d.ts:6:5 - (ae-forgotten-export) The symbol "helpers" needs to be exported by the entry point index.d.ts + // (No @packageDocumentation comment for this package) ``` From 5d369b603025e41347b6ce4df52a3d7e4ca17f43 Mon Sep 17 00:00:00 2001 From: Erik Engervall Date: Mon, 23 Aug 2021 17:17:00 +0200 Subject: [PATCH 06/10] Update plugin.test.ts with new exports Signed-off-by: Erik Engervall --- plugins/git-release-manager/src/plugin.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/git-release-manager/src/plugin.test.ts b/plugins/git-release-manager/src/plugin.test.ts index 69e2c47c6a..3431775fcb 100644 --- a/plugins/git-release-manager/src/plugin.test.ts +++ b/plugins/git-release-manager/src/plugin.test.ts @@ -21,6 +21,9 @@ describe('git-release-manager', () => { expect(Object.keys(plugin)).toMatchInlineSnapshot(` Array [ "gitReleaseManagerApiRef", + "constants", + "helpers", + "components", "gitReleaseManagerPlugin", "GitReleaseManagerPage", ] From bdf30530d80c3a3447dbc9d818010901366ecb9f Mon Sep 17 00:00:00 2001 From: Erik Engervall Date: Tue, 24 Aug 2021 13:28:50 +0200 Subject: [PATCH 07/10] Export testHelpers as well to further aid development of custom features Signed-off-by: Erik Engervall --- plugins/git-release-manager/src/index.ts | 3 ++- plugins/git-release-manager/src/plugin.ts | 3 ++- .../src/test-helpers/index.ts | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 plugins/git-release-manager/src/test-helpers/index.ts diff --git a/plugins/git-release-manager/src/index.ts b/plugins/git-release-manager/src/index.ts index cb903044f4..c325a3335b 100644 --- a/plugins/git-release-manager/src/index.ts +++ b/plugins/git-release-manager/src/index.ts @@ -20,10 +20,11 @@ export { gitReleaseManagerApiRef, } from './plugin'; -import { components, constants, helpers } from './plugin'; +import { components, constants, helpers, testHelpers } from './plugin'; export const internals = { components, constants, helpers, + testHelpers, }; diff --git a/plugins/git-release-manager/src/plugin.ts b/plugins/git-release-manager/src/plugin.ts index 03027a5369..a416ab9092 100644 --- a/plugins/git-release-manager/src/plugin.ts +++ b/plugins/git-release-manager/src/plugin.ts @@ -28,8 +28,9 @@ import { rootRouteRef } from './routes'; import * as constants from './constants/constants'; import * as helpers from './helpers'; import * as components from './components'; +import * as testHelpers from './test-helpers'; -export { gitReleaseManagerApiRef, constants, helpers, components }; +export { gitReleaseManagerApiRef, constants, helpers, components, testHelpers }; export const gitReleaseManagerPlugin = createPlugin({ id: 'git-release-manager', diff --git a/plugins/git-release-manager/src/test-helpers/index.ts b/plugins/git-release-manager/src/test-helpers/index.ts new file mode 100644 index 0000000000..07c59e68cd --- /dev/null +++ b/plugins/git-release-manager/src/test-helpers/index.ts @@ -0,0 +1,19 @@ +/* + * 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 * as stats from './stats'; +export * as testHelpers from './test-helpers'; +export * as testIds from './test-ids'; From 9ad8641161c9bcf643daadc1343265885f9efc8d Mon Sep 17 00:00:00 2001 From: Erik Engervall Date: Tue, 24 Aug 2021 13:40:34 +0200 Subject: [PATCH 08/10] Export testHelpers properly Signed-off-by: Erik Engervall --- plugins/git-release-manager/src/test-helpers/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/git-release-manager/src/test-helpers/index.ts b/plugins/git-release-manager/src/test-helpers/index.ts index 07c59e68cd..2a91928321 100644 --- a/plugins/git-release-manager/src/test-helpers/index.ts +++ b/plugins/git-release-manager/src/test-helpers/index.ts @@ -14,6 +14,8 @@ * limitations under the License. */ -export * as stats from './stats'; -export * as testHelpers from './test-helpers'; -export * as testIds from './test-ids'; +import * as stats from './stats'; +import * as testHelpers from './test-helpers'; +import * as testIds from './test-ids'; + +export { stats, testHelpers, testIds }; From 33b5933c4b64744d7e00c03e88bcc17f7da47f60 Mon Sep 17 00:00:00 2001 From: Erik Engervall Date: Tue, 24 Aug 2021 13:43:05 +0200 Subject: [PATCH 09/10] Update api-report.md Signed-off-by: Erik Engervall --- plugins/git-release-manager/api-report.md | 261 ++++++++++++++++++++++ 1 file changed, 261 insertions(+) diff --git a/plugins/git-release-manager/api-report.md b/plugins/git-release-manager/api-report.md index 44fafd7387..2c3b55a110 100644 --- a/plugins/git-release-manager/api-report.md +++ b/plugins/git-release-manager/api-report.md @@ -17,6 +17,20 @@ import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) const calverRegexp: RegExp; +// Warning: (ae-forgotten-export) The symbol "GetCommitResult" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "createMockCommit" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const createMockCommit: ( + overrides: Partial, +) => GetCommitResult; + +// Warning: (ae-forgotten-export) The symbol "GetTagResult" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "createMockTag" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const createMockTag: (overrides: Partial) => GetTagResult; + // Warning: (ae-forgotten-export) The symbol "DifferProps" needs to be exported by the entry point index.d.ts // Warning: (ae-missing-release-tag) "Differ" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // @@ -170,6 +184,7 @@ export const internals: { components: typeof components; constants: typeof constants; helpers: typeof helpers; + testHelpers: typeof testHelpers; }; // Warning: (ae-missing-release-tag) "isCalverTagParts" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) @@ -193,6 +208,153 @@ function LinearProgressWithLabel(props: { responseSteps: ResponseStep[]; }): JSX.Element; +// Warning: (ae-missing-release-tag) "mockApiClient" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +const mockApiClient: GitReleaseApi; + +// Warning: (ae-missing-release-tag) "mockBumpedTag" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const mockBumpedTag = 'rc-2020.01.01_1337'; + +// Warning: (ae-missing-release-tag) "mockCalverProject" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const mockCalverProject: Project; + +// Warning: (ae-missing-release-tag) "mockDefaultBranch" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const mockDefaultBranch = 'mock_defaultBranch'; + +// Warning: (ae-forgotten-export) The symbol "getReleaseCandidateGitInfo" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "mockNextGitInfoCalver" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const mockNextGitInfoCalver: ReturnType; + +// Warning: (ae-missing-release-tag) "mockNextGitInfoSemver" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const mockNextGitInfoSemver: ReturnType; + +// Warning: (ae-missing-release-tag) "mockReleaseBranch" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const mockReleaseBranch: { + name: string; + links: { + html: string; + }; + commit: { + sha: string; + commit: { + tree: { + sha: string; + }; + }; + }; +}; + +// Warning: (ae-missing-release-tag) "mockReleaseCandidateCalver" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const mockReleaseCandidateCalver: { + targetCommitish: string; + tagName: string; + prerelease: boolean; + id: number; + htmlUrl: string; + body?: string | null | undefined; +}; + +// Warning: (ae-missing-release-tag) "mockReleaseCandidateSemver" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const mockReleaseCandidateSemver: { + targetCommitish: string; + tagName: string; + prerelease: boolean; + id: number; + htmlUrl: string; + body?: string | null | undefined; +}; + +// Warning: (ae-forgotten-export) The symbol "ReleaseStats" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "mockReleaseStats" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const mockReleaseStats: ReleaseStats; + +// Warning: (ae-missing-release-tag) "mockReleaseVersionCalver" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const mockReleaseVersionCalver: { + targetCommitish: string; + tagName: string; + prerelease: boolean; + id: number; + htmlUrl: string; + body?: string | null | undefined; +}; + +// Warning: (ae-missing-release-tag) "mockReleaseVersionSemver" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const mockReleaseVersionSemver: { + targetCommitish: string; + tagName: string; + prerelease: boolean; + id: number; + htmlUrl: string; + body?: string | null | undefined; +}; + +// Warning: (ae-missing-release-tag) "mockSearchCalver" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const mockSearchCalver: string; + +// Warning: (ae-missing-release-tag) "mockSearchSemver" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const mockSearchSemver: string; + +// Warning: (ae-missing-release-tag) "mockSelectedPatchCommit" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const mockSelectedPatchCommit: { + htmlUrl: string; + sha: string; + author: { + htmlUrl?: string | undefined; + login?: string | undefined; + }; + commit: { + message: string; + }; + firstParentSha?: string | undefined; +}; + +// Warning: (ae-missing-release-tag) "mockSemverProject" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const mockSemverProject: Project; + +// Warning: (ae-missing-release-tag) "mockTagParts" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const mockTagParts: CalverTagParts; + +// Warning: (ae-missing-release-tag) "mockUser" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const mockUser: { + username: string; + email: string; +}; + // Warning: (ae-missing-release-tag) "NoLatestRelease" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -243,12 +405,110 @@ const SEMVER_PARTS: { // @public (undocumented) const semverRegexp: RegExp; +declare namespace stats { + export { mockReleaseStats }; +} + // Warning: (ae-missing-release-tag) "TAG_OBJECT_MESSAGE" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) const TAG_OBJECT_MESSAGE = 'Tag generated by your friendly neighborhood Backstage Release Manager'; +// Warning: (ae-missing-release-tag) "TEST_IDS" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +const TEST_IDS: { + info: { + info: string; + infoFeaturePlus: string; + }; + createRc: { + cta: string; + semverSelect: string; + }; + promoteRc: { + mockedPromoteRcBody: string; + notRcWarning: string; + promoteRc: string; + cta: string; + }; + patch: { + error: string; + loading: string; + notPrerelease: string; + body: string; + }; + form: { + owner: { + loading: string; + select: string; + error: string; + empty: string; + }; + repo: { + loading: string; + select: string; + error: string; + empty: string; + }; + versioningStrategy: { + radioGroup: string; + }; + }; + components: { + divider: string; + noLatestRelease: string; + circularProgress: string; + responseStepListDialogContent: string; + responseStepListItem: string; + responseStepListItemIconSuccess: string; + responseStepListItemIconFailure: string; + responseStepListItemIconLink: string; + responseStepListItemIconDefault: string; + differ: { + current: string; + next: string; + icons: { + tag: string; + branch: string; + github: string; + slack: string; + versioning: string; + }; + }; + linearProgressWithLabel: string; + }; +}; + +declare namespace testHelpers_2 { + export { + createMockTag, + createMockCommit, + mockUser, + mockSemverProject, + mockCalverProject, + mockSearchCalver, + mockSearchSemver, + mockDefaultBranch, + mockNextGitInfoSemver, + mockNextGitInfoCalver, + mockTagParts, + mockBumpedTag, + mockReleaseCandidateCalver, + mockReleaseVersionCalver, + mockReleaseCandidateSemver, + mockReleaseVersionSemver, + mockReleaseBranch, + mockSelectedPatchCommit, + mockApiClient, + }; +} + +declare namespace testIds { + export { TEST_IDS }; +} + // Warning: (ae-missing-release-tag) "validateTagName" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -283,6 +543,7 @@ const VERSIONING_STRATEGIES: { // src/index.d.ts:4:5 - (ae-forgotten-export) The symbol "components" needs to be exported by the entry point index.d.ts // src/index.d.ts:5:5 - (ae-forgotten-export) The symbol "constants" needs to be exported by the entry point index.d.ts // src/index.d.ts:6:5 - (ae-forgotten-export) The symbol "helpers" needs to be exported by the entry point index.d.ts +// src/index.d.ts:7:5 - (ae-forgotten-export) The symbol "testHelpers" needs to be exported by the entry point index.d.ts // (No @packageDocumentation comment for this package) ``` From d3e9e2485bb7c6f7a1b2f47ccae2b1afa5f94bd4 Mon Sep 17 00:00:00 2001 From: Erik Engervall Date: Tue, 24 Aug 2021 14:00:09 +0200 Subject: [PATCH 10/10] Update plugin.test.ts with newly added testHelpers export Signed-off-by: Erik Engervall --- plugins/git-release-manager/src/plugin.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/git-release-manager/src/plugin.test.ts b/plugins/git-release-manager/src/plugin.test.ts index 3431775fcb..db60617c24 100644 --- a/plugins/git-release-manager/src/plugin.test.ts +++ b/plugins/git-release-manager/src/plugin.test.ts @@ -24,6 +24,7 @@ describe('git-release-manager', () => { "constants", "helpers", "components", + "testHelpers", "gitReleaseManagerPlugin", "GitReleaseManagerPage", ]