mirror of
https://github.com/harness/drone.git
synced 2025-05-31 11:43:15 +00:00
feat: [CODE-2466]: support for codeowners usergroup (#2795)
* feat: [CODE-2466]: support for codeowners usergroup
This commit is contained in:
parent
465275b549
commit
ac8eb9ff37
@ -488,8 +488,12 @@ func (s *Service) resolveUserGroupCodeOwner(
|
||||
Name: usrgrp.Name,
|
||||
}
|
||||
ownersEvaluations := make([]OwnerEvaluation, 0, len(usrgrp.Users))
|
||||
for _, uid := range usrgrp.Users {
|
||||
pullreqReviewer := findReviewerInList("", uid, reviewers)
|
||||
principalInfos, err := s.principalStore.FindManyByUID(ctx, usrgrp.Users)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error finding user by uids %v for usergroup %s: %w", usrgrp.Users, usrgrp.Identifier, err)
|
||||
}
|
||||
for _, principalInfo := range principalInfos {
|
||||
pullreqReviewer := findReviewerInList(principalInfo.Email, principalInfo.UID, reviewers)
|
||||
// we don't append all the user of the user group in the owner evaluations and
|
||||
// append it only if it is reviewed by a user.
|
||||
if pullreqReviewer != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user