Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't allow merging PR's which are being conflict checked #19357

Merged
merged 8 commits into from
Apr 20, 2022
5 changes: 5 additions & 0 deletions services/pull/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ var (
ErrUserNotAllowedToMerge = errors.New("user not allowed to merge")
ErrHasMerged = errors.New("has already been merged")
ErrIsWorkInProgress = errors.New("work in progress PRs cannot be merged")
ErrIsChecking = errors.New("cannot merge while conflict checking is in progress")
ErrNotMergableState = errors.New("not in mergeable state")
ErrDependenciesLeft = errors.New("is blocked by an open dependency")
)
Expand Down Expand Up @@ -88,6 +89,10 @@ func CheckPullMergable(ctx context.Context, doer *user_model.User, perm *models.
return ErrNotMergableState
}

if pr.IsChecking() {
lafriks marked this conversation as resolved.
Show resolved Hide resolved
return ErrIsChecking
}

if err := CheckPRReadyToMerge(ctx, pr, false); err != nil {
if models.IsErrDisallowedToMerge(err) {
if force {
Expand Down