Skip to content

Updating existing merge request labels not working #76

Closed
@ddeno

Description

@ddeno

I am attempting to update an existing merge request's labels by removing one and adding another. After connecting to the Gitlab server, I am trying the following:

for p in gl.Project():
    if (p.id == json_project):
        for mr in p.MergeRequest():
            if (mr.id == json_mr):
                final_labels = []
                for label in mr.labels:
                    if (label not in attribs['remove']):
                        final_labels.append(label)
                for label in attribs['add']:
                    final_labels.append(u'%s' % (label))
                gl_mr.labels = final_labels
                gl_mr.save()

I am getting the error: GitlabUpdateError: 400: Source branch cannot be changed

Is this the proper way to update an existing merge request or am I doing something wrong?

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