From 82f06c160a05bcd18dfee63d408c88a19416cb2d Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 19 Jan 2025 10:48:16 -0600 Subject: [PATCH] more rill. trying to improve logic --- TODO | 46 +++++----------------------------------------- findNext.go | 4 ++-- prepareRelease.go | 46 +++++++++++++++++++++++----------------------- 3 files changed, 30 insertions(+), 66 deletions(-) diff --git a/TODO b/TODO index 81d4362..f0583ca 100644 --- a/TODO +++ b/TODO @@ -2,49 +2,13 @@ notes on what to fix next go-args make patches for alexflint -forge checkout jcarr +forge checkout jcarr (alias username to 'user') +forge verify devel branches + +fix going2go build +fix fyne build go-mod-clean set ctime on files go-mod-clean fix --purge to be used more often. put --purge in 'make clean' ? -guirelease try to figure out where the stupid output is coming from go-mod-clean guireleaser change "title small" to the package being updated" - -wit-test fix zookeeper build - - - -Running [go-mod-clean --strict] in go.wit.com/lib/gui/repolist -fixGoDeps() returned false -findNext() update needed go.wit.com/lib/protobuf/forgepb v0.0.48 vs v0.0.47-2-g9e81be8 -findFix is true. running fixGoDeps() -Running [go-mod-clean --strict] in go.wit.com/lib/protobuf/forgepb -fixGoDeps() returned false -findNext() update needed go.wit.com/lib/protobuf/gitpb v0.0.51 vs v0.0.50-1-g8c06b25 -findFix is true. running fixGoDeps() -Running [go-mod-clean --strict] in go.wit.com/lib/protobuf/gitpb -current repo go.wit.com/lib/protobuf/gitpb go dependancy count: 8IsReadOnly = true github.com/destel/rill -IsReadOnly = true github.com/go-cmd/cmd -IsReadOnly = true github.com/go-test/deep -IsReadOnly = true github.com/google/go-cmp -IsReadOnly = true golang.org/x/xerrors -IsReadOnly = true google.golang.org/protobuf -fixGoDeps() returned true -current repo go.wit.com/lib/protobuf/gitpb go dependancy count: 8github.com/go-test/deep ok error .v1.1.0. vs .v1.1.1. (ignoring read-only repo)github.com/google/go-cmp ok error .v0.5.5. vs .v0.6.0. (ignoring read-only repo)golang.org/x/xerrors ok error .v0.0.0-20191204190536-9bdfabe68543. vs .. (ignoring read-only repo)google.golang.org/protobuf ok error .v1.36.3. vs .v1.35.2. (ignoring read-only repo)findNext() found something -Running [go-mod-clean --strict] in go.wit.com/lib/protobuf/gitpb -current repo go.wit.com/lib/protobuf/gitpb go dependancy count: 8IsReadOnly = true github.com/destel/rill -IsReadOnly = true github.com/go-cmd/cmd -IsReadOnly = true github.com/go-test/deep -IsReadOnly = true github.com/google/go-cmp -IsReadOnly = true golang.org/x/xerrors -IsReadOnly = true google.golang.org/protobuf -current repo go.wit.com/lib/protobuf/gitpb go dependancy count: 8github.com/go-test/deep ok error .v1.1.0. vs .v1.1.1. (ignoring read-only repo)github.com/google/go-cmp ok error .v0.5.5. vs .v0.6.0. (ignoring read-only repo)golang.org/x/xerrors ok error .v0.0.0-20191204190536-9bdfabe68543. vs .. (ignoring read-only repo)google.golang.org/protobuf ok error .v1.36.3. vs .v1.35.2. (ignoring read-only repo)GOOD TO RUN ANOTHER DAY ON: go.wit.com/lib/protobuf/gitpb -doRelease() worked. findCounter = 13 -doRelease() on go.wit.com/lib/protobuf/gitpb -everything is ok. version starts with v. v0.0.51 -go.mod exists ok -current repo go.wit.com/lib/protobuf/gitpb go dependancy count: 8github.com/go-test/deep ok error .v1.1.0. vs .v1.1.1. (ignoring read-only repo)github.com/google/go-cmp ok error .v0.5.5. vs .v0.6.0. (ignoring read-only repo)golang.org/x/xerrors ok error .v0.0.0-20191204190536-9bdfabe68543. vs .. (ignoring read-only repo)google.golang.org/protobuf ok error .v1.36.3. vs .v1.35.2. (ignoring read-only repo) tag and push master v0.0.51 set protobuf uuids - IsProtobuf() == true - should add the protobuf files here - - diff --git a/findNext.go b/findNext.go index b36594c..4436446 100644 --- a/findNext.go +++ b/findNext.go @@ -100,7 +100,7 @@ func runGoClean(check *gitpb.Repo, myarg string) bool { check.GoDeps = nil cmd := []string{"go-mod-clean", myarg} - log.Info("Running", cmd, "in", check.GetGoPath()) + // log.Info("Running", cmd, "in", check.GetGoPath()) result := check.Run(cmd) if result.Error != nil { /* @@ -125,7 +125,7 @@ func runGoClean(check *gitpb.Repo, myarg string) bool { if check.ParseGoSum() { return true } - log.Info("ParseGoSum() failed") + log.Info("ParseGoSum() failed", check.GetGoPath()) return false } diff --git a/prepareRelease.go b/prepareRelease.go index a54bd6c..a06c058 100644 --- a/prepareRelease.go +++ b/prepareRelease.go @@ -3,7 +3,9 @@ package main import ( "os" "strings" + "time" + "go.wit.com/lib/gui/shell" "go.wit.com/lib/protobuf/forgepb" "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" @@ -62,39 +64,37 @@ func forceReleaseVersion(repo *gitpb.Repo) { // os.Exit(-1) } } +func rillGoModRestore(repo *gitpb.Repo) error { + if repo.GetTargetVersion() == "" { + // not set to upgrade + return nil + } + if repo.GetLastTag() == repo.GetTargetVersion() { + return nil + } + if me.forge.Config.IsReadOnly(repo.GetGoPath()) { + return nil + } + if me.forge.Config.IsPrivate(repo.GetGoPath()) { + return nil + } + runGoClean(repo, "--restore") + return nil +} func rePrepareRelease() { // reload the config me.forge = forgepb.Init() me.found = new(gitpb.Repos) - // blank all the target versions incase they were saved in the config .pb file + now := time.Now() + me.forge.RillFuncError(rillGoModRestore) + log.Printf("rillFixGodeps() (%d total repos) took:%s\n", me.forge.Repos.Len(), shell.FormatDuration(time.Since(now))) + all := me.forge.Repos.SortByFullPath() for all.Scan() { check := all.Next() - // set the target version to the current master version - lastTag := check.GetLastTag() - check.SetTargetVersion(lastTag) - if me.forge.Config.IsReadOnly(check.GetGoPath()) { - // can't release readonly repos - continue - } - if me.forge.Config.IsPrivate(check.GetGoPath()) { - // can't release readonly repos - continue - } - - if !runGoClean(check, "--restore") { - log.Info("gomodclean probably failed here. that's ok", check.GetGoPath()) - // os.Exit(-1) - } - } - - all = me.forge.Repos.SortByFullPath() - for all.Scan() { - check := all.Next() - if me.forge.Config.IsReadOnly(check.GetGoPath()) { // can't release readonly repos continue