feat: sort scan tasks and runs by completion time - #337
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a4a5c07110
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #337 +/- ##
============================================
+ Coverage 86.27% 86.30% +0.03%
Complexity 1448 1448
============================================
Files 800 802 +2
Lines 83699 83822 +123
Branches 14706 14742 +36
============================================
+ Hits 72211 72344 +133
+ Misses 11488 11478 -10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7234db3e6a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Please re-review the latest head after the connection-timezone and status-filter indexing fixes, including the expanded regression coverage. If no actionable findings remain, please state that explicitly. |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Scan task and run lists currently use ascending IDs, so an older task that finishes later is buried and recent failures are harder to find. Add completion-time sorting to the Tasks and Overview (scan runs) views, defaulting to newest first, and show the task's finished timestamp. Click the Finished or Completed column header to toggle direction; arrow icons match the repository list, without a separate sort dropdown.
The API accepts
sort=finished_atfor tasks orsort=completed_atfor runs withdirection=asc|desc. Ordering uses completion time plus ID, with unfinished tasks last in either direction. Stateless timestamp/ID cursors work across pages and replicas without looking up the boundary record. Cursor parsing rejects timestamps outside the JDBC/database range with HTTP 400; date-binding overflow caused by a different JDBC connection timezone also maps to 400 without masking other database errors. Requests withoutsortretain ID-based pagination for compatibility.Migration V55 adds timestamp/ID indexes for tasks and runs, including repository-scoped and status-filtered tasks. Task pages fetch completed and unfinished ranges separately in one read-only repeatable-read transaction. The default query avoids null-rank sorting and keeps repository visibility checks from becoming a full-history semijoin sort. MySQL creates indexes online; PostgreSQL creates them concurrently, with retry coverage for both backends.
Includes English/Chinese API documentation and coverage for out-of-order completions, ties, unfinished tasks, repository scopes, retries, invalid cursors, stale UI responses, and pagination resets. Pages remain live views across separate requests.
Validation:
git diff --check.Related to #329.