-
Suggestion
-
Resolution: Duplicate
-
None
Forcing all merges to a certain branch (except for key people) to go via pull requests is currently possible in branch permissions.
Pull Requests give traceability and the option to comment on code being merged in - in addition, developers can use plugins and merge checks to add additional controls and warnings to the Pull Request page.
This means that automated checks can be added as merge checks and the people that can be allowed to merge is greater than those who can push - a pre-receive hook doesn't allow good feedback or warnings to the user (as well as not having the context of the branch being merged in, the author etc), so allowing only a restricted set of users to push but allowing all to merge a pull request is desirable.
- duplicates
-
BSERV-2910 Allow merging via pull request but disallow pushing directly to branch
- Closed
- is cloned from
-
BSERV-2910 Allow merging via pull request but disallow pushing directly to branch
- Closed
Form Name |
---|
After digging through the source for the attached zip, it appears the zip file allows all merge commits for all branches. There is a configuration page for the attached zip that allows you to define which users have direct push permission to each branch.
My code attached on 11/Jul/14 simply denies all direct pushes to develop, master or release branches without exception. It allows merge commits to those branches done via pull requests for all users.
The one shortcoming with both solutions is STASH-4837 is still a problem. To work around this, we must disable the plugin for the repo, make the fix, then re-enable the plugin. Either that, or create an "integration" branch, merge changes from the source branch into that, then create a pull request targeting the protected branch. It's clunky.
I know my code is ready to use - we use it daily. I'm unsure about the attached zip. For either one you must build the plugin from source. Since you must do that anyway, it's trivial to test out the plugin on a test instance of stash with pre-defined repositories containing dummy commits, branches, etc. You literally just type 'atlas-run' after building the plugin to launch this. You can test out both to figure out which one works for you.