You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Handle scenario where new PR branch has been merged
If we try and transer a new PR which has been merged but the
source branch was not deleted, we previously got a 422 status and
the transfer failed. Modify the logic to pick up the 422 status
and, if seen, fall back to creating an issue.
// try to create the GitHub pull request from the GitLab issue
574
+
awaitthis.githubApi.pulls.create(props);
575
+
returnPromise.resolve({data: null});// need to return null promise for parent to wait on
576
+
}catch(err){
577
+
if(err.status===422){
578
+
console.error(
579
+
`Pull request #${pullRequest.iid} - attempt to create has failed, assume '${pullRequest.source_branch}' has already been merged => cannot migrate pull request, creating an issue instead.`
580
+
);
581
+
// fall through to next section
582
+
}else{
583
+
throw(err);
584
+
}
585
+
}
586
+
}
587
+
588
+
// Failing all else, create an issue with a descriptive title
0 commit comments