From cf943fc5ba31a1da06c2620f57eb763a1e05bb7a Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 5 Nov 2024 05:57:59 -0600 Subject: [PATCH] attempting a release again Signed-off-by: Jeff Carr --- Makefile | 25 ++++++++----------------- doRelease.go | 14 +++++++++++--- http.go | 15 +++++++++++++-- 3 files changed, 32 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index 02a47e3..60ba15e 100644 --- a/Makefile +++ b/Makefile @@ -19,8 +19,8 @@ prepare-release: make curl-incrementAllTargetVersions make curl-list-release-notdone make curl-whitelist-stuff - make curl-findNext - make curl-showNext + make findNext + make showNext goimports: goimports -w *.go @@ -64,39 +64,30 @@ curl-setBranchesToMasterB: curl --silent http://localhost:9419/setBranchesToMasterB # report on the release -curl-findNext: +findNext: curl --silent http://localhost:9419/findNext -curl-showNext: +showNext: curl --silent http://localhost:9419/showNext doRelease: - make curl-showNext + make showNext sleep 10 curl --silent http://localhost:9419/doRelease +curl-setCurrent-go-wit-com-gui: + curl --silent http://localhost:9419/setCurrentRepo?repo=go.wit.com/gui + curl-setTargetVersion-virtigo-v0.1.1: curl --silent http://localhost:9419/setTargetVersion?version=v0.1.1 curl-incrementAllTargetVersions: curl --silent http://localhost:9419/setAllTargetVersions -#curl-IncrementMinorVersion: -# curl --silent http://localhost:9419/IncrementMinorVersion?repo=go.wit.com/toolkit/debian - -#curl-IncrementRevisonVersion: -# curl --silent http://localhost:9419/IncrementRevisonVersion?repo=go.wit.com/toolkit/debian - # report on the release curl-list-release-notdone: curl --silent http://localhost:9419/releaseList?readonly=true -#curl-list-release-real: -# curl --silent http://localhost:9419/releaseList?readonly=true?perfect=false - -#curl-doSingleRepo: -# curl --silent 'http://localhost:9419/doSingleRepo?repo=go.wit.com/gui&dryrun=false' - # only show repos that need to be merged to the master branch curl-list-changed: curl --silent http://localhost:9419/list?perfect=false diff --git a/doRelease.go b/doRelease.go index 878fb4b..71baa57 100644 --- a/doRelease.go +++ b/doRelease.go @@ -45,9 +45,17 @@ func doRelease() bool { } else { all = append(all, []string{"git", "add", "-f", "go.sum"}) } - if me.current.Status.IsProtobuf() { - log.Info("\tshould add protobuf files here!") + if ok, files, err := me.current.Status.IsProtobuf(); ok { + log.Info("\tIsProtobuf() == true") + if err != nil { + log.Info("\tERROR: There are protobuf files, but they are not compiled") + log.Info("\tERROR: can not continue") + } + log.Info("\tshould add the protobuf files here") + log.Info("\tfiles found:", files) //all = append(all, []string{"git", "add", "-f", "go.sum"}) + } else { + log.Info("\tIsProtobuf() == false") } all = append(all, []string{"git", "commit", "-m", me.releaseReasonS}) all = append(all, []string{"git", "push"}) @@ -104,7 +112,7 @@ func doRelease() bool { func checkValidGoSum(repo *repolist.RepoRow) bool { ok, err := me.repos.View.CheckValidGoSum(repo) if err != nil { - log.Info("go mod tidy not ok") + log.Info("go mod tidy not ok", err) return false } if ok { diff --git a/http.go b/http.go index 8622c83..08074d7 100644 --- a/http.go +++ b/http.go @@ -81,6 +81,11 @@ func okHandler(w http.ResponseWriter, r *http.Request) { msg(w, "notes: "+me.release.notes.String()) msg(w, "status: "+me.release.status.String()) + if me.current == nil { + msg(w, "findNext() == nil") + return + } + msg(w, me.current.StandardHeader()) msg(w, me.current.StandardReleaseHeader()) case "/rescanAll": @@ -157,6 +162,10 @@ func okHandler(w http.ResponseWriter, r *http.Request) { msg(w, "gui notes: "+me.release.notes.String()) msg(w, "gui status: "+me.release.status.String()) msg(w, "") + if me.current == nil { + msg(w, "me.current == nil") + return + } if checkValidGoSum(me.current) { msg(w, "checkValidGoSum() == true") @@ -178,10 +187,12 @@ func okHandler(w http.ResponseWriter, r *http.Request) { } else { msg(w, "IsPrimitive() == false") } - if me.current.Status.IsProtobuf() { - msg(w, "IsProtobuf() == true") + if ok, files, err := me.current.Status.IsProtobuf(); ok { + msg(w, log.Sprint("IsProtobuf() == true files = ", files)) + msg(w, log.Sprint("IsProtobuf() == err", err)) } else { msg(w, "IsProtobuf() == false") + msg(w, log.Sprint("IsProtobuf() == err", err)) } if me.current.Status.Whitelist { msg(w, "Whitelist == true SHOULD NOT RELEASE THIS")