From 5feedbf4b6fd2cdcccafcebe52a9fddcce046689 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 23 Apr 2026 15:43:50 +0100 Subject: [PATCH] fix: honor explicit CI timing run id --- scripts/ci-run-timings.mjs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/ci-run-timings.mjs b/scripts/ci-run-timings.mjs index 519006b5362..ecb5338a3bf 100644 --- a/scripts/ci-run-timings.mjs +++ b/scripts/ci-run-timings.mjs @@ -173,6 +173,15 @@ async function main() { const args = process.argv.slice(2); const recentIndex = args.indexOf("--recent"); const limitIndex = args.indexOf("--limit"); + const ignoredArgIndexes = new Set(); + if (limitIndex !== -1) { + ignoredArgIndexes.add(limitIndex); + ignoredArgIndexes.add(limitIndex + 1); + } + if (recentIndex !== -1) { + ignoredArgIndexes.add(recentIndex); + ignoredArgIndexes.add(recentIndex + 1); + } const limit = limitIndex === -1 ? 15 : Math.max(1, Number.parseInt(args[limitIndex + 1] ?? "", 10) || 15); if (recentIndex !== -1) { @@ -196,14 +205,7 @@ async function main() { } return; } - const runId = - args.find( - (arg, index) => - index !== limitIndex && - index !== limitIndex + 1 && - index !== recentIndex && - index !== recentIndex + 1, - ) ?? getLatestCiRunId(); + const runId = args.find((_arg, index) => !ignoredArgIndexes.has(index)) ?? getLatestCiRunId(); const summary = summarizeRunTimings(loadRun(runId), limit); console.log(