loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add migrated pulls to pull request task queue (#13331)

* Add migrated pulls to pull request task queue

Fix #13321

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Improve error reports

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>

authored by

zeripath
techknowlogick
and committed by
GitHub
7dfb2fc1 6c2c521b

+10 -8
+8 -8
modules/migrations/gitea_downloader.go
··· 47 47 48 48 path := strings.Split(repoNameSpace, "/") 49 49 if len(path) < 2 { 50 - return nil, fmt.Errorf("invalid path") 50 + return nil, fmt.Errorf("invalid path: %s", repoNameSpace) 51 51 } 52 52 53 53 repoPath := strings.Join(path[len(path)-2:], "/") ··· 87 87 gitea_sdk.SetContext(ctx), 88 88 ) 89 89 if err != nil { 90 - log.Error(fmt.Sprintf("NewGiteaDownloader: %s", err.Error())) 90 + log.Error(fmt.Sprintf("Failed to create NewGiteaDownloader for: %s. Error: %v", baseURL, err)) 91 91 return nil, err 92 92 } 93 93 ··· 395 395 396 396 reactions, err := g.getIssueReactions(issue.Index) 397 397 if err != nil { 398 - return nil, false, fmt.Errorf("error while loading reactions: %v", err) 398 + return nil, false, fmt.Errorf("error while loading reactions for issue #%d. Error: %v", issue.Index, err) 399 399 } 400 400 401 401 var assignees []string ··· 446 446 // Page: i, 447 447 }}) 448 448 if err != nil { 449 - return nil, fmt.Errorf("error while listing comments: %v", err) 449 + return nil, fmt.Errorf("error while listing comments for issue #%d. Error: %v", index, err) 450 450 } 451 451 452 452 for _, comment := range comments { 453 453 reactions, err := g.getCommentReactions(comment.ID) 454 454 if err != nil { 455 - return nil, fmt.Errorf("error while listing comment creactions: %v", err) 455 + return nil, fmt.Errorf("error while listing reactions for comment %d in issue #%d. Error: %v", comment.ID, index, err) 456 456 } 457 457 458 458 allComments = append(allComments, &base.Comment{ ··· 490 490 State: gitea_sdk.StateAll, 491 491 }) 492 492 if err != nil { 493 - return nil, false, fmt.Errorf("error while listing repos: %v", err) 493 + return nil, false, fmt.Errorf("error while listing pull requests (page: %d, pagesize: %d). Error: %v", page, perPage, err) 494 494 } 495 495 for _, pr := range prs { 496 496 var milestone string ··· 521 521 if headSHA == "" { 522 522 headCommit, _, err := g.client.GetSingleCommit(g.repoOwner, g.repoName, url.PathEscape(pr.Head.Ref)) 523 523 if err != nil { 524 - return nil, false, fmt.Errorf("error while resolving git ref: %v", err) 524 + return nil, false, fmt.Errorf("error while resolving head git ref: %s for pull #%d. Error: %v", pr.Head.Ref, pr.Index, err) 525 525 } 526 526 headSHA = headCommit.SHA 527 527 } ··· 534 534 535 535 reactions, err := g.getIssueReactions(pr.Index) 536 536 if err != nil { 537 - return nil, false, fmt.Errorf("error while loading reactions: %v", err) 537 + return nil, false, fmt.Errorf("error while loading reactions for pull #%d. Error: %v", pr.Index, err) 538 538 } 539 539 540 540 var assignees []string
+2
modules/migrations/gitea_uploader.go
··· 28 28 "code.gitea.io/gitea/modules/storage" 29 29 "code.gitea.io/gitea/modules/structs" 30 30 "code.gitea.io/gitea/modules/timeutil" 31 + "code.gitea.io/gitea/services/pull" 31 32 32 33 gouuid "github.com/google/uuid" 33 34 ) ··· 524 525 } 525 526 for _, pr := range gprs { 526 527 g.issues.Store(pr.Issue.Index, pr.Issue.ID) 528 + pull.AddToTaskQueue(pr) 527 529 } 528 530 return nil 529 531 }