checkAndUpdateStatus checks if pull request is possible to leaving checking status, and set to be either conflict or mergeable.
()
| 821 | // checkAndUpdateStatus checks if pull request is possible to leaving checking status, |
| 822 | // and set to be either conflict or mergeable. |
| 823 | func (pr *PullRequest) checkAndUpdateStatus() { |
| 824 | // Status is not changed to conflict means mergeable. |
| 825 | if pr.Status == PullRequestStatusChecking { |
| 826 | pr.Status = PullRequestStatusMergeable |
| 827 | } |
| 828 | |
| 829 | // Make sure there is no waiting test to process before leaving the checking status. |
| 830 | if !PullRequestQueue.Exist(pr.ID) { |
| 831 | if err := pr.UpdateCols("status"); err != nil { |
| 832 | log.Error("Update[%d]: %v", pr.ID, err) |
| 833 | } |
| 834 | } |
| 835 | } |
| 836 | |
| 837 | // TestPullRequests checks and tests untested patches of pull requests. |
| 838 | // TODO: test more pull requests at same time. |