attempting to fix guireleaser
This commit is contained in:
parent
08c7765cc7
commit
a7619389df
|
@ -29,7 +29,7 @@ func CheckReady() bool {
|
||||||
log.Info("find the next repo first")
|
log.Info("find the next repo first")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
goSumS := release.current.Status.GetGoSumStatus()
|
goSumS := release.current.GoState()
|
||||||
dirtyS := release.current.State()
|
dirtyS := release.current.State()
|
||||||
lastS := release.current.Status.GetLastTagVersion()
|
lastS := release.current.Status.GetLastTagVersion()
|
||||||
currentS := release.current.Status.GetCurrentBranchVersion()
|
currentS := release.current.Status.GetCurrentBranchVersion()
|
||||||
|
@ -44,7 +44,7 @@ func CheckReady() bool {
|
||||||
}
|
}
|
||||||
if goSumS == "PRIMATIVE" {
|
if goSumS == "PRIMATIVE" {
|
||||||
if targetS == lastS {
|
if targetS == lastS {
|
||||||
release.current.Status.SetGoSumStatus("RELEASED")
|
release.current.SetGoState("RELEASED")
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
@ -53,15 +53,15 @@ func CheckReady() bool {
|
||||||
}
|
}
|
||||||
if goSumS == "READY" {
|
if goSumS == "READY" {
|
||||||
if targetS == lastS {
|
if targetS == lastS {
|
||||||
release.current.Status.SetGoSumStatus("RELEASED")
|
release.current.SetGoState("RELEASED")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if lastS == currentS {
|
if lastS == currentS {
|
||||||
release.current.Status.SetGoSumStatus("UNRELEASED")
|
release.current.SetGoState("UNRELEASED")
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
release.current.Status.SetGoSumStatus("NOT READY")
|
release.current.SetGoState("NOT READY")
|
||||||
if release.current.Status.ReadOnly() {
|
if release.current.Status.ReadOnly() {
|
||||||
log.Info("\trepo is read only")
|
log.Info("\trepo is read only")
|
||||||
return false
|
return false
|
||||||
|
@ -69,12 +69,12 @@ func CheckReady() bool {
|
||||||
|
|
||||||
if targetS == lastS {
|
if targetS == lastS {
|
||||||
log.Info("\trepo is already done", lastS, "=", targetS)
|
log.Info("\trepo is already done", lastS, "=", targetS)
|
||||||
release.current.Status.SetGoSumStatus("READY")
|
release.current.SetGoState("READY")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if lastS == currentS {
|
if lastS == currentS {
|
||||||
log.Info("\trepo is already done", lastS, "=", targetS)
|
log.Info("\trepo is already done", lastS, "=", targetS)
|
||||||
release.current.Status.SetGoSumStatus("READY")
|
release.current.SetGoState("READY")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ func CheckReady() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
release.current.Status.SetGoSumStatus("READY")
|
release.current.SetGoState("READY")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ func doRelease() bool {
|
||||||
log.Warn("version does not start with v.", release.version.String())
|
log.Warn("version does not start with v.", release.version.String())
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
switch release.current.Status.GetGoSumStatus() {
|
switch release.current.GoState() {
|
||||||
case "PRIMATIVE":
|
case "PRIMATIVE":
|
||||||
log.Warn("can do PRIMATIVE", release.current.Name())
|
log.Warn("can do PRIMATIVE", release.current.Name())
|
||||||
case "GOOD":
|
case "GOOD":
|
||||||
|
@ -88,7 +88,7 @@ func doRelease() bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Info("PUBLISH OK")
|
log.Info("PUBLISH OK")
|
||||||
release.current.Status.SetGoSumStatus("RELEASED")
|
release.current.SetGoState("RELEASED")
|
||||||
|
|
||||||
// unwind and re-tag. Now that the go.mod and go.sum are published, revert
|
// unwind and re-tag. Now that the go.mod and go.sum are published, revert
|
||||||
// to the development branch
|
// to the development branch
|
||||||
|
@ -178,7 +178,7 @@ func doPublishVersion() bool {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
log.Info("SELF UPDATE OK. out =", out)
|
log.Info("SELF UPDATE OK. out =", out)
|
||||||
log.Info("SELF UPDATE WORKED")
|
log.Info("SELF UPDATE WORKED")
|
||||||
release.current.Status.SetGoSumStatus("RELEASED")
|
release.current.SetGoState("RELEASED")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
|
|
@ -25,7 +25,7 @@ func showHideRepos() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if me.autoReleased.Checked() {
|
if me.autoReleased.Checked() {
|
||||||
if repo.Status.GetGoSumStatus() == "RELEASED" {
|
if repo.GoState() == "RELEASED" {
|
||||||
repo.Hide()
|
repo.Hide()
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ func globalDisplayOptions(box *gui.Node) {
|
||||||
me.autoReleased.Custom = func() {
|
me.autoReleased.Custom = func() {
|
||||||
if me.autoReleased.Checked() {
|
if me.autoReleased.Checked() {
|
||||||
for _, repo := range me.repos.View.AllRepos() {
|
for _, repo := range me.repos.View.AllRepos() {
|
||||||
if repo.Status.GetGoSumStatus() == "RELEASED" {
|
if repo.GoState() == "RELEASED" {
|
||||||
repo.Hide()
|
repo.Hide()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -227,6 +227,14 @@ func globalDisplayOptions(box *gui.Node) {
|
||||||
log.Info("All repos seem okay")
|
log.Info("All repos seem okay")
|
||||||
})
|
})
|
||||||
|
|
||||||
|
group1.NewButton("initialize all the repos", func() {
|
||||||
|
setRepoState()
|
||||||
|
})
|
||||||
|
|
||||||
|
group1.NewButton("scanForReady()", func() {
|
||||||
|
scanForReady()
|
||||||
|
})
|
||||||
|
|
||||||
group2 := vbox.NewGroup("Debugger")
|
group2 := vbox.NewGroup("Debugger")
|
||||||
group2.NewButton("logging Window", func() {
|
group2.NewButton("logging Window", func() {
|
||||||
logsettings.LogWindow()
|
logsettings.LogWindow()
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func lookToUnwind(r *repolist.Repo) bool {
|
func lookToUnwind(r *repolist.Repo) bool {
|
||||||
goSumS := r.Status.GetGoSumStatus()
|
goSumS := r.GoState()
|
||||||
dirtyS := r.State()
|
dirtyS := r.State()
|
||||||
currentS := r.Status.GetCurrentBranchVersion()
|
currentS := r.Status.GetCurrentBranchVersion()
|
||||||
log.Info("repo:", r.Name(), goSumS, dirtyS, r.State(), currentS)
|
log.Info("repo:", r.Name(), goSumS, dirtyS, r.State(), currentS)
|
||||||
|
@ -21,19 +21,19 @@ func lookToUnwind(r *repolist.Repo) bool {
|
||||||
log.Info("\trepo is ready working from main branch", curName, "=", mName)
|
log.Info("\trepo is ready working from main branch", curName, "=", mName)
|
||||||
} else {
|
} else {
|
||||||
log.Info("\trepo is not ready main branch", curName, "!=", mName)
|
log.Info("\trepo is not ready main branch", curName, "!=", mName)
|
||||||
r.Status.SetGoSumStatus("CAN NOT UNWIND")
|
r.SetGoState("CAN NOT UNWIND")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if r.LastTag() != currentS {
|
if r.LastTag() != currentS {
|
||||||
log.Info("\trepo version mismatch last vs current", r.LastTag(), "!=", currentS)
|
log.Info("\trepo version mismatch last vs current", r.LastTag(), "!=", currentS)
|
||||||
r.Status.SetGoSumStatus("CAN NOT UNWIND")
|
r.SetGoState("CAN NOT UNWIND")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if release.version.String() != r.LastTag() {
|
if release.version.String() != r.LastTag() {
|
||||||
log.Info("\trepo version mismatch last vs official", r.LastTag(), "!=", release.version.String())
|
log.Info("\trepo version mismatch last vs official", r.LastTag(), "!=", release.version.String())
|
||||||
r.Status.SetGoSumStatus("CAN NOT UNWIND")
|
r.SetGoState("CAN NOT UNWIND")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ func lookToUnwind(r *repolist.Repo) bool {
|
||||||
testf := filepath.Join(fullpath, "go.mod")
|
testf := filepath.Join(fullpath, "go.mod")
|
||||||
if Exists(testf) {
|
if Exists(testf) {
|
||||||
log.Info("\trepo is ready. go.mod exists")
|
log.Info("\trepo is ready. go.mod exists")
|
||||||
r.Status.SetGoSumStatus("UNWIND")
|
r.SetGoState("UNWIND")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,10 +49,10 @@ func lookToUnwind(r *repolist.Repo) bool {
|
||||||
testf = filepath.Join(fullpath, "go.sum")
|
testf = filepath.Join(fullpath, "go.sum")
|
||||||
if Exists(testf) {
|
if Exists(testf) {
|
||||||
log.Info("\trepo is ready. go.sum exists")
|
log.Info("\trepo is ready. go.sum exists")
|
||||||
r.Status.SetGoSumStatus("UNWIND")
|
r.SetGoState("UNWIND")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Status.SetGoSumStatus("NO UNWIND?")
|
r.SetGoState("NO UNWIND?")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
104
main.go
104
main.go
|
@ -66,8 +66,58 @@ func main() {
|
||||||
// save the ENV var here
|
// save the ENV var here
|
||||||
me.releaseReasonS = releaseReasonS
|
me.releaseReasonS = releaseReasonS
|
||||||
|
|
||||||
me.repos = makeRepoView()
|
log.Info("Creating the Release Window")
|
||||||
|
|
||||||
|
// scan in the repo map first
|
||||||
|
// hopefully this is the list of all the golang packages and only the GUI golang packages
|
||||||
|
me.repos = makeRepoView()
|
||||||
|
log.Sleep(3)
|
||||||
|
|
||||||
|
// create the right side of the main window
|
||||||
|
createReleaseBox(me.mainBox)
|
||||||
|
|
||||||
|
// disable the open repo button. this isn't really important
|
||||||
|
// but does indicates the app (and toolkit) is working
|
||||||
|
// this can be removed later, but in these early days, I'm using this
|
||||||
|
// tool to release the code for this app, the gui and the gui toolkits
|
||||||
|
// and sometimes they lie, don't display stuff, don't even disable things
|
||||||
|
// so I can't trust even what I see. It's complicated right now still.
|
||||||
|
release.openrepo.Disable()
|
||||||
|
|
||||||
|
// parse config file and scan for .git repos
|
||||||
|
me.repos.initRepoList()
|
||||||
|
|
||||||
|
// reads in the State of all the repos
|
||||||
|
// TODO: should not really be necessary directly after init()
|
||||||
|
me.repos.View.ScanRepositories()
|
||||||
|
|
||||||
|
me.Enable()
|
||||||
|
|
||||||
|
// intermittently scans the status indefinitly
|
||||||
|
me.repos.View.Watchdog(func() {
|
||||||
|
log.Info("In main()")
|
||||||
|
// processing is done. update the repo summary box
|
||||||
|
// me.summary.Update()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func setRepoState() {
|
||||||
|
// start the initail scan and make sure each repo is set
|
||||||
|
// to the master branch
|
||||||
|
for _, repo := range me.repos.View.AllRepos() {
|
||||||
|
if repo.ReadOnly() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if whitelist(repo.GoPath()) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if repo.Status.CheckoutMaster() {
|
||||||
|
log.Warn("git checkout master branch worked", repo.Name())
|
||||||
|
} else {
|
||||||
|
log.Warn("git checkout master branch failed", repo.Name())
|
||||||
|
}
|
||||||
|
repo.NewScan()
|
||||||
|
}
|
||||||
// go through and set the target versions for each repo
|
// go through and set the target versions for each repo
|
||||||
// todo: add sanity checking in repolist to verify these and/or autocompute them
|
// todo: add sanity checking in repolist to verify these and/or autocompute them
|
||||||
// for now, just don't be stupid when you set your ENV vars
|
// for now, just don't be stupid when you set your ENV vars
|
||||||
|
@ -98,57 +148,7 @@ func main() {
|
||||||
repo.Status.SetTargetVersion(lasttag)
|
repo.Status.SetTargetVersion(lasttag)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.Info("Creating the Release Window")
|
|
||||||
|
|
||||||
// create the right side of the main window
|
|
||||||
createReleaseBox(me.mainBox)
|
|
||||||
|
|
||||||
|
|
||||||
// start the initail scan and make sure each repo is set
|
|
||||||
// to the master branch
|
|
||||||
for _, repo := range me.repos.View.AllRepos() {
|
for _, repo := range me.repos.View.AllRepos() {
|
||||||
if repo.ReadOnly() {
|
repo.NewScan()
|
||||||
continue
|
|
||||||
}
|
|
||||||
if whitelist(repo.GoPath()) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if repo.Status.CheckoutMaster() {
|
|
||||||
log.Warn("git checkout master branch worked", repo.Name())
|
|
||||||
repo.Status.UpdateNew()
|
|
||||||
} else {
|
|
||||||
repo.Status.UpdateNew()
|
|
||||||
log.Warn("git checkout master branch failed", repo.Name())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// disable the open repo button. this isn't really important
|
|
||||||
// but does indicates the app (and toolkit) is working
|
|
||||||
// this can be removed later, but in these early days, I'm using this
|
|
||||||
// tool to release the code for this app, the gui and the gui toolkits
|
|
||||||
// and sometimes they lie, don't display stuff, don't even disable things
|
|
||||||
// so I can't trust even what I see. It's complicated right now still.
|
|
||||||
release.openrepo.Disable()
|
|
||||||
|
|
||||||
// I don't know what this is autotypist thing?
|
|
||||||
// globalResetOptions(me.mainbox)
|
|
||||||
|
|
||||||
// hopefully this is the list of all the golang packages and only the GUI golang packages
|
|
||||||
me.repos = makeRepoView()
|
|
||||||
|
|
||||||
// parse config file and scan for .git repos
|
|
||||||
me.repos.initRepoList()
|
|
||||||
|
|
||||||
// reads in the State of all the repos
|
|
||||||
// TODO: should not really be necessary directly after init()
|
|
||||||
me.repos.View.ScanRepositories()
|
|
||||||
|
|
||||||
me.Enable()
|
|
||||||
|
|
||||||
// intermittently scans the status indefinitly
|
|
||||||
me.repos.View.Watchdog(func() {
|
|
||||||
log.Info("In main()")
|
|
||||||
// processing is done. update the repo summary box
|
|
||||||
// me.summary.Update()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -325,7 +325,7 @@ func scanForReady() bool {
|
||||||
|
|
||||||
if whitelist(repo.GoPath()) {
|
if whitelist(repo.GoPath()) {
|
||||||
log.Info("found WHITELIST", repo.GoPath())
|
log.Info("found WHITELIST", repo.GoPath())
|
||||||
repo.Status.SetGoSumStatus("WHITELIST")
|
repo.SetGoState("WHITELIST")
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,7 +341,7 @@ func scanForReady() bool {
|
||||||
// todo: redo this logic as it is terrible
|
// todo: redo this logic as it is terrible
|
||||||
func findNextDirty(onlyKind string) bool {
|
func findNextDirty(onlyKind string) bool {
|
||||||
for _, repo := range me.repos.View.AllRepos() {
|
for _, repo := range me.repos.View.AllRepos() {
|
||||||
goSumS := repo.Status.GetGoSumStatus()
|
goSumS := repo.GoState()
|
||||||
// dirtyS := repo.State()
|
// dirtyS := repo.State()
|
||||||
|
|
||||||
log.Info("findNextDirty()", repo.GoPath(), goSumS)
|
log.Info("findNextDirty()", repo.GoPath(), goSumS)
|
||||||
|
|
15
scanGoSum.go
15
scanGoSum.go
|
@ -6,25 +6,14 @@ import (
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
/*
|
|
||||||
func getGoSumStatus(r *repolist.Repo) string {
|
|
||||||
return r.Status.GoSumStatus.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
func setGoSumStatus(r *repolist.Repo, s string) {
|
|
||||||
r.goSumStatus.SetLabel(s)
|
|
||||||
r.status.SetGoSumStatus(s)
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
func checkSafeGoSumRemake(r *repolist.Repo) {
|
func checkSafeGoSumRemake(r *repolist.Repo) {
|
||||||
if ok, bad := r.Status.CheckSafeGoSumRemake(); ok {
|
if ok, bad := r.Status.CheckSafeGoSumRemake(); ok {
|
||||||
log.Info("checkSafeGoSumRemake() is safe to redo")
|
log.Info("checkSafeGoSumRemake() is safe to redo")
|
||||||
r.Status.SetGoSumStatus("SAFE")
|
r.SetGoState("SAFE")
|
||||||
r.Status.MakeRedomod()
|
r.Status.MakeRedomod()
|
||||||
} else {
|
} else {
|
||||||
log.Info("checkSafeGoSumRemake() is not safe. problems:", bad)
|
log.Info("checkSafeGoSumRemake() is not safe. problems:", bad)
|
||||||
r.Status.SetGoSumStatus("BAD DEP")
|
r.SetGoState("BAD DEP")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
15
whitelist.go
15
whitelist.go
|
@ -13,12 +13,15 @@ func initWhitelist() {
|
||||||
if strings.HasPrefix(repo.GoPath(), "go.wit.com/dev/davecgh") {
|
if strings.HasPrefix(repo.GoPath(), "go.wit.com/dev/davecgh") {
|
||||||
release.whitelist[repo.GoPath()] = repo
|
release.whitelist[repo.GoPath()] = repo
|
||||||
}
|
}
|
||||||
// if repo.String() == "go.wit.com/apps/guireleaser" {
|
//
|
||||||
// release.whitelist[repo.String()] = repo
|
// if repo.String() == "go.wit.com/apps/guireleaser" {
|
||||||
// }
|
// release.whitelist[repo.String()] = repo
|
||||||
// if repo.String() == "go.wit.com/lib/gui/repostatus" {
|
// }
|
||||||
// release.whitelist[repo.String()] = repo
|
//
|
||||||
// }
|
// if repo.String() == "go.wit.com/lib/gui/repostatus" {
|
||||||
|
// release.whitelist[repo.String()] = repo
|
||||||
|
// }
|
||||||
|
//
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue