Checkpoint

Signed-off-by: bnechyporenko <bnechyporenko@bol.com>
This commit is contained in:
bnechyporenko
2024-02-04 21:09:34 +01:00
parent 2f5246ba5c
commit 911557bae8
7 changed files with 12 additions and 8 deletions
+1
View File
@@ -41,6 +41,7 @@ backend.add(
backend.add(import('@backstage/plugin-permission-backend/alpha'));
backend.add(import('@backstage/plugin-proxy-backend/alpha'));
backend.add(import('@backstage/plugin-scaffolder-backend/alpha'));
backend.add(import('@backstage/plugin-scaffolder-backend-module-github'));
backend.add(import('@backstage/plugin-search-backend-module-catalog/alpha'));
backend.add(import('@backstage/plugin-search-backend-module-explore/alpha'));
backend.add(import('@backstage/plugin-search-backend-module-techdocs/alpha'));
@@ -37,7 +37,7 @@
"@backstage/config": "workspace:^",
"@backstage/errors": "workspace:^",
"@backstage/integration": "workspace:^",
"@backstage/plugin-scaffolder-backend": "workspace:^",
"@backstage/plugin-scaffolder-common": "workspace:^",
"@backstage/plugin-scaffolder-node": "workspace:^",
"@backstage/types": "workspace:^",
"@octokit/webhooks": "^10.0.0",
@@ -37,7 +37,7 @@ import {
entityRefToName,
} from './gitHelpers';
import { JsonObject } from '@backstage/types';
import { defineCheckpoint } from '@backstage/plugin-scaffolder-backend';
import { defineCheckpoint } from '@backstage/plugin-scaffolder-common';
const DEFAULT_TIMEOUT_MS = 60_000;
@@ -208,11 +208,12 @@ export async function createGithubRepoWithCollaboratorsAndTopics(
`Failed to create the ${user.data.type} repository ${owner}/${repo}, ${e.message}`,
);
}
return { newRepo };
return { clone_url: newRepo.clone_url, html_url: newRepo.html_url };
};
const { newRepo } = await defineCheckpoint<{
newRepo: { clone_url: string; html_url: string };
const { clone_url, html_url } = await defineCheckpoint<{
clone_url: string;
html_url: string;
}>({
key: 'v1.task.checkpoint.repo.creation',
checkpoint,
@@ -345,7 +346,7 @@ export async function createGithubRepoWithCollaboratorsAndTopics(
}
}
return newRepo;
return { clone_url, html_url };
}
export async function initRepoPushAndProtect(
-1
View File
@@ -23,6 +23,5 @@
export * from './scaffolder';
export * from './service/router';
export * from './lib';
export { defineCheckpoint } from './util/defineCheckpoint';
export * from './deprecated';
+2
View File
@@ -34,3 +34,5 @@ export type {
TemplatePermissionsV1beta3,
TemplateRecoveryV1beta3,
} from './TemplateEntityV1beta3';
export { defineCheckpoint } from './defineCheckpoint';
+2 -1
View File
@@ -8376,7 +8376,7 @@ __metadata:
"@backstage/config": "workspace:^"
"@backstage/errors": "workspace:^"
"@backstage/integration": "workspace:^"
"@backstage/plugin-scaffolder-backend": "workspace:^"
"@backstage/plugin-scaffolder-common": "workspace:^"
"@backstage/plugin-scaffolder-node": "workspace:^"
"@backstage/types": "workspace:^"
"@octokit/webhooks": ^10.0.0
@@ -27101,6 +27101,7 @@ __metadata:
"@backstage/plugin-playlist-backend": "workspace:^"
"@backstage/plugin-proxy-backend": "workspace:^"
"@backstage/plugin-scaffolder-backend": "workspace:^"
"@backstage/plugin-scaffolder-backend-module-github": "workspace:^"
"@backstage/plugin-search-backend": "workspace:^"
"@backstage/plugin-search-backend-module-catalog": "workspace:^"
"@backstage/plugin-search-backend-module-explore": "workspace:^"