modulesync icon indicating copy to clipboard operation
modulesync copied to clipboard

GitLab merge request should enable "Delete source branch" option by default

Open bittner opened this issue 4 years ago • 3 comments

Currently, when a merge request is created on GitLab using the --pr option, the checkbox "Delete source branch" remains unchecked. It looks like that GitLab doesn't automatically consider the related default in the GitLab repo project's merge request settings.

We should set that option by default, optionally making it configurable.

Optionally, it could be investigated whether a similar option exists for GitHub in the meantime (probably not), which would help to keep the feature set aligned across GitHub and GitLab. (We probably want to avoid "GitLab-only" command line switches.)

bittner avatar Aug 14 '20 14:08 bittner

as far as I know you cannot set this on GitHub for a single pull request. On GitHub we've got one setting for the whole repository to delete merged branches ( which we've enabled):

2020-08-15-195909_952x125_scrot

I think in the past we had the create a pr option in modulesync only for github, not for gitlab. I am not against options that are gitlab specific, as far as it's properly documented (but others might see this differently).

bastelfreak avatar Aug 15 '20 18:08 bastelfreak

It may make sense to not make this configurable, and simply implement "the expected default behavior".

(Note that this behavior is configurable via the GitLab project settings since recently. So, well, what's the default? Though, GitLab's "Delete source branch" option is so common that, at least currently, it's somewhat "an accepted default". Not sure if someone would object here. And, as a side note, it may be a GitLab API bug that the project default value is not considered in the API call, when the value is unspecified; maybe this will get fixed by GitLab in future.)

Also, ModuleSync will likely always create a new branch, which deserves being removed after being merged. IOW, why should someone want to keep a merged branch that was created by a bot (or human automation)?

bittner avatar Aug 16 '20 01:08 bittner

There's an issue open to respect the configured value https://gitlab.com/gitlab-org/gitlab/-/issues/231245

Would be great to have an option to configure that.

saz avatar Oct 07 '22 13:10 saz