diff --git a/.github/workflows/robot/internal/review/review.go b/.github/workflows/robot/internal/review/review.go index db5804853a874..d768a991b6a00 100644 --- a/.github/workflows/robot/internal/review/review.go +++ b/.github/workflows/robot/internal/review/review.go @@ -180,7 +180,8 @@ func (r *Assignments) getCodeReviewerSets(author string) ([]string, []string) { v, ok := r.c.CodeReviewers[author] if !ok || v.Team == "Internal" { reviewers := r.getAdminReviewers(author) - return reviewers, reviewers + n := len(reviewers) / 2 + return reviewers[:n], reviewers[n:] } return getReviewerSets(author, v.Team, r.c.CodeReviewers, r.c.CodeReviewersOmit) @@ -207,6 +208,7 @@ func (r *Assignments) CheckInternal(author string, reviews map[string]*github.Re switch { case docs && code: + log.Printf("Check: Found docs and code changes.") if err := r.checkDocsReviews(author, reviews); err != nil { return trace.Wrap(err) } @@ -214,15 +216,18 @@ func (r *Assignments) CheckInternal(author string, reviews map[string]*github.Re return trace.Wrap(err) } case !docs && code: + log.Printf("Check: Found code changes.") if err := r.checkCodeReviews(author, reviews); err != nil { return trace.Wrap(err) } case docs && !code: + log.Printf("Check: Found docs changes.") if err := r.checkDocsReviews(author, reviews); err != nil { return trace.Wrap(err) } // Strange state, an empty commit? Check admins. case !docs && !code: + log.Printf("Check: Found no docs or code changes.") if checkN(r.getAdminReviewers(author), reviews) < 2 { return trace.BadParameter("requires two admin approvals") } diff --git a/.github/workflows/robot/internal/review/review_test.go b/.github/workflows/robot/internal/review/review_test.go index 2bbfcd070e04a..39145e62256c2 100644 --- a/.github/workflows/robot/internal/review/review_test.go +++ b/.github/workflows/robot/internal/review/review_test.go @@ -102,8 +102,8 @@ func TestGetCodeReviewers(t *testing.T) { }, }, author: "5", - setA: []string{"1", "2"}, - setB: []string{"1", "2"}, + setA: []string{"1"}, + setB: []string{"2"}, }, { desc: "normal",