Closed darkdragon-001 closed 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).
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
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.