diff --git a/bots-common/gitea_utils.go b/bots-common/gitea_utils.go index 2b392e2..aca4026 100644 --- a/bots-common/gitea_utils.go +++ b/bots-common/gitea_utils.go @@ -152,6 +152,7 @@ func (gitea *GiteaTransport) GetOrganizationRepositories(orgName string) ([]*mod } repos = append(repos, ret.Payload...) + page++ } return repos, nil diff --git a/prjgit-updater/main.go b/prjgit-updater/main.go index c675110..19267d5 100644 --- a/prjgit-updater/main.go +++ b/prjgit-updater/main.go @@ -251,19 +251,41 @@ func verifyProjectState(git *common.GitHandler, orgName string, config *common.A } // find all missing repositories, and add them + if debugMode { + log.Println("checking for missing repositories...") + } repos, err := gitea.GetOrganizationRepositories(orgName) if err != nil { return err } -next_repo: + if debugMode { + log.Println(" nRepos:", len(repos)) + } + + next_repo: for _, r := range repos { + if debugMode { + log.Println(" -- checking", r.Name) + } + for _, c := range configs { if c.Organization == orgName && c.GitProjectName == r.Name { - break next_repo + // ignore project gits + break } } + for repo := range sub { + if repo == r.Name { + continue next_repo + } + } + + if debugMode { + log.Println(" -- checking repository:", r.Name) + } + if _, err := gitea.GetRecentCommits(orgName, r.Name, config.Branch, 10); err != nil { // assumption that package does not exist, so not part of project // https://github.com/go-gitea/gitea/issues/31976 @@ -296,6 +318,10 @@ next_repo: } } + if debugMode { + log.Println("Verification finished for ", orgName, ", config", config.GitProjectName) + } + return nil }