Closed colindean closed 1 year ago
The problem is that I have no idea how to check if a wiki is used or not.
We could adapt the clone error like this:
if strings.Contains(err.Error(), "remote repository is empty") {
if !strings.HasSuffix(repo.Url, ".wiki.git") || !strings.HasSuffix(repo.Url, ".wiki.git") {
log.Warn().Str("stage", "locally").Str("path", l.Path).Str("repo", repo.Name).Msg(err.Error())
break
}
}
It looks like there's a Project Wikis API.
https://docs.gitlab.com/ee/api/wikis.html
Perhaps list the wiki pages without content and if it's non-zero, then clone.
I'll have a look at it.
I implemented the logic for the wiki clone for github and gitlab. They only clone the wiki if it has pages. eb3704b272cc08a421353cf863148c48849a5f16
For gitea I'll have to wait until their v1.16 release to implement that. Because with the current release version, they don't support a wiki api.
c1669ad8b508f963aa07485089973d3b458ee565 added GitLab Wiki support but it doesn't check if the repo status before cloning it, only if it's enabled or not. Because wiki is enabled by default, this results in a ton of extra work and warnings in the logs for repos that are empty:
I see this for basically every GitLab repo.