@@ -92,7 +92,7 @@ func NewGitlabDownloader(ctx context.Context, baseURL, repoPath, username, passw
92
92
pathParts := strings .Split (strings .Trim (repoPath , "/" ), "/" )
93
93
var resp * gitlab.Response
94
94
u , _ := url .Parse (baseURL )
95
- for len (pathParts ) > 2 {
95
+ for len (pathParts ) >= 2 {
96
96
_ , resp , err = gitlabClient .Version .GetVersion ()
97
97
if err == nil || resp != nil && resp .StatusCode == 401 {
98
98
err = nil // if no authentication given, this still should work
@@ -609,8 +609,12 @@ func (g *GitlabDownloader) GetPullRequests(page, perPage int) ([]*base.PullReque
609
609
610
610
// GetReviews returns pull requests review
611
611
func (g * GitlabDownloader ) GetReviews (pullRequestNumber int64 ) ([]* base.Review , error ) {
612
- state , _ , err := g .client .MergeRequestApprovals .GetApprovalState (g .repoID , int (pullRequestNumber ), gitlab .WithContext (g .ctx ))
612
+ state , resp , err := g .client .MergeRequestApprovals .GetApprovalState (g .repoID , int (pullRequestNumber ), gitlab .WithContext (g .ctx ))
613
613
if err != nil {
614
+ if resp != nil && resp .StatusCode == 404 {
615
+ log .Error (fmt .Sprintf ("GitlabDownloader: while migrating a error occurred: '%s'" , err .Error ()))
616
+ return []* base.Review {}, nil
617
+ }
614
618
return nil , err
615
619
}
616
620
0 commit comments