Updater 3.4 – Lifecycle Hardening #28

Merged
Masterluke77 merged 96 commits from feature/updater-3.4-lifecycle into main 2026-07-10 17:54:37 +00:00
Showing only changes of commit ce2304cc52 - Show all commits
+6 -3
View File
@@ -129,9 +129,12 @@ function normalizeRun(run) {
}
function bestRun(runs) {
const successful = runs.filter(run => run.state === 'success').sort((a, b) => time(b.updatedAt) - time(a.updatedAt))[0];
if (successful) return successful;
return [...runs].sort((a, b) => time(b.updatedAt) - time(a.updatedAt))[0];
return [...runs].sort((a, b) => {
const dateDelta = time(b.updatedAt) - time(a.updatedAt);
if (dateDelta) return dateDelta;
const rank = { success: 4, pending: 3, failure: 2, cancelled: 1, missing: 0 };
return (rank[b.state] || 0) - (rank[a.state] || 0);
})[0];
}
export function classifyChecks({ checks = [], workflowRuns = [], requiredChecks = REQUIRED_CHECKS, requiredWorkflows = REQUIRED_WORKFLOWS, elapsedSeconds = 0, gracePeriodSeconds = 90, timedOut = false }) {