diff options
| -rw-r--r-- | finalGoSumCheck.go | 18 | ||||
| -rw-r--r-- | rill.go | 42 |
2 files changed, 51 insertions, 9 deletions
diff --git a/finalGoSumCheck.go b/finalGoSumCheck.go index e789c89..42be348 100644 --- a/finalGoSumCheck.go +++ b/finalGoSumCheck.go @@ -76,42 +76,42 @@ func (f *Forge) FinalGoDepsCheckOk(check *gitpb.Repo) error { // TODO: this is a dumb hack & needs to be updated to talk to forged func (f *Forge) CheckOverride(gopath string) bool { if gopath == "bou.ke/monkey" { - log.Info("CheckOverride() is bypassing", gopath) + // log.Info("CheckOverride() is bypassing", gopath) return true } if gopath == "github.com/posener/complete/v2" { - log.Info("CheckOverride() is bypassing", gopath) + // log.Info("CheckOverride() is bypassing", gopath) return true } if strings.HasPrefix(gopath, "github.com/go-gl") { - log.Info("CheckOverride() is bypassing", gopath) + // log.Info("CheckOverride() is bypassing", gopath) return true } if strings.HasPrefix(gopath, "google.golang.org") { - log.Info("CheckOverride() is bypassing", gopath) + // log.Info("CheckOverride() is bypassing", gopath) return true } if strings.HasPrefix(gopath, "cloud.google.com/go") { - log.Info("CheckOverride() is bypassing", gopath) + // log.Info("CheckOverride() is bypassing", gopath) return true } if strings.HasPrefix(gopath, "go.opencensus.io") { - log.Info("CheckOverride() is bypassing", gopath) + // log.Info("CheckOverride() is bypassing", gopath) return true } if strings.HasPrefix(gopath, "github.com/nicksnyder/go-i18n") { - log.Info("CheckOverride() is bypassing", gopath) + // log.Info("CheckOverride() is bypassing", gopath) return true } // fuckit for now. just blacklist github.com if strings.HasPrefix(gopath, "github.com/") { if env.Verbose() { - log.Info("CheckOverride() is ignoring everything at github.com", gopath) + // log.Info("CheckOverride() is ignoring everything at github.com", gopath) } return true } if !strings.HasPrefix(gopath, "go.wit.com") { - log.Info("CheckOverride() is ignoring else not at go.wit.com", gopath) + // log.Info("CheckOverride() is ignoring else not at go.wit.com", gopath) return true } return false @@ -160,6 +160,48 @@ func (f *Forge) RillRepos(rillf func(*gitpb.Repo) error) map[string]*RillStats { return stats } +// returns the set of failed repos +func (f *Forge) RunOnReposNew(repos *gitpb.Repos, rillf func(*gitpb.Repo) error) *gitpb.Repos { + stats := f.RunOnRepos(repos, rillf) + failed := gitpb.NewRepos() + counter := 1 + for s, stat := range stats { + if stat.Err == nil { + continue + } + counter += 1 + found := f.Repos.FindByFullPath(s) + if found == nil { + log.Info("found", found, "'"+s+"'") + panic("wrong namespace logic. couldn't find repo from stats") + } + newr := failed.Clone(found) + newr.State = fmt.Sprintf("%v (%d)", stat.Err, counter) + } + + return failed +} + +// dumb & slow, but needed. This is old school dumb. Before we had the awesome machines we have today. +// Use this if you think SMP processing might be the problem. +// if this works, and GO Rill doesn't work, then you, yes you, are the problem. Your code sucks. +// fix it, happy hacking +func (f *Forge) RunOnReposNewDumb(repos *gitpb.Repos, rillf func(*gitpb.Repo) error) *gitpb.Repos { + failed := gitpb.NewRepos() + counter := 1 + for repo := range repos.IterAll() { + err := rillf(repo) + if err == nil { + continue + } + newr := failed.Clone(repo) + newr.State = fmt.Sprintf("%v (%d)", err, counter) + counter += 1 + } + + return failed +} + // x is the size of the queued up pool (shouldn't matter here for this I think) // y is how many simultanous functions will run // todo: tune and compute x,y by # of CPUs and disk io |
