-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API ListActionTasks is not sorted chronologically #31066
Comments
It's sorted by created time. I don't think it's a bug maybe an enhancement is better. |
Hi Lunny, I’m not seeing it being sorted that way when I call the API, and
if you look at the source code I linked to you see there is no order clause
given to the FindAndCount method
…On Fri, 24 May 2024 at 1:02 PM, Lunny Xiao ***@***.***> wrote:
It's sorted by created time. I don't think it's a bug maybe an enhancement
is better.
—
Reply to this email directly, view it on GitHub
<#31066 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADSZ4R25KN2O5NPN5E6PVTZD2UVVAVCNFSM6AAAAABIGXMI76VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRYGQZDKMZYGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Yes, there is no explicit order clause in |
I’m not sure what the confusion is here but you’re saying that the endpoint
is sorted and I’m telling you it’s not
…On Fri, 24 May 2024 at 2:02 PM, Lunny Xiao ***@***.***> wrote:
Yes, there is no explicit order clause in FindAndCount. So the database
should have a default one. Commonly it should be the id asc which is the
same order as the created.
—
Reply to this email directly, view it on GitHub
<#31066 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADSZ4TKWZRBFWVJIKESHQ3ZD23WXAVCNFSM6AAAAABIGXMI76VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRYGQ4DCMRVHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
the web runtime correctly does a FindAndCount with ordering declared: gitea/routers/web/shared/actions/runners.go Lines 77 to 85 in ec771fd
the API runtime does not: gitea/routers/api/v1/repo/action.go Lines 562 to 565 in ec771fd
|
following up on request from @lunny in discord
I propose that the API should return the workflow_runs in the same order that the web runtime currently sorts the list, ie. add @chesteripz @wolfogre do you have any thoughts? |
In the absence of an explicit ORDER BY clause, different databases may return query results in varying orders due to their unique underlying implementations and optimizations. So I believe @mattfysh did meet a "random" order result via API.
It makes sense. I think we can just drop the option So #31150 |
Description
These are currently randomly sorted. Can they be updated to be sorted in reverse chronological order, i.e. the same as the Web UI?
gitea/routers/api/v1/repo/action.go
Lines 562 to 565 in ec771fd
Gitea Version
1.22.0+rc1-106-gedbf74c418
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
Via the helm chart
Database
None
The text was updated successfully, but these errors were encountered: