diff options
Diffstat (limited to 'findNext.go')
| -rw-r--r-- | findNext.go | 75 |
1 files changed, 19 insertions, 56 deletions
diff --git a/findNext.go b/findNext.go index 261e47c..5434b7e 100644 --- a/findNext.go +++ b/findNext.go @@ -16,43 +16,6 @@ var findCounter int var findFix bool = false var findOk bool = true -func checkDeps(repo *gitpb.Repo) error { - if repo.GoDeps == nil { - return fmt.Errorf("%s has GoDeps == nil", repo.GetNamespace()) - } - for dep := range repo.GoDeps.IterAll() { - // log.Info(repo.GetNamespace(), dep.GoPath, dep.Version) - - // check if the package in question is waiting for another package to publish - found := me.forge.FindByNamespace(dep.GoPath) - if found == nil { - return fmt.Errorf("%s has dep == nil", repo.GetNamespace(), dep.GoPath) - } - - // loop through all the repos that need to be published with new go versions - all := me.found.SortByFullPath() - for all.Scan() { - check := all.Next() - - if found.GetNamespace() == check.GetNamespace() { - // this package is waiting on other packages to publish - return fmt.Errorf("%s is waiting on %s", repo.GetNamespace(), found.GetNamespace()) - } - } - // found package isn't being published. is the version correct? - // never check this? we are done? - /* - if found.GetLastTag() == dep.Version { - // everything is normal - } else { - return fmt.Errorf("%s version mismatch on %s (%s vs %s)", repo.GetNamespace(), found.GetNamespace(), found.GetLastTag(), dep.Version) - } - */ - } - // everything might be cool? - return nil -} - // trys to figure out if there is still something to update // todo: redo this logic as it is terrible // rename this findNext() @@ -62,28 +25,28 @@ func findNext() bool { for all.Scan() { check := all.Next() if check.GetMasterBranchName() != check.GetCurrentBranchName() { - log.Info("YOU MUST BE ON THE MASTER BRANCH", check.GetNamespace()) + log.Info("FIND NEXT: YOU MUST BE ON THE MASTER BRANCH", check.GetNamespace()) continue } if check.IsDirty() { - log.Info("CAN NOT RELEASE DIRTY REPO", check.GetNamespace()) + log.Info("FIND NEXT: CAN NOT RELEASE DIRTY REPO", check.GetNamespace()) continue } if alreadyDone(check) { - log.Info("findNext() alreadyDone. WHY IS THIS STILL CHECKING?", check.GetNamespace()) + log.Info("FIND NEXT: findNext() alreadyDone. WHY IS THIS STILL CHECKING?", check.GetNamespace()) continue } - log.Info("CHECKING START:", check.GetNamespace()) + log.Info("FIND NEXT: CHECKING START:", check.GetNamespace()) if me.forge.Config.IsPrivate(check.GetNamespace()) { - log.Info("GOOD TO GO ON PRIVATE REPO", check.GetNamespace()) + log.Info("FIND NEXT: GOOD TO GO ON PRIVATE REPO", check.GetNamespace()) setCurrentRepo(check, "should be good to release", "pretty sure") return true } godepsNew, err := check.GoSumFromRepo() if err != nil { - log.Info("CHECKING go deps from repo failed", err) + log.Info("FIND NEXT: CHECKING go deps from repo failed", err) continue } @@ -93,41 +56,41 @@ func findNext() bool { cmd := []string{"go", "mod", "tidy"} err := check.RunVerbose(cmd) if err != nil { - log.Info("go mod tidy failed. this go package needs to be examined by hand as it doesn't appear to be primitive") + log.Info("FIND NEXT: go mod tidy failed. this go package needs to be examined by hand as it doesn't appear to be primitive") os.Exit(-1) } // if godepsNew == nil, then this go package is a primitive and there is no go.sum file } else { if err := testGoDepsCheckOk(godepsNew, argv.Verbose); err != nil { - log.Info("CHECKING current repo deps failed", err) + log.Info("FIND NEXT: CHECKING current repo deps failed", err) continue } } if err := me.forge.FinalGoDepsCheckOk(check, argv.Verbose); err != nil { // if err := me.forge.FinalGoDepsCheckOk(check, false); err != nil { - log.Info("FinalGoDepsCheckOk() repo=", check.GetNamespace(), "err:", err) - log.Info("CHECKING END:", check.GetNamespace()) - log.Info("") + log.Info("FIND NEXT: FinalGoDepsCheckOk() repo=", check.GetNamespace(), "err:", err) + log.Info("FIND NEXT: CHECKING END:", check.GetNamespace()) + log.Info("FIND NEXT: ") continue } - log.Info("GOOD TO GO ON", check.GetNamespace()) + log.Info("FIND NEXT: GOOD TO GO ON", check.GetNamespace()) setCurrentRepo(check, "should be good to release", "pretty sure") return true } if findCounter == 0 { - log.Info("NOTHING TO UPDATE. findCounter =", findCounter, "found len =", me.found.Len()) + log.Info("FIND NEXT: NOTHING TO UPDATE. findCounter =", findCounter, "found len =", me.found.Len()) if me.found.Len() == 0 { printDone() okExit("") } } else { - log.Info("me.current is nil findCounter =", findCounter, "so set findFix =", findFix) + log.Info("FIND NEXT: me.current is nil findCounter =", findCounter, "so set findFix =", findFix) } - log.Info("tried to findNext() but not sure what to do next counter =", findCounter, "findFix =", findFix) - setCurrentRepo(nil, "findNext found nothing", "crap") - me.release.status.SetText("ALL DONE?") + log.Info("FIND NEXT: tried to findNext() but not sure what to do next counter =", findCounter, "findFix =", findFix) + setCurrentRepo(nil, "FIND NEXT: findNext found nothing", "crap") + me.release.status.SetText("FIND NEXT: ALL DONE?") return false } @@ -136,8 +99,8 @@ func setCurrentRepo(check *gitpb.Repo, s string, note string) bool { if check == nil { me.release.repo.SetText("") me.release.version.SetText("") - me.release.releaseVersionB.SetText("nope") - me.release.version.SetText("badver") + me.release.releaseVersionB.SetText("repo == nil") + me.release.version.SetText("repo == nil") } else { me.release.repo.SetText(check.GetNamespace()) me.release.version.SetText(check.GetTargetVersion()) |
