gogs: Ensure to list all repositories
In contrary of gitea listing which does not require to provide the q query parameter, it is required for the gogs case.
After reading the gogs source code, the /repos/search
endpoint generates
a sql request of the form: SELECT * FROM repos WHERE name LIKE '%{q}%'
.
By setting the q
parameter value to _
, the LIKE clause acts as a
wildcard and all repositories are ensured to be returned.
Fixes #4698 (closed).
- Before that change
$ swh lister run -l gogs instance=git.pvv.ntnu.no
ListerStats(pages=1, origins=2)
$ swh lister run -l gitea instance=git.supernets.org
ListerStats(pages=1, origins=46)
- After that change
$ swh -l DEBUG lister run -l gogs instance=git.pvv.ntnu.no
ListerStats(pages=1, origins=23)
$ swh lister run -l gitea instance=git.supernets.org
ListerStats(pages=1, origins=46)