Add block on pending codeowner reviews branch protection#34995
Add block on pending codeowner reviews branch protection#34995Naxdy wants to merge 2 commits intogo-gitea:mainfrom
Conversation
7ff6bd4 to
7141ade
Compare
39ba543 to
18cce17
Compare
a5035a7 to
5df3166
Compare
|
|
||
| hasApprovals := true | ||
|
|
||
| for _, rule := range rules { |
There was a problem hiding this comment.
The logic appears overly complex and doesn’t seem correct. I ran a test, and it didn’t work as expected. Could you please rewrite it to make it clearer and more readable?
There was a problem hiding this comment.
I ran a test, and it didn’t work as expected.
Can you give me more info about that, like the codeowner file you used and what you expected vs. what happened?
There was a problem hiding this comment.
Also went and amended it to be a bit more concise. The behavior should be unchanged though, so I'd still be interested in your findings.
b448f2c to
e01ac3d
Compare
|
Relevant PR for gitea docs, for if/when this is merged: https://gitea.com/gitea/docs/pulls/245 |
d1f75f3 to
1201827
Compare
1201827 to
7f9d373
Compare
ce73de0 to
e40c846
Compare
a25ec77 to
f8cba0b
Compare
f8cba0b to
49f1ed0
Compare
e0e5370 to
186f7c4
Compare
186f7c4 to
743ded8
Compare
|
Been busy for a while, but finally found some time to clean this up. Ready for another review pass by @lunny |
This commit introduces a new branch protection rule that allows merge blocking if there are pending reviews from one or more code owners (as defined in any valid
CODEOWNERSfile). This is determined by evaluating each rule present in theCODEOWNERSfile individually. For every rule, at least one named code owner (or member of a code owner team) must have given an approving review for merging to be possible.Closes #32602
This PR does NOT display code owners separately from other reviewers (#28137), as I think it makes sense to do that in a separate PR, as it doesn't require any database migrations.
Screenshot
Pull Request
Branch Protection Rule
Unresolved questions
Does this warrant a doc change?Relevant PR: https://gitea.com/gitea/docs/pulls/245