keystone-cli 2.1.8 → 2.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -269,6 +269,12 @@ export async function executeDynamicStep(
|
|
|
269
269
|
|
|
270
270
|
return buildFinalResult(state);
|
|
271
271
|
} catch (error) {
|
|
272
|
+
// Re-throw suspension/waiting errors so the workflow can properly suspend
|
|
273
|
+
if (error instanceof Error) {
|
|
274
|
+
if (error.name === 'WorkflowSuspendedError' || error.name === 'WorkflowWaitingError') {
|
|
275
|
+
throw error;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
272
278
|
return await handleExecutionError(step, state, dbState, stateManager, options.saveState, error);
|
|
273
279
|
}
|
|
274
280
|
}
|
|
@@ -324,8 +324,17 @@ export class WorkflowState {
|
|
|
324
324
|
try {
|
|
325
325
|
output = JSON.parse(exec.output);
|
|
326
326
|
} catch (e) {
|
|
327
|
-
|
|
327
|
+
this.logger.warn(
|
|
328
|
+
`Failed to parse output for step "${stepId}": ${e instanceof Error ? e.message : String(e)}`
|
|
329
|
+
);
|
|
330
|
+
// If parsing fails, try using the raw output
|
|
331
|
+
output = exec.output;
|
|
328
332
|
}
|
|
333
|
+
} else if (exec.status === 'success') {
|
|
334
|
+
// If step succeeded but has no output, log a warning
|
|
335
|
+
this.logger.warn(
|
|
336
|
+
`Step "${stepId}" completed with status "${exec.status}" but has no output. This may cause issues for dependent steps.`
|
|
337
|
+
);
|
|
329
338
|
}
|
|
330
339
|
|
|
331
340
|
this.stepContexts.set(stepId, {
|
|
@@ -42,14 +42,14 @@ steps:
|
|
|
42
42
|
needs: [generate]
|
|
43
43
|
foreach: ${{ steps.generate.outputs.files.filter(f => f.path.endsWith('.yaml') && f.path.includes('workflows')) }}
|
|
44
44
|
run: |
|
|
45
|
-
echo "${{ item.content }}" |
|
|
45
|
+
echo "${{ item.content }}" | bun run src/cli.ts validate --stdin --type workflow
|
|
46
46
|
allowFailure: true
|
|
47
47
|
transform: |
|
|
48
48
|
{
|
|
49
49
|
path: item.path,
|
|
50
50
|
content: item.content,
|
|
51
|
-
valid:
|
|
52
|
-
error:
|
|
51
|
+
valid: exitCode === 0,
|
|
52
|
+
error: exitCode !== 0 ? stderr : null
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
- id: repair_workflows
|
|
@@ -76,7 +76,7 @@ steps:
|
|
|
76
76
|
3. A `steps` array with at least one step
|
|
77
77
|
4. Each step must have `id` and `type` fields
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
Return a JSON object with a single "content" field containing the corrected YAML as a string.
|
|
80
80
|
outputSchema:
|
|
81
81
|
type: object
|
|
82
82
|
properties:
|
|
@@ -88,10 +88,15 @@ steps:
|
|
|
88
88
|
- id: merge_files
|
|
89
89
|
type: shell
|
|
90
90
|
needs: [validate_workflows, repair_workflows]
|
|
91
|
+
env:
|
|
92
|
+
GENERATED: ${{ JSON.stringify(steps.generate.outputs.files) }}
|
|
93
|
+
VALIDATED: ${{ JSON.stringify(steps.validate_workflows.output) }}
|
|
94
|
+
REPAIRED: ${{ JSON.stringify(steps.repair_workflows.output) }}
|
|
91
95
|
run: |
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
const
|
|
96
|
+
bun -e '
|
|
97
|
+
const generated = JSON.parse(process.env.GENERATED || "[]");
|
|
98
|
+
const validated = JSON.parse(process.env.VALIDATED || "[]");
|
|
99
|
+
const repaired = JSON.parse(process.env.REPAIRED || "[]");
|
|
95
100
|
|
|
96
101
|
const repairedMap = new Map();
|
|
97
102
|
if (Array.isArray(repaired)) {
|
|
@@ -110,7 +115,10 @@ steps:
|
|
|
110
115
|
return file;
|
|
111
116
|
});
|
|
112
117
|
|
|
113
|
-
|
|
118
|
+
console.log(JSON.stringify({ files: final }));
|
|
119
|
+
'
|
|
120
|
+
transform: |
|
|
121
|
+
JSON.parse(stdout)
|
|
114
122
|
|
|
115
123
|
- id: write_files
|
|
116
124
|
type: file
|