Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #34 from LF-Engineering/DA-4914
Browse files Browse the repository at this point in the history
Add review creator to reviewers
  • Loading branch information
khalifapro authored Jul 20, 2022
2 parents 46e8520 + 621c784 commit 4e9e80e
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions cmd/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -6751,6 +6751,29 @@ func (j *DSGitHub) GetModelDataPullRequest(ctx *shared.Ctx, docs []interface{})
}
data[key] = ary
nReviews++
// add review creator to reviewers
pullRequestReviewer := igh.PullRequestReviewer{
ID: pullRequestReviewerID,
PullRequestID: pullRequestID,
Reviewer: insights.Reviewer{
ReviewerID: username,
Contributor: contributor,
SyncTimestamp: time.Now(),
SourceTimestamp: createdOn,
},
}
_, ok = addedReviewers[pullRequestReviewerID]
if !ok {
key := "reviewer_added"
ary, ok := data[key]
if !ok {
ary = []interface{}{pullRequestReviewer}
} else {
ary = append(ary, pullRequestReviewer)
}
data[key] = ary
addedReviewers[pullRequestReviewerID] = struct{}{}
}
}
}
}
Expand Down

0 comments on commit 4e9e80e

Please sign in to comment.