Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge request note update appends instead of replaces #2870

Closed
Flamefire opened this issue May 16, 2024 · 2 comments
Closed

Merge request note update appends instead of replaces #2870

Flamefire opened this issue May 16, 2024 · 2 comments

Comments

@Flamefire
Copy link

Description of the problem, including code/CLI snippet

I want to update a comment on a merge request. For that I use:

    mr = gitlab_project.mergerequests.get(mr_iid)
    match_str = find_comment_match(comment)
    try:
        existing_note = None
        for note in mr.notes.list():
            if find_comment_match(note.body) == match_str:
                existing_note = note
        if existing_note:
            existing_note.body = comment
            existing_note.save()

Expected Behavior

Comment gets replaced by the new text

Actual Behavior

New comment is appended to the text of the old comment

Specifications

  • python-gitlab version: 2.10.1
  • API version you are using (v3/v4): ?
  • Gitlab server version: v16.10.5
@JohnVillalovos
Copy link
Member

Can you try with the latest version of python-gitlab?

@Flamefire
Copy link
Author

Looks like it was a mistake on my side. Tried to reproduce it in a small testcase but failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants