-
- Notifications
You must be signed in to change notification settings - Fork 6.2k
improve protected branch to add whitelist support #2451
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
Conversation
models/migrations/v39.go Outdated
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.
Need also migration support for PostgreSQL and MSSQL
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.
I think I have done that
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.
Sorry didn't see, my mistake :)
models/migrations/v39.go Outdated
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.
Sorry didn't see, my mistake :)
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.
Wrong error message
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.
done.
options/locale/locale_en-US.ini Outdated
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.
I would suggest Disable force pushes and prevent deletion.
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.
done.
options/locale/locale_en-US.ini Outdated
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.
I would suggest Branch protect options changed successfully
.
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.
done.
options/locale/locale_en-US.ini Outdated
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.
I would suggest Teams whose members can push to this branch
.
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.
done.
options/locale/locale_en-US.ini Outdated
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.
I would suggest Add users or teams to this branch's whitelist. Whitelisted users bypass the typical push restrictions.
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.
done.
models/migrations/v39.go Outdated
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.
Blank space
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.
done.
LGTM |
models/branches.go Outdated
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.
should return nil
@lunny From the screenshot, do we really need to differentiate between Users and Teams? Can't they be in the same list? (Gitea knows the difference internally anyhow) |
@bkcsoft For a non-organization repository, we only have users. For an organization repository, we will have users and teams. I think both are needed. |
@lunny Right, the list it returns would be different, but I still don't understand why it needs to be 2 lists? |
Two lists is easy to implement. 😄 We can optimist it later. We still need pull request control, status check and approval control. |
I also would like to see there single list instead of two but I agree that it can be implemented later |
7cea815
to 1666907
Compare models/branches.go Outdated
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.
Would it be possible to move these helpers for int64 slices to a util file? They don't have anything to do with branches.
models/org.go Outdated
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.
I'd suggest renaming to TeamsWithAccessToRepo
(and similarly GetTeamsWithAccessToRepo
)
models/repo.go Outdated
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.
misspelled Access
0ad42cc
to bcadda5
Compare will be part of #32 |
@ethantkoenig all done. |
my gitea version 1.2 the protect branch tool didn't work, but when i use version 1.1.3, it works well |
@LanaYuan could you try on https://try.gitea.io |
bcadda5
to f71a25a
Compare LGTM |
Codecov Report
@@ Coverage Diff @@ ## master #2451 +/- ## ========================================== - Coverage 27.83% 27.75% -0.09% ========================================== Files 83 83 Lines 16835 16886 +51 ========================================== Hits 4686 4686 - Misses 11474 11525 +51 Partials 675 675
Continue to review full report at Codecov.
|
This PR will add a protected branch edit page to enable or disable protected branch. It also add support to whitelist users or whitelist teams so that special users could push to the branch.