mirror of
https://github.com/go-gitea/gitea.git
synced 2024-11-21 01:14:31 +08:00
Move Errored PRs out of StatusChecking (#9675)
* Set Errored PRs out of StatusChecking * Ensure that api status is correctly set too * Update models/pull.go Co-Authored-By: John Olheiser <42128690+jolheiser@users.noreply.github.com> Co-authored-by: John Olheiser <42128690+jolheiser@users.noreply.github.com>
This commit is contained in:
parent
6c46a56360
commit
17b844a3ec
@ -35,6 +35,7 @@ const (
|
||||
PullRequestStatusChecking
|
||||
PullRequestStatusMergeable
|
||||
PullRequestStatusManuallyMerged
|
||||
PullRequestStatusError
|
||||
)
|
||||
|
||||
// PullRequest represents relation between pull request and repositories.
|
||||
@ -517,7 +518,7 @@ func (pr *PullRequest) apiFormat(e Engine) *api.PullRequest {
|
||||
}
|
||||
|
||||
if pr.Status != PullRequestStatusChecking {
|
||||
mergeable := pr.Status != PullRequestStatusConflict && !pr.IsWorkInProgress()
|
||||
mergeable := !(pr.Status == PullRequestStatusConflict || pr.Status == PullRequestStatusError) && !pr.IsWorkInProgress()
|
||||
apiPullRequest.Mergeable = mergeable
|
||||
}
|
||||
if pr.HasMerged {
|
||||
|
@ -194,10 +194,14 @@ func TestPullRequests(ctx context.Context) {
|
||||
if err != nil {
|
||||
log.Error("GetPullRequestByID[%s]: %v", prID, err)
|
||||
continue
|
||||
} else if pr.Status != models.PullRequestStatusChecking {
|
||||
continue
|
||||
} else if manuallyMerged(pr) {
|
||||
continue
|
||||
} else if err = TestPatch(pr); err != nil {
|
||||
log.Error("testPatch[%d]: %v", pr.ID, err)
|
||||
pr.Status = models.PullRequestStatusError
|
||||
pr.UpdateCols("status")
|
||||
continue
|
||||
}
|
||||
checkAndUpdateStatus(pr)
|
||||
|
Loading…
Reference in New Issue
Block a user