fix: don't display pending reviews as participants (#10528)
Fixes #10155 When participants are displayed, don't include those that only have made a pending review. Those should not yet be revealed as participants. Apart from adding automated tests, this is the manual verification process I've followed: 1. Set up three users 2. User 1 creates a repository, then creates a pull request adding a new file 3. User 2 creates a new code comment but doesn't not publish the review, shows as pending. 4. User 3 creates a new code comment and publishes the review. 5. From everyone's perspective the number of participants is: 2. And, the participants displayed in the list are 1 and 3. User 2, which hasn't yet published the review is not displayed. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10528 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: luisadame <luisadame@noreply.codeberg.org> Co-committed-by: luisadame <luisadame@noreply.codeberg.org>
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
- id: 1001
|
||||
type: 21 # code comment
|
||||
poster_id: 10
|
||||
issue_id: 1
|
||||
review_id: 1001
|
||||
content: "Some code comment that is pending to be published"
|
||||
line: -4
|
||||
tree_path: "README.md"
|
||||
created_unix: 946684812
|
||||
invalidated: false
|
||||
@@ -0,0 +1,7 @@
|
||||
- id: 1001
|
||||
type: 0 # Pending review
|
||||
reviewer_id: 10
|
||||
issue_id: 1
|
||||
content: "Pending review for issue 1"
|
||||
updated_unix: 946684810
|
||||
created_unix: 946684810
|
||||
@@ -18,6 +18,7 @@ import (
|
||||
)
|
||||
|
||||
func TestCloseIssue(t *testing.T) {
|
||||
defer unittest.OverrideFixtures("services/mailer/fixtures/TestCloseIssue")()
|
||||
defer require.NoError(t, unittest.PrepareTestDatabase())
|
||||
|
||||
called := false
|
||||
|
||||
Reference in New Issue
Block a user