Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

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

Provide feedback

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

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: remove default arguments for mergerequests.merge()#1818

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nejch merged 1 commit intomainfromjlvillal/merge_request_merge_defaults
Jan 8, 2022

Conversation

JohnVillalovos
Copy link
Member

The argumentsshould_remove_source_branch and
merge_when_pipeline_succeeds are optional arguments. We should not
be setting any default value for them.

https://docs.gitlab.com/ee/api/merge_requests.html#accept-mr

Closes:#1750

@JohnVillalovosJohnVillalovosforce-pushed thejlvillal/merge_request_merge_defaults branch fromadc9c7c tod76152eCompareJanuary 8, 2022 22:47
The arguments `should_remove_source_branch` and`merge_when_pipeline_succeeds` are optional arguments. We should notbe setting any default value for them.https://docs.gitlab.com/ee/api/merge_requests.html#accept-mrCloses:#1750
@JohnVillalovosJohnVillalovosforce-pushed thejlvillal/merge_request_merge_defaults branch fromd76152e to8e589c4CompareJanuary 8, 2022 23:08
@codecov-commenter
Copy link

Codecov Report

Merging#1818 (8e589c4) intomain (22a1516) willnot change coverage.
The diff coverage is50.00%.

@@           Coverage Diff           @@##             main    #1818   +/-   ##=======================================  Coverage   92.01%   92.01%           =======================================  Files          76       76             Lines        4799     4799           =======================================  Hits         4416     4416             Misses        383      383
FlagCoverage Δ
cli_func_v481.39% <50.00%> (-0.03%)⬇️
py_func_v480.07% <50.00%> (ø)
unit83.07% <0.00%> (ø)

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

Impacted FilesCoverage Δ
gitlab/v4/objects/merge_requests.py84.78% <50.00%> (ø)

@nejch
Copy link
Member

As we see in the functional tests this istechnically a breaking behavior. But only in the scenarios where
a) the project-level setting for "should remove source branch" is set to true (which I think has been the default for new projects for a while now)
b) the user does not supply theshould_remove_source_branch param

In this case,python-gitlab used to override the project default due to its own default (which wasFalse). But IMO this is wrong and unexpected behavior frompython-gitlab, so I think we can get away with afix here 👍 For anyone reading this after the fact, themerge() default was added years before the project-level setting was introduced, so as soon as GitLab introduced the project-level setting our client started to have wrong behavior and it doesn't make sense anymore.

JohnVillalovos reacted with thumbs up emoji

@JohnVillalovos
Copy link
MemberAuthor

@nejch I agree. As it is very confusing if the project default is set to remove it but then we are by default not removing it.

@nejchnejch merged commit0dba899 intomainJan 8, 2022
@nejchnejch deleted the jlvillal/merge_request_merge_defaults branchJanuary 8, 2022 23:33
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nejchnejchAwaiting requested review from nejch

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

mergerequest.merge() implicitly setsshould_remove_source_branch: false since 2.7.0
3 participants
@JohnVillalovos@codecov-commenter@nejch

[8]ページ先頭

©2009-2025 Movatter.jp