← 返回首页
fix: `mr.cancel_merge_when_pipeline_succeeds()` by JohnVillalovos · Pull Request #2350 · python-gitlab/python-gitlab · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

fix: mr.cancel_merge_when_pipeline_succeeds()#2350

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

fix: mr.cancel_merge_when_pipeline_succeeds()#2350
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

Copy link
Copy Markdown

codecov-commenter commented Oct 30, 2022
edited by codecov Bot
Loading

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
Copy link
Copy Markdown
Member

nejch left a comment

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 Hide comment

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.

Comment thread gitlab/v4/objects/merge_requests.py Show resolved Hide resolved
Comment thread tests/functional/conftest.py Show resolved Hide resolved
Comment thread tests/functional/api/test_merge_requests.py Show resolved Hide resolved
Comment thread tests/functional/api/test_merge_requests.py Show resolved Hide resolved
Comment thread tests/functional/conftest.py Show resolved Hide resolved
Copy link
Copy Markdown
Member

nejch left a comment

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 Hide comment

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

Footer

© 2026 GitHub, Inc.