Skip to content
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

Protected branches system #32

Closed
DblK opened this issue Nov 3, 2016 · 17 comments
Closed

Protected branches system #32

DblK opened this issue Nov 3, 2016 · 17 comments
Labels
type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first.
Milestone

Comments

@DblK
Copy link
Member

DblK commented Nov 3, 2016

One missing feature from gogs is a way to protect branches like Github does.
After the completion of the API implementation, we could easily add application like Drone to check the PR.

The UI need to be changed to add options to protect branches like this:
image

I suggest to add some columns in table (don't know how many yet) to store those options.
The "Merge" button from a PR should be activated is the conditions are not matched.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@tboerger
Copy link
Member

tboerger commented Nov 3, 2016

Please don't prefix the issue with [Feature], that should be done via labels. This is an important feature for an lgtm.co integration, so a big 👍 for that.

@tboerger tboerger changed the title [Feature] Add the protected branches system Add the protected branches system Nov 3, 2016
@tboerger tboerger added the type/enhancement An improvement of existing functionality label Nov 3, 2016
@tboerger tboerger added this to the 1.1.0 milestone Nov 3, 2016
@lunny
Copy link
Member

lunny commented Nov 3, 2016

I think this need a proposal to describe it.

@tboerger tboerger added type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first. and removed type/enhancement An improvement of existing functionality type/feature Completely new functionality. Can only be merged if feature freeze is not active. labels Nov 3, 2016
@bkcsoft
Copy link
Member

bkcsoft commented Nov 4, 2016

@lunny Agreed. I've looked into this issue before, and it requires a rewrite of how GitHooks are currently Exposed.

Reference: gogs/gogs#776 (comment)

@strk
Copy link
Member

strk commented Nov 5, 2016

@DblK "proposal" proposed process is here https://github.com/go-gitea/proposals/pull/1

@thibaultmeyer
Copy link
Contributor

thibaultmeyer commented Nov 5, 2016

+1 without protected branches system, Gitea will be not ready for a corporate environment where is not acceptable to ask at each developers to use the "fork and pull request" flow.

@lunny
Copy link
Member

lunny commented Nov 5, 2016

Before we can start protected branch, we have to finish the dependent features first:

  • code review, this is based comment on code, but add a flag to disable merge button until the comment author close it.
  • status check system, this is based webhook. and it's a specific webhook. We could define it like github.
  • rebase the PR.

Implement every one feature will not result many commits, so we can do it step by step.
Welcome to improve it.

@Ritbit
Copy link

Ritbit commented Nov 9, 2016

+1 desperately in need for this.

@bkcsoft
Copy link
Member

bkcsoft commented Nov 9, 2016

@lunny no need for all that, just a simple branch X can't be pushed to would suffice to start with 🙂

As for status check, that would be fairly simple to implement really (if one does as GitHub API does)

@bkcsoft bkcsoft changed the title Add the protected branches system Protected branches system Dec 2, 2016
@lunny
Copy link
Member

lunny commented Feb 22, 2017

#339 is the first part merged for this issue, so let's move it to v1.2.

@lunny lunny modified the milestones: 1.2.0, 1.1.0 Feb 22, 2017
@lunny lunny mentioned this issue Feb 23, 2017
20 tasks
@lunny lunny modified the milestones: 1.x.x, 1.2.0 Apr 6, 2017
@ghost
Copy link

ghost commented Jun 2, 2017

Only thing stopping us moving to gitea now.
We have a company 1k dev strong.
Please, I urge the community to focus on this.

@ptman
Copy link
Contributor

ptman commented Jun 2, 2017

@exp10r3r Do you have any golang devs that could help?

@lunny
Copy link
Member

lunny commented Jun 2, 2017

@exp10r3r We have #339 merged a simple protected branch system. Of course we need more features.

@ghost
Copy link

ghost commented Jun 2, 2017

@ptman Unfortunately, no. More than 50% from NodeJS, 10% php and the rest html/css.

@lunny I know, and I have been following development since you guys forked and personally using it since last 15 days.
The issue arose from the fact that I had given the rest of my team write access to the repo and marked master branch as protected.
I only want them to be able to push to the feature branch, after which a PR is made and only the person with push rights to master can merge this PR.
Imagine my surprise when a dev was merging his own PRs.
Obviously it was an oversight on my end, I should have tested this first hand.
I'm glad though that force pushes are not allowed, that would have been a nightmare.

Anyways, a good branch protection scheme will go a long way in increasing gitea's value proposition.

@ghost
Copy link

ghost commented Jun 17, 2017

Even implementing this would go along a long way.

@svarlamov
Copy link
Contributor

Now that we have protected branches and whitelisting, what would it take to add status checks similar to: https://help.github.com/articles/enabling-required-status-checks/

@lunny
Copy link
Member

lunny commented Dec 7, 2017

@svarlamov yes, we need only 1 PR to show the status check on PR UI since all data have been ready.

@lunny
Copy link
Member

lunny commented May 17, 2018

I think this issue has been resolved.

@lunny lunny added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label May 17, 2018
@lafriks lafriks modified the milestones: 1.x.x, 1.5.0 May 17, 2018
@lafriks lafriks closed this as completed May 17, 2018
lunny referenced this issue in lunny/gitea Feb 7, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

10 participants