Skip to content

Commit

Permalink
debug msgs and check if pushedat is nil (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
cooperspencer authored Apr 15, 2024
1 parent 6a293dd commit a62270d
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions bitbucket/bitbucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
exclude := types.GetMap(repo.Exclude)

for _, r := range repositories.Items {
sub.Debug().Msg(r.Links["clone"].([]interface{})[0].(map[string]interface{})["href"].(string))
user := repo.User
if r.Owner != nil {
if _, ok := r.Owner["nickname"]; ok {
Expand Down
1 change: 1 addition & 0 deletions gitea/gitea.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
}

if len(repo.Filter.Languages) > 0 {
sub.Debug().Msg(r.HTMLURL)
langs, _, err := client.GetRepoLanguages(r.Owner.UserName, r.Name)
if err != nil {
sub.Error().
Expand Down
4 changes: 4 additions & 0 deletions github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
languages := types.GetMap(repo.Filter.Languages)

for _, r := range githubrepos {
sub.Debug().Msg(*r.CloneURL)
if repo.Filter.ExcludeForks {
if *r.Fork {
continue
Expand All @@ -241,6 +242,9 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
if *r.StargazersCount < repo.Filter.Stars {
continue
}
if r.PushedAt == nil {
continue
}
if time.Since(r.PushedAt.Time) > repo.Filter.LastActivityDuration && repo.Filter.LastActivityDuration != 0 {
continue
}
Expand Down
1 change: 1 addition & 0 deletions gitlab/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
}

if len(repo.Filter.Languages) > 0 {
sub.Debug().Msg(r.WebURL)
langs, _, err := client.Projects.GetProjectLanguages(r.ID)
if err != nil {
sub.Error().
Expand Down
1 change: 1 addition & 0 deletions gogs/gogs.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
excludeorgs := types.GetMap(repo.ExcludeOrgs)

for _, r := range gogsrepos {
sub.Debug().Msg(r.HTMLURL)
if repo.Filter.ExcludeForks {
if r.Fork {
continue
Expand Down
14 changes: 7 additions & 7 deletions onedev/onedev.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
}

for _, r := range userrepos {
urls, _, err := client.GetCloneUrl(r.ID)
if err != nil {
sub.Error().
Msg("couldn't get clone urls")
continue
}
sub.Debug().Msg(urls.HTTP)
if repo.Filter.ExcludeForks {
if r.ForkedFromID != 0 {
continue
Expand All @@ -98,13 +105,6 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
}
}

urls, _, err := client.GetCloneUrl(r.ID)
if err != nil {
sub.Error().
Msg("couldn't get clone urls")
continue
}

defaultbranch, _, err := client.GetDefaultBranch(r.ID)
if err != nil {
sub.Error().
Expand Down
1 change: 1 addition & 0 deletions sourcehut/sourcehut.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
for _, r := range repositories.Results {
repoURL := fmt.Sprintf("%s%s/%s", repo.URL, repo.User, r.Name)
sshURL := fmt.Sprintf("git@%s:%s/%s", types.GetHost(repo.URL), r.Owner.CanonicalName, r.Name)
sub.Debug().Msg(repoURL)

refs, err := getRefs(apiURL, r.Name, token)
if err != nil {
Expand Down

0 comments on commit a62270d

Please sign in to comment.