|
|
@ -113,22 +113,28 @@ func (pr *PullRequest) LoadIssue() (err error) { |
|
|
|
|
|
|
|
|
|
|
|
// This method assumes following fields have been assigned with valid values:
|
|
|
|
// This method assumes following fields have been assigned with valid values:
|
|
|
|
// Required - Issue
|
|
|
|
// Required - Issue
|
|
|
|
|
|
|
|
// Required - HeadRepo
|
|
|
|
|
|
|
|
// Required - BaseRepo
|
|
|
|
// Optional - Merger
|
|
|
|
// Optional - Merger
|
|
|
|
func (pr *PullRequest) APIFormat() *api.PullRequest { |
|
|
|
func (pr *PullRequest) APIFormat() *api.PullRequest { |
|
|
|
apiIssue := pr.Issue.APIFormat() |
|
|
|
apiIssue := pr.Issue.APIFormat() |
|
|
|
apiPullRequest := &api.PullRequest{ |
|
|
|
apiPullRequest := &api.PullRequest{ |
|
|
|
ID: pr.ID, |
|
|
|
ID: pr.ID, |
|
|
|
Index: pr.Index, |
|
|
|
Index: pr.Index, |
|
|
|
Poster: apiIssue.Poster, |
|
|
|
Poster: apiIssue.Poster, |
|
|
|
Title: apiIssue.Title, |
|
|
|
Title: apiIssue.Title, |
|
|
|
Body: apiIssue.Body, |
|
|
|
Body: apiIssue.Body, |
|
|
|
Labels: apiIssue.Labels, |
|
|
|
Labels: apiIssue.Labels, |
|
|
|
Milestone: apiIssue.Milestone, |
|
|
|
Milestone: apiIssue.Milestone, |
|
|
|
Assignee: apiIssue.Assignee, |
|
|
|
Assignee: apiIssue.Assignee, |
|
|
|
State: apiIssue.State, |
|
|
|
State: apiIssue.State, |
|
|
|
Comments: apiIssue.Comments, |
|
|
|
Comments: apiIssue.Comments, |
|
|
|
HTMLURL: pr.Issue.HTMLURL(), |
|
|
|
HeadBranch: pr.HeadBranch, |
|
|
|
HasMerged: pr.HasMerged, |
|
|
|
HeadRepo: pr.HeadRepo.APIFormat(nil), |
|
|
|
|
|
|
|
BaseBranch: pr.BaseBranch, |
|
|
|
|
|
|
|
BaseRepo: pr.BaseRepo.APIFormat(nil), |
|
|
|
|
|
|
|
HTMLURL: pr.Issue.HTMLURL(), |
|
|
|
|
|
|
|
HasMerged: pr.HasMerged, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if pr.Status != PULL_REQUEST_STATUS_CHECKING { |
|
|
|
if pr.Status != PULL_REQUEST_STATUS_CHECKING { |
|
|
|