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: 2 additions & 1 deletion models/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const (
PullRequestStatusChecking
PullRequestStatusMergeable
PullRequestStatusManuallyMerged
PullRequestStatusError
)

// PullRequest represents relation between pull request and repositories.
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions services/pull/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down