Generator packages.list(iterator=True) fails to paginate when deleting packages #2271
Replies: 3 comments
-
In this specific case, I'm not sure I'd recommend using the iterator as the number of items changes while iterating over them, so pagination might not return items properly - a bit like trying to delete dict items while looping over it sometimes isn't safe. Maybe we can look at the docs again though, thanks for the report! |
Beta Was this translation helpful? Give feedback.
-
Yes, that's what I thought. I think, though, it'd be useful to note such a case in the docs. Thanks for the reply! |
Beta Was this translation helpful? Give feedback.
-
For this case would probably want to use |
Beta Was this translation helpful? Give feedback.
-
Description of the problem, including code/CLI snippet
Generator for a project packages list does not return the complete list of packages when iterating through them with deletion.
Steps to reproduce:
CI_PROJECT_ID
Notes:
list(iterator=True)
is the recommended way to iterate through a large number of items.list(get_all=True)
works as expected.list(iterator=True)
without deletion, generator returns the complete list, as expected.Expected Behavior
Output:
Actual Behavior
Output:
Specifications
Beta Was this translation helpful? Give feedback.
All reactions