diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2024-01-22 14:47:49 -0500 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2024-01-22 14:47:49 -0500 |
commit | c3fa8bd14fe452fcceafd7f2baea171ac5533f30 (patch) | |
tree | b7e376dc98b7421cc365ef1a0e800b569b391376 | |
parent | f25e5126091f1a25dd610f8ab620be8f8195e73b (diff) | |
download | korg-helpers-master.tar.gz |
We weren't doing the right thing when processing paginated data.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rwxr-xr-x | git-patchwork-bot.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/git-patchwork-bot.py b/git-patchwork-bot.py index 8941b97..8dc4f48 100755 --- a/git-patchwork-bot.py +++ b/git-patchwork-bot.py @@ -116,12 +116,17 @@ class Restmaker: _params = list(params) + [('page', page)] logger.debug('Performing query: url=%s, params=%s', url, _params) rsp = self.session.get(url, params=_params, stream=False) + if rsp.status_code == 404: + logger.debug('No such page: %s', page) + break rsp.raise_for_status() pagedata = rsp.json() if not pagedata: + logger.debug('No pagedata returned, exiting fetches') break results.extend(pagedata) - if len(pagedata) <= REST_PER_PAGE: + if len(pagedata) < REST_PER_PAGE: + logger.debug('Fewer than %s returned, assuming last page', REST_PER_PAGE) break return results @@ -444,6 +449,7 @@ def git_get_new_revs(gitdir: str, db_heads: List[Tuple[str, str]], git_heads: Li lines = git_get_command_lines(gitdir, args) if not lines: + # TODO: Fix for rebased repositories continue revs = list() |