fixing the release process

This commit is contained in:
Jeff Carr 2024-02-18 07:24:56 -06:00
parent 754371fdbf
commit 697696d3df
5 changed files with 145 additions and 32 deletions

View File

@ -25,7 +25,7 @@ build:
echo "build it!"
-rm resources/*.so
cp -a ~/go/src/go.wit.com/toolkits/*.so resources/
go build -v -x
GO111MODULE=off go build -v -x
install:
rm -f ~/go/src/go.wit.com/toolkits/*.so

View File

@ -83,7 +83,9 @@ func globalDisplayOptions(vbox *gui.Node) {
}
scanbox.NewButton("scan now", func() {
log.Info("re-scanning repos now")
me.repos.View.ScanRepositories()
i, s := me.repos.View.ScanRepositories()
log.Info("re-scanning repos done", i, s)
me.duration.SetText(s)
})
me.duration = scanbox.NewLabel("")

70
initRepoList.go Normal file
View File

@ -0,0 +1,70 @@
package main
// this initializes the repos
import (
"io/ioutil"
"os"
"os/user"
"path/filepath"
"strings"
"go.wit.com/lib/gui/repolist"
"go.wit.com/lib/gui/repostatus"
"go.wit.com/log"
)
func (r *repoWindow) initRepoList() {
usr, _ := user.Current()
repos := parsecfg("~/.config/autotypist")
for _, line := range repos {
log.Verbose("repo =", line)
path, mbranch, dbranch, ubranch := splitLine(line)
if mbranch == "" {
mbranch = "master"
}
if dbranch == "" {
dbranch = "devel"
}
if ubranch == "" {
ubranch = usr.Username
}
r.View.AddRepo(path, mbranch, dbranch, ubranch)
}
if args.OnlyMe {
log.Info("not scanning everything")
} else {
log.Info("scanning everything in ~/go/src")
for i, path := range repostatus.ListGitDirectories() {
// log.Info("addRepo()", i, path)
path = strings.TrimPrefix(path, me.goSrcPwd.String())
path = strings.Trim(path, "/")
log.Info("addRepo()", i, path)
r.View.AddRepo(path, "master", "devel", usr.Username)
}
}
}
func parsecfg(f string) []string {
homeDir, _ := os.UserHomeDir()
cfgfile := filepath.Join(homeDir, f)
content, _ := ioutil.ReadFile(cfgfile)
out := string(content)
out = strings.TrimSpace(out)
lines := strings.Split(out, "\n")
return lines
}
// returns path, master branch name, devel branch name, user branch name
func splitLine(line string) (string, string, string, string) {
var path, master, devel, user string
parts := strings.Split(line, " ")
path, parts = repolist.RemoveFirstElement(parts)
master, parts = repolist.RemoveFirstElement(parts)
devel, parts = repolist.RemoveFirstElement(parts)
user, parts = repolist.RemoveFirstElement(parts)
// path, master, devel, user := strings.Split(line, " ")
return path, master, devel, user
}

34
main.go
View File

@ -2,11 +2,8 @@ package main
import (
"embed"
"os/user"
"strings"
"go.wit.com/lib/debugger"
"go.wit.com/lib/gui/repostatus"
"go.wit.com/log"
"go.wit.com/gui"
@ -42,29 +39,26 @@ func main() {
me.repos = makeRepoView()
usr, _ := user.Current()
if args.OnlyMe {
log.Info("not scanning everything")
} else {
log.Info("scanning everything in ~/go/src")
for i, path := range repostatus.ListGitDirectories() {
// log.Info("addRepo()", i, path)
path = strings.TrimPrefix(path, me.goSrcPwd.String())
path = strings.Trim(path, "/")
log.Info("addRepo()", i, path)
me.repos.View.AddRepo(path, "master", "devel", usr.Username)
}
}
// 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()
// process everything on the command line
// may exit here
handleCmdLine()
me.repos.View.ScanRepositories()
me.Enable()
// processing is done. update the repo summary box
me.summary.Update()
me.Enable()
// intermittently scans the status indefinitly
me.repos.View.Watchdog()
me.repos.View.Watchdog(func() {
log.Info("In main()")
// processing is done. update the repo summary box
me.summary.Update()
})
}

View File

@ -27,19 +27,25 @@ type patchSummary struct {
gitPullB *gui.Node
checkB *gui.Node
totalOL *gadgets.OneLiner
totalGoOL *gadgets.OneLiner
dirtyOL *gadgets.OneLiner
readonlyOL *gadgets.OneLiner
totalPatchesOL *gadgets.OneLiner
// stats
totalOL *gadgets.OneLiner
totalGoOL *gadgets.OneLiner
dirtyOL *gadgets.OneLiner
readonlyOL *gadgets.OneLiner
totalPatchesOL *gadgets.OneLiner
totalUserRepos *gui.Node
totalDevelRepos *gui.Node
totalMasterRepos *gui.Node
totalUserPatches *gui.Node
totalDevelPatches *gui.Node
totalMasterPatches *gui.Node
// patch set generation
unknownOL *gadgets.OneLiner
unknownSubmitB *gui.Node
reason *gadgets.BasicEntry
submitB *gui.Node
allp []*patch
reason *gadgets.BasicEntry
submitB *gui.Node
allp []*patch
}
func submitPatchesBox(box *gui.Node) *patchSummary {
@ -156,10 +162,21 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
s.unknownSubmitB.Hide()
s.grid.NextRow()
s.grid = group1.RawGrid()
s.grid.NewLabel("")
s.grid.NewLabel("")
s.grid.NewLabel("user to devel")
s.grid.NewLabel("devel to master")
s.grid.NewLabel("master to last tag")
s.grid.NextRow()
s.totalOL = gadgets.NewOneLiner(s.grid, "Total")
s.grid.NextRow()
s.totalGoOL = gadgets.NewOneLiner(s.grid, "Total GO")
s.totalUserRepos = s.grid.NewLabel("5 go repos")
s.totalDevelRepos = s.grid.NewLabel("3 go repos")
s.totalMasterRepos = s.grid.NewLabel("8 go repos")
s.grid.NextRow()
s.dirtyOL = gadgets.NewOneLiner(s.grid, "dirty")
@ -169,8 +186,19 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
s.grid.NextRow()
s.totalPatchesOL = gadgets.NewOneLiner(s.grid, "total commits")
s.totalUserPatches = s.grid.NewLabel("5 patches")
s.totalDevelPatches = s.grid.NewLabel("3 patches")
s.totalMasterPatches = s.grid.NewLabel("8 patches")
s.grid.NextRow()
s.grid.NewLabel("")
s.grid.NewLabel("")
s.grid.NewButton("merge from user", func() {})
s.grid.NewButton("merge from devel", func() {})
s.grid.NextRow()
group1 = box.NewGroup("Create GUI Patch Set")
s.grid = group1.RawGrid()
s.reason = gadgets.NewBasicEntry(s.grid, "patch name:")
s.reason.Custom = func() {
if s.reason.String() != "" {
@ -203,6 +231,8 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
func (s *patchSummary) Update() {
var total, totalgo, dirty, readonly int
var userT, develT, masterT int
// var userP, develP, masterP int
for _, repo := range repolist.AllRepos() {
total += 1
if repo.Status.IsDirty() {
@ -219,12 +249,29 @@ func (s *patchSummary) Update() {
if repo.Status.IsGoLang() {
totalgo += 1
}
userV := repo.Status.GetUserVersion()
develV := repo.Status.GetDevelVersion()
masterV := repo.Status.GetMasterVersion()
lastV := repo.Status.GetLastTagVersion()
if userV != develV {
userT += 1
}
if develV != masterV {
develT += 1
}
if masterV != lastV {
masterT += 1
}
}
s.totalOL.SetText(strconv.Itoa(total) + " repos")
s.totalGoOL.SetText(strconv.Itoa(totalgo) + " repos")
s.dirtyOL.SetText(strconv.Itoa(dirty) + " repos")
s.readonlyOL.SetText(strconv.Itoa(readonly) + " repos")
s.totalUserRepos.SetText(strconv.Itoa(userT) + " repos")
s.totalDevelRepos.SetText(strconv.Itoa(develT) + " repos")
s.totalMasterRepos.SetText(strconv.Itoa(masterT) + " repos")
/* move all this to repolist and gowit repos
p, allp := s.GetPatches()
if s.allp == nil {