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 { for _, repo := range me.allrepos {
repo.status.UpdateCurrent() repo.status.UpdateCurrent()
repo.newScan() 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") log.Info("Creating the Release Window")

View File

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

View File

@ -82,12 +82,13 @@ func repoworld() {
} }
reposgroup = reposbox.NewGroup("go repositories (read from ~/.config/myrepolist)") 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("") // path goes here
reposgrid.NewLabel("last tag").SetProgName("last tag") reposgrid.NewLabel("last tag")
reposgrid.NewLabel("Current Version").SetProgName("Current Version") reposgrid.NewLabel("Current Ver")
reposgrid.NewLabel("Target Ver")
reposgrid.NewLabel("Status") reposgrid.NewLabel("Status")
reposgrid.NewLabel("go.sum") 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.path = path
newRepo.pLabel = grid.NewLabel(path).SetProgName("path") newRepo.pLabel = grid.NewLabel(path)
newRepo.lastTag = grid.NewLabel("").SetProgName("lastTag") newRepo.lastTag = grid.NewLabel("")
newRepo.vLabel = grid.NewLabel("").SetProgName("current") newRepo.vLabel = grid.NewLabel("")
newRepo.targetVersion = grid.NewLabel("")
newRepo.dirtyLabel = grid.NewLabel("") newRepo.dirtyLabel = grid.NewLabel("")
newRepo.goSumStatus = grid.NewLabel("?") newRepo.goSumStatus = grid.NewLabel("?")

View File

@ -86,19 +86,16 @@ type repo struct {
lasttagrev string lasttagrev string
lasttag string lasttag string
// what version to release this package as
targetVersionS string
pLabel *gui.Node // path label pLabel *gui.Node // path label
// bLabel *gui.Node // branch label // bLabel *gui.Node // branch label
lastTag *gui.Node // last tagged version label lastTag *gui.Node // last tagged version label
vLabel *gui.Node // version label vLabel *gui.Node // version label
dirtyLabel *gui.Node // git state (dirty or not?) dirtyLabel *gui.Node // git state (dirty or not?)
goSumStatus *gui.Node // what is the state of the go.sum file goSumStatus *gui.Node // what is the state of the go.sum file
targetVersion *gui.Node // the final repo release version
// 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
statusButton *gui.Node // opens up the status window statusButton *gui.Node // opens up the status window