go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
45.06k stars 5.49k forks source link

Protected branches system #32

Closed DblK closed 6 years ago

DblK commented 8 years ago

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!](https://www.bountysource.com/issues/38914868-protected-branches-system?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github).
tboerger commented 8 years ago

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 :+1: for that.

lunny commented 8 years ago

I think this need a proposal to describe it.

bkcsoft commented 8 years ago

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

Reference: https://github.com/gogits/gogs/issues/776#issuecomment-238779355

strk commented 8 years ago

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

thibaultmeyer commented 8 years ago

+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 commented 8 years ago

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

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

Ritbit commented 8 years ago

+1 desperately in need for this.

bkcsoft commented 8 years ago

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

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

lunny commented 7 years ago

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

ghost commented 7 years ago

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 commented 7 years ago

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

lunny commented 7 years ago

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

ghost commented 7 years ago

@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 commented 7 years ago

Even implementing this would go along a long way.

svarlamov commented 6 years ago

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 commented 6 years ago

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

lunny commented 6 years ago

I think this issue has been resolved.