summaryrefslogtreecommitdiff
path: root/releaseWindow.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-26 11:59:59 -0600
committerJeff Carr <[email protected]>2024-01-26 11:59:59 -0600
commit1a459d6f6ff8ed77f41bba1cceea92035415aa0b (patch)
tree209e012acba80a0397d5c7be181e85bbb0241df4 /releaseWindow.go
parent615947a05a5fd291f4e43da11eeb50fcd3eaa597 (diff)
closer to release automation
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'releaseWindow.go')
-rw-r--r--releaseWindow.go93
1 files changed, 67 insertions, 26 deletions
diff --git a/releaseWindow.go b/releaseWindow.go
index 62c8953..3314af8 100644
--- a/releaseWindow.go
+++ b/releaseWindow.go
@@ -3,6 +3,7 @@ package main
import (
"os"
+ "strings"
"go.wit.com/gui"
"go.wit.com/log"
@@ -43,6 +44,9 @@ func createReleaseWindow() {
return
}
+ versionS := "0.13.13"
+ partS := strings.Split(versionS, ".")
+
release.win = gadgets.NewBasicWindow(me.myGui, "Make a new release")
release.win.Custom = func() {
log.Info("Release Window close")
@@ -59,6 +63,8 @@ func createReleaseWindow() {
scanGoSum()
release.grid.NewButton("next repo", func() {
+ buttonDisable()
+ defer buttonEnable()
log.Info("find the next repo to release here")
if findNextDirty() {
log.Info("findNextDirty() found a repo")
@@ -79,6 +85,17 @@ func createReleaseWindow() {
log.Info("find the next repo first")
return
}
+ // make sure read only is set
+ if release.current.status.ReadOnly() {
+ release.readOnly.SetValue("true")
+ } else {
+ release.readOnly.SetValue("false")
+ }
+
+ // do a new scan
+ release.current.newScan()
+
+ // only continue if the go.sum & go.mod files are clean
if ok, missing := release.current.status.CheckGoSum(); ok {
log.Info("repo has go.sum requirements that are clean")
release.status.SetValue("CLEAN")
@@ -87,21 +104,17 @@ func createReleaseWindow() {
log.Info("BAD repo has go.sum requirements that are screwed up. missing:", missing)
release.status.SetValue("BAD")
release.current.setGoSumStatus("BAD")
+ return
}
- if release.current.status.ReadOnly() {
- release.readOnly.SetValue("true")
- } else {
- release.readOnly.SetValue("false")
- }
- release.current.newScan()
if release.current.dirtyLabel.String() == "PERFECT" {
+ log.Info("REPO IS STILL DIRTY")
return
}
- // log.Info("find the next repo to release here")
+ // open the status window to commit the release
release.current.status.Toggle()
- release.current.status.SetVersion("0", "13", "11", release.reason.String())
+ release.current.status.SetVersion(partS[0], partS[1], partS[2], release.reason.String())
release.current.status.Update()
})
release.openrepo.Disable()
@@ -112,23 +125,23 @@ func createReleaseWindow() {
release.notes = gadgets.NewOneLiner(release.grid, "notes")
release.version = gadgets.NewOneLiner(release.grid, "version")
- release.version.SetText("0.13.11")
+ release.version.SetText(versionS)
release.reason = gadgets.NewBasicEntry(release.grid, "release reason")
release.reason.SetText("hide works")
release.sendVersionB = release.grid.NewButton("send version", func() {
log.Info("set version()")
- release.current.status.SetVersion("0", "13", "12", release.reason.String())
+ release.current.status.SetVersion(partS[0], partS[1], partS[2], release.reason.String())
})
release.grid.NewButton("set ignore", func() {
tmp := release.current.getGoSumStatus()
log.Info("trying to set repo IGNORE is now =", tmp)
release.current.setGoSumStatus("IGNORE")
})
- release.checkDirtyB = release.grid.NewButton("CheckDirty()", func() {
+ release.checkDirtyB = release.grid.NewButton("checkDirty()", func() {
buttonDisable()
- if release.current.status.CheckDirty() {
+ if release.current.checkDirty() {
log.Info("repo is dirty")
} else {
log.Info("repo is not dirty")
@@ -220,23 +233,33 @@ func createReleaseWindow() {
}
func buttonDisable() {
- release.goGetB.Disable()
- release.makeRedomodB.Disable()
- release.checkGoSumB.Disable()
- release.openrepo.Disable()
- release.checkDirtyB.Disable()
- release.sendVersionB.Disable()
- release.checkSafeB.Disable()
+ release.win.Disable()
+ /*
+ release.nextRepoB.Disable()
+ release.openRepoB.Disable()
+ release.goGetB.Disable()
+ release.makeRedomodB.Disable()
+ release.checkGoSumB.Disable()
+ release.openrepo.Disable()
+ release.checkDirtyB.Disable()
+ release.sendVersionB.Disable()
+ release.checkSafeB.Disable()
+ */
}
func buttonEnable() {
- release.goGetB.Enable()
- release.makeRedomodB.Enable()
- release.checkGoSumB.Enable()
- release.openrepo.Enable()
- release.checkDirtyB.Enable()
- release.sendVersionB.Enable()
- release.checkSafeB.Enable()
+ release.win.Enable()
+ /*
+ release.nextRepoB.Enable()
+ release.openRepoB.Enable()
+ release.goGetB.Enable()
+ release.makeRedomodB.Enable()
+ release.checkGoSumB.Enable()
+ release.openrepo.Enable()
+ release.checkDirtyB.Enable()
+ release.sendVersionB.Enable()
+ release.checkSafeB.Enable()
+ */
}
func findDirty2() bool {
@@ -305,6 +328,12 @@ func findNextDirty() bool {
}
// latestversion := repo.status.GetLastTagVersion()
if goSumS == "CLEAN" {
+ // 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()
+ }
if dirtyS == "PERFECT" {
continue
}
@@ -348,6 +377,12 @@ func findNextRepo() bool {
}
// latestversion := repo.status.GetLastTagVersion()
if goSumS == "CLEAN" {
+ // 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()
+ }
if dirtyS == "PERFECT" {
continue
}
@@ -370,6 +405,12 @@ func findNextRepo() bool {
}
}
if goSumS == "BAD" {
+ // 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()
+ }
if setCurrentRepo(repo, "bad", "redo go.sum") {
return true
}