store target version in the repolist

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-02-02 00:02:53 -06:00
parent b83d92f7b4
commit 504cd29dcb
4 changed files with 36 additions and 31 deletions

View File

@ -32,6 +32,12 @@ func main() {
for _, repo := range me.allrepos {
repo.status.UpdateCurrent()
repo.newScan()
if repo.String() == "go.wit.com/widget" {
repo.targetVersion.SetText("v" + "1.1.14")
} else {
repo.targetVersion.SetText("v" + "0.19.1")
}
}
log.Info("Creating the Release Window")

View File

@ -25,8 +25,8 @@ type releaseStruct struct {
readOnly *gadgets.OneLiner
notes *gadgets.OneLiner
version *gadgets.OneLiner
versionS string
widgetVersionS string
// versionS string
// widgetVersionS string
releaseVersionB *gui.Node
unreleaseB *gui.Node
reason *gadgets.BasicEntry
@ -60,9 +60,7 @@ func (w *autoType) Enable() {
}
func createReleaseBox(box *gui.Node) {
release.versionS = "0.19.0"
release.widgetVersionS = "1.1.13"
release.reasonS = "gocui checkboxes"
release.reasonS = "gocui dropdown"
initWhitelist()
@ -81,12 +79,15 @@ func createReleaseBox(box *gui.Node) {
})
release.grid.NewButton("findNextDirty()", func() {
me.Disable()
if findNextDirty() {
defer me.Enable()
if findNextDirty("PRIMATIVE") {
log.Info("findNextDirty() found a repo")
return
}
if findNextDirty("") {
log.Info("findNextDirty() found a repo")
me.Enable()
return
}
me.Enable()
})
release.releaseVersionB = release.grid.NewButton("release version", func() {
buttonDisable()
@ -389,15 +390,9 @@ func setCurrentRepo(newcur *repo, s string, note string) bool {
release.status.SetValue(s)
release.notes.SetValue(note)
release.current = newcur
if newcur.String() == "go.wit.com/widget" {
release.version.SetText("v" + release.widgetVersionS)
release.releaseVersionB.SetText("release version v" + release.widgetVersionS)
release.unreleaseB.SetText("un-release version v" + release.widgetVersionS)
} else {
release.version.SetText("v" + release.versionS)
release.releaseVersionB.SetText("release version v" + release.versionS)
release.unreleaseB.SetText("un-release version v" + release.versionS)
}
release.version.SetText(release.current.targetVersion.String())
release.releaseVersionB.SetText("release version" + release.current.targetVersion.String())
release.unreleaseB.SetText("un-release version" + release.current.targetVersion.String())
release.openrepo.Enable()
/*
@ -415,6 +410,7 @@ func scanForReady() bool {
goSumS := repo.getGoSumStatus()
dirtyS := repo.dirtyLabel.String()
log.Info("findNextDirty()", repo.String(), goSumS, dirtyS)
if whitelist(repo.String()) {
log.Info("found WHITELIST", repo.String())
repo.setGoSumStatus("WHITELIST")
@ -429,7 +425,7 @@ func scanForReady() bool {
return true
}
func findNextDirty() bool {
func findNextDirty(onlyKind string) bool {
for _, repo := range me.allrepos {
goSumS := repo.getGoSumStatus()
dirtyS := repo.dirtyLabel.String()
@ -444,6 +440,10 @@ func findNextDirty() bool {
}
}
continue
} else {
if onlyKind == "PRIMATIVE" {
continue
}
}
if goSumS == "IGNORE" {
continue

View File

@ -82,12 +82,13 @@ func repoworld() {
}
reposgroup = reposbox.NewGroup("go repositories (read from ~/.config/myrepolist)")
reposgrid = reposgroup.NewGrid("test", 6, 1)
reposgrid = reposgroup.NewGrid("test", 7, 1)
reposgrid.NewLabel("") // path goes here
reposgrid.NewLabel("last tag").SetProgName("last tag")
reposgrid.NewLabel("Current Version").SetProgName("Current Version")
reposgrid.NewLabel("last tag")
reposgrid.NewLabel("Current Ver")
reposgrid.NewLabel("Target Ver")
reposgrid.NewLabel("Status")
reposgrid.NewLabel("go.sum")
@ -144,10 +145,11 @@ func addRepo(grid *gui.Node, path string, master string, devel string, user stri
}
newRepo.path = path
newRepo.pLabel = grid.NewLabel(path).SetProgName("path")
newRepo.pLabel = grid.NewLabel(path)
newRepo.lastTag = grid.NewLabel("").SetProgName("lastTag")
newRepo.vLabel = grid.NewLabel("").SetProgName("current")
newRepo.lastTag = grid.NewLabel("")
newRepo.vLabel = grid.NewLabel("")
newRepo.targetVersion = grid.NewLabel("")
newRepo.dirtyLabel = grid.NewLabel("")
newRepo.goSumStatus = grid.NewLabel("?")

View File

@ -86,19 +86,16 @@ type repo struct {
lasttagrev string
lasttag string
// what version to release this package as
targetVersionS string
pLabel *gui.Node // path label
// bLabel *gui.Node // branch label
lastTag *gui.Node // last tagged version label
vLabel *gui.Node // version label
dirtyLabel *gui.Node // git state (dirty or not?)
goSumStatus *gui.Node // what is the state of the go.sum file
// masterName *gui.Node // the master branch name
// masterVersion *gui.Node // the master branch version
// develName *gui.Node // the devel branch name
// develVersion *gui.Node // the devel branch version
// userName *gui.Node // the jcarr branch name
// userVersion *gui.Node // the jcarr branch version
targetVersion *gui.Node // the final repo release version
statusButton *gui.Node // opens up the status window