Skip to content

Commit

Permalink
fix: Fixing Mergeable issue
Browse files Browse the repository at this point in the history
  • Loading branch information
HB-Balaji committed Feb 23, 2024
1 parent d563366 commit 2648f2d
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions server/events/vcs/gitlab_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,13 +310,17 @@ func (g *GitlabClient) PullIsMergeable(repo models.Repo, pull models.PullRequest
return false, err
}

if ((ok && (mr.DetailedMergeStatus == "mergeable" || mr.DetailedMergeStatus == "ci_still_running")) ||
(!ok && mr.MergeStatus == "can_be_merged")) &&
mr.ApprovalsBeforeMerge <= 0 &&
mr.BlockingDiscussionsResolved &&
!mr.WorkInProgress &&
(allowSkippedPipeline || !isPipelineSkipped) {
return true, nil
retryLimit := 3
for attempt := 0; attempt < retryLimit; attempt++ {
if ((ok && (mr.DetailedMergeStatus == "mergeable" || mr.DetailedMergeStatus == "ci_still_running")) ||
(!ok && mr.MergeStatus == "can_be_merged")) &&

Check failure on line 316 in server/events/vcs/gitlab_client.go

View workflow job for this annotation

GitHub Actions / golangci-lint

[golangci-lint] server/events/vcs/gitlab_client.go#L316

SA1019: mr.MergeStatus is deprecated: This parameter is replaced by DetailedMergeStatus in GitLab 15.6. (staticcheck)
Raw output
server/events/vcs/gitlab_client.go:316:12: SA1019: mr.MergeStatus is deprecated: This parameter is replaced by DetailedMergeStatus in GitLab 15.6. (staticcheck)
			(!ok && mr.MergeStatus == "can_be_merged")) &&
			        ^

Check failure on line 316 in server/events/vcs/gitlab_client.go

View workflow job for this annotation

GitHub Actions / revive

[revive] server/events/vcs/gitlab_client.go#L316

SA1019: mr.MergeStatus is deprecated: This parameter is replaced by DetailedMergeStatus in GitLab 15.6. (staticcheck)
Raw output
server/events/vcs/gitlab_client.go:316:12: SA1019: mr.MergeStatus is deprecated: This parameter is replaced by DetailedMergeStatus in GitLab 15.6. (staticcheck)
			(!ok && mr.MergeStatus == "can_be_merged")) &&
			        ^

Check failure on line 316 in server/events/vcs/gitlab_client.go

View workflow job for this annotation

GitHub Actions / errcheck

[errcheck] server/events/vcs/gitlab_client.go#L316

SA1019: mr.MergeStatus is deprecated: This parameter is replaced by DetailedMergeStatus in GitLab 15.6. (staticcheck)
Raw output
server/events/vcs/gitlab_client.go:316:12: SA1019: mr.MergeStatus is deprecated: This parameter is replaced by DetailedMergeStatus in GitLab 15.6. (staticcheck)
			(!ok && mr.MergeStatus == "can_be_merged")) &&
			        ^
mr.ApprovalsBeforeMerge <= 0 &&
mr.BlockingDiscussionsResolved &&
!mr.WorkInProgress &&
(allowSkippedPipeline || !isPipelineSkipped) {
return true, nil
}
time.Sleep(10 * time.Second)
}
return false, nil
}
Expand Down

0 comments on commit 2648f2d

Please sign in to comment.