diff --git a/README.md b/README.md index 5bbe657..946bdc3 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ cache: - [ ] Add GitHub support - [ ] Rename --gitlab flag to --remote - [ ] Add option to select individual remote for `gpm cache load` +- [ ] Add flag for clone timeout for large repos - [x] Use multi-gitlab by default in config init - [x] Update docs for multi-gitlab - [x] Remove all references to old keys diff --git a/internal/cache/projects_git.go b/internal/cache/projects_git.go index 6b562af..d895ebe 100644 --- a/internal/cache/projects_git.go +++ b/internal/cache/projects_git.go @@ -8,7 +8,7 @@ import ( "gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/projects" ) -const gitCloneTimeoutSecs = 30 +const gitCloneTimeoutSecs = 60 // Will either read in the current repo, preparing a report // on its current state, or will clone the project if it has not diff --git a/internal/remotes/gitea/gitea_api.go b/internal/remotes/gitea/gitea_api.go index cdc97cc..17e7af0 100644 --- a/internal/remotes/gitea/gitea_api.go +++ b/internal/remotes/gitea/gitea_api.go @@ -14,12 +14,6 @@ func (r *GiteaRemote) ReposToProjects(repos []*gitea.Repository) []*projects.Pro pList := make([]*projects.Project, len(repos)) for i, repo := range repos { path := strings.Split(repo.FullName, "/") - var repoPath []string - if len(path) > 1 { - repoPath = path[:len(path)-1] - } else { - repoPath = path - } project := &projects.Project{ ID: int(repo.ID), Description: repo.Description, @@ -28,7 +22,7 @@ func (r *GiteaRemote) ReposToProjects(repos []*gitea.Repository) []*projects.Pro WebURL: repo.HTMLURL, Name: repo.Name, NameWithNamespace: repo.FullName, - Path: strings.Join(repoPath, "/"), + Path: path[len(path)-1], AvatarURL: repo.AvatarURL, PathWithNamespace: strings.Join(path, "/"), LastActivityAt: repo.Updated, diff --git a/internal/remotes/gitea/gitea_stream.go b/internal/remotes/gitea/gitea_stream.go index fd26b44..c7a6973 100644 --- a/internal/remotes/gitea/gitea_stream.go +++ b/internal/remotes/gitea/gitea_stream.go @@ -2,7 +2,6 @@ package gitearemote import ( "errors" - "fmt" "code.gitea.io/sdk/gitea" "gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/load" @@ -20,8 +19,6 @@ func (r *GiteaRemote) StreamProjects(pi *load.ProgressInfo, opts *remote.RemoteQ for { repos, resp, err := r.api.ListMyRepos(gitea.ListReposOptions{ListOptions: giteaListOpts}) - fmt.Printf("Gitea PrevPage %d, NextPage %d, Pages %d\n", resp.PrevPage, resp.NextPage, resp.LastPage) - if err != nil { pi.ErrorChan <- err break