ValentinFrancois / python-gitlab-submodule

List project submodules and get the commits they point to with python-gitlab
Apache License 2.0
3 stars 3 forks source link

[PATCH] Make sure to fetch all pages #15

Closed darkdragon-001 closed 2 years ago

darkdragon-001 commented 2 years ago

By default, Gitlab pagination only fetches the first 20 results. If the submodule diff is not part of the first 20 files, it won't be detected. The Gitlab python client has a nice feature to handle this automatically and only when needed when you use the generator call. See documentation.

ValentinFrancois commented 2 years ago

Ah thanks, didn't know about the pagination limit but glad to see that we can handle it in python-gitlab so easily!

Looks like this could be the reason of https://github.com/ValentinFrancois/python-gitlab-submodule/blob/main/gitlab_submodule/submodule_commit.py#L76 ? I don't remember exactly on which project I observed that, will try to reproduce it and see if this PR solves it. If it does then I can get rid of the get_latest_commit_possible_if_not_found argument.

Btw I took the liberty to put '[PATCH]' in front of your PR title (since your last contribution I set up the CI to get the new package version from the title, see https://github.com/ValentinFrancois/python-gitlab-submodule#contributing).

ValentinFrancois commented 2 years ago

Ok I found back the private projects where I had observed the issue and indeed pagination was the reason, so your fix makes the argument get_latest_commit_possible_if_not_found unnecessary