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

add request review from specific reviewers feature in pull request #10756

Merged
merged 10 commits into from Apr 6, 2020

Conversation

a1012112796
Copy link
Member

@a1012112796 a1012112796 commented Mar 18, 2020

add a way to notify specific reviewers to review like github , by add or delet a special type
review . The acton is is similar to Assign , so many code reuse the function and items of
Assignee, but the meaning and result is different.

The Permission style is is similar to github, that only writer can add a review request from Reviewers,
but the poster can recall and remove a review request after a reviwer has revied even if he don't have
Write Premission. only manager , the poster and reviewer of a request review can remove it.

The reviewers can be requested to review contain all readers for private repo , for public, contain
all writers and watchers.

The offical Review Request will block merge if Reject can block it.

an other change: add ui otify for Assignees.

screenshots:

jta


jtw


jtb


jtm

@lafriks lafriks added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Mar 18, 2020
@lafriks lafriks added this to the 1.12.0 milestone Mar 18, 2020
models/notification.go Outdated Show resolved Hide resolved
models/notification.go Outdated Show resolved Hide resolved
models/review.go Outdated Show resolved Hide resolved
routers/repo/issue.go Show resolved Hide resolved
routers/repo/issue.go Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Mar 18, 2020
@a1012112796
Copy link
Member Author

@lafriks Thanks for your checking!

@a1012112796 a1012112796 force-pushed the add_review_requst_fun branch 3 times, most recently from 37d73d5 to 6fe0d36 Compare March 21, 2020 01:22
models/notification.go Outdated Show resolved Hide resolved
models/review.go Outdated Show resolved Hide resolved
modules/notification/ui/ui.go Show resolved Hide resolved
models/issue_comment.go Show resolved Hide resolved
models/review.go Outdated Show resolved Hide resolved
routers/repo/issue.go Outdated Show resolved Hide resolved
routers/repo/issue.go Outdated Show resolved Hide resolved
models/review.go Outdated Show resolved Hide resolved
routers/routes/routes.go Outdated Show resolved Hide resolved
web_src/js/index.js Outdated Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented Mar 22, 2020

Codecov Report

Merging #10756 into master will decrease coverage by 0.15%.
The diff coverage is 20.86%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10756      +/-   ##
==========================================
- Coverage   43.62%   43.47%   -0.16%     
==========================================
  Files         597      597              
  Lines       83923    84252     +329     
==========================================
+ Hits        36614    36625      +11     
- Misses      42797    43113     +316     
- Partials     4512     4514       +2     
Impacted Files Coverage Δ
models/branches.go 41.88% <0.00%> (ø)
models/issue_comment.go 46.68% <ø> (ø)
modules/notification/base/null.go 66.66% <0.00%> (-2.09%) ⬇️
modules/notification/mail/mail.go 27.02% <0.00%> (-1.96%) ⬇️
modules/notification/notification.go 76.97% <0.00%> (-2.29%) ⬇️
routers/user/home.go 58.08% <0.00%> (-0.20%) ⬇️
services/issue/assignee.go 34.88% <0.00%> (-16.85%) ⬇️
models/review.go 32.37% <4.27%> (-10.38%) ⬇️
routers/repo/issue.go 35.76% <11.11%> (-1.96%) ⬇️
modules/notification/ui/ui.go 64.10% <48.00%> (-6.27%) ⬇️
... and 19 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca33a95...543425f. Read the comment docs.

