From 79ea2eaec1e308276a2ebc6da9872bd21bee191c Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 17 Dec 2024 21:58:14 -0600 Subject: [PATCH] more and more and more --- Makefile | 13 +------------ doRelease.go | 2 +- http.go | 37 ++----------------------------------- main.go | 3 +++ prepareRelease.go | 8 ++++++-- structs.go | 1 + 6 files changed, 14 insertions(+), 50 deletions(-) diff --git a/Makefile b/Makefile index 25aa5a4..65acc1f 100644 --- a/Makefile +++ b/Makefile @@ -87,21 +87,10 @@ curl-incrementAllTargetVersions: list-release-notdone: curl --silent http://localhost:9419/releaseList?readonly=true -# only show repos that need to be merged to the master branch -curl-list-changed: - curl --silent http://localhost:9419/list?perfect=false - -# include repos that you probably can't git push commits -curl-list-everything: +list-all: curl --silent http://localhost:9419/list?readonly=true -curl-file-for-go.wit.com: - curl --silent http://localhost:9419/goweblist?readonly=true - curl --silent http://localhost:9419/goweblist?readonly=true |sort > ~/go.wit.com.versions - safe-build: install forge --find-private wit-package --no-gui --make-install cd ~/go/src/go.wit.com/lib/xgb/ && GUIRELEASE_REASON="safe-build" guireleaser - - diff --git a/doRelease.go b/doRelease.go index 71ca2aa..e1af8cb 100644 --- a/doRelease.go +++ b/doRelease.go @@ -208,7 +208,7 @@ func doRelease() bool { if !doReleaseFindNext() { log.Info("doReleaseFindNext() could not find a new", findCounter) log.Info("THIS PROBABLY MEANS THAT ACTUALLY WE ARE TOTALLY DONE?", findCounter) - count := me.forge.PrintReleaseReport() + count := me.forge.PrintReleaseReport(me.found) log.Info("count =", count) os.Setenv("FindNextDone", "true") return false diff --git a/http.go b/http.go index 3db18bc..a54ec27 100644 --- a/http.go +++ b/http.go @@ -28,9 +28,6 @@ func okHandler(w http.ResponseWriter, r *http.Request) { repoName := r.URL.Query().Get("repo") version := r.URL.Query().Get("version") comment := r.URL.Query().Get("comment") - readonly := r.URL.Query().Get("readonly") - onlydirty := r.URL.Query().Get("onlydirty") - perfect := r.URL.Query().Get("perfect") whitelist := r.URL.Query().Get("whitelist") switch route { @@ -174,40 +171,10 @@ func okHandler(w http.ResponseWriter, r *http.Request) { showNext() return case "/list": - PrintReport(readonly, onlydirty, perfect) + me.forge.PrintReleaseReport(me.forge.Repos) return case "/releaseList": - me.forge.PrintReleaseReport() - return - case "/goweblist": - loop := me.repos.View.ReposAll() - for loop.Scan() { - repo := loop.Repo() - - lastTag := repo.LastTag() - tag := repo.Status.NewestTag() - gitAge, err := tag.GetDate() - if err != nil { - log.Info(fmt.Sprintf("tag date error", repo.Name())) - } - // if lastTag == "" { - // lastTag = tag.Name() - // } - if repo.ReadOnly() { - if readonly == "true" { - continue - } - } - // dur := time.Since(gitAge) - // log.Info(fmt.Sprintf("%-60s %s %s %s", repo.Name(), lastTag, shell.FormatDuration(dur), lastTag, tag.Name())) - log.Info(fmt.Sprintf("%s %d %s", repo.Name(), gitAge.Unix(), lastTag)) - /* - for _, tag := range repo.Tags.ListAll() { - log.Info(fmt.Sprintf("%-60s %s", "", tag.Name())) - } - */ - - } + me.forge.PrintReleaseReport(me.found) return default: log.Info("BAD URL = " + route) diff --git a/main.go b/main.go index 3893087..9a7bf55 100644 --- a/main.go +++ b/main.go @@ -11,6 +11,7 @@ import ( "go.wit.com/gui" "go.wit.com/lib/gui/shell" "go.wit.com/lib/protobuf/forgepb" + "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" ) @@ -26,6 +27,8 @@ func main() { // load the ~/.config/forge/ config me.forge = forgepb.Init() + me.found = new(gitpb.Repos) + // me.forge.ConfigPrintTable() os.Setenv("REPO_WORK_PATH", me.forge.GetGoSrc()) diff --git a/prepareRelease.go b/prepareRelease.go index 043597b..050af38 100644 --- a/prepareRelease.go +++ b/prepareRelease.go @@ -14,7 +14,7 @@ func makePrepareRelease() { // if it succeeds, disable this button me.setBranchesToMasterB.Disable() me.release.box.Enable() - me.forge.PrintReleaseReport() + me.forge.PrintReleaseReport(me.found) } else { log.Info("setAllBranchesToMaster() failed") } @@ -25,7 +25,8 @@ func makePrepareRelease() { check := all.Next() // set the target version to the current master version - check.SetTargetVersion("") + lastTag := check.GetLastTag() + check.SetTargetVersion(lastTag) } all = me.forge.Repos.SortByFullPath() @@ -41,12 +42,14 @@ func makePrepareRelease() { lastTag := check.GetLastTag() if master != lastTag { forceReleaseVersion(check) + me.found.AppendUniqueGoPath(check) continue } if argv.Protobuf && check.GetRepoType() == "protobuf" { // if --protobuf, this will force upgrade each one forceReleaseVersion(check) + me.found.AppendUniqueGoPath(check) continue } @@ -60,6 +63,7 @@ func makePrepareRelease() { } log.Printf("dependancy checks indicate a new release is needed for %s\n", check.GetGoPath()) forceReleaseVersion(check) + me.found.AppendUniqueGoPath(check) } } diff --git a/structs.go b/structs.go index 567a715..3113926 100644 --- a/structs.go +++ b/structs.go @@ -19,6 +19,7 @@ type autoType struct { reposgrid *gui.Node reposgroup *gui.Node current *gitpb.Repo + found *gitpb.Repos // stores the list of repos to process things on // this is the repo we are starting in // make sure it never changes so go.mod and go.sum are always there