Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions models/domainlayer/code/pull_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ type PullRequest struct {
RepoId string `gorm:"index"`
Status string `gorm:"comment:open/closed or other"`
Title string
Description string
Url string
AuthorName string
AuthorId int
Key int
CreatedDate time.Time
MergedDate *time.Time
Expand Down
6 changes: 3 additions & 3 deletions plugins/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,17 +449,17 @@ func main() {
//"collectIssues",
//"collectIssueEvents",
//"collectIssueComments",
//"collectPullRequests",
"collectPullRequests",
//"collectPullRequestReviews",
//"collectPullRequestCommits",
"enrichIssues",
//"enrichIssues",
//"enrichPullRequests",
//"enrichComments",
//"enrichPullRequestIssues",
//"convertRepos",
//"convertIssues",
//"convertIssueLabels",
//"convertPullRequests",
"convertPullRequests",
//"convertCommits",
//"convertPullRequestCommits",
//"convertPullRequestLabels",
Expand Down
3 changes: 3 additions & 0 deletions plugins/github/models/github_pull_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@ type GithubPullRequest struct {
BaseRef string
BaseCommitSha string
HeadCommitSha string
Url string
AuthorName string
AuthorId int
common.NoPKModel
}
8 changes: 8 additions & 0 deletions plugins/github/tasks/github_pull_request_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@ type GithubApiPullRequest struct {
State string
Title string
Body string
Url string
Labels []struct {
Name string `json:"name"`
} `json:"labels"`
Assignee *struct {
Login string
Id int
}
User *struct {
Id int
Login string
}
ClosedAt *core.Iso8601Time `json:"closed_at"`
MergedAt *core.Iso8601Time `json:"merged_at"`
GithubCreatedAt core.Iso8601Time `json:"created_at"`
Expand Down Expand Up @@ -108,6 +113,9 @@ func convertGithubPullRequest(pull *GithubApiPullRequest, repoId int) (*models.G
Number: pull.Number,
State: pull.State,
Title: pull.Title,
Url: pull.Url,
AuthorName: pull.User.Login,
AuthorId: pull.User.Id,
GithubCreatedAt: pull.GithubCreatedAt.ToTime(),
GithubUpdatedAt: core.Iso8601TimeToTime(pull.GithubUpdatedAt),
ClosedAt: core.Iso8601TimeToTime(pull.ClosedAt),
Expand Down
4 changes: 4 additions & 0 deletions plugins/github/tasks/github_pull_request_converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ func ConvertPullRequests(ctx context.Context, repoId int) error {
RepoId: domainRepoIdGenerator.Generate(pr.RepoId),
Status: pr.State,
Title: pr.Title,
Description: pr.Body,
Url: pr.Url,
AuthorName: pr.AuthorName,
AuthorId: pr.AuthorId,
CreatedDate: pr.GithubCreatedAt,
MergedDate: pr.MergedAt,
ClosedAt: pr.ClosedAt,
Expand Down