Made "checkpoint" on scaffolder action context non-optional (#23291)
* Made "checkpoint" on scaffolder action context non-optional Signed-off-by: bnechyporenko <bnechyporenko@bol.com>
This commit is contained in:
committed by
GitHub
parent
b130eb36b4
commit
bbd1fe19ab
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder-node-test-utils': patch
|
||||
'@backstage/plugin-scaffolder-backend': patch
|
||||
'@backstage/plugin-scaffolder-node': patch
|
||||
---
|
||||
|
||||
Made "checkpoint" on scaffolder action context non-optional
|
||||
@@ -138,13 +138,13 @@ describe('NunjucksWorkflowRunner', () => {
|
||||
id: 'checkpoints-action',
|
||||
description: 'Mock action with checkpoints',
|
||||
handler: async ctx => {
|
||||
const key1 = await ctx.checkpoint?.('key1', async () => {
|
||||
const key1 = await ctx.checkpoint('key1', async () => {
|
||||
return 'updated';
|
||||
});
|
||||
const key2 = await ctx.checkpoint?.('key2', async () => {
|
||||
const key2 = await ctx.checkpoint('key2', async () => {
|
||||
return 'updated';
|
||||
});
|
||||
const key3 = await ctx.checkpoint?.('key3', async () => {
|
||||
const key3 = await ctx.checkpoint('key3', async () => {
|
||||
return 'updated';
|
||||
});
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ export const createMockActionContext = <
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
input: {} as TActionInput,
|
||||
checkpoint: jest.fn(),
|
||||
};
|
||||
|
||||
const createDefaultWorkspace = () => ({
|
||||
|
||||
@@ -30,7 +30,7 @@ export type ActionContext<
|
||||
secrets?: TaskSecrets;
|
||||
workspacePath: string;
|
||||
input: TActionInput;
|
||||
checkpoint?<U extends JsonValue>(
|
||||
checkpoint<U extends JsonValue>(
|
||||
key: string,
|
||||
fn: () => Promise<U>,
|
||||
): Promise<U>;
|
||||
|
||||
@@ -35,7 +35,7 @@ export type ActionContext<
|
||||
secrets?: TaskSecrets;
|
||||
workspacePath: string;
|
||||
input: TActionInput;
|
||||
checkpoint?<U extends JsonValue>(
|
||||
checkpoint<U extends JsonValue>(
|
||||
key: string,
|
||||
fn: () => Promise<U>,
|
||||
): Promise<U>;
|
||||
|
||||
Reference in New Issue
Block a user