Skip to content

Misleading documentation: mr_id instead of mr_iid #2295

Closed
@stdedos

Description

@stdedos

Description of the problem, including code/CLI snippet

Get a single MR::
mr = project.mergerequests.get(mr_id)
Create a MR::
mr = project.mergerequests.create({'source_branch': 'cool_feature',
'target_branch': 'main',
'title': 'merge cool feature',
'labels': ['label1', 'label2']})
Update a MR::
mr.description = 'New description'
mr.labels = ['foo', 'bar']
mr.save()
Change the state of a MR (close or reopen)::
mr.state_event = 'close' # or 'reopen'
mr.save()
Delete a MR::
project.mergerequests.delete(mr_id)
# or
mr.delete()

"Most probably", here the author meant mr_iid and not mr_id (i.e. the project-agnostic ID).

If those are the only two instances, I'd open an MR to fix them now - but I'm thinking whether this a more widespread issue that I wouldn't know how to fix 😕

Expected Behavior

Actual Behavior

Specifications

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions