diff options
| -rw-r--r-- | doRelease.go | 2 | ||||
| -rw-r--r-- | finalGoDepsCheckOk.go | 42 | ||||
| -rw-r--r-- | findNext.go | 25 | ||||
| -rw-r--r-- | http.go | 15 | ||||
| -rw-r--r-- | prepareRelease.go | 6 | ||||
| -rw-r--r-- | releaseBox.go | 2 | 
6 files changed, 49 insertions, 43 deletions
diff --git a/doRelease.go b/doRelease.go index 1defc0c..fd419a6 100644 --- a/doRelease.go +++ b/doRelease.go @@ -81,7 +81,7 @@ func doRelease() error {  		return skipToNext()  	}  	me.done = append(me.done, me.current.GetGoPath()) -	if err := me.forge.FinalGoDepsCheckOk(check, true); err != nil { +	if err := finalGoDepsCheckOk(check); err != nil {  		msg := fmt.Sprint("the go.mod file is wrong. fix it here?", check.GetGoPath())  		badExit(errors.New(msg))  		return fmt.Errorf("FinalGoDeps %s err %v", check.GetGoPath(), err) diff --git a/finalGoDepsCheckOk.go b/finalGoDepsCheckOk.go new file mode 100644 index 0000000..6b0c2a1 --- /dev/null +++ b/finalGoDepsCheckOk.go @@ -0,0 +1,42 @@ +package main + +import ( +	"errors" +	"fmt" +	"os" +	"path/filepath" + +	"go.wit.com/lib/ENV" +	"go.wit.com/lib/protobuf/gitpb" +	"go.wit.com/log" +) + +func finalGoDepsCheckOk(check *gitpb.Repo) error { +	data, _ := os.ReadFile(filepath.Join(check.FullPath, "go.mod")) +	log.Info(string(data)) + +	err := me.forge.FinalGoDepsCheckOk(check) +	if err == nil { +		log.Info("FINDNEXT: forge.FinalGoDepsCheck(check) worked!") +		return nil +	} +	log.Printf("FINDNEXT: forge.FinalGoDepsCheck(check) err (%v)\n", err) +	return err +} + +func testGoDepsCheckOk(godeps *gitpb.GoDeps) error { +	if godeps == nil { +		return errors.New("testGoDepsCheckOk() godeps == nil") +	} +	all := godeps.SortByGoPath() +	for all.Scan() { +		depRepo := all.Next() +		fullpath := filepath.Join(ENV.Get("gopath"), depRepo.GoPath) +		found := me.found.FindByFullPath(fullpath) +		if found == nil { +			continue +		} +		return fmt.Errorf("testGoDepsCheckOk() dep is being upgraded %s", depRepo.GoPath) +	} +	return nil +} diff --git a/findNext.go b/findNext.go index 5434b7e..775ec4f 100644 --- a/findNext.go +++ b/findNext.go @@ -1,14 +1,10 @@  package main  import ( -	"errors" -	"fmt"  	"os" -	"path/filepath"  	"go.wit.com/log" -	"go.wit.com/lib/ENV"  	"go.wit.com/lib/protobuf/gitpb"  ) @@ -61,13 +57,13 @@ func findNext() bool {  			}  			// 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 { +			if err := testGoDepsCheckOk(godepsNew); err != nil {  				log.Info("FIND NEXT: CHECKING current repo deps failed", err)  				continue  			}  		} -		if err := me.forge.FinalGoDepsCheckOk(check, argv.Verbose); err != nil { +		if err := finalGoDepsCheckOk(check); err != nil {  			// if err := me.forge.FinalGoDepsCheckOk(check, false); err != nil {  			log.Info("FIND NEXT: FinalGoDepsCheckOk() repo=", check.GetNamespace(), "err:", err)  			log.Info("FIND NEXT: CHECKING END:", check.GetNamespace()) @@ -112,20 +108,3 @@ func setCurrentRepo(check *gitpb.Repo, s string, note string) bool {  	// me.release.openrepo.Enable()  	return true  } - -func testGoDepsCheckOk(godeps *gitpb.GoDeps, verbose bool) error { -	if godeps == nil { -		return errors.New("testGoDepsCheckOk() godeps == nil") -	} -	all := godeps.SortByGoPath() -	for all.Scan() { -		depRepo := all.Next() -		fullpath := filepath.Join(ENV.Get("gopath"), depRepo.GoPath) -		found := me.found.FindByFullPath(fullpath) -		if found == nil { -			continue -		} -		return fmt.Errorf("dep is being upgraded %s", depRepo.GoPath) -	} -	return nil -} @@ -3,11 +3,8 @@ package main  import (  	"fmt"  	"net/http" -	"os" -	"path/filepath"  	"strings" -	"go.wit.com/lib/protobuf/gitpb"  	"go.wit.com/log"  ) @@ -32,18 +29,6 @@ func okHandler(w http.ResponseWriter, r *http.Request) {  	}  } -func testGoRepo(check *gitpb.Repo) { -	data, _ := os.ReadFile(filepath.Join(check.FullPath, "go.mod")) -	log.Info(string(data)) - -	if err := me.forge.FinalGoDepsCheckOk(check, true); err == nil { -		log.Info("forge.FinalGoDepsCheck(check) worked!") -	} else { -		log.Info("forge.FinalGoDepsCheck(check) failed. boo.") -	} - -} -  // starts and sits waiting for HTTP requests  func startHTTP() {  	http.HandleFunc("/", okHandler) diff --git a/prepareRelease.go b/prepareRelease.go index 8ae8be1..4488935 100644 --- a/prepareRelease.go +++ b/prepareRelease.go @@ -214,7 +214,7 @@ func rePrepareRelease() {  		// any library version change  		//		if check.GetRepoType() == "binary" || check.GetRepoType() == "plugin" {  		// check if the package dependancies changed, if so, re-publish -		if err := me.forge.FinalGoDepsCheckOk(check, false); err == nil { +		if err := finalGoDepsCheckOk(check); err == nil {  			// log.Printf("go.sum is perfect! %s\n", check.GetGoPath())  			continue  		} else { @@ -266,7 +266,7 @@ func checkPublishedGodeps(repo *gitpb.Repo) error {  		return err  	}  	if godepsOld != nil { -		if err := me.forge.TestGoDepsCheckOk(godepsOld, argv.Verbose); err != nil { +		if err := testGoDepsCheckOk(godepsOld); err != nil {  			return err  		}  	} @@ -282,7 +282,7 @@ func checkPublishedGodeps(repo *gitpb.Repo) error {  			return fmt.Errorf("published godeps == nil vs real != nil")  		}  	} -	if err := me.forge.TestGoDepsCheckOk(godepsNew, argv.Verbose); err != nil { +	if err := testGoDepsCheckOk(godepsNew); err != nil {  		return err  	}  	return nil diff --git a/releaseBox.go b/releaseBox.go index bfd4e6a..3237c13 100644 --- a/releaseBox.go +++ b/releaseBox.go @@ -79,7 +79,7 @@ func createReleaseBox(box *gui.Node) {  			log.Info("boo, current is missing", me.current.GetGoPath())  			return  		} -		testGoRepo(check) +		finalGoDepsCheckOk(check)  	})  	me.release.grid.NextRow()  | 
