From bd82d745c8ea9ff6ff078a4c961a2d6e64a2f63c Mon Sep 17 00:00:00 2001 From: John Villalovos Date: Mon, 31 Oct 2022 03:24:27 -0700 Subject: fix: use POST method and return dict in `cancel_merge_when_pipeline_succeeds()` (#2350) * Call was incorrectly using a `PUT` method when should have used a `POST` method. * Changed return type to a `dict` as GitLab only returns {'status': 'success'} on success. Since the function didn't work previously, this should not impact anyone. * Updated the test fixture `merge_request` to add ability to create a pipeline. * Added functional test for `mr.cancel_merge_when_pipeline_succeeds()` Fixes: #2349 --- docs/gl_objects/merge_requests.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/gl_objects/merge_requests.rst b/docs/gl_objects/merge_requests.rst index 02121dc..fd57e60 100644 --- a/docs/gl_objects/merge_requests.rst +++ b/docs/gl_objects/merge_requests.rst @@ -122,8 +122,14 @@ Accept a MR:: mr.merge() -Cancel a MR when the build succeeds:: +Schedule a MR to merge after the pipeline(s) succeed:: + mr.merge(merge_when_pipeline_succeeds=True) + +Cancel a MR from merging when the pipeline succeeds:: + + # Cancel a MR from being merged that had been previously set to + # 'merge_when_pipeline_succeeds=True' mr.cancel_merge_when_pipeline_succeeds() List commits of a MR:: -- cgit v1.2.1