summaryrefslogtreecommitdiff
path: root/globalDisplayOptions.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-13 17:23:33 -0600
committerJeff Carr <[email protected]>2024-11-13 17:23:33 -0600
commitfcd132c109ed4f1ecf4348a6fdc85092973fbb97 (patch)
tree72791ca0ff59f39880576cb35c89b13f1b3b7f98 /globalDisplayOptions.go
parent250a96c49f0d4d56362be4aa02f74b6b63b4495a (diff)
code cleanup
Diffstat (limited to 'globalDisplayOptions.go')
-rw-r--r--globalDisplayOptions.go296
1 files changed, 158 insertions, 138 deletions
diff --git a/globalDisplayOptions.go b/globalDisplayOptions.go
index 2e60176..69dd5ad 100644
--- a/globalDisplayOptions.go
+++ b/globalDisplayOptions.go
@@ -1,12 +1,7 @@
package main
import (
- "os"
- "strings"
-
"go.wit.com/gui"
- "go.wit.com/lib/debugger"
- "go.wit.com/lib/gui/logsettings"
"go.wit.com/log"
)
@@ -27,44 +22,47 @@ func globalDisplayOptions(box *gui.Node) {
})
hidegrid.NextRow()
- me.autoHideReadOnly = hidegrid.NewCheckbox("Hide read-only repos").SetChecked(true)
- me.autoHideReadOnly.Custom = func() {
- if me.autoHideReadOnly.Checked() {
- os.Setenv("AUTOTYPIST_READONLY", "hide")
- } else {
- os.Unsetenv("AUTOTYPIST_READONLY")
+ /*
+ me.autoHideReadOnly = hidegrid.NewCheckbox("Hide read-only repos").SetChecked(true)
+ me.autoHideReadOnly.Custom = func() {
+ if me.autoHideReadOnly.Checked() {
+ os.Setenv("AUTOTYPIST_READONLY", "hide")
+ } else {
+ os.Unsetenv("AUTOTYPIST_READONLY")
+ }
}
- }
- os.Setenv("AUTOTYPIST_READONLY", "hide")
- hidegrid.NextRow()
+ os.Setenv("AUTOTYPIST_READONLY", "hide")
+ hidegrid.NextRow()
- me.autoHideReleased = hidegrid.NewCheckbox("Hide Released repos").SetChecked(true)
- hidegrid.NextRow()
+ me.autoHideReleased = hidegrid.NewCheckbox("Hide Released repos").SetChecked(true)
+ hidegrid.NextRow()
- me.ignoreWhitelist = hidegrid.NewCheckbox("ignore whitelist (are you sure?)").SetChecked(false)
- hidegrid.NextRow()
+ me.ignoreWhitelist = hidegrid.NewCheckbox("ignore whitelist (are you sure?)").SetChecked(false)
+ hidegrid.NextRow()
- me.scanEveryMinute = hidegrid.NewCheckbox("Scan every minute").SetChecked(false)
- me.scanEveryMinute.Custom = func() {
- if me.scanEveryMinute.Checked() {
- os.Setenv("REPO_AUTO_SCAN", "true")
- log.Info("env REPO_AUTO_SCAN=", os.Getenv("REPO_AUTO_SCAN"))
- } else {
- os.Unsetenv("REPO_AUTO_SCAN")
- log.Info("env REPO_AUTO_SCAN=", os.Getenv("REPO_AUTO_SCAN"))
+ me.scanEveryMinute = hidegrid.NewCheckbox("Scan every minute").SetChecked(false)
+ me.scanEveryMinute.Custom = func() {
+ if me.scanEveryMinute.Checked() {
+ os.Setenv("REPO_AUTO_SCAN", "true")
+ log.Info("env REPO_AUTO_SCAN=", os.Getenv("REPO_AUTO_SCAN"))
+ } else {
+ os.Unsetenv("REPO_AUTO_SCAN")
+ log.Info("env REPO_AUTO_SCAN=", os.Getenv("REPO_AUTO_SCAN"))
+ }
}
- }
+ */
- hidegrid.NewButton("scan now", func() {
- log.Info("re-scanning repos now")
- i, s := me.repos.View.ScanRepositories()
- log.Info("re-scanning repos done", i, s)
- // me.duration.SetText(s)
- })
- me.duration = me.repos.View.MirrorScanDuration()
- hidegrid.Append(me.duration)
+ /*
+ hidegrid.NewButton("scan now", func() {
+ log.Info("re-scanning repos now")
+ i, s := me.repos.View.ScanRepositories()
+ log.Info("re-scanning repos done", i, s)
+ // me.duration.SetText(s)
+ })
+ me.duration = me.repos.View.MirrorScanDuration()
+ hidegrid.Append(me.duration)
- hidegrid.NextRow()
+ */
group1 = vbox.NewGroup("prep for release")
grid := group1.RawGrid()
@@ -101,125 +99,146 @@ func globalDisplayOptions(box *gui.Node) {
})
grid.NextRow()
- var incrementTags *gui.Node
- incrementTags = grid.NewButton("increment tags", func() {
- me.Disable()
- for _, repo := range me.repos.View.AllRepos() {
- if whitelist(repo.GoPath()) {
- continue
- }
- if repo.ReadOnly() {
- continue
+ grid.NewButton("make prepare-release", func() {
+ loop := me.repos.View.ReposSortByName()
+ for loop.Scan() {
+ repo := loop.Repo()
+
+ master := repo.Status.GetMasterVersion()
+ lastTag := repo.Status.LastTag()
+ if master == lastTag {
+ repo.Status.SetTargetVersion(master)
+ } else {
+ repo.Status.IncrementRevisionVersion("Nov 2024 test")
}
- lasttag := repo.LastTag()
- masterv := repo.Status.GetMasterVersion()
- targetv := repo.Status.GetTargetVersion()
+ }
+ })
+ grid.NextRow()
- if lasttag == masterv {
- // nothing to do if curv == masterv
- // unless go.sum depends on changed repos
- if targetv != lasttag {
- log.Info(repo.GoPath(), "trigger a new release?", targetv, lasttag)
- // repo.Status.SetVersion("0", "21", "0", me.releaseReasonS)
- repo.Status.IncrementMinorVersion(me.releaseReasonS)
+ /*
+ var incrementTags *gui.Node
+ incrementTags = grid.NewButton("increment tags", func() {
+ me.Disable()
+ for _, repo := range me.repos.View.AllRepos() {
+ if whitelist(repo.GoPath()) {
+ continue
+ }
+ if repo.ReadOnly() {
+ continue
}
+ lasttag := repo.LastTag()
+ masterv := repo.Status.GetMasterVersion()
+ targetv := repo.Status.GetTargetVersion()
- continue
- }
+ if lasttag == masterv {
+ // nothing to do if curv == masterv
+ // unless go.sum depends on changed repos
+ if targetv != lasttag {
+ log.Info(repo.GoPath(), "trigger a new release?", targetv, lasttag)
+ // repo.Status.SetVersion("0", "21", "0", me.releaseReasonS)
+ repo.Status.IncrementMinorVersion(me.releaseReasonS)
+ }
- newversion := repo.Status.GetNewVersionTag()
- if newversion == targetv {
- log.Info(repo.GoPath(), "targetv has been increased already to", targetv)
- continue
- }
+ continue
+ }
- if masterv != targetv {
- log.Info(repo.GoPath(), "master and target differ", masterv, targetv)
- repo.Status.IncrementVersion()
newversion := repo.Status.GetNewVersionTag()
- repo.Status.SetTargetVersion("v" + newversion)
- // already incremented
- continue
- }
- }
- if findNext() {
- log.Info("findNext() found a repo")
- }
- incrementTags.SetText("maybe ready?")
- me.Enable()
- })
- grid.NewButton("increment minor version", func() {
- // this is messy still. if the release process fails, it needs to continue
- // for now, use the "go.wit.com/log" release minor number as the official
- // release. If it hasn't been updated yet, then start there
- logrepo := me.repos.View.FindRepo("go.wit.com/log")
- if logrepo == nil {
- log.Info("couldn't find go.wit.com/log")
- return
- }
- releasev := logrepo.Status.LastTag()
- for _, repo := range me.repos.View.AllRepos() {
- if whitelist(repo.GoPath()) {
- continue
- }
- if repo.ReadOnly() {
- continue
- }
- if strings.HasPrefix(repo.GoPath(), "go.wit.com/dev") {
- continue
- }
- if strings.HasPrefix(repo.GoPath(), "go.wit.com/widget") {
- // widget I versioned early before I knew what the hell this would mean and can
- // not be down versioned because that's not how GO versioning works. Once you
- // set the version for a path, it's set in stone forever. (smart system!)
- // we could rename go.wit.com/widget to go.wit.com/newwidget and restart the versioning
- // system, but that's rediculous and this servers to always remind me to never make this mistake again
- repo.Status.IncrementRevisionVersion("trying minor")
- continue
+ if newversion == targetv {
+ log.Info(repo.GoPath(), "targetv has been increased already to", targetv)
+ continue
+ }
+
+ if masterv != targetv {
+ log.Info(repo.GoPath(), "master and target differ", masterv, targetv)
+ repo.Status.IncrementVersion()
+ newversion := repo.Status.GetNewVersionTag()
+ repo.Status.SetTargetVersion("v" + newversion)
+ // already incremented
+ continue
+ }
}
- if releasev == repo.Status.LastTag() {
- log.Info("skipping already released repo", repo.Status.GoPath())
- repo.Status.SetTargetVersion(releasev)
- continue
+ if findNext() {
+ log.Info("findNext() found a repo")
}
- // repo.Status.SetVersion("0", "22", "0", "trying increment minor")
- repo.Status.IncrementMinorVersion("trying minor")
- }
- })
- grid.NewButton("increment changed repos", func() {
- me.Disable()
- for _, repo := range me.repos.View.AllRepos() {
- if whitelist(repo.GoPath()) {
- continue
+ incrementTags.SetText("maybe ready?")
+ me.Enable()
+ })
+ grid.NewButton("increment minor version", func() {
+ // this is messy still. if the release process fails, it needs to continue
+ // for now, use the "go.wit.com/log" release minor number as the official
+ // release. If it hasn't been updated yet, then start there
+ logrepo := me.repos.View.FindRepo("go.wit.com/log")
+ if logrepo == nil {
+ log.Info("couldn't find go.wit.com/log")
+ return
}
- if repo.ReadOnly() {
- continue
+ releasev := logrepo.Status.LastTag()
+ for _, repo := range me.repos.View.AllRepos() {
+ if whitelist(repo.GoPath()) {
+ continue
+ }
+ if repo.ReadOnly() {
+ continue
+ }
+ if strings.HasPrefix(repo.GoPath(), "go.wit.com/dev") {
+ continue
+ }
+ if strings.HasPrefix(repo.GoPath(), "go.wit.com/widget") {
+ // widget I versioned early before I knew what the hell this would mean and can
+ // not be down versioned because that's not how GO versioning works. Once you
+ // set the version for a path, it's set in stone forever. (smart system!)
+ // we could rename go.wit.com/widget to go.wit.com/newwidget and restart the versioning
+ // system, but that's rediculous and this servers to always remind me to never make this mistake again
+ repo.Status.IncrementRevisionVersion("trying minor")
+ continue
+ }
+ if releasev == repo.Status.LastTag() {
+ log.Info("skipping already released repo", repo.Status.GoPath())
+ repo.Status.SetTargetVersion(releasev)
+ continue
+ }
+ // repo.Status.SetVersion("0", "22", "0", "trying increment minor")
+ repo.Status.IncrementMinorVersion("trying minor")
}
- lasttag := repo.Status.LastTag()
- if repo.Status.GetCurrentVersion() == lasttag {
- log.Info("skipping unchanged repo", repo.Status.GoPath())
- repo.Status.SetTargetVersion(lasttag)
- continue
+ })
+ grid.NewButton("increment changed repos", func() {
+ me.Disable()
+ for _, repo := range me.repos.View.AllRepos() {
+ if whitelist(repo.GoPath()) {
+ continue
+ }
+ if repo.ReadOnly() {
+ continue
+ }
+ lasttag := repo.Status.LastTag()
+ if repo.Status.GetCurrentVersion() == lasttag {
+ log.Info("skipping unchanged repo", repo.Status.GoPath())
+ repo.Status.SetTargetVersion(lasttag)
+ continue
+ }
+ repo.Status.IncrementRevisionVersion("go-clone")
}
- repo.Status.IncrementRevisionVersion("go-clone")
- }
- me.repos.View.ScanRepositories()
- me.Enable()
- })
+ me.repos.View.ScanRepositories()
+ me.Enable()
+ })
+ */
grid.NextRow()
- group2 := vbox.NewGroup("Debugger")
- dbggrid := group2.NewGrid("gdb", 0, 0)
- dbggrid.NewButton("logging Window", func() {
- logsettings.LogWindow()
- })
- dbggrid.NextRow()
+ /*
+ group2 := vbox.NewGroup("Debugger")
+ dbggrid := group2.NewGrid("gdb", 0, 0)
+ dbggrid.NewButton("logging Window", func() {
+ logsettings.LogWindow()
+ })
+ dbggrid.NextRow()
- dbggrid.NewButton("Debugger Window", func() {
- debugger.DebugWindow()
- })
+ dbggrid.NewButton("Debugger Window", func() {
+ debugger.DebugWindow()
+ })
+ */
}
+/*
func hidePerfect() {
for _, repo := range me.repos.View.AllRepos() {
if repo.State() == "PERFECT" {
@@ -231,3 +250,4 @@ func hidePerfect() {
}
}
}
+*/