more things moved to gitpb
This commit is contained in:
parent
9e297f4603
commit
4e0a111c8c
22
doRelease.go
22
doRelease.go
|
@ -16,7 +16,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func doRelease() bool {
|
func doRelease() bool {
|
||||||
log.Info("doRelease() on", me.current.Name())
|
log.Info("doRelease() on", me.current.GetGoPath())
|
||||||
if !findOk {
|
if !findOk {
|
||||||
log.Info("doRelease() immediately end something went wrong last time. findOk == false")
|
log.Info("doRelease() immediately end something went wrong last time. findOk == false")
|
||||||
return false
|
return false
|
||||||
|
@ -41,8 +41,8 @@ func doRelease() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
curName := me.current.Status.GetCurrentBranchName()
|
curName := me.current.GetCurrentBranchName()
|
||||||
mName := me.current.Status.GetMasterBranchName()
|
mName := me.current.GetMasterBranchName()
|
||||||
if curName != mName {
|
if curName != mName {
|
||||||
log.Info("\trepo is not working from main branch", curName, "!=", mName)
|
log.Info("\trepo is not working from main branch", curName, "!=", mName)
|
||||||
return false
|
return false
|
||||||
|
@ -122,7 +122,7 @@ func doRelease() bool {
|
||||||
badExit(errors.New(msg))
|
badExit(errors.New(msg))
|
||||||
}
|
}
|
||||||
|
|
||||||
if !me.current.Status.DoAll(all) {
|
if !me.current.RunAll(all) {
|
||||||
log.Info("failed to make new release", me.release.version.String())
|
log.Info("failed to make new release", me.release.version.String())
|
||||||
findOk = false
|
findOk = false
|
||||||
return false
|
return false
|
||||||
|
@ -159,7 +159,7 @@ func doRelease() bool {
|
||||||
|
|
||||||
// unwind and re-tag. Now that the go.mod and go.sum are published, revert
|
// unwind and re-tag. Now that the go.mod and go.sum are published, revert
|
||||||
// to the development branch
|
// to the development branch
|
||||||
if !me.current.Status.RevertMasterToDevel() {
|
if !me.current.RevertMasterToDevel() {
|
||||||
log.Info("Revert Failed")
|
log.Info("Revert Failed")
|
||||||
findOk = false
|
findOk = false
|
||||||
return false
|
return false
|
||||||
|
@ -179,12 +179,12 @@ func doRelease() bool {
|
||||||
check.Run(cmd)
|
check.Run(cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !me.current.Status.DoAll(retag) {
|
if !me.current.RunAll(retag) {
|
||||||
log.Info("retag failed")
|
log.Info("retag failed")
|
||||||
findOk = false
|
findOk = false
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
log.Info("EVERYTHING OK. RERELEASED", me.current.Name())
|
log.Info("EVERYTHING OK. RERELEASED", me.current.GetGoPath())
|
||||||
|
|
||||||
// save autogen files under the tag version (for example: "v0.2.3")
|
// save autogen files under the tag version (for example: "v0.2.3")
|
||||||
newtag := me.release.version.String()
|
newtag := me.release.version.String()
|
||||||
|
@ -200,7 +200,9 @@ func doRelease() bool {
|
||||||
me.forge = forgepb.Init()
|
me.forge = forgepb.Init()
|
||||||
|
|
||||||
// update the values in the GUI
|
// update the values in the GUI
|
||||||
me.current.NewScan()
|
if repov := me.repos.View.FindByPath(check.GetGoPath()); repov != nil {
|
||||||
|
repov.NewScan2(check)
|
||||||
|
}
|
||||||
|
|
||||||
// attempt to find another repo to release
|
// attempt to find another repo to release
|
||||||
if !doReleaseFindNext() {
|
if !doReleaseFindNext() {
|
||||||
|
@ -211,7 +213,7 @@ func doRelease() bool {
|
||||||
os.Setenv("FindNextDone", "true")
|
os.Setenv("FindNextDone", "true")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
log.Info("GOOD TO RUN ANOTHER DAY ON:", me.current.Name())
|
log.Info("GOOD TO RUN ANOTHER DAY ON:", me.current.GetGoPath())
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,7 +254,7 @@ func doPublishVersion() bool {
|
||||||
docmd := []string{"go", "get", "-v", gopath + "@" + me.release.version.String()}
|
docmd := []string{"go", "get", "-v", gopath + "@" + me.release.version.String()}
|
||||||
log.Info("SHOULD RUN cmd HERE:", docmd)
|
log.Info("SHOULD RUN cmd HERE:", docmd)
|
||||||
|
|
||||||
if me.current.Status.IsPrivate() {
|
if me.forge.Config.IsPrivate(me.current.GetGoPath()) {
|
||||||
// do not self update private repos
|
// do not self update private repos
|
||||||
log.Info("This is a private repo and can not be self checked")
|
log.Info("This is a private repo and can not be self checked")
|
||||||
return true
|
return true
|
||||||
|
|
28
findNext.go
28
findNext.go
|
@ -6,7 +6,6 @@ import (
|
||||||
|
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
|
|
||||||
"go.wit.com/lib/gui/repolist"
|
|
||||||
"go.wit.com/lib/protobuf/gitpb"
|
"go.wit.com/lib/protobuf/gitpb"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -19,14 +18,13 @@ var findOk bool = true
|
||||||
// rename this findNext()
|
// rename this findNext()
|
||||||
func findNext() bool {
|
func findNext() bool {
|
||||||
findCounter = 0
|
findCounter = 0
|
||||||
loop := me.repos.View.ReposSortByName()
|
all := me.forge.Repos.SortByFullPath()
|
||||||
for loop.Scan() {
|
for all.Scan() {
|
||||||
repo := loop.Repo()
|
check := all.Next()
|
||||||
|
|
||||||
check := me.forge.FindByGoPath(repo.GetGoPath())
|
if check.GetTargetVersion() == "" {
|
||||||
if check == nil {
|
// not set to upgrade
|
||||||
log.Info("boo, you didn't git clone", repo.GetGoPath())
|
continue
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
if check.GetLastTag() == check.GetTargetVersion() {
|
if check.GetLastTag() == check.GetTargetVersion() {
|
||||||
// log.Info("findNext() no update needed", check.GetGoPath, check.GetTargetVersion(), "vs", check.GetCurrentBranchVersion())
|
// log.Info("findNext() no update needed", check.GetGoPath, check.GetTargetVersion(), "vs", check.GetCurrentBranchVersion())
|
||||||
|
@ -73,7 +71,7 @@ func findNext() bool {
|
||||||
log.Info("go.mod is gone here")
|
log.Info("go.mod is gone here")
|
||||||
}
|
}
|
||||||
if me.forge.FinalGoDepsCheckOk(check) {
|
if me.forge.FinalGoDepsCheckOk(check) {
|
||||||
setCurrentRepo(repo, "should be good to release", "pretty sure")
|
setCurrentRepo(check, "should be good to release", "pretty sure")
|
||||||
if check.Exists("go.mod") {
|
if check.Exists("go.mod") {
|
||||||
log.Info("go.mod exists here")
|
log.Info("go.mod exists here")
|
||||||
} else {
|
} else {
|
||||||
|
@ -86,7 +84,7 @@ func findNext() bool {
|
||||||
} else {
|
} else {
|
||||||
log.Info("go.mod is gone here")
|
log.Info("go.mod is gone here")
|
||||||
}
|
}
|
||||||
log.Info("findNext() got to the end. repo", repo.GetGoPath(), "did not work. trying to find a new one now")
|
log.Info("findNext() got to the end. repo", check.GetGoPath(), "did not work. trying to find a new one now")
|
||||||
}
|
}
|
||||||
if findCounter == 0 {
|
if findCounter == 0 {
|
||||||
log.Info("NOTHING TO UPDATE. findCounter =", findCounter)
|
log.Info("NOTHING TO UPDATE. findCounter =", findCounter)
|
||||||
|
@ -166,17 +164,11 @@ func fixGodeps(check *gitpb.Repo) bool {
|
||||||
return good
|
return good
|
||||||
}
|
}
|
||||||
|
|
||||||
func setCurrentRepo(repo *repolist.RepoRow, s string, note string) bool {
|
func setCurrentRepo(check *gitpb.Repo, s string, note string) bool {
|
||||||
check := me.forge.FindByGoPath(repo.GetGoPath())
|
|
||||||
if check == nil {
|
|
||||||
log.Info("boo, you didn't git clone", repo.GetGoPath())
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
me.release.repo.SetText(check.GetGoPath())
|
me.release.repo.SetText(check.GetGoPath())
|
||||||
me.release.status.SetText(s)
|
me.release.status.SetText(s)
|
||||||
me.release.notes.SetText(note)
|
me.release.notes.SetText(note)
|
||||||
me.current = repo
|
me.current = check
|
||||||
me.release.version.SetText(check.GetTargetVersion())
|
me.release.version.SetText(check.GetTargetVersion())
|
||||||
me.release.releaseVersionB.SetText("release version " + check.GetTargetVersion())
|
me.release.releaseVersionB.SetText("release version " + check.GetTargetVersion())
|
||||||
me.release.openrepo.Enable()
|
me.release.openrepo.Enable()
|
||||||
|
|
26
http.go
26
http.go
|
@ -75,8 +75,8 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Info(me.current.StandardHeader())
|
// log.Info(me.current.StandardHeader())
|
||||||
log.Info(me.current.StandardReleaseHeader())
|
log.Info(me.forge.StandardReleaseHeader(me.current, "todoing"))
|
||||||
case "/rescanAll":
|
case "/rescanAll":
|
||||||
me.repos.View.ScanRepositories()
|
me.repos.View.ScanRepositories()
|
||||||
case "/setCurrentRepo":
|
case "/setCurrentRepo":
|
||||||
|
@ -85,7 +85,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
log.Info("version: " + version)
|
log.Info("version: " + version)
|
||||||
log.Info("comment: " + comment)
|
log.Info("comment: " + comment)
|
||||||
|
|
||||||
repo := me.repos.View.FindByName(repoName)
|
repo := me.forge.FindByGoPath(repoName)
|
||||||
if repo == nil {
|
if repo == nil {
|
||||||
log.Info("FindRepoByName() returned nil")
|
log.Info("FindRepoByName() returned nil")
|
||||||
return
|
return
|
||||||
|
@ -95,12 +95,12 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
case "/IncrementRevisonVersion":
|
case "/IncrementRevisonVersion":
|
||||||
log.Info("repo: " + repoName)
|
log.Info("repo: " + repoName)
|
||||||
log.Info("version: " + version)
|
log.Info("version: " + version)
|
||||||
me.current.Status.IncrementRevisionVersion(comment)
|
me.current.IncrementTargetRevision()
|
||||||
case "/IncrementMinorVersion":
|
case "/IncrementMinorVersion":
|
||||||
log.Info("repo: " + repoName)
|
log.Info("repo: " + repoName)
|
||||||
log.Info("version: " + version)
|
log.Info("version: " + version)
|
||||||
|
|
||||||
me.current.Status.IncrementMinorVersion("trying minor")
|
me.current.IncrementTargetMinor()
|
||||||
case "/setAllBranchesToMaster":
|
case "/setAllBranchesToMaster":
|
||||||
log.Info("set all branches to master")
|
log.Info("set all branches to master")
|
||||||
me.Disable()
|
me.Disable()
|
||||||
|
@ -128,7 +128,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
log.Info("me.current == nil")
|
log.Info("me.current == nil")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
me.current.Status.SetTargetVersion(version)
|
me.current.SetTargetVersion(version)
|
||||||
return
|
return
|
||||||
case "/setAllTargetVersions":
|
case "/setAllTargetVersions":
|
||||||
log.Info("version: " + version)
|
log.Info("version: " + version)
|
||||||
|
@ -263,7 +263,10 @@ func showNext() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if me.current.Status.IsReleased() {
|
if me.current.GetTargetVersion() == "" {
|
||||||
|
log.Info("TargetVersion == blank")
|
||||||
|
}
|
||||||
|
if me.current.GetTargetVersion() == me.current.GetCurrentVersion() {
|
||||||
log.Info("IsReleased() == true. do not release this a second time")
|
log.Info("IsReleased() == true. do not release this a second time")
|
||||||
} else {
|
} else {
|
||||||
log.Info("IsReleased() == false")
|
log.Info("IsReleased() == false")
|
||||||
|
@ -298,18 +301,11 @@ func showNext() {
|
||||||
log.Info(log.Sprint("IsProtobuf() == err", err))
|
log.Info(log.Sprint("IsProtobuf() == err", err))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if me.current.Status.Whitelist {
|
|
||||||
log.Info("Whitelist == true SHOULD NOT RELEASE THIS")
|
|
||||||
} else {
|
|
||||||
log.Info("Whitelist == false")
|
|
||||||
}
|
|
||||||
log.Info("")
|
|
||||||
|
|
||||||
testNext()
|
testNext()
|
||||||
|
|
||||||
log.Info(repolist.ReportHeader())
|
log.Info(repolist.ReportHeader())
|
||||||
log.Info(me.current.StandardHeader())
|
|
||||||
log.Info("")
|
log.Info("")
|
||||||
log.Info(repolist.ReleaseReportHeader())
|
log.Info(repolist.ReleaseReportHeader())
|
||||||
log.Info(me.current.StandardReleaseHeader())
|
log.Info(me.forge.StandardReleaseHeader(me.current, "notsure"))
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ package main
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go.wit.com/gui"
|
"go.wit.com/gui"
|
||||||
|
@ -71,7 +70,9 @@ func createReleaseBox(box *gui.Node) {
|
||||||
|
|
||||||
me.release.repo = gadgets.NewOneLiner(me.release.grid, "repo")
|
me.release.repo = gadgets.NewOneLiner(me.release.grid, "repo")
|
||||||
me.release.openrepo = me.release.grid.NewButton("Configure", func() {
|
me.release.openrepo = me.release.grid.NewButton("Configure", func() {
|
||||||
me.current.Status.Toggle()
|
if repov := me.repos.View.FindByPath(me.current.GetGoPath()); repov != nil {
|
||||||
|
repov.Status.Toggle()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
me.release.openrepo.Disable()
|
me.release.openrepo.Disable()
|
||||||
me.release.grid.NextRow()
|
me.release.grid.NextRow()
|
||||||
|
@ -104,8 +105,10 @@ func createReleaseBox(box *gui.Node) {
|
||||||
|
|
||||||
grid.NewButton("whitelist", func() {
|
grid.NewButton("whitelist", func() {
|
||||||
// tmp := me.current.GoState()
|
// tmp := me.current.GoState()
|
||||||
log.Info("trying to whitelist repo", me.current.GetGoPath())
|
if repov := me.repos.View.FindByPath(me.current.GetGoPath()); repov != nil {
|
||||||
me.current.Status.Whitelist = true
|
log.Info("trying to whitelist repo", me.current.GetGoPath())
|
||||||
|
repov.Status.Whitelist = true
|
||||||
|
}
|
||||||
findNext()
|
findNext()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -191,51 +194,6 @@ func createReleaseBox(box *gui.Node) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
grid.NextRow()
|
grid.NextRow()
|
||||||
|
|
||||||
grid.NewButton("git ls-files |grep go.mod", func() {
|
|
||||||
loop := me.repos.View.ReposSortByName()
|
|
||||||
for loop.Scan() {
|
|
||||||
repo := loop.Repo()
|
|
||||||
log.Info("repo:", repo.Name())
|
|
||||||
if repo.Status.ReadOnly() {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if repo.Status.Whitelist {
|
|
||||||
log.Warn("skipping whitelist", repo.GetGoPath())
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
good, files := repo.Status.GitLsFiles()
|
|
||||||
if !good {
|
|
||||||
log.Warn("Something went wrong", repo.GetGoPath())
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
for _, filename := range strings.Split(files, "\n") {
|
|
||||||
log.Info("\tfile", filename)
|
|
||||||
if filename == "go.mod" {
|
|
||||||
log.Info("Found go.mod. does version match release version?")
|
|
||||||
log.Info(repo.Status.GetLastTagVersion(), "vs", repo.Status.GetTargetVersion())
|
|
||||||
if repo.Status.GetLastTagVersion() != repo.Status.GetTargetVersion() {
|
|
||||||
log.Info(repo.Status.GetLastTagVersion(), "vs", repo.Status.GetTargetVersion())
|
|
||||||
log.Info("Found go.sum. version mismatch")
|
|
||||||
setCurrentRepo(repo, "VERY BROKEN", "rewind go.mod commit")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if filename == "go.sum" {
|
|
||||||
log.Info("Found go.sum. does version match release version?")
|
|
||||||
log.Info(repo.Status.GetLastTagVersion(), "vs", repo.Status.GetTargetVersion())
|
|
||||||
if repo.Status.GetLastTagVersion() != repo.Status.GetTargetVersion() {
|
|
||||||
log.Info(repo.Status.GetLastTagVersion(), "vs", repo.Status.GetTargetVersion())
|
|
||||||
log.Info("Found go.sum. version mismatch")
|
|
||||||
setCurrentRepo(repo, "VERY BROKEN", "rewind go.mod commit")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
log.Info("All repos seem okay")
|
|
||||||
})
|
|
||||||
grid.NextRow()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func doReleaseAll() (bool, time.Duration) {
|
func doReleaseAll() (bool, time.Duration) {
|
||||||
|
|
|
@ -4,7 +4,6 @@ package main
|
||||||
import (
|
import (
|
||||||
"go.wit.com/gui"
|
"go.wit.com/gui"
|
||||||
"go.wit.com/lib/gadgets"
|
"go.wit.com/lib/gadgets"
|
||||||
"go.wit.com/lib/gui/repolist"
|
|
||||||
"go.wit.com/lib/protobuf/forgepb"
|
"go.wit.com/lib/protobuf/forgepb"
|
||||||
"go.wit.com/lib/protobuf/gitpb"
|
"go.wit.com/lib/protobuf/gitpb"
|
||||||
)
|
)
|
||||||
|
@ -19,7 +18,7 @@ type autoType struct {
|
||||||
reposbox *gui.Node
|
reposbox *gui.Node
|
||||||
reposgrid *gui.Node
|
reposgrid *gui.Node
|
||||||
reposgroup *gui.Node
|
reposgroup *gui.Node
|
||||||
current *repolist.RepoRow
|
current *gitpb.Repo
|
||||||
|
|
||||||
// this is the repo we are starting in
|
// this is the repo we are starting in
|
||||||
// make sure it never changes so go.mod and go.sum are always there
|
// make sure it never changes so go.mod and go.sum are always there
|
||||||
|
|
Loading…
Reference in New Issue