review-bot icon indicating copy to clipboard operation
review-bot copied to clipboard

Same reviewer tagged several times.

Open maksymiliev opened this issue 4 years ago • 3 comments

It seems like the bot has an issue where it fails to tag a correct reviewer and instead tags a different reviewer, resulting in one reviewer being tagged several times.

In the screenshot below you can see @Maksym Iliev has been tagged 2 times, even though there should've been a different person tagged the second time instead of tagging @Maksym Iliev again.

The Reviewer file has the correct mapping of gitlab username to slack ID just like provided in examples.

image

maksymiliev avatar Sep 21 '21 13:09 maksymiliev

Update:

Issue seems to be related with how the bot assesses reviewers that have approved the pull/merge request and those that haven't.

Instead, I have changed the template file to simply show all reviewers in the merge/pull request:

*<{{.Project.WebURL}}|{{.Project.Name}}>* Merge Requests:


{{range .Reminders}}
*<{{.MR.WebURL}}|{{.MR.Title}}>*
{{if .Discussions}} {{.Discussions}} :speech_balloon: {{end}} {{range $emoji, $count := .Emojis}} {{$count}} :{{$emoji}}: {{end}}
{{range .MR.Reviewers}}
<@{{.Username}}> {{end}}
{{end}}

maksymiliev avatar Oct 18 '21 20:10 maksymiliev

Thanks for the feedback. This needs investigation.

sj14 avatar Oct 22 '21 16:10 sj14

https://github.com/sj14/review-bot/blob/84680665e10c7d4a427dcbad3bbd649e823076c8/hoster/gitlab/gitlab.go#L162

getReviewed() is only considering the Author of the MR as the possible owner, but the owner could be determined as someone else later in the processing.

https://github.com/sj14/review-bot/blob/84680665e10c7d4a427dcbad3bbd649e823076c8/hoster/gitlab/gitlab.go#L93

Maybe that's the issue but at the moment I don't have a working test setup.

sj14 avatar Oct 22 '21 16:10 sj14