Scroll the runs table, pick a range, and choose what a comparison plots against
Docs / docs (push) Successful in 35s
Playwright Tests / test-playwright (1, 2) (push) Failing after 3m14s
Playwright Tests / test-playwright (2, 2) (push) Failing after 1m44s
pre-commit / pre-commit (push) Failing after 3m54s
Test Backend / test-backend (push) Successful in 3m12s
Compose Smoke Test / test-compose (push) Successful in 32s
Playwright Tests / merge-reports (push) Failing after 1m28s

This commit is contained in:
2026-08-25 16:32:34 +02:00
parent 3c15964364
commit 4350916bd8
14 changed files with 498 additions and 151 deletions
+18 -4
View File
@@ -27,8 +27,8 @@ export const runKeys = {
detail: (id: string) => ["runs", "detail", id] as const,
metrics: (id: string, name: string) =>
["runs", "detail", id, "metrics", name] as const,
compare: (ids: string[], metric: string) =>
["runs", "compare", ids.join(","), metric] as const,
compare: (ids: string[], metric: string, x: string) =>
["runs", "compare", ids.join(","), metric, x] as const,
}
/** The resting surface these screens are built from, as Health names it. */
@@ -93,17 +93,31 @@ export const runMetricsQueryOptions = (id: string, name = "") => ({
queryFn: () => RunsService.readMetrics({ runId: id, name }),
})
/** What a comparison can be plotted against, beside another metric's name. */
export const STEP_AXIS = "step"
export const TIME_AXIS = "time"
export const compareQueryOptions = (
ids: string[],
metric: string,
x = STEP_AXIS,
refetchInterval?: number,
) => ({
queryKey: runKeys.compare(ids, metric),
queryFn: () => RunsService.compareMetric({ ids: ids.join(","), metric }),
queryKey: runKeys.compare(ids, metric, x),
queryFn: () => RunsService.compareMetric({ ids: ids.join(","), metric, x }),
enabled: ids.length > 0 && Boolean(metric),
...(refetchInterval ? { refetchInterval } : {}),
})
/**
* How many runs one selection carries.
*
* The selection is the address, which is what makes a comparison a link — and
* a URL is not a place to put five hundred 22-character ids. A chart draws
* five of them anyway; the rest of the room is for changing your mind.
*/
export const MAX_SELECTION = 50
export function useCancelRun() {
const client = useQueryClient()
return useMutation({