review-bot
review-bot copied to clipboard
Same reviewer tagged several times.
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.

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}}
Thanks for the feedback. This needs investigation.
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.