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
{{ message }}
Repository navigation
Trying to Fetch multiple ProjectIssues in a single batch call returns only the last ProjectIssue specified in the list #1407
Description of the problem, including code/CLI snippet
According to Gitlab, we can make a batch GET call to fetch multiple issues by passing in the list of issue_ids in parameter iids.
However, while using the library this method call always returns a list with a single element (which happens to be the last element in the iids list.
project=gl.projects.get(project_id)
project.issues.list(all=True, iids=[1, 2, 3]) # Returns a list with a single element ProjectIssue[iid=3]project.issues.list(all=True, iids=[3, 2, 1]) # Returns a list with a single element ProjectIssue[iid=1]
Are batch requests not supported yet or is this a bug?
Expected Behavior
The batch call should return a list of all ProjectIssues as mentioned in the iids field.
changed the title [-]Trying to Fetch multiple ProjectIssues by a single batch call returns only the last ProjectIssue specified in the list[/-][+]Trying to Fetch multiple ProjectIssues in a single batch call returns only the last ProjectIssue specified in the list[/+]on Apr 23, 2021
Activity
[-]Trying to Fetch multiple ProjectIssues by a single batch call returns only the last ProjectIssue specified in the list[/-][+]Trying to Fetch multiple ProjectIssues in a single batch call returns only the last ProjectIssue specified in the list[/+]nejch commentedon Apr 23, 2021
This seems related to some other issues where lists aren't passed to query params correctly, I'll check. I think we have a similar issue with scopes.
Out of curiosity, have you tried passing the
iidsas a comma-delimited string? Would need to check what the current state of the gitlab API is with this (see e.g. https://gitlab.com/gitlab-org/gitlab-foss/-/issues/48007)aaronalphonso commentedon Apr 23, 2021
I just tried passing in
iidsas a comma-delimted string and it gives me the expected results. Thank you very much for the suggestion! :)JohnVillalovos commentedon Apr 25, 2021
EDIT: Now I am less sure. I need to do more investigation... I'm pretty sure that the patch as it is right now will not work 😢
I have proposed a patch for this issue in #1413
I'm hopeful that it will work though I have not tested it.JohnVillalovos commentedon Apr 25, 2021
EDIT: So after further research believe the problem is python-gitlab. Created issue for it: #1419
I have left a comment on the MR, which seems to have caused this behavior in Gitlab:https://gitlab.com/gitlab-org/gitlab/-/merge_requests/33450JohnVillalovos commentedon Apr 26, 2021
Related issue: #1256
JohnVillalovos commentedon Apr 27, 2021
@nejch I think I may have found out our root cause issue.
Had a discussion with a Gitlab developer in: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/33450
From the Gitlab documentation: https://docs.gitlab.com/ee/api/#array
array
import_sourcesis a parameter of type array:So it seems for
arraytypes we need to append[]to the variable name.