diff --git a/osc/gitea_api/branch.py b/osc/gitea_api/branch.py index b9da06e3..cc75da4b 100644 --- a/osc/gitea_api/branch.py +++ b/osc/gitea_api/branch.py @@ -41,7 +41,10 @@ class Branch: :param owner: Owner of the repo. :param repo: Name of the repo. """ - url = conn.makeurl("repos", owner, repo, "branches") + q = { + "limit": -1, + } + url = conn.makeurl("repos", owner, repo, "branches", query=q) # XXX: returns 'null' when there are no branches; an empty list would be a better API return conn.request("GET", url) diff --git a/osc/gitea_api/fork.py b/osc/gitea_api/fork.py index 3901628c..911923a4 100644 --- a/osc/gitea_api/fork.py +++ b/osc/gitea_api/fork.py @@ -20,8 +20,10 @@ class Fork: :param owner: Owner of the repo. :param repo: Name of the repo. """ - - url = conn.makeurl("repos", owner, repo, "forks") + q = { + "limit": -1, + } + url = conn.makeurl("repos", owner, repo, "forks", query=q) return conn.request("GET", url) @classmethod diff --git a/osc/gitea_api/pr.py b/osc/gitea_api/pr.py index b73e7aeb..f9a929f8 100644 --- a/osc/gitea_api/pr.py +++ b/osc/gitea_api/pr.py @@ -180,6 +180,7 @@ class PullRequest: q = { "state": state, + "limit": -1, } url = conn.makeurl("repos", owner, repo, "pulls", query=q) return conn.request("GET", url) @@ -220,6 +221,8 @@ class PullRequest: "created": created, "mentioned": mentioned, "review_requested": review_requested, + # HACK: limit=-1 doesn't work, the request gets stuck; we need to use a high number to avoid pagination + "limit": 10**6, } url = conn.makeurl("repos", "issues", "search", query=q) return conn.request("GET", url) diff --git a/osc/gitea_api/ssh_key.py b/osc/gitea_api/ssh_key.py index f4801735..4a0c2236 100644 --- a/osc/gitea_api/ssh_key.py +++ b/osc/gitea_api/ssh_key.py @@ -23,7 +23,10 @@ class SSHKey: :param conn: Gitea ``Connection`` instance. """ - url = conn.makeurl("user", "keys") + q = { + "limit": -1, + } + url = conn.makeurl("user", "keys", query=q) return conn.request("GET", url) @classmethod