FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Trying to list merge requests containing specific approver_ids returns an exception · Issue #1010 · python-gitlab/python-gitlab · GitHub

Repository navigation

Trying to list merge requests containing specific approver_ids returns an exception #1010

Description

Description of the problem, including code/CLI snippet

I am trying to list merge requests which contain a certain approver ID. As per https://docs.gitlab.com/ee/api/merge_requests.html#list-merge-requests this should be doable via:

gl.mergerequests.list(approver_ids=[1])

Calling that code raises the following exception (GitLab EE):

Traceback (most recent call last):
  File "/venv/lib/python3.7/site-packages/gitlab/exceptions.py", line 267, in wrapped_f
    return f(*args, **kwargs)
  File "/venv/lib/python3.7/site-packages/gitlab/mixins.py", line 141, in list
    obj = self.gitlab.http_list(path, **data)
  File "/venv/lib/python3.7/site-packages/gitlab/__init__.py", line 648, in http_list
    return list(GitlabList(self, url, query_data, get_next=False, **kwargs))
  File "/venv/lib/python3.7/site-packages/gitlab/__init__.py", line 771, in __init__
    self._query(url, query_data, **kwargs)
  File "/venv/lib/python3.7/site-packages/gitlab/__init__.py", line 776, in _query
    result = self._gl.http_request("get", url, query_data=query_data, **kwargs)
  File "/venv/lib/python3.7/site-packages/gitlab/__init__.py", line 572, in http_request
    response_body=result.content,
gitlab.exceptions.GitlabHttpError: 400: approver_ids should be an array, 'None' or 'Any'

In the gitlab server logs I see the following:

"GET /api/v4/merge_requests?approver_ids=1 HTTP/1.1" 400 60 "-" "python-gitlab/2.0.1" "-"

Expected Behavior

Return merge requests for the specified approver_ids.

Actual Behavior

Raises an exception.

Specifications

  • python-gitlab version: 2.0.1
  • API version you are using (v3/v4): v4
  • Gitlab server version (or gitlab.com): 12.7.5-ee

Activity

  1. max-wittig commented on Feb 10, 2020

    Member

    This will be fixed by #1005, but I haven't gotten to testing it yet. Will do so soon.

  2. sim0nx commented on Feb 10, 2020

    Author

    Thank you! Appreciate that!

  3. max-wittig commented on Feb 12, 2020

    Member

    Should be fixed with the next release

  4. locked as resolved and limited conversation to collaborators on Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL