-
Notifications
You must be signed in to change notification settings - Fork 613
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
Respect GitLab's delete source branch checkbox #1220
Conversation
Incremental build 1.5.28-rc1334.943db_b_50c532 is available for testing. The incremental build is available from: https://repo.jenkins-ci.org/incrementals/org/jenkins-ci/plugins/gitlab-plugin/1.5.28-rc1334.943db_b_50c532/ @UnsolvedCypher Can you please test the incremental build and confirm the issue is resolved? For instructions on how to install a custom build, see: https://www.jenkins.io/doc/book/managing/plugins/#advanced-installation |
Hello @basil, thank you for the instructions. I have set this up locally and confirmed that this change does in fact work and causes GitLab's "Should remove source branch" checkbox to be respected. In the process, I found that in the plugin even without my change completely ignores the removeSourceBranch parameter to acceptGitLabMR(). Before my change, it would always pass "false" to GitLab regardless of the parameter, and now with my change, it always passes "null" (which means that it defers to GitLab's checkbox). I can open a separate issue for that, but as this PR does at least improve the situation, I think it is ready to be merged. |
Can you please look into fixing |
I'd be happy to look into it but I will need some help understanding the architecture. I don't really understand how the parameters from |
Sure, the relevant source file is @DataBoundSetter
public void setRemoveSourceBranch(boolean removeSourceBranch) {
this.removeSourceBranch = removeSourceBranch;
} It seems like one problem is that this uses the mechanism for optional parameters ( |
Thank you, that is very helpful. I have determined that the request getting sent to GitLab is correct, but for some reason is still not working properly. There have been a number of bugs filed and fixed in the past few years about GitLab's I've opened #1232, so if you are alright with it, I will open a PR to upgrade the |
Sure, go ahead! |
943dbb5
to
925f984
Compare
Hi @basil, I believe this is ready to be merged. I have made some further changes (part of the plugin was still using primitive I have ensured (by building an hpi locally and installing it on a Dockerized Jenkins) that:
Please let me know if there are any other changes you would like to this PR! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! Thanks again for the PR.
Wonderful, thank you for the quick merge! Would it be possible to get a release sometime soon? This fix would be very helpful to have at work. |
Released in 1.5.28. |
Currently,
acceptGitLabMR
passesfalse
to GitLab's API forshould_remove_source_branch
unless otherwise specified. This change makes it specifynull
instead, which means that unless it is specified, it will respect the checkbox in the GitLab UI for removing the source branch after merge.