2024-01-23 22:48:07 -06:00
|
|
|
// This is a simple example
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2024-02-14 16:20:26 -06:00
|
|
|
"fmt"
|
2024-01-25 01:29:00 -06:00
|
|
|
"os"
|
2024-01-30 16:48:40 -06:00
|
|
|
"path/filepath"
|
2024-01-25 01:29:00 -06:00
|
|
|
|
2024-01-23 22:48:07 -06:00
|
|
|
"go.wit.com/gui"
|
|
|
|
"go.wit.com/log"
|
|
|
|
|
|
|
|
"go.wit.com/lib/gadgets"
|
|
|
|
)
|
|
|
|
|
|
|
|
var release releaseStruct
|
|
|
|
|
|
|
|
type releaseStruct struct {
|
|
|
|
current *repo
|
|
|
|
|
2024-02-02 01:42:13 -06:00
|
|
|
box *gui.Node
|
|
|
|
group *gui.Node
|
|
|
|
grid *gui.Node
|
|
|
|
repo *gadgets.OneLiner
|
|
|
|
status *gadgets.OneLiner
|
|
|
|
readOnly *gadgets.OneLiner
|
|
|
|
notes *gadgets.OneLiner
|
|
|
|
version *gadgets.OneLiner
|
|
|
|
// versionS string
|
|
|
|
// widgetVersionS string
|
2024-02-01 13:30:26 -06:00
|
|
|
releaseVersionB *gui.Node
|
2024-02-14 16:16:11 -06:00
|
|
|
// unreleaseB *gui.Node
|
2024-02-14 16:20:26 -06:00
|
|
|
reason *gadgets.BasicEntry
|
2024-02-05 15:06:02 -06:00
|
|
|
// reasonS string
|
2024-01-23 22:48:07 -06:00
|
|
|
|
|
|
|
openrepo *gui.Node
|
2024-01-24 16:25:41 -06:00
|
|
|
|
2024-01-24 22:22:34 -06:00
|
|
|
goGetB *gui.Node
|
|
|
|
checkGoSumB *gui.Node
|
|
|
|
checkDirtyB *gui.Node
|
2024-01-24 16:25:41 -06:00
|
|
|
makeRedomodB *gui.Node
|
|
|
|
sendVersionB *gui.Node
|
2024-01-26 09:34:42 -06:00
|
|
|
checkSafeB *gui.Node
|
2024-01-31 01:36:54 -06:00
|
|
|
whitelist map[string]*repo
|
2024-02-01 15:16:15 -06:00
|
|
|
|
|
|
|
// store myself here. use myself to
|
|
|
|
// do garbage go get tests and other potential junk
|
2024-02-02 01:42:13 -06:00
|
|
|
guireleaser *repo
|
2024-01-23 22:48:07 -06:00
|
|
|
}
|
|
|
|
|
2024-01-30 14:20:54 -06:00
|
|
|
func (w *autoType) Disable() {
|
2024-01-31 04:10:54 -06:00
|
|
|
// w.mainWindow.Disable()
|
|
|
|
release.box.Disable()
|
|
|
|
// buttonDisable()
|
2024-01-30 14:20:54 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
func (w *autoType) Enable() {
|
2024-01-31 04:10:54 -06:00
|
|
|
// w.mainWindow.Enable()
|
|
|
|
release.box.Enable()
|
|
|
|
// buttonEnable()
|
2024-01-30 14:20:54 -06:00
|
|
|
}
|
2024-01-23 22:48:07 -06:00
|
|
|
|
2024-01-30 14:20:54 -06:00
|
|
|
func createReleaseBox(box *gui.Node) {
|
2024-01-31 01:14:11 -06:00
|
|
|
initWhitelist()
|
2024-01-30 16:48:40 -06:00
|
|
|
|
2024-01-30 14:05:22 -06:00
|
|
|
release.box = box
|
2024-01-23 22:48:07 -06:00
|
|
|
release.group = release.box.NewGroup("things")
|
|
|
|
release.grid = release.group.NewGrid("buildOptions", 2, 1)
|
|
|
|
|
2024-01-24 02:41:34 -06:00
|
|
|
// do an initial scan of all the repos
|
|
|
|
scanGoSum()
|
|
|
|
|
2024-01-30 16:48:40 -06:00
|
|
|
release.grid.NewButton("scan for Ready", func() {
|
2024-01-30 14:20:54 -06:00
|
|
|
me.Disable()
|
2024-01-30 16:48:40 -06:00
|
|
|
scanForReady()
|
2024-01-30 14:20:54 -06:00
|
|
|
me.Enable()
|
|
|
|
})
|
2024-01-30 14:40:41 -06:00
|
|
|
release.grid.NewButton("findNextDirty()", func() {
|
2024-01-30 14:20:54 -06:00
|
|
|
me.Disable()
|
2024-02-02 00:02:53 -06:00
|
|
|
defer me.Enable()
|
|
|
|
if findNextDirty("PRIMATIVE") {
|
|
|
|
log.Info("findNextDirty() found a repo")
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if findNextDirty("") {
|
2024-01-26 09:34:42 -06:00
|
|
|
log.Info("findNextDirty() found a repo")
|
|
|
|
return
|
|
|
|
}
|
2024-01-29 09:38:32 -06:00
|
|
|
})
|
2024-02-09 11:50:16 -06:00
|
|
|
|
2024-02-01 13:30:26 -06:00
|
|
|
release.releaseVersionB = release.grid.NewButton("release version", func() {
|
2024-01-29 09:38:32 -06:00
|
|
|
buttonDisable()
|
2024-02-09 11:50:16 -06:00
|
|
|
if doRelease() {
|
2024-01-31 16:39:42 -06:00
|
|
|
buttonEnable()
|
2024-02-09 11:50:16 -06:00
|
|
|
log.Info("doRelease() worked")
|
2024-01-31 16:39:42 -06:00
|
|
|
} else {
|
2024-02-09 11:50:16 -06:00
|
|
|
log.Info("doRelease() failed")
|
2024-01-31 16:39:42 -06:00
|
|
|
}
|
2024-01-23 22:48:07 -06:00
|
|
|
})
|
|
|
|
|
|
|
|
release.openrepo = release.grid.NewButton("open repo", func() {
|
2024-01-24 02:41:34 -06:00
|
|
|
release.current.status.Toggle()
|
2024-01-23 22:48:07 -06:00
|
|
|
})
|
|
|
|
release.openrepo.Disable()
|
|
|
|
|
|
|
|
release.repo = gadgets.NewOneLiner(release.grid, "repo")
|
|
|
|
release.status = gadgets.NewOneLiner(release.grid, "status")
|
2024-01-25 01:29:00 -06:00
|
|
|
release.readOnly = gadgets.NewOneLiner(release.grid, "read-only")
|
2024-01-23 22:48:07 -06:00
|
|
|
release.notes = gadgets.NewOneLiner(release.grid, "notes")
|
2024-01-24 02:41:34 -06:00
|
|
|
|
|
|
|
release.version = gadgets.NewOneLiner(release.grid, "version")
|
|
|
|
|
2024-01-25 22:47:05 -06:00
|
|
|
release.reason = gadgets.NewBasicEntry(release.grid, "release reason")
|
2024-02-05 15:06:02 -06:00
|
|
|
release.reason.SetText(me.releaseReasonS)
|
2024-01-24 02:41:34 -06:00
|
|
|
|
2024-01-30 16:48:40 -06:00
|
|
|
me.autoWorkingPwd = gadgets.NewOneLiner(release.grid, "working directory (pwd)")
|
|
|
|
me.userHomePwd = gadgets.NewOneLiner(release.grid, "user home")
|
|
|
|
me.goSrcPwd = gadgets.NewOneLiner(release.grid, "go src home")
|
|
|
|
|
|
|
|
homeDir, err := os.UserHomeDir()
|
|
|
|
if err != nil {
|
|
|
|
log.Warn("Error getting home directory:", err)
|
|
|
|
homeDir = "/home/autotypist"
|
|
|
|
}
|
|
|
|
me.userHomePwd.SetText(homeDir)
|
|
|
|
srcDir := filepath.Join(homeDir, "go/src")
|
|
|
|
me.goSrcPwd.SetText(srcDir)
|
|
|
|
|
2024-02-02 16:37:41 -06:00
|
|
|
testf := filepath.Join(srcDir, "go.wit.com/apps/guireleaser", "go.sum")
|
2024-02-02 17:04:57 -06:00
|
|
|
if !Exists(testf) {
|
2024-02-02 16:37:41 -06:00
|
|
|
log.Info("go.sum missing", testf)
|
|
|
|
panic("redo go.sum")
|
|
|
|
}
|
|
|
|
|
2024-01-30 16:48:40 -06:00
|
|
|
release.grid.NewButton("Check Ready", func() {
|
2024-01-31 04:10:54 -06:00
|
|
|
buttonDisable()
|
|
|
|
defer buttonEnable()
|
2024-01-30 16:48:40 -06:00
|
|
|
goSumS := release.current.getGoSumStatus()
|
|
|
|
dirtyS := release.current.dirtyLabel.String()
|
|
|
|
lastS := release.current.status.GetLastTagVersion()
|
|
|
|
if CheckReady() {
|
|
|
|
log.Info("repo is ready", release.current.String(), goSumS, dirtyS, lastS)
|
|
|
|
return
|
|
|
|
} else {
|
|
|
|
log.Info("\trepo is not ready", release.current.String(), goSumS, dirtyS, lastS)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2024-01-24 02:41:34 -06:00
|
|
|
release.grid.NewButton("set ignore", func() {
|
2024-01-26 02:04:19 -06:00
|
|
|
tmp := release.current.getGoSumStatus()
|
2024-01-24 02:41:34 -06:00
|
|
|
log.Info("trying to set repo IGNORE is now =", tmp)
|
2024-01-26 02:04:19 -06:00
|
|
|
release.current.setGoSumStatus("IGNORE")
|
2024-01-30 16:48:40 -06:00
|
|
|
release.whitelist[release.current.String()] = release.current
|
2024-01-24 02:41:34 -06:00
|
|
|
})
|
2024-01-30 16:48:40 -06:00
|
|
|
|
2024-02-11 18:58:52 -06:00
|
|
|
release.checkSafeB = release.grid.NewButton("fullDoubleCheckFix()", func() {
|
2024-01-26 09:34:42 -06:00
|
|
|
buttonDisable()
|
2024-02-11 18:58:52 -06:00
|
|
|
if fullDoubleCheckFix() {
|
|
|
|
log.Info("go.sum is clean")
|
2024-01-31 16:39:42 -06:00
|
|
|
} else {
|
|
|
|
log.Info("repo go.sum FAILED")
|
2024-02-11 18:58:52 -06:00
|
|
|
return
|
2024-01-31 16:39:42 -06:00
|
|
|
}
|
2024-01-26 09:34:42 -06:00
|
|
|
buttonEnable()
|
|
|
|
})
|
2024-02-02 01:42:13 -06:00
|
|
|
|
2024-01-24 16:25:41 -06:00
|
|
|
release.checkGoSumB = release.grid.NewButton("CheckGoSum()", func() {
|
|
|
|
buttonDisable()
|
2024-01-31 04:10:54 -06:00
|
|
|
if ok, _ := release.current.status.CheckGoSum(); ok {
|
2024-01-24 16:25:41 -06:00
|
|
|
log.Info("repo has go.sum requirements that are clean")
|
2024-02-02 01:42:13 -06:00
|
|
|
// release.current.setGoSumStatus("CLEAN")
|
|
|
|
release.status.SetValue("GOOD")
|
|
|
|
release.notes.SetValue("CheckGoSum() does not seem to lie")
|
2024-01-31 03:00:10 -06:00
|
|
|
}
|
|
|
|
buttonEnable()
|
|
|
|
})
|
2024-02-02 01:42:13 -06:00
|
|
|
|
2024-02-02 17:56:59 -06:00
|
|
|
release.makeRedomodB = release.grid.NewButton("make redomod", func() {
|
|
|
|
buttonDisable()
|
2024-02-14 01:26:31 -06:00
|
|
|
if release.current.status.MakeRedomod() {
|
|
|
|
} else {
|
|
|
|
log.Info("This is bad. stop here")
|
|
|
|
}
|
2024-02-02 17:56:59 -06:00
|
|
|
buttonEnable()
|
|
|
|
})
|
2024-02-02 01:42:13 -06:00
|
|
|
|
2024-02-02 17:42:48 -06:00
|
|
|
release.grid.NewButton("goodCheckGoSum()", func() {
|
2024-01-24 16:25:41 -06:00
|
|
|
buttonDisable()
|
2024-02-02 17:42:48 -06:00
|
|
|
if goodCheckGoSum() {
|
|
|
|
log.Info("goodCheckGoSum() GOOD")
|
2024-01-24 16:25:41 -06:00
|
|
|
} else {
|
2024-02-02 17:42:48 -06:00
|
|
|
log.Info("goodCheckGoSum() FAILED")
|
2024-01-24 16:25:41 -06:00
|
|
|
}
|
|
|
|
buttonEnable()
|
|
|
|
})
|
2024-02-09 11:50:16 -06:00
|
|
|
|
2024-02-14 15:39:13 -06:00
|
|
|
release.grid.NewButton("release all", func() {
|
2024-02-14 16:20:26 -06:00
|
|
|
var worked bool = true
|
2024-02-09 11:50:16 -06:00
|
|
|
buttonDisable()
|
2024-02-14 15:39:13 -06:00
|
|
|
// rather than loop forever, at least limit this to the number of repos
|
|
|
|
// incase something, somewhere, goes wrong
|
2024-02-14 16:20:26 -06:00
|
|
|
duration := timeFunction(func() {
|
|
|
|
for n := 0; n <= len(me.allrepos); n++ {
|
|
|
|
if doRelease() {
|
|
|
|
log.Info("doRelease() worked")
|
|
|
|
} else {
|
|
|
|
if release.status.String() == "ALL DONE?" {
|
|
|
|
log.Info("maybe ALL DONE?")
|
|
|
|
buttonEnable()
|
|
|
|
worked = true
|
|
|
|
break
|
|
|
|
}
|
|
|
|
log.Info("doRelease() failed")
|
|
|
|
worked = false
|
|
|
|
break
|
2024-02-09 11:50:16 -06:00
|
|
|
}
|
|
|
|
}
|
2024-02-14 16:20:26 -06:00
|
|
|
})
|
|
|
|
s := fmt.Sprint(duration)
|
|
|
|
log.Info("release returned", worked, "and ran for", s)
|
2024-02-09 11:50:16 -06:00
|
|
|
buttonEnable()
|
|
|
|
})
|
2024-01-24 16:25:41 -06:00
|
|
|
}
|
2024-02-02 02:42:17 -06:00
|
|
|
|
2024-02-11 18:58:52 -06:00
|
|
|
func fullDoubleCheckFix() bool {
|
|
|
|
release.current.status.CheckSafeGoSumRemake()
|
2024-02-14 12:14:33 -06:00
|
|
|
if !release.current.status.MakeRedomod() {
|
2024-02-14 01:26:31 -06:00
|
|
|
log.Info("go mod failed")
|
|
|
|
return false
|
|
|
|
}
|
2024-02-11 18:58:52 -06:00
|
|
|
if ok, _ := release.current.status.CheckGoSum(); ok {
|
|
|
|
log.Info("go.sum is clean")
|
|
|
|
} else {
|
|
|
|
log.Info("repo go.sum FAILED")
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
if ok, _ := release.current.status.CheckGoSum(); ok {
|
|
|
|
log.Info("repo has go.sum requirements that are clean")
|
|
|
|
// release.current.setGoSumStatus("CLEAN")
|
|
|
|
release.status.SetValue("GOOD")
|
|
|
|
release.notes.SetValue("CheckGoSum() does not seem to lie")
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2024-02-02 01:42:13 -06:00
|
|
|
func goodCheckGoSum() bool {
|
|
|
|
tmp := release.current.String()
|
2024-02-02 02:42:17 -06:00
|
|
|
log.Info("goodCheckGoSum() START on repo:", tmp, "STATUS =", release.current.getGoSumStatus())
|
2024-02-02 01:42:13 -06:00
|
|
|
|
|
|
|
var maybe bool = true
|
|
|
|
goConfig := release.current.status.GetGoDeps()
|
|
|
|
for depname, version := range goConfig {
|
|
|
|
log.Info("Checking repo deps:", depname, version)
|
|
|
|
repo, ok := me.allrepos[depname]
|
|
|
|
if ok {
|
|
|
|
goSumS := repo.getGoSumStatus()
|
2024-02-02 17:56:59 -06:00
|
|
|
// ignore dependencies on whitelisted repos
|
|
|
|
// TODO: warn the user about the whitelist
|
2024-02-02 01:42:13 -06:00
|
|
|
if goSumS == "WHITELIST" {
|
|
|
|
continue
|
|
|
|
}
|
2024-02-02 17:56:59 -06:00
|
|
|
// check if the dependent repo is ReadOnly
|
|
|
|
// if so, there isn't anything we can do about
|
|
|
|
// version mis-matches
|
|
|
|
if repo.status.ReadOnly() {
|
2024-02-02 17:42:48 -06:00
|
|
|
continue
|
|
|
|
}
|
2024-02-02 01:42:13 -06:00
|
|
|
lastS := repo.status.GetLastTagVersion()
|
|
|
|
targetS := repo.targetVersion.String()
|
|
|
|
log.Info(" repo deps:", depname, version, "vs", goSumS, lastS, targetS)
|
|
|
|
if lastS != targetS {
|
2024-02-02 17:56:59 -06:00
|
|
|
log.Info("repo deps: FALSE lastS != targetS", lastS, targetS)
|
|
|
|
log.Info("repo deps: FALSE status.ReadOnly()", release.current.status.ReadOnly())
|
|
|
|
log.Info("repo deps: FALSE path", release.current.String())
|
2024-02-02 01:42:13 -06:00
|
|
|
maybe = false
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
log.Info(" repo deps: IGNORE", depname, version)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if maybe {
|
|
|
|
log.Info("SUCCEEDED.", release.current.String())
|
2024-02-02 02:42:17 -06:00
|
|
|
log.Info("SUCCEEDED. goSumStatus.String() =", release.current.goSumStatus.String())
|
2024-02-02 01:42:13 -06:00
|
|
|
log.Info("SUCCEEDED. MAYBE. try it again get go.sum requirements")
|
|
|
|
return true
|
|
|
|
} else {
|
|
|
|
log.Info("FAILED. move on")
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
2024-01-24 16:25:41 -06:00
|
|
|
|
|
|
|
func buttonDisable() {
|
2024-01-30 14:20:54 -06:00
|
|
|
me.Disable()
|
2024-01-24 16:25:41 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
func buttonEnable() {
|
2024-01-30 14:20:54 -06:00
|
|
|
me.Enable()
|
2024-01-24 16:25:41 -06:00
|
|
|
}
|
|
|
|
|
2024-01-25 01:29:00 -06:00
|
|
|
func setCurrentRepo(newcur *repo, s string, note string) bool {
|
|
|
|
if newcur.status.ReadOnly() {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
release.repo.SetValue(newcur.status.String())
|
|
|
|
release.status.SetValue(s)
|
|
|
|
release.notes.SetValue(note)
|
|
|
|
release.current = newcur
|
2024-02-02 00:02:53 -06:00
|
|
|
release.version.SetText(release.current.targetVersion.String())
|
2024-02-02 01:42:13 -06:00
|
|
|
release.releaseVersionB.SetText("release version " + release.current.targetVersion.String())
|
2024-02-14 16:16:11 -06:00
|
|
|
// release.unreleaseB.SetText("un-release version " + release.current.targetVersion.String())
|
2024-01-25 01:29:00 -06:00
|
|
|
release.openrepo.Enable()
|
|
|
|
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2024-01-30 16:48:40 -06:00
|
|
|
func scanForReady() bool {
|
2024-01-30 14:20:54 -06:00
|
|
|
for _, repo := range me.allrepos {
|
|
|
|
goSumS := repo.getGoSumStatus()
|
|
|
|
dirtyS := repo.dirtyLabel.String()
|
|
|
|
log.Info("findNextDirty()", repo.String(), goSumS, dirtyS)
|
2024-02-02 00:02:53 -06:00
|
|
|
|
2024-01-30 16:48:40 -06:00
|
|
|
if whitelist(repo.String()) {
|
|
|
|
log.Info("found WHITELIST", repo.String())
|
|
|
|
repo.setGoSumStatus("WHITELIST")
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
|
|
|
log.Info("scan for Ready: found a repo")
|
|
|
|
if setCurrentRepo(repo, "checking ready", "notsure") {
|
2024-01-31 04:10:54 -06:00
|
|
|
CheckReady()
|
2024-01-30 14:20:54 -06:00
|
|
|
}
|
|
|
|
}
|
2024-01-30 16:48:40 -06:00
|
|
|
return true
|
2024-01-30 14:20:54 -06:00
|
|
|
}
|
|
|
|
|
2024-02-02 00:02:53 -06:00
|
|
|
func findNextDirty(onlyKind string) bool {
|
2024-02-02 02:42:17 -06:00
|
|
|
for key := range me.allrepos {
|
|
|
|
repo := me.allrepos[key]
|
2024-01-26 02:04:19 -06:00
|
|
|
goSumS := repo.getGoSumStatus()
|
2024-01-24 16:25:41 -06:00
|
|
|
dirtyS := repo.dirtyLabel.String()
|
|
|
|
|
2024-01-25 01:29:00 -06:00
|
|
|
log.Info("findNextDirty()", repo.String(), goSumS, dirtyS)
|
2024-02-02 02:42:17 -06:00
|
|
|
if repo.status.ReadOnly() {
|
|
|
|
log.Info("findNextDirty() skipping readonly")
|
|
|
|
continue
|
|
|
|
}
|
2024-01-24 16:25:41 -06:00
|
|
|
if goSumS == "PRIMATIVE" {
|
2024-02-01 14:30:30 -06:00
|
|
|
if setCurrentRepo(repo, "PRIMATIVE", "release new version") {
|
|
|
|
if release.version.String() == release.current.status.GetLastTagVersion() {
|
|
|
|
// everything is fine. the primative has already been released
|
|
|
|
} else {
|
2024-01-25 22:47:05 -06:00
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
2024-01-24 16:25:41 -06:00
|
|
|
continue
|
2024-02-02 00:02:53 -06:00
|
|
|
} else {
|
|
|
|
if onlyKind == "PRIMATIVE" {
|
|
|
|
continue
|
|
|
|
}
|
2024-01-24 16:25:41 -06:00
|
|
|
}
|
|
|
|
if goSumS == "IGNORE" {
|
|
|
|
continue
|
|
|
|
}
|
2024-02-02 01:42:13 -06:00
|
|
|
if goSumS == "RELEASED" {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
if goSumS == "WHITELIST" {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
setCurrentRepo(repo, "REDO GOSUM", "try redoing the gosum")
|
2024-02-02 02:42:17 -06:00
|
|
|
newgoSumS := release.current.getGoSumStatus()
|
|
|
|
newdirtyS := release.current.dirtyLabel.String()
|
|
|
|
newlastS := release.current.status.GetLastTagVersion()
|
2024-02-02 01:42:13 -06:00
|
|
|
if goodCheckGoSum() {
|
2024-02-02 02:42:17 -06:00
|
|
|
log.Info("findNextDirty() returning true from goodCheckGoSum()", newgoSumS, newgoSumS, newdirtyS, newlastS)
|
2024-02-02 01:42:13 -06:00
|
|
|
return true
|
|
|
|
} else {
|
|
|
|
// continue
|
|
|
|
}
|
|
|
|
if repo.String() == "go.wit.com/log" {
|
|
|
|
log.Info("findNextDirty() FOUND LOG", repo.String(), goSumS, dirtyS)
|
|
|
|
log.Info("findNextDirty() FOUND LOG", repo.String(), goSumS, dirtyS)
|
|
|
|
log.Info("findNextDirty() FOUND LOG", repo.String(), goSumS, dirtyS)
|
|
|
|
log.Info("findNextDirty() FOUND LOG", repo.String(), goSumS, dirtyS)
|
|
|
|
log.Info("findNextDirty() FOUND LOG", repo.String(), goSumS, dirtyS)
|
|
|
|
log.Sleep(10)
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
continue
|
2024-02-01 15:16:15 -06:00
|
|
|
if goSumS == "UNRELEASED" {
|
|
|
|
if setCurrentRepo(repo, "UNRELEASED", "manually check go.sum") {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
continue
|
|
|
|
}
|
2024-02-01 13:51:17 -06:00
|
|
|
if goSumS == "NOT READY" {
|
|
|
|
if setCurrentRepo(repo, "NOT READY", "manually check go.sum") {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
continue
|
|
|
|
}
|
2024-01-24 16:25:41 -06:00
|
|
|
if goSumS == "DIRTY 2" {
|
|
|
|
continue
|
|
|
|
}
|
2024-01-29 09:38:32 -06:00
|
|
|
if goSumS == "BAD DEP" {
|
|
|
|
// find out what kind of BAD DEP?
|
|
|
|
continue
|
|
|
|
}
|
2024-01-24 16:25:41 -06:00
|
|
|
// latestversion := repo.status.GetLastTagVersion()
|
|
|
|
if goSumS == "CLEAN" {
|
2024-01-26 11:59:59 -06:00
|
|
|
// if it's clean here, then check and remake the go.sum file
|
|
|
|
// then stop to commit the release version
|
|
|
|
repo.checkSafeGoSumRemake()
|
|
|
|
if repo.checkDirty() {
|
|
|
|
dirtyS = repo.dirtyLabel.String()
|
|
|
|
}
|
2024-01-24 16:25:41 -06:00
|
|
|
if dirtyS == "PERFECT" {
|
|
|
|
continue
|
|
|
|
}
|
2024-01-25 01:29:00 -06:00
|
|
|
if setCurrentRepo(repo, "clean", "check manually") {
|
|
|
|
return true
|
|
|
|
}
|
2024-01-24 16:25:41 -06:00
|
|
|
}
|
|
|
|
if goSumS == "DIRTY" {
|
2024-01-24 22:22:34 -06:00
|
|
|
if ok, missing := repo.status.CheckGoSum(); ok {
|
2024-01-24 16:25:41 -06:00
|
|
|
log.Info("repo has go.sum requirements that are clean")
|
2024-01-26 02:04:19 -06:00
|
|
|
// repo.setGoSumStatus("CLEAN")
|
2024-01-24 16:25:41 -06:00
|
|
|
} else {
|
2024-01-24 22:22:34 -06:00
|
|
|
log.Info("DIRTY 2 repo has go.sum requirements that are screwed up. missing:", missing)
|
2024-01-26 02:04:19 -06:00
|
|
|
repo.setGoSumStatus("DIRTY 2")
|
2024-01-24 16:25:41 -06:00
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
2024-01-25 01:29:00 -06:00
|
|
|
if setCurrentRepo(repo, "dirty", "commit changes") {
|
|
|
|
return true
|
|
|
|
}
|
2024-01-24 16:25:41 -06:00
|
|
|
}
|
|
|
|
}
|
2024-01-24 22:22:34 -06:00
|
|
|
log.Info("tried to findNextDirty() but not sure what to do next")
|
2024-02-09 11:50:16 -06:00
|
|
|
release.status.SetValue("ALL DONE?")
|
2024-01-24 16:25:41 -06:00
|
|
|
return false
|
2024-01-23 22:48:07 -06:00
|
|
|
}
|