Merge pull request #26813 from acierto/checkpoint-key

Included step name and step id into check point key.
This commit is contained in:
Ben Lambert
2024-10-01 10:55:35 +02:00
committed by GitHub
3 changed files with 8 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend': patch
---
Include step name and step id to checkpoint key
@@ -601,11 +601,11 @@ describe('NunjucksWorkflowRunner', () => {
return Promise.resolve({
state: {
checkpoints: {
['v1.task.checkpoint.key1']: {
['v1.task.checkpoint.test.key1']: {
status: 'success',
value: 'initial',
},
['v1.task.checkpoint.key2']: {
['v1.task.checkpoint.test2.key2']: {
status: 'failed',
reason: 'fatal error',
},
@@ -375,7 +375,7 @@ export class NunjucksWorkflowRunner implements WorkflowRunner {
keySuffix: string,
fn: () => Promise<U>,
) {
const key = `v1.task.checkpoint.${keySuffix}`;
const key = `v1.task.checkpoint.${step.id}.${keySuffix}`;
try {
let prevValue: U | undefined;
if (prevTaskState) {