You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There seem to be 2 options for that when using this library:
a) remember to use get_all=True and probably cause with increased resources use on the GitLab instance,
b) remember to use iterator=True and add extra code to get all the elements of the list,
Both of these require extra code that you need to remember about (because the missing parameter will not cause an error unless you test with lists of > 20 elements) and are inconvenient.
We already had 2 bugs in gitlabform because we forgot to add this code:
This could be implemented with iterators to not cause an extra load in the GitLab instance. The execution time or resource use on the client side is less important here as this would probably be used for scripting, batch operations and generally non-interactive purposes.
Specifications
python-gitlab version: v4.4.0
API version you are using (v3/v4): v4
Gitlab server version (or gitlab.com): doesn't matter
The text was updated successfully, but these errors were encountered:
That's a cool idea @gdubicki! Even in my team we often end up creating something like a list_kwargs that we pass to all list methods. Having this natively would be nicer for sure.
It might be good to cover both the iterator and get_all for this, or just allow passing either of the two when instantiating the instance.
Description of the problem
In the gitlabform app (https://github.com/gitlabform/gitlabform), and probably for many other purposes too, we always want to get all the elements of lists.
Current solution
There seem to be 2 options for that when using this library:
a) remember to use
get_all=True
and probably cause with increased resources use on the GitLab instance,b) remember to use
iterator=True
and add extra code to get all the elements of the list,Both of these require extra code that you need to remember about (because the missing parameter will not cause an error unless you test with lists of > 20 elements) and are inconvenient.
We already had 2 bugs in gitlabform because we forgot to add this code:
Proposed solution
Let's introduce a global configuration flag to get all the elements of each list by default.
We could name this flag
get_all_by_default
and pass it to the constructor (like the "pagination" parameter now).This could be implemented with iterators to not cause an extra load in the GitLab instance. The execution time or resource use on the client side is less important here as this would probably be used for scripting, batch operations and generally non-interactive purposes.
Specifications
The text was updated successfully, but these errors were encountered: