diff --git a/lib/platform/gitlab/index.js b/lib/platform/gitlab/index.js index 3d9e1b4c0b22d67a4915a893120a7bdb04b93468..d5dbac9be66424c16101ff0c2da0fac624f87d87 100644 --- a/lib/platform/gitlab/index.js +++ b/lib/platform/gitlab/index.js @@ -535,8 +535,8 @@ async function addComment(issueNo, body) { } async function editComment(issueNo, commentId, body) { - // PATCH projects/:owner/:repo/merge_requests/:number/notes/:id - await get.patch( + // PUT projects/:owner/:repo/merge_requests/:number/notes/:id + await get.put( `projects/${ config.repository }/merge_requests/${issueNo}/notes/${commentId}`, diff --git a/test/platform/gitlab/index.spec.js b/test/platform/gitlab/index.spec.js index 0e7f7ba803bd889b5e5adcbbf0f3fa307947376d..b0352aa653b287345c7e2f3f59303292c25c3d21 100644 --- a/test/platform/gitlab/index.spec.js +++ b/test/platform/gitlab/index.spec.js @@ -706,8 +706,8 @@ describe('platform/gitlab', () => { }); await gitlab.ensureComment(42, 'some-subject', 'some\ncontent'); expect(get.post.mock.calls).toHaveLength(0); - expect(get.patch.mock.calls).toHaveLength(1); - expect(get.patch.mock.calls).toMatchSnapshot(); + expect(get.put.mock.calls).toHaveLength(1); + expect(get.put.mock.calls).toMatchSnapshot(); }); it('skips comment', async () => { await initRepo({ repository: 'some/repo', token: 'token' }); @@ -716,14 +716,14 @@ describe('platform/gitlab', () => { }); await gitlab.ensureComment(42, 'some-subject', 'some\ncontent'); expect(get.post.mock.calls).toHaveLength(0); - expect(get.patch.mock.calls).toHaveLength(0); + expect(get.put.mock.calls).toHaveLength(0); }); it('handles comment with no description', async () => { await initRepo({ repository: 'some/repo', token: 'token' }); get.mockReturnValueOnce({ body: [{ id: 1234, body: '!merge' }] }); await gitlab.ensureComment(42, null, '!merge'); expect(get.post.mock.calls).toHaveLength(0); - expect(get.patch.mock.calls).toHaveLength(0); + expect(get.put.mock.calls).toHaveLength(0); }); }); describe('ensureCommentRemoval', () => {