-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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 reviewers selection to new pull request form #26596
Conversation
this needs to be a negative integer
Ping @lunny and @steve-dwyer-itdev could you habe another look? Would be awesome to get this into the next release. |
@denyskon i think you did modify the same template for project selection on PR creation. Maybe you could take a look at this PR, too? |
@@ -800,6 +802,47 @@ func CompareDiff(ctx *context.Context) { | |||
if ctx.Written() { | |||
return | |||
} | |||
|
|||
// Get reviewer info for pr |
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.
Maybe this can be moved into RetrieveRepoMetas, where similar code exists for populating ctx.Data["Assignees"]
?
if err != nil { | ||
return err | ||
} | ||
_, err = issue_service.ReviewRequest(ctx, issue, issue.Poster, reviewer, true) |
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.
This also creates the review request notification. So the user will receive the "review requested" notification before the "pull request created" notification. If you look at the assignee code, they are first added without sending a notification. The notification is sent later on:
Line 198 in 62d8403
notify_service.IssueChangeAssignee(ctx, issue.Poster, issue, assignee, false, assigneeCommentMap[assigneeID]) |
Due to this, it also seems like the UI notification cannot be created. I'm seeing this in the logs:
2023/12/30 13:20:58 ...tification/notify.go:56:handler() [E] Was unable to create issue notification: issue does not exist [id: 10, repo_id: 0, index: 0]
I suspect this is because the notifier runs in a different transaction and does not "see" the newly created PR yet?
Thank you all. "Add reviewers selection to new pull request #32403" has been merged. |
This is my first contribution so please be kind. I'm not that fluent in Go. I hope the code looks god.
The UI looks just like the assignee selection here because i think the actions from the pull request edit dialog don't make much sense here. The assignee selection on the pr create and edit pages also differ.
This only touches the UI parts not the API.
For some strange reason i had to comment out https://github.com/go-gitea/gitea/blob/main/modules/notification/notification.go#L234 while testing. Otherwise Gitea just hang there. I think there is / was some notifier setup broken in the Gitpod.io setup.
Fixes #26289