Skip to content

Commit 484bf40

Browse files
Merge branch 'main' into pcdnm-list
2 parents dfd848f + 2ef6452 commit 484bf40

4 files changed

Lines changed: 16 additions & 1 deletion

File tree

‎docs/gl_objects/discussions.rst‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ You can get and update a single note using the ``*DiscussionNote`` resources::
7575
last_note.body = 'Updated comment'
7676
last_note.save()
7777

78+
Resolve / unresolve a note::
79+
80+
last_note = discussion.notes.get(note_id)
81+
last_note.resolved = True # True to resolve, False to unresolve
82+
last_note.save()
83+
7884
Create a new discussion::
7985

8086
discussion = resource.discussions.create({'body': 'First comment of discussion'})

‎gitlab/v4/objects/hooks.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class ProjectHookManager(CRUDMixin[ProjectHook]):
6060
"wiki_page_events",
6161
"enable_ssl_verification",
6262
"token",
63+
"custom_webhook_template",
6364
),
6465
)
6566
_update_attrs = RequiredOptional(
@@ -76,6 +77,7 @@ class ProjectHookManager(CRUDMixin[ProjectHook]):
7677
"wiki_events",
7778
"enable_ssl_verification",
7879
"token",
80+
"custom_webhook_template",
7981
),
8082
)
8183

‎gitlab/v4/objects/notes.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class ProjectMergeRequestDiscussionNoteManager(
153153
"discussion_id": "id",
154154
}
155155
_create_attrs = RequiredOptional(required=("body",), optional=("created_at",))
156-
_update_attrs = RequiredOptional(required=("body",))
156+
_update_attrs = RequiredOptional(exclusive=("body", "resolved"))
157157

158158

159159
class ProjectSnippetNote(SaveMixin, ObjectDeleteMixin, RESTObject):

‎tests/functional/api/test_merge_requests.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ def test_merge_request_discussion(project):
6969
discussion = mr.discussions.get(discussion.id)
7070
assert discussion.attributes["notes"][-1]["body"] == "updated body"
7171

72+
note_from_get = discussion.notes.get(note.id)
73+
note_from_get.resolved = True
74+
note_from_get.save()
75+
76+
discussion = mr.discussions.get(discussion.id)
77+
assert discussion.attributes["notes"][-1]["resolved"] is True
78+
7279
note_from_get.delete()
7380

7481

0 commit comments

Comments
 (0)