diff --git a/microsite/data/plugins/release-manager-as-a-service.yaml b/microsite/data/plugins/github-release-manager.yaml
similarity index 100%
rename from microsite/data/plugins/release-manager-as-a-service.yaml
rename to microsite/data/plugins/github-release-manager.yaml
diff --git a/plugins/github-release-manager/dev/index.tsx b/plugins/github-release-manager/dev/index.tsx
index ff794f428a..d525b3f55b 100644
--- a/plugins/github-release-manager/dev/index.tsx
+++ b/plugins/github-release-manager/dev/index.tsx
@@ -15,41 +15,42 @@
*/
import React from 'react';
import { createDevApp } from '@backstage/dev-utils';
+
import {
gitHubReleaseManagerPlugin,
- ReleaseManagerAsAServicePage,
+ GitHubReleaseManagerPage,
} from '../src/plugin';
createDevApp()
.registerPlugin(gitHubReleaseManagerPlugin)
.addPage({
+ title: 'Page 1',
element: (
-
),
- title: 'Root Page',
})
.addPage({
+ title: 'Page 2',
element: (
-
),
- title: 'Another page',
})
.render();
diff --git a/plugins/github-release-manager/src/GitHubReleaseManager.tsx b/plugins/github-release-manager/src/GitHubReleaseManager.tsx
index 6b89eb4439..2011fb40b0 100644
--- a/plugins/github-release-manager/src/GitHubReleaseManager.tsx
+++ b/plugins/github-release-manager/src/GitHubReleaseManager.tsx
@@ -114,7 +114,9 @@ function Cards({ project, components }: ReleaseManagerAsAServiceProps) {
}
if (gitHubBatchInfo.value === undefined) {
- return Failed to fetch latest GHE release;
+ return (
+ Failed to fetch latest GitHub release
+ );
}
if (!gitHubBatchInfo.value.repository.permissions.push) {
diff --git a/plugins/github-release-manager/src/cards/createRc/sideEffects/createRc.test.ts b/plugins/github-release-manager/src/cards/createRc/sideEffects/createRc.test.ts
index 26450ac162..407790f252 100644
--- a/plugins/github-release-manager/src/cards/createRc/sideEffects/createRc.test.ts
+++ b/plugins/github-release-manager/src/cards/createRc/sideEffects/createRc.test.ts
@@ -21,7 +21,7 @@ import {
} from '../../../test-helpers/test-helpers';
import { createRc } from './createRc';
-describe('createGheRc', () => {
+describe('createRc', () => {
beforeEach(jest.clearAllMocks);
it('should work', async () => {
diff --git a/plugins/github-release-manager/src/cards/createRc/sideEffects/createRc.ts b/plugins/github-release-manager/src/cards/createRc/sideEffects/createRc.ts
index 6d45abbb0f..0a532dcb0d 100644
--- a/plugins/github-release-manager/src/cards/createRc/sideEffects/createRc.ts
+++ b/plugins/github-release-manager/src/cards/createRc/sideEffects/createRc.ts
@@ -22,7 +22,7 @@ import {
ResponseStep,
} from '../../../types/types';
import { ApiClient } from '../../../api/ApiClient';
-import { ReleaseManagerAsAServiceError } from '../../../errors/ReleaseManagerAsAServiceError';
+import { GitHubReleaseManagerError } from '../../../errors/GitHubReleaseManagerError';
interface CreateRC {
apiClient: ApiClient;
@@ -67,7 +67,7 @@ export async function createRc({
).createdRef;
} catch (error) {
if (error.body.message === 'Reference already exists') {
- throw new ReleaseManagerAsAServiceError(
+ throw new GitHubReleaseManagerError(
`Branch "${nextGitHubInfo.rcBranch}" already exists: .../tree/${nextGitHubInfo.rcBranch}`,
);
}
diff --git a/plugins/github-release-manager/src/cards/patchRc/PatchBody.test.tsx b/plugins/github-release-manager/src/cards/patchRc/PatchBody.test.tsx
index 74f701a120..7ddc6308cf 100644
--- a/plugins/github-release-manager/src/cards/patchRc/PatchBody.test.tsx
+++ b/plugins/github-release-manager/src/cards/patchRc/PatchBody.test.tsx
@@ -37,7 +37,7 @@ describe('PatchBody', () => {
it('should render error', async () => {
mockApiClient.getBranch.mockImplementationOnce(() => {
- throw new Error('lmao hehe');
+ throw new Error('banana');
});
const { getByTestId } = render(
diff --git a/plugins/github-release-manager/src/cards/patchRc/sideEffects/patch.ts b/plugins/github-release-manager/src/cards/patchRc/sideEffects/patch.ts
index 6b6190e723..1d592b330b 100644
--- a/plugins/github-release-manager/src/cards/patchRc/sideEffects/patch.ts
+++ b/plugins/github-release-manager/src/cards/patchRc/sideEffects/patch.ts
@@ -20,7 +20,7 @@ import {
ResponseStep,
} from '../../../types/types';
import { CalverTagParts } from '../../../helpers/tagParts/getCalverTagParts';
-import { ReleaseManagerAsAServiceError } from '../../../errors/ReleaseManagerAsAServiceError';
+import { GitHubReleaseManagerError } from '../../../errors/GitHubReleaseManagerError';
import { ApiClient } from '../../../api/ApiClient';
import { SemverTagParts } from '../../../helpers/tagParts/getSemverTagParts';
@@ -33,9 +33,7 @@ interface Patch {
tagParts: NonNullable;
}
-/**
- * Inspo: https://stackoverflow.com/questions/53859199/how-to-cherry-pick-through-githubs-api
- */
+// Inspo: https://stackoverflow.com/questions/53859199/how-to-cherry-pick-through-githubs-api
export async function patch({
apiClient,
bumpedTag,
@@ -47,7 +45,7 @@ export async function patch({
const responseSteps: ResponseStep[] = [];
if (!selectedPatchCommit || !selectedPatchCommit.sha) {
- throw new ReleaseManagerAsAServiceError('Invalid commit');
+ throw new GitHubReleaseManagerError('Invalid commit');
}
const releaseBranchName = latestRelease.target_commitish;
diff --git a/plugins/github-release-manager/src/components/ProjectContext.ts b/plugins/github-release-manager/src/components/ProjectContext.ts
index e9cf87a859..61d41f8dc9 100644
--- a/plugins/github-release-manager/src/components/ProjectContext.ts
+++ b/plugins/github-release-manager/src/components/ProjectContext.ts
@@ -16,7 +16,7 @@
import { createContext, useContext } from 'react';
import { ApiClient } from '../api/ApiClient';
-import { ReleaseManagerAsAServiceError } from '../errors/ReleaseManagerAsAServiceError';
+import { GitHubReleaseManagerError } from '../errors/GitHubReleaseManagerError';
export const ApiClientContext = createContext(undefined);
@@ -24,7 +24,7 @@ export const useApiClientContext = () => {
const apiClient = useContext(ApiClientContext);
if (!apiClient) {
- throw new ReleaseManagerAsAServiceError('apiClient not found');
+ throw new GitHubReleaseManagerError('apiClient not found');
}
return apiClient;
diff --git a/plugins/github-release-manager/src/errors/ReleaseManagerAsAServiceError.ts b/plugins/github-release-manager/src/errors/GitHubReleaseManagerError.ts
similarity index 85%
rename from plugins/github-release-manager/src/errors/ReleaseManagerAsAServiceError.ts
rename to plugins/github-release-manager/src/errors/GitHubReleaseManagerError.ts
index cd6231d229..144ad7af90 100644
--- a/plugins/github-release-manager/src/errors/ReleaseManagerAsAServiceError.ts
+++ b/plugins/github-release-manager/src/errors/GitHubReleaseManagerError.ts
@@ -13,10 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-export class ReleaseManagerAsAServiceError extends Error {
+export class GitHubReleaseManagerError extends Error {
constructor(message: string) {
super(message);
- this.name = 'ReleaseManagerAsAServiceError';
+ this.name = 'GitHubReleaseManagerError';
}
}
diff --git a/plugins/github-release-manager/src/helpers/date.test.ts b/plugins/github-release-manager/src/helpers/date.test.ts
deleted file mode 100644
index 06bdd31573..0000000000
--- a/plugins/github-release-manager/src/helpers/date.test.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2021 Spotify AB
- *
- * 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 { getNewDate } from './date';
-
-describe('getNewDate', () => {
- it('should get a date', () => {
- const newDate = getNewDate();
-
- expect(newDate.toISOString()).toMatch(
- /[\d]{4}-[\d]{2}-[\d]{2}T[\d]{2}:[\d]{2}:[\d]{2}.[\d]{3}Z/,
- );
- });
-});
diff --git a/plugins/github-release-manager/src/helpers/date.ts b/plugins/github-release-manager/src/helpers/date.ts
deleted file mode 100644
index 6c9d8423b6..0000000000
--- a/plugins/github-release-manager/src/helpers/date.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright 2021 Spotify AB
- *
- * 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 const getNewDate = () => new Date();
diff --git a/plugins/github-release-manager/src/helpers/getShortCommitHash.ts b/plugins/github-release-manager/src/helpers/getShortCommitHash.ts
index 7abc541606..bb85703477 100644
--- a/plugins/github-release-manager/src/helpers/getShortCommitHash.ts
+++ b/plugins/github-release-manager/src/helpers/getShortCommitHash.ts
@@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import { ReleaseManagerAsAServiceError } from '../errors/ReleaseManagerAsAServiceError';
+import { GitHubReleaseManagerError } from '../errors/GitHubReleaseManagerError';
export function getShortCommitHash(hash: string) {
const shortCommitHash = hash.substr(0, 7);
if (shortCommitHash.length < 7) {
- throw new ReleaseManagerAsAServiceError(
+ throw new GitHubReleaseManagerError(
'Invalid shortCommitHash: less than 7 characters',
);
}
diff --git a/plugins/github-release-manager/src/helpers/tagParts/getCalverTagParts.ts b/plugins/github-release-manager/src/helpers/tagParts/getCalverTagParts.ts
index c6169ac7f5..c76ef92a85 100644
--- a/plugins/github-release-manager/src/helpers/tagParts/getCalverTagParts.ts
+++ b/plugins/github-release-manager/src/helpers/tagParts/getCalverTagParts.ts
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import { ReleaseManagerAsAServiceError } from '../../errors/ReleaseManagerAsAServiceError';
+import { GitHubReleaseManagerError } from '../../errors/GitHubReleaseManagerError';
export type CalverTagParts = {
prefix: string;
@@ -27,7 +27,7 @@ export function getCalverTagParts(tag: string) {
);
if (result === null || result.length < 4) {
- throw new ReleaseManagerAsAServiceError('Invalid calver tag');
+ throw new GitHubReleaseManagerError('Invalid calver tag');
}
const tagParts: CalverTagParts = {
diff --git a/plugins/github-release-manager/src/helpers/tagParts/getSemverTagParts.ts b/plugins/github-release-manager/src/helpers/tagParts/getSemverTagParts.ts
index 8b2ae2873b..f6a97908e2 100644
--- a/plugins/github-release-manager/src/helpers/tagParts/getSemverTagParts.ts
+++ b/plugins/github-release-manager/src/helpers/tagParts/getSemverTagParts.ts
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import { ReleaseManagerAsAServiceError } from '../../errors/ReleaseManagerAsAServiceError';
+import { GitHubReleaseManagerError } from '../../errors/GitHubReleaseManagerError';
export type SemverTagParts = {
prefix: string;
@@ -26,7 +26,7 @@ export function getSemverTagParts(tag: string) {
const result = tag.match(/(rc|version)-([0-9]+)\.([0-9]+)\.([0-9]+)/);
if (result === null || result.length < 4) {
- throw new ReleaseManagerAsAServiceError('Invalid semver tag');
+ throw new GitHubReleaseManagerError('Invalid semver tag');
}
const tagParts: SemverTagParts = {
diff --git a/plugins/github-release-manager/src/index.ts b/plugins/github-release-manager/src/index.ts
index 6768091ee9..c4177089eb 100644
--- a/plugins/github-release-manager/src/index.ts
+++ b/plugins/github-release-manager/src/index.ts
@@ -13,7 +13,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-export {
- gitHubReleaseManagerPlugin as releaseManagerAsAServicePlugin,
- ReleaseManagerAsAServicePage,
-} from './plugin';
+export { gitHubReleaseManagerPlugin, GitHubReleaseManagerPage } from './plugin';
diff --git a/plugins/github-release-manager/src/plugin.ts b/plugins/github-release-manager/src/plugin.ts
index 276691762a..252b0c6674 100644
--- a/plugins/github-release-manager/src/plugin.ts
+++ b/plugins/github-release-manager/src/plugin.ts
@@ -43,7 +43,7 @@ export const gitHubReleaseManagerPlugin = createPlugin({
],
});
-export const ReleaseManagerAsAServicePage = gitHubReleaseManagerPlugin.provide(
+export const GitHubReleaseManagerPage = gitHubReleaseManagerPlugin.provide(
createRoutableExtension({
component: () =>
import('./GitHubReleaseManager').then(m => m.ReleaseManagerAsAService),