models/review.go Outdated Show resolved Hide resolved
for _, issue := range issues {
if issue.IsPull {

if isReRequest && issue.PosterID != ctx.User.ID {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, updating my list, I still think the reviewers should be able to dismiss themselves, regardless of what permissions they have.

Also, people with write permissions should not be able to dismiss any review (I as a maintainer am not allowed to dismiss other maintainer's review here in Github). Admins/owners should.

Having said that, Gitea does have its own personality, so some tasks are not entirely resolved the same way as Github. For example, reviewer whitelists are handled separately from PR write access, so we must be careful on what we can copy and what we should reconsider.

@a1012112796
Copy link
Member Author

@guillep2k hello, I have changed it follow your suggestions, about reviewers who can be requested to review, add all readers for private repo, but olny add all watchers and writers in repo , because , readers mean all user in the platform for a public repo, but It's not necessary, Because people who don't watch it won't like to make a review for this repo.

@a1012112796 a1012112796 changed the title add request review from specific reviewers feature in pull request like github add request review from specific reviewers feature in pull request Mar 26, 2020
models/review.go Outdated Show resolved Hide resolved
@guillep2k
Copy link
Member

I'm not sure using the watchers list is a good idea. A public repository's branch could have a very limited number of reviewers, and they may or may not be watching the repo. Or repositories like Gitea may have hundreds of watchers (currently 460). Maybe we could use the "watchers" function for branches that are not protected (or have no reviewer restrictions) but use the list of official/whitelisted reviewers when the target branch has one.

By the way, a public repository whose owner is a hidden organization (visible: false) should be considered like a private repository.

@a1012112796
Copy link
Member Author

@guillep2k Hello, I'm sorry , but I can't fully agree with you, first this list only show who can be requested to review not help users to choose, And in gitea any user who can read can make a review. but for the public repo, which will become a problem , Because if not have some additional limit, which will mean all users in the platform should in this list, but it's not necessary. So only add offical users (which can found in accesses table) and watchers, but I really forget the whitelisted reviewers for protect branches, they should alse be check and add to this list. and also because this list may become very big I add a filter box which is provided by "Semantic UI" , and may be it should become a search because load many users may cost too much time, but now I have no idea about how to do it . that's my think. thanks

@guillep2k
Copy link
Member

guillep2k commented Mar 27, 2020

As long as the explicitly whitelisted users or groups for the target branch are included in the list, I'm OK with that (I don't mean when "everyone" is allowed).

@a1012112796
Copy link
Member Author

@guillep2k Hello, after carefully check , I think It's not necessary to load whitelisted users or groups
because thy all can be found in accesses table, which has been load firstly. so It's not necessary to load them again. you can see these codes:

users, err := c.Repo.Repository.GetReaders()
if err != nil {
c.ServerError("Repo.Repository.GetReaders", err)
return
}
c.Data["Users"] = users

they just use users who can found in accesses table.

and all users in the teams of the own organization can be found in by this way also.

So , that means after these code. all users who can be choose into whitelisted users or the groups has been loaded by these codes:
https://github.com/a1012112796/gitea/blob/69e40d604fe77fc3e5460a9c63ee962ead7eb33a/models/repo.go#L665-L674
so it's not necessay to load again. Do you think it's right ,thanks.

models/repo.go Outdated Show resolved Hide resolved
models/repo.go Outdated Show resolved Hide resolved
models/review.go Outdated Show resolved Hide resolved
models/review.go Outdated Show resolved Hide resolved
models/review.go Outdated Show resolved Hide resolved
routers/repo/issue.go Show resolved Hide resolved
routers/repo/issue.go Outdated Show resolved Hide resolved
routers/repo/issue.go Outdated Show resolved Hide resolved
routers/repo/issue.go Outdated Show resolved Hide resolved
routers/repo/issue.go Outdated Show resolved Hide resolved
Copy link
Member

@guillep2k guillep2k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, this was a long journey. Great job!!

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 3, 2020
@lunny
Copy link
Member

lunny commented Apr 3, 2020

Please resolve the conflicts.

@a1012112796
Copy link
Member Author

Hello, I have resolved the conflicts and do some ui changes, please review , Thanks.
@lunny @guillep2k @zeripath ....

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 6, 2020
@lafriks lafriks added the type/changelog Adds the changelog for a new Gitea version label Apr 6, 2020
@lafriks
Copy link
Member

lafriks commented Apr 6, 2020

Great work, looks good now ;)

@lafriks
Copy link
Member

lafriks commented Apr 6, 2020

Make lgtm work

@lafriks lafriks merged commit ef89e75 into go-gitea:master Apr 6, 2020
@lunny
Copy link
Member

lunny commented Apr 11, 2020

It's better to add the feature in comparsion doc.

ydelafollye pushed a commit to ydelafollye/gitea that referenced this pull request Jul 31, 2020
…o-gitea#10756)

* add request review feature in pull request

add a way to notify specific reviewers to review like github , by add  or delet a  special type
review . The acton is  is similar to Assign ,  so many code reuse the function and items of
Assignee, but the meaning and result is different.

The Permission style is is similar to github, that only writer can add a review request from Reviewers,
but the poster can recall and remove a review request after a reviwer has revied even if he don't have
Write Premission. only manager , the poster and reviewer of a request review can remove it.

The reviewers can be requested to review contain all readers for private repo , for public, contain
all writers and watchers.

The offical Review Request will block merge if Reject can block it.

an other change: add ui otify for Assignees.

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: Lauris BH <lauris@nix.lv>

Signed-off-by: a1012112796 <1012112796@qq.com>

* new change

* add placeholder string

* do some changes follow go-gitea#10238 to add review requests num on lists also
change icon for review requests to eye

Co-authored-by: Lauris BH <lauris@nix.lv>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
@a1012112796 a1012112796 deleted the add_review_requst_fun branch January 26, 2021 13:08
@delvh delvh removed the type/changelog Adds the changelog for a new Gitea version label Oct 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants