mirror of
https://github.com/go-gitea/gitea
synced 2024-12-25 18:14:28 +00:00
* final fix 2.0? * ignore Approvals for pulls if not found * CI.restart() Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
parent
33431fcbd3
commit
4c9d00cf78
@ -92,7 +92,7 @@ func NewGitlabDownloader(ctx context.Context, baseURL, repoPath, username, passw
|
|||||||
pathParts := strings.Split(strings.Trim(repoPath, "/"), "/")
|
pathParts := strings.Split(strings.Trim(repoPath, "/"), "/")
|
||||||
var resp *gitlab.Response
|
var resp *gitlab.Response
|
||||||
u, _ := url.Parse(baseURL)
|
u, _ := url.Parse(baseURL)
|
||||||
for len(pathParts) > 2 {
|
for len(pathParts) >= 2 {
|
||||||
_, resp, err = gitlabClient.Version.GetVersion()
|
_, resp, err = gitlabClient.Version.GetVersion()
|
||||||
if err == nil || resp != nil && resp.StatusCode == 401 {
|
if err == nil || resp != nil && resp.StatusCode == 401 {
|
||||||
err = nil // if no authentication given, this still should work
|
err = nil // if no authentication given, this still should work
|
||||||
@ -609,8 +609,12 @@ func (g *GitlabDownloader) GetPullRequests(page, perPage int) ([]*base.PullReque
|
|||||||
|
|
||||||
// GetReviews returns pull requests review
|
// GetReviews returns pull requests review
|
||||||
func (g *GitlabDownloader) GetReviews(pullRequestNumber int64) ([]*base.Review, error) {
|
func (g *GitlabDownloader) GetReviews(pullRequestNumber int64) ([]*base.Review, error) {
|
||||||
state, _, err := g.client.MergeRequestApprovals.GetApprovalState(g.repoID, int(pullRequestNumber), gitlab.WithContext(g.ctx))
|
state, resp, err := g.client.MergeRequestApprovals.GetApprovalState(g.repoID, int(pullRequestNumber), gitlab.WithContext(g.ctx))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if resp != nil && resp.StatusCode == 404 {
|
||||||
|
log.Error(fmt.Sprintf("GitlabDownloader: while migrating a error occurred: '%s'", err.Error()))
|
||||||
|
return []*base.Review{}, nil
|
||||||
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user