Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Saving issue after retrieving with label details destroys labels in GL  #1922

Open
@wieland-s

Description

@wieland-s

Description of the problem, including code/CLI snippet

After retrieving issues with the Option with_labels_details=True and calling issue.save() the Labels in Gitlab are broken. Means: All old labels are overwritten with new ones. The new ones are dict-elements as shown below.

Looks like there is a problem in the save()-function of issues.

Example task:

# get issues
issue = project.issues.list(all=True, with_labels_details=True)[0]

# edit labels 
# e.g. delete one, change color, ...
# editing is not needed to reproduce this issue 

# save issue (with changed labels)
issue.save()

Expected Behavior

Saves edited labels in issues like before: Non touched should be not touched etc.
Simply save like edited issues retrieved with with_labels_details=False (this works like a charm)

image

Actual Behavior

The dict elements are stored as labels.
image

Specifications

  • python-gitlab version: 3.1.1
  • API version you are using (v3/v4): v4
  • Gitlab server version: 14.7.4

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