From 7ccbf7f59d389013639264c8a5b541b53ecb2627 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 7 Jan 2025 06:46:55 -0600 Subject: [PATCH] say goodbye finally --- hideFunction.go | 8 ++----- http.go | 53 ----------------------------------------------- main.go | 38 ++++++++++++++++++--------------- prepareRelease.go | 18 +++++++++------- releaseBox.go | 10 +++++---- 5 files changed, 39 insertions(+), 88 deletions(-) diff --git a/hideFunction.go b/hideFunction.go index 65d04bd..2bcc383 100644 --- a/hideFunction.go +++ b/hideFunction.go @@ -1,12 +1,7 @@ package main -import ( - "os" - - "go.wit.com/lib/gui/repolist" -) - // like tcl/tk, use ENV variables to set display preferences +/* func hideFunction(r *repolist.RepoRow) { // always show dirty repos if r.Status.IsDirty() { @@ -40,3 +35,4 @@ func hideFunction(r *repolist.RepoRow) { // as read-only=true r.Show() } +*/ diff --git a/http.go b/http.go index a54ec27..9717d88 100644 --- a/http.go +++ b/http.go @@ -77,7 +77,6 @@ func okHandler(w http.ResponseWriter, r *http.Request) { case "/rescanAll": me.repos.View.ScanRepositories() case "/setCurrentRepo": - log.Info("repo: " + repoName) log.Info("version: " + version) log.Info("comment: " + comment) @@ -89,59 +88,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) { } setCurrentRepo(repo, "HTTP", "doRelease() ?") - case "/IncrementRevisonVersion": - log.Info("repo: " + repoName) - log.Info("version: " + version) - me.current.IncrementTargetRevision() - case "/IncrementMinorVersion": - log.Info("repo: " + repoName) - log.Info("version: " + version) - - me.current.IncrementTargetMinor() - case "/setAllBranchesToMaster": - log.Info("set all branches to master") - me.Disable() - defer me.Enable() - if setAllBranchesToMaster() { - // if it succeeds, disable this button - me.setBranchesToMasterB.Disable() - } return - case "/setTargetVersion": - log.Info("repo: " + repoName) - log.Info("version: " + version) - if repoName != "" { - repo := me.repos.View.FindByName(repoName) - if repo == nil { - log.Info("could not find repo", repoName) - } else { - log.Info("setting target version", version) - repo.Status.SetTargetVersion(version) - } - return - } - - if me.current == nil { - log.Info("me.current == nil") - return - } - me.current.SetTargetVersion(version) - return - case "/setAllTargetVersions": - log.Info("version: " + version) - - 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") - } - } case "/whitelist": repo := me.repos.View.FindByName(repoName) if repo == nil { diff --git a/main.go b/main.go index d990c69..b9ffe3d 100644 --- a/main.go +++ b/main.go @@ -29,21 +29,23 @@ func main() { me.forge = forgepb.Init() me.found = new(gitpb.Repos) - var bad bool = false - all := me.forge.Repos.SortByFullPath() - for all.Scan() { - repo := all.Next() - if repo.IsDevelBranch() { - continue + /* + var bad bool = false + all := me.forge.Repos.SortByFullPath() + for all.Scan() { + repo := all.Next() + if repo.IsDevelBranch() { + continue + } + log.Info("not on devel branch:", repo.GetCurrentBranchName(), repo.GetDevelBranchName()) + log.Info("not on devel branch:", repo.GetFullPath()) + log.Info("you can not continue if repos are not on devel branches") + bad = true } - log.Info("not on devel branch:", repo.GetCurrentBranchName(), repo.GetDevelBranchName()) - log.Info("not on devel branch:", repo.GetFullPath()) - log.Info("you can not continue if repos are not on devel branches") - bad = true - } - if bad { - os.Exit(-1) - } + if bad { + os.Exit(-1) + } + */ // me.forge.ConfigPrintTable() os.Setenv("REPO_WORK_PATH", me.forge.GetGoSrc()) @@ -109,7 +111,7 @@ func main() { me.Disable() // register a Show/Hide function for the repo list table - me.repos.View.RegisterHideFunction(hideFunction) + // me.repos.View.RegisterHideFunction(hideFunction) // scan in the State of all the repos // TODO: should not really be necessary directly after init() @@ -124,9 +126,9 @@ func main() { repo.Status.SetReadOnly(false) } if me.forge.Config.IsPrivate(repo.GetGoPath()) { - repo.Status.SetPrivate(true) + // repo.Status.SetPrivate(true) } else { - repo.Status.SetPrivate(false) + // repo.Status.SetPrivate(false) } } @@ -151,6 +153,7 @@ func main() { }) } +/* // start the initail scan and make sure each repo is set // to the master branch func setAllBranchesToMaster() bool { @@ -177,3 +180,4 @@ func setAllBranchesToMaster() bool { } return worked } +*/ diff --git a/prepareRelease.go b/prepareRelease.go index 469fa3e..a2ca20c 100644 --- a/prepareRelease.go +++ b/prepareRelease.go @@ -14,14 +14,16 @@ func makePrepareRelease() { me.release.box.Disable() defer me.Enable() - if setAllBranchesToMaster() { - // if it succeeds, disable this button - me.setBranchesToMasterB.Disable() - me.release.box.Enable() - me.forge.PrintReleaseReport(me.found) - } else { - log.Info("setAllBranchesToMaster() failed") - } + /* + if setAllBranchesToMaster() { + // if it succeeds, disable this button + me.setBranchesToMasterB.Disable() + me.release.box.Enable() + me.forge.PrintReleaseReport(me.found) + } else { + log.Info("setAllBranchesToMaster() failed") + } + */ // run this each time something gets published successfully rePrepareRelease() diff --git a/releaseBox.go b/releaseBox.go index 67ac284..87deb62 100644 --- a/releaseBox.go +++ b/releaseBox.go @@ -188,10 +188,12 @@ func createReleaseBox(box *gui.Node) { me.setBranchesToMasterB = grid.NewButton("set all branches to master", func() { me.Disable() defer me.Enable() - if setAllBranchesToMaster() { - // if it succeeds, disable this button - me.setBranchesToMasterB.Disable() - } + /* + if setAllBranchesToMaster() { + // if it succeeds, disable this button + me.setBranchesToMasterB.Disable() + } + */ }) grid.NextRow() }