Skip to content

Order Dashboard jobs in more "natural" order#1604

Merged
bensheldon merged 3 commits intobensheldon:mainfrom
francois:sort-scheduled-jobs-in-scheduled_at-order
Mar 9, 2025
Merged

Order Dashboard jobs in more "natural" order#1604
bensheldon merged 3 commits intobensheldon:mainfrom
francois:sort-scheduled-jobs-in-scheduled_at-order

Conversation

@francois
Copy link
Copy Markdown
Contributor

"Next-job-first" makes more sense for the scheduled tab.

Closes #1580.

@francois
Copy link
Copy Markdown
Contributor Author

Incidentally, I have not been able to find where the default sort order is applied? @bensheldon, feel free to move elsewhere if it makes more sense.

@francois
Copy link
Copy Markdown
Contributor Author

Hold on! This is insufficient. I hadn't tried with multiple pages.

"Next-job-first" makes more sense for the scheduled tab.

Closes bensheldon#1580.
@francois francois force-pushed the sort-scheduled-jobs-in-scheduled_at-order branch from 08a0509 to a049edf Compare February 14, 2025 22:19
@francois
Copy link
Copy Markdown
Contributor Author

All right, I have a solution! I had to pass state to the display_all scope. BatchRecord redefined the display_all scope so I had to introduce an unused parameter to respect the contract.

End of page 1:
Capture d’écran, le 2025-02-14 à 17 06 08

Start of page 2:
Capture d’écran, le 2025-02-14 à 17 06 14

Notice that job 01d... is present on both pages. Not sure if that is acceptable.

@bensheldon bensheldon changed the title Show scheduled jobs in "natural" order Order Dashboard jobs in more "natural" order Mar 9, 2025
@bensheldon
Copy link
Copy Markdown
Owner

I added ordering for all of the states. The overall principle I went with was: most recent relevant change first. e.g

  • All: most recently created
  • Scheduled / Retried: next scheduled job
  • Queued: most recent job to become queued
  • Running: most recent job to start running
  • Succeeded / Discarded: most recent job to finish

I think for Queued and Running, there is an alternatively important question that's relevant which is: what is the oldest or longest running job? I will defer that until someone wants to add a feature to "reorder".

@bensheldon bensheldon added the enhancement New feature or request label Mar 9, 2025
@bensheldon bensheldon merged commit 5b82975 into bensheldon:main Mar 9, 2025
@github-project-automation github-project-automation Bot moved this from Inbox to Done in GoodJob Backlog v2 Mar 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Development

Successfully merging this pull request may close these issues.

[dashboard] Scheduled tasks are shown "backwards"

2 participants