Merge branch 'cursor/trigger-failure-workflow-3038' into cursor/ftp-sftp-script-3038
This commit is contained in:
@@ -63,9 +63,10 @@ export default function dashboardPluginFactory(registry) {
|
||||
}
|
||||
}
|
||||
|
||||
const [running, failed, recent] = await Promise.all([
|
||||
const [running, streaks, failedEvents, recent] = await Promise.all([
|
||||
store.listRuns({ status: "running", limit: 10 }),
|
||||
store.listRuns({ status: "failed", limit: 20 }),
|
||||
store.listConsecutiveFailureStreaks({ minCount: 4, limit: 10 }),
|
||||
store.listRuns({ status: "failed", limit: 5 }),
|
||||
store.listRuns({ limit: 10 }),
|
||||
]);
|
||||
|
||||
@@ -76,9 +77,11 @@ export default function dashboardPluginFactory(registry) {
|
||||
brokenCount,
|
||||
running,
|
||||
needsAttention: {
|
||||
failed,
|
||||
consecutiveFailures: streaks.items,
|
||||
consecutiveFailureCount: streaks.total,
|
||||
brokenWorkflows,
|
||||
},
|
||||
failedEvents,
|
||||
recent,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -17,6 +17,15 @@ export default async function runsPlugin(fastify) {
|
||||
return { runs };
|
||||
});
|
||||
|
||||
fastify.get("/consecutive-failures", async (req) => {
|
||||
const q = /** @type {Record<string, string | undefined>} */ (req.query ?? {});
|
||||
const limit = q.limit ? Number(q.limit) : undefined;
|
||||
return store.listConsecutiveFailureStreaks({
|
||||
minCount: 4,
|
||||
limit: Number.isFinite(limit) ? limit : 200,
|
||||
});
|
||||
});
|
||||
|
||||
fastify.get("/runs/:id", async (req, reply) => {
|
||||
const { id } = /** @type {{ id: string }} */ (req.params);
|
||||
const run = await store.getRun(id);
|
||||
|
||||
@@ -28,7 +28,7 @@ function triggerSummary(owner, workflow) {
|
||||
path: isHttp && t?.path != null ? namespacedPath(owner, t.path) : t?.path ?? null,
|
||||
schedule: t?.schedule ?? null,
|
||||
onConsecutiveFailures: t?.onConsecutiveFailures ?? null,
|
||||
triggerWorkflow: t?.triggerWorkflow ?? null,
|
||||
onFailureWorkflow: t?.onFailureWorkflow ?? null,
|
||||
auth: isHttp ? authLabel(t?.auth) : null,
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user