Pārlūkot izejas kodu

Fix repo API listing stability (#12057)

Repo listings are paginated in the API now. Unfortunately, they are
ORDER BY updated_unix which only has second resolution. This means that
if you do a listing when multiple projects were created at the same time
you can unstable ordering. If that unstable ordering happens at a page
boundary you may fail to get a complete repo listing.

To make things worse sorting by updated_unix means that we may never get
a complete listing because udpated_unix can change independent of our
API calls.

Fix this by making the API repo listing order by id instead.
tags/v1.13.0-rc1
Clark Boylan pirms 3 gadiem
vecāks
revīzija
7e401fb026
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam
1 mainītis faili ar 1 papildinājumiem un 0 dzēšanām
  1. 1
    0
      routers/api/v1/user/repo.go

+ 1
- 0
routers/api/v1/user/repo.go Parādīt failu

@@ -22,6 +22,7 @@ func listUserRepos(ctx *context.APIContext, u *models.User, private bool) {
Actor: u,
Private: private,
ListOptions: opts,
OrderBy: "id ASC",
})
if err != nil {
ctx.Error(http.StatusInternalServerError, "GetUserRepositories", err)

Notiek ielāde…
Atcelt
Saglabāt