go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.37k stars 5.43k forks source link

UI does not display all repositories #28815

Open KazzmanK opened 8 months ago

KazzmanK commented 8 months ago

Description

Under root of Gitea UI there is a repository counter : image

And a list of items under it takes a REST as data source, so it is the easiest way to get a json with all repositories.

I personally hate pagination, so , as Gitea is superfast, I configured items per page to higher numbers

[api]
DEFAULT_PAGING_NUM = 100

[ui]
FEED_PAGING_NUM = 100
EXPLORE_PAGING_NUM = 100
ISSUE_PAGING_NUM = 100

[ui.user]
REPO_PAGING_NUM = 100

So, by now all repositories must fit in this request /repo/search?sort=updated&order=desc&uid=4&team_id=undefined&q=&page=1&limit=100&mode=&archived=false

but they are not, this request returns only 50 repositories, but UI thinks that it is OK, and pagination control at the bottom is grayed. image UI works as expected, but service is not. To get all 65 repositories I must make two calls /repo/search?sort=updated&order=desc&uid=4&team_id=undefined&q=&page=1&limit=50&mode=&archived=false /repo/search?sort=updated&order=desc&uid=4&team_id=undefined&q=&page=2&limit=50&mode=&archived=false

Somewhere inside there is no respect to limit counter (=100 in my case)

Screenshots

--

Gitea Version

1.21.3

Can you reproduce the bug on the Gitea demo site?

No

Operating System

win

Browser Version

120

yp05327 commented 8 months ago

The config option is REPO_PAGING_NUM

https://github.com/go-gitea/gitea/blob/eba9c0ce48c7d43910eb77db74c6648157663ceb/custom/conf/app.example.ini#L1275-L1281

KazzmanK commented 8 months ago

I have REPO_PAGING_NUM also set to 100

Updated first comment

KazzmanK commented 8 months ago

Gitea now is 1.21.4

I have modified config to make more unique results


[api]
DEFAULT_PAGING_NUM = 100

[ui]
FEED_PAGING_NUM = 101
EXPLORE_PAGING_NUM = 102
ISSUE_PAGING_NUM = 103

[ui.user]
REPO_PAGING_NUM = 104

So UI asks for data with this query /repo/search?sort=updated&order=desc&uid=4&team_id=undefined&q=&page=1&limit=104&mode=&archived=false

but reply still has exactly 50 items

nicolascalev commented 8 months ago

I hope this helps. 50 is the value that's being hardcoded for that variable REPO_PAGING_NUM

image

And then we are not reading the limit search param from the URL, and just using the config value

image

I am not a Go dev, but it would be nice to get limit or pageSize from the URL and just use it in that function. That should do it right?

KazzmanK commented 8 months ago

I override both REPO_PAGING_NUM in ui.user and ui.admin but it does not help. These default hardcoded values are about to be overrided with app.ini values.

yardenshoham commented 8 months ago

Set MAX_RESPONSE_ITEMS in api https://docs.gitea.com/administration/config-cheat-sheet#api-api

KazzmanK commented 8 months ago

It worked, and now it is a clear discrepancy between list of repos and pagination control attached to this list. Also, it is not clear that one setting may be capped by other setting. Or pagination control should be capped by the same MAX_RESPONSE_ITEMS setting as list.

zmweske commented 5 months ago

I found that ISSUE_PAGING_NUM also limits the response of an API call, though it should probably only affect the UI itself. When calling against /repos/issues/search, the API is limited by a setting configured under the [ui] section of app.ini.