FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: `mr.cancel_merge_when_pipeline_succeeds()` by JohnVillalovos · Pull Request #2350 · python-gitlab/python-gitlab · GitHub

Repository navigation

fix: mr.cancel_merge_when_pipeline_succeeds() - #2350

Merged
nejch merged 1 commit into
mainfrom
jlvillal/cancel_merge
Oct 31, 2022
Merged

nejch merged 1 commit into
mainfrom
jlvillal/cancel_merge

Conversation

Copy link
Copy Markdown
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 commented Oct 30, 2022 •
edited by codecov Bot
Loading

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.88%. Comparing base (2974966) to head (cd31cda).
⚠️ Report is 714 commits behind head on main.

Additional details and impacted files
@@            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.62% <33.33%> (-0.10%) ⬇️
unit 87.76% <33.33%> (+0.01%) ⬆️

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

Files with missing lines Coverage Δ
gitlab/v4/objects/merge_requests.py 88.88% <100.00%> (+3.37%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

JohnVillalovos requested a review from nejch October 30, 2022 19:55

nejch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

nejch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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 force-pushed the jlvillal/cancel_merge branch from 19ee535 to cd31cda Compare October 31, 2022 10:12
nejch enabled auto-merge (squash) October 31, 2022 10:16
nejch merged commit bd82d74 into main Oct 31, 2022
nejch deleted the jlvillal/cancel_merge branch October 31, 2022 10:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Successfully merging this pull request may close these issues.

project-merge-request cancel-merge-when-pipeline-succeeds fails with gitlab.exceptions.GitlabMROnBuildSuccessError: 404: 404 Not Found

4 participants


Back | FazBrowse Home | New Git URL