-
Notifications
You must be signed in to change notification settings - Fork 643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce a global setting to always get all element from list()
calls
#2843
Comments
That's a cool idea @gdubicki! Even in my team we often end up creating something like a It might be good to cover both the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: