Skip to content

fix: mr.cancel_merge_when_pipeline_succeeds() #2350

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

Merged
merged 1 commit into from
Oct 31, 2022
Merged

Conversation

JohnVillalovos
Copy link
Member

  • 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

@codecov-commenter
Copy link

codecov-commenter commented Oct 30, 2022

Codecov Report

Merging #2350 (19ee535) into main (f04e8ba) will increase coverage by 0.09%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2350      +/-   ##
==========================================
+ Coverage   95.78%   95.88%   +0.09%     
==========================================
  Files          79       79              
  Lines        5249     5248       -1     
==========================================
+ Hits         5028     5032       +4     
+ Misses        221      216       -5     
Flag Coverage Δ
api_func_v4 83.47% <100.00%> (+0.09%) ⬆️
cli_func_v4 82.73% <33.33%> (+0.01%) ⬆️
unit 87.76% <33.33%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
gitlab/v4/objects/merge_requests.py 88.88% <100.00%> (+3.37%) ⬆️

@JohnVillalovos JohnVillalovos requested a review from nejch October 30, 2022 19:55
Copy link
Member

@nejch nejch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @JohnVillalovos nice catch with the response gotcha! I think we just need to update the docstring as well.

Interesting, GitlabMROnBuildSuccessError also sounds a bit weird to me now here, could be there are some historical reasons for discrepancies here.

Copy link
Member

@nejch nejch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @JohnVillalovos for the quick fix and @lmilbaum for the review, let's tackle the follow-up separately :)

  * 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
@nejch nejch force-pushed the jlvillal/cancel_merge branch from 19ee535 to cd31cda Compare October 31, 2022 10:12
@nejch nejch enabled auto-merge (squash) October 31, 2022 10:16
@nejch nejch merged commit bd82d74 into main Oct 31, 2022
@nejch nejch deleted the jlvillal/cancel_merge branch October 31, 2022 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants