Files
orca/src/main/gitlab
Brennan Benson 9c68fc1d20 Show when each check ran and how long it took (#38731)
* feat(checks): show when each check ran and how long it took

Check rows in the right-sidebar Checks panel now show how long a
finished check took and how long ago it finished (or started, while it
runs), with exact start and finish times on hover. GitHub check runs,
legacy commit statuses and GitLab jobs carry provider run times; rows
without times show nothing.

A GitLab pipeline that ran on a commit the merge request has since moved
past says so. The GitHub rollup read keys its 60s cache by the expected
head, so a push never serves the previous head's checks.

* test(checks): bound the clock work of check time labels

* perf(checks): rebuild check time text only when its data changes

Clock ticks now move only each row's age; exact times, duration and copy
are built once per data or language change. Move the run-time mapping
tests to the mapping layer to keep the client test file within budget.

* fix(checks): annotate the gh pr checks reply instead of casting it

* fix(checks): say when a running check started; key the rollup cache by a query comment

A running row reads 'started 5m ago' so its age isn't read as when it
ran. The expected head now rides in a GraphQL comment, which servers
ignore but gh's cache key includes. Add the new copy to the English
catalog and test behavior rather than formatted copy.

* fix(checks): let check times truncate before names in a narrow sidebar

At the narrowest sidebar the time text never shrank, squeezing check
names to nothing and pushing status labels out of their rows. The time
now sits beside the name, gives up width first, and the name keeps a
minimum width.

* fix(checks): rebuild check time copy when translation catalogs change

* fix(checks): reserve room for a running check's growing start age

* test(checks): keep REST check-run times covered through the schema

* fix(checks): read the checks rollup without gh's disk cache

gh's cache key ignores the PR head, so after a push it answered with the
previous head's checks, and it never evicts expired entries. Orca's own
head-keyed checks cache and read coalescing already bound the requests.

* fix(checks): hide check times in rows too narrow to show them

Below a 17rem row the time text is hidden, so the narrowest sidebar keeps
main's name, status and link layout; wider rows truncate the time before
the name, which keeps a 36px minimum.

* fix(checks): truncate a check's duration before its age

The age answers when a check ran, so in a tight row the duration now
gives up its width first.

* test(checks): type the rollup fixture

* fix(checks): show check times only in rows with room for them

Between a 17rem and 19rem row the times squeezed names to their minimum
and clipped; hold them back until 19rem, which the default 350px sidebar
clears.

* fix(checks): keep a minimum name width only while check times show

Rows too narrow for times, including the narrower folder-workspace parent
PR rows, now lay out exactly as before.

* fix(checks): show a running check's elapsed time instead of its start age

'started 10m ago' reserved so much room that running check names shrank
to a few characters at the default sidebar width; beside a running status
the elapsed time ('10m') says the same thing in a quarter of the space.

* test(checks): use a type import for the mocked module
2026-11-05 23:34:53 -08:00
..
…