Skip to content

Commit d6bf04d

Browse files
authored
Workaround for detailed_merge_status=need_rebase issue (#197)
1 parent 985eecf commit d6bf04d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

server/src/GitlabApi.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export enum DetailedMergeStatus {
2727
NotOpen = 'not_open',
2828
JiraAssociationMissing = 'jira_association_missing',
2929
NeedsRebase = 'needs_rebase',
30+
NeedRebase = 'need_rebase', // Wrong, but existing value. See https://gitlab.com/gitlab-org/gitlab/-/issues/454409
3031
Conflict = 'conflict',
3132
RequestedChanges = 'requested_changes',
3233
}

server/src/MergeRequestAcceptor.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,10 @@ export const acceptMergeRequest = async (
205205
return 'continue';
206206
}
207207

208-
if (mergeRequestInfo.detailed_merge_status === DetailedMergeStatus.NeedsRebase) {
208+
if (
209+
mergeRequestInfo.detailed_merge_status === DetailedMergeStatus.NeedsRebase ||
210+
mergeRequestInfo.detailed_merge_status === DetailedMergeStatus.NeedRebase
211+
) {
209212
console.log(`[MR][${mergeRequestInfo.iid}] source branch is not up to date, rebasing`);
210213
await tryCancelPipeline(gitlabApi, mergeRequestInfo, user);
211214
await gitlabApi.rebaseMergeRequest(

0 commit comments

Comments
 (0)