Compare commits

..

No commits in common. "master" and "v0.23.49" have entirely different histories.

13 changed files with 468 additions and 311 deletions

View File

@ -55,9 +55,15 @@ curl-setBranchesToMasterB:
findNext: findNext:
curl --silent http://localhost:9419/findNext curl --silent http://localhost:9419/findNext
fixNext:
curl --silent http://localhost:9419/fixNext
showNext: showNext:
curl --silent http://localhost:9419/showNext curl --silent http://localhost:9419/showNext
testNext:
curl --silent http://localhost:9419/testNext
doRelease: doRelease:
reset reset
make showNext make showNext
@ -86,40 +92,6 @@ list-release-notdone:
curl --silent http://localhost:9419/releaseList?readonly=true curl --silent http://localhost:9419/releaseList?readonly=true
safe-build: install safe-build: install
# forge list --private forge list --private
wit-test install --verbose wit-test install --verbose
# cd ~/go/src/go.wit.com/lib/xgb/ && time GUIRELEASE_REASON="safe-build" guireleaser --gui gocui --gui-verbose --gui-file ../../toolkits/gocui/gocui.so >/tmp/forge.log 2>&1 cd ~/go/src/go.wit.com/lib/xgb/ && GUIRELEASE_REASON="safe-build" guireleaser
rm -f go.* ; git checkout go.mod ; cd ~/go/src/go.wit.com/lib/xgb/ && time GUIRELEASE_REASON="safe-build" guireleaser --gui andlabs
build-quick: install
wit-test install --verbose
# rm -f go.* ; git checkout go.mod ;cd ~/go/src/go.wit.com/lib/xgb/ && time GUIRELEASE_REASON="safe-build" guireleaser --gui andlabs quick
sudo "wit update"
autocomplete:
guireleaser --bash > ~/.local/share/bash-completion/completions/guireleaser
test-build-force:
GUIRELEASE_REASON="safe-build" guireleaser --gui andlabs --force
# time GUIRELEASE_REASON="safe-build" make test-build
test-build:
wit-test install --verbose
rm ~/go/bin/forged
cd ~/go/src/go.wit.com/lib/xgb/ && rm -f go.*
cd ~/go/src/go.wit.com/lib/xgb/ && git checkout go.mod
cd ~/go/src/go.wit.com/lib/xgb/ && time guireleaser --gui andlabs
cd ~/go/src/go.wit.com/apps/guireleaser
wit-test debian --verbose
do-aptly
# time GUIRELEASE_REASON="safe-build" make test-build-quick
test-build-quick:
wit-test install --verbose
rm ~/go/bin/forged
cd ~/go/src/go.wit.com/lib/xgb/ && rm -f go.*
cd ~/go/src/go.wit.com/lib/xgb/ && git checkout go.mod
cd ~/go/src/go.wit.com/lib/xgb/ && time guireleaser --gui andlabs quick
cd ~/go/src/go.wit.com/apps/guireleaser
wit-test debian --verbose
do-aptly

8
TODO
View File

@ -2,7 +2,13 @@ notes on what to fix next
go-args make patches for alexflint go-args make patches for alexflint
go-mod-clean --restore *.pb.go files forge checkout jcarr (alias username to 'user')
forge verify devel branches
fix going2go build
fix fyne build
go-mod-clean set ctime on files go-mod-clean set ctime on files
go-mod-clean fix --purge to be used more often. put --purge in 'make clean' ?
guireleaser change "title small" to the package being updated" guireleaser change "title small" to the package being updated"

69
argv.go
View File

@ -1,11 +1,5 @@
package main package main
import (
"fmt"
"os"
"os/user"
)
/* /*
this parses the command line arguements this parses the command line arguements
@ -13,23 +7,22 @@ import (
*/ */
type args struct { type args struct {
Quick *QuickCmd `arg:"subcommand:quick" help:"only do repos with patches"` Quick *QuickCmd `arg:"subcommand:quick" help:"only do repos with patches"`
DryRun bool `arg:"--dry-run,env:DRYRUN" help:"don't actually do the release"` DryRun bool `arg:"--dry-run,env:DRYRUN" help:"don't actually do the release"`
Minor bool `arg:"--minor" help:"increment minor verion numbers"` // Fix bool `arg:"--fix" help:"run fixGoMod() on startup"`
Protobuf bool `arg:"--protobuf" help:"increment protobuf repos"` Minor bool `arg:"--minor" help:"increment minor verion numbers"`
Verbose bool `arg:"--verbose" help:"talk alot"` Protobuf bool `arg:"--protobuf" help:"increment protobuf repos"`
Full bool `arg:"--full" help:"build every package"` Verbose bool `arg:"--verbose" help:"talk alot"`
Reason string `arg:"--reason" help:"tag message"` Reason string `arg:"--reason" help:"tag message"`
Force bool `arg:"--force" help:"try harder than normal"` // DumpVersions bool `arg:"--dump-versions" help:"dump the versions file for go.wit.com"`
Port int `arg:"--port" default:"9419" help:"do fun stuff with curl"` Port int `arg:"--port" default:"9419" help:"do fun stuff with curl"`
Bash bool `arg:"--bash" help:"generate bash completion"` Bash bool `arg:"--bash" help:"generate bash completion"`
BashAuto []string `arg:"--auto-complete" help:"does the actual autocompletion"` BashAuto []string `arg:"--auto-complete" help:"does the actual autocompletion"`
} }
type QuickCmd struct { type QuickCmd struct {
List *EmptyCmd `arg:"subcommand:list" help:"list available patches"` List *EmptyCmd `arg:"subcommand:list" help:"list available patches"`
Show *EmptyCmd `arg:"subcommand:show" help:"show a specific patch"` Show *EmptyCmd `arg:"subcommand:show" help:"show a specific patch"`
NoLibs *EmptyCmd `arg:"subcommand:show" help:"skip libraries that aren't changed"`
} }
type EmptyCmd struct { type EmptyCmd struct {
@ -47,39 +40,3 @@ the repositories in the go.sum file using git clone`
func (args) Version() string { func (args) Version() string {
return "guireleaser " + VERSION return "guireleaser " + VERSION
} }
/*
handles shell autocomplete
*/
func (a args) DoAutoComplete(argv []string) {
switch argv[0] {
case "checkout":
usr, _ := user.Current()
fmt.Println("user devel master " + usr.Username)
case "commit":
fmt.Println("--all")
case "config":
fmt.Println("add fix list delete")
case "list":
fmt.Println("--all --mine --favorites --private")
case "pull":
fmt.Println("--all --mine --favorites --private")
case "patch":
fmt.Println("--list --submit --show")
case "dirty":
fmt.Println("--show-files")
case "user":
fmt.Println("--force")
case "devel":
fmt.Println("--force")
case "master":
fmt.Println("--force")
default:
if argv[0] == ARGNAME {
// list the subcommands here
fmt.Println("--bash quick")
}
}
os.Exit(0)
}

97
argvAutoshell.go Normal file
View File

@ -0,0 +1,97 @@
package main
import (
"fmt"
"os"
"os/user"
)
/*
handles shell autocomplete
*/
// used for shell auto completion
// var ARGNAME string = "forge" // todo: get this from $0 ?
func (args) doBashAuto() {
argv.doBashHelp()
switch argv.BashAuto[0] {
case "checkout":
usr, _ := user.Current()
fmt.Println("user devel master " + usr.Username)
case "commit":
fmt.Println("--all")
case "config":
fmt.Println("add fix list delete")
case "list":
fmt.Println("--all --mine --favorites --private")
case "pull":
fmt.Println("--all --mine --favorites --private")
case "patch":
fmt.Println("--list --submit --show")
case "dirty":
fmt.Println("--show-files")
case "user":
fmt.Println("--force")
case "devel":
fmt.Println("--force")
case "master":
fmt.Println("--force")
default:
if argv.BashAuto[0] == ARGNAME {
// list the subcommands here
fmt.Println("--bash quick")
}
}
os.Exit(0)
}
// prints help to STDERR // TODO: move everything below this to go-args
func (args) doBashHelp() {
if argv.BashAuto[1] != "''" {
// if this is not blank, then the user has typed something
return
}
if argv.BashAuto[0] != ARGNAME {
// if this is not the name of the command, the user already started doing something
return
}
if argv.BashAuto[0] == ARGNAME {
me.pp.WriteHelp(os.Stderr)
return
}
fmt.Fprintln(os.Stderr, "")
fmt.Fprintln(os.Stderr, "hello world")
fmt.Fprintln(os.Stderr, "")
}
// complete -F forge --bash forge
func (args) doBash() {
fmt.Println("# add this in your bashrc:")
fmt.Println("")
fmt.Println("# todo: add this to go-arg as a 'hidden' go-arg option --bash")
fmt.Println("#")
fmt.Println("# todo: make this output work/parse with:")
fmt.Println("# complete -C " + ARGNAME + " --bash go")
fmt.Println("")
fmt.Println("_" + ARGNAME + "_complete()")
fmt.Println("{")
fmt.Println(" # sets local to this func vars")
fmt.Println(" local cur prev all")
fmt.Println(" cur=${COMP_WORDS[COMP_CWORD]}")
fmt.Println(" prev=${COMP_WORDS[COMP_CWORD-1]}")
fmt.Println(" all=${COMP_WORDS[@]}")
fmt.Println("")
fmt.Println(" # this is where we generate the go-arg output")
fmt.Println(" GOARGS=$(" + ARGNAME + " --auto-complete $prev \\'$cur\\' $all)")
fmt.Println("")
fmt.Println(" # this compares the command line input from the user")
fmt.Println(" # to whatever strings we output")
fmt.Println(" COMPREPLY=( $(compgen -W \"$GOARGS\" -- $cur) ) # THIS WORKS")
fmt.Println(" return 0")
fmt.Println("}")
fmt.Println("complete -F _" + ARGNAME + "_complete " + ARGNAME)
fmt.Println("")
fmt.Println("# copy and paste the above into your bash shell should work")
os.Exit(0)
}

View File

@ -54,19 +54,9 @@ func doRelease() error {
log.Info("doRelease() WARNING. should have never gotten here. return true. already done", check.GetGoPath()) log.Info("doRelease() WARNING. should have never gotten here. return true. already done", check.GetGoPath())
log.Info("doRelease() WARNING. should have never gotten here. return true. already done", check.GetGoPath()) log.Info("doRelease() WARNING. should have never gotten here. return true. already done", check.GetGoPath())
log.Info("doRelease() WARNING. should have never gotten here. return true. already done", check.GetGoPath()) log.Info("doRelease() WARNING. should have never gotten here. return true. already done", check.GetGoPath())
check.ReloadCheck() check.Reload()
return fmt.Errorf("already released %s", check.GetGoPath()) return fmt.Errorf("already released %s", check.GetGoPath())
} }
// check if the git tag already exists somehow
testtag := me.release.version.String()
if check.LocalTagExists(testtag) {
log.Info("TAG ALREADY EXISTS", testtag)
return log.Errorf("%s TAG ALREADY EXISTS %s", check.FullPath, testtag)
} else {
log.Info("TAG IS NEW", testtag)
}
if me.forge.Config.IsPrivate(me.current.GetGoPath()) { 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.") log.Info("This is a private repo.")
@ -109,23 +99,6 @@ func doRelease() error {
badExit(errors.New(msg)) badExit(errors.New(msg))
} }
// this is the final check. even here, just to be a total asshole
// I rerun go mod init and go mod tidy
// the re-parse all the results
// this is the last and final check.
// believe it or not, I've seen this fail. It's not worth being careful here
// or liberal about it. if it doesn't work, yep, you are stuck here you bastard
// (bastard being me. I designed this to be so annoying that if it makes it
// past this point it always works. that is the whole point of this code. NEVER
// EVER FAIL PAST THIS POINT
// )
// so let's do it: let's run go-mod-clean strict
// then reparse everything
_, err := check.RunVerboseOnError([]string{"go-mod-clean", "strict"})
if err != nil {
badExit(err)
}
var all [][]string var all [][]string
var autogen []string var autogen []string
all = append(all, []string{"git", "add", "-f", "go.mod"}) all = append(all, []string{"git", "add", "-f", "go.mod"})
@ -179,9 +152,9 @@ func doRelease() error {
time.Sleep(3 * time.Second) time.Sleep(3 * time.Second)
// this can fail to update, try it again after sleep(3s) // this can fail to update, try it again after sleep(3s)
if !doPublishVersion() { if !doPublishVersion() {
log.Info("PUBLISH FAILED gopath=%s", check.GetGoPath()) log.Info("PUBLISH FAILED")
findOk = false findOk = false
return fmt.Errorf("PUBLISH FAILED gopath=%s", check.GetGoPath()) return fmt.Errorf("PUBLISH FAILED %s", check.GetGoPath())
} }
} }
@ -203,6 +176,13 @@ func doRelease() error {
retag = append(retag, []string{"git", "tag", "-m", me.releaseReasonS, me.release.version.String()}) retag = append(retag, []string{"git", "tag", "-m", me.releaseReasonS, me.release.version.String()})
retag = append(retag, []string{"git", "push", "origin", me.release.version.String()}) retag = append(retag, []string{"git", "push", "origin", me.release.version.String()})
if err := check.AutogenRestore(cname); err != nil {
log.Info("AutogenRestore() failed", err)
} else {
cmd := []string{"git", "push", "origin", "refs/notes/*:refs/notes/*"}
check.Run(cmd)
}
if !me.current.RunAll(retag) { if !me.current.RunAll(retag) {
log.Info("retag failed") log.Info("retag failed")
findOk = false findOk = false
@ -210,6 +190,34 @@ func doRelease() error {
} }
log.Info("EVERYTHING OK. RERELEASED", me.current.GetGoPath()) log.Info("EVERYTHING OK. RERELEASED", me.current.GetGoPath())
// save autogen files under the tag version (for example: "v0.2.3")
newtag := me.release.version.String()
if err := check.AutogenSave(autogen, newtag, true); err != nil {
log.Info("AutogenSave() error", err)
msg := fmt.Sprint("AutogenSave() error", err)
badExit(errors.New(msg))
}
return skipToNext()
}
func skipToNext() error {
me.current.Reload()
me.forge.SetConfigSave(true)
me.forge.ConfigSave()
log.Info("sleep 2")
time.Sleep(2 * time.Second)
printDone()
rePrepareRelease()
findNext()
if me.current == nil {
log.Info("NOT GOOD TO RUN ANOTHER DAY")
log.Info("took out all the loop code")
setCurrentRepo(nil, "loop by hand motherfucker", "fucknuts")
return fmt.Errorf("findNext returned next repo == nil")
}
log.Info("GOOD TO RUN ANOTHER DAY ON:", me.current.GetGoPath())
return nil return nil
} }

View File

@ -8,12 +8,11 @@ import (
func okExit(thing string) { func okExit(thing string) {
log.Info(thing, "ok") log.Info(thing, "ok")
// log.Info("Finished go-clean on", check.GetNamespace(), "ok") // log.Info("Finished go-clean on", check.GetGoPath(), "ok")
me.forge.Exit()
os.Exit(0) os.Exit(0)
} }
func badExit(err error) { func badExit(err error) {
log.Info("forge failed: ", err, me.forge.Config.ReposDir) log.Info("forge failed: ", err, me.forge.GetGoSrc())
os.Exit(-1) os.Exit(-1)
} }

View File

@ -1,3 +1,4 @@
// This is a simple example
package main package main
import ( import (
@ -17,25 +18,24 @@ var findOk bool = true
func checkDeps(repo *gitpb.Repo) error { func checkDeps(repo *gitpb.Repo) error {
if repo.GoDeps == nil { if repo.GoDeps == nil {
return fmt.Errorf("%s has GoDeps == nil", repo.GetNamespace()) return fmt.Errorf("%s has GoDeps == nil", repo.GetGoPath())
} }
for dep := range repo.GoDeps.IterAll() { all := repo.GoDeps.All()
// log.Info(repo.GetNamespace(), dep.GoPath, dep.Version) for all.Scan() {
dep := all.Next()
// log.Info(repo.GetGoPath(), dep.GoPath, dep.Version)
// check if the package in question is waiting for another package to publish // check if the package in question is waiting for another package to publish
found := me.forge.FindByGoPath(dep.GoPath) found := me.forge.FindByGoPath(dep.GoPath)
if found == nil { if found == nil {
return fmt.Errorf("%s has dep == nil", repo.GetNamespace(), dep.GoPath) return fmt.Errorf("%s has dep == nil", repo.GetGoPath(), dep.GoPath)
} }
// loop through all the repos that need to be published with new go versions
all := me.found.SortByFullPath() all := me.found.SortByFullPath()
for all.Scan() { for all.Scan() {
check := all.Next() check := all.Next()
if found.GetGoPath() == check.GetGoPath() {
if found.GetNamespace() == check.GetNamespace() {
// this package is waiting on other packages to publish // this package is waiting on other packages to publish
return fmt.Errorf("%s is waiting on %s", repo.GetNamespace(), found.GetNamespace()) return fmt.Errorf("%s is waiting on %s", repo.GetGoPath(), found.GetGoPath())
} }
} }
// found package isn't being published. is the version correct? // found package isn't being published. is the version correct?
@ -44,7 +44,7 @@ func checkDeps(repo *gitpb.Repo) error {
if found.GetLastTag() == dep.Version { if found.GetLastTag() == dep.Version {
// everything is normal // everything is normal
} else { } else {
return fmt.Errorf("%s version mismatch on %s (%s vs %s)", repo.GetNamespace(), found.GetNamespace(), found.GetLastTag(), dep.Version) return fmt.Errorf("%s version mismatch on %s (%s vs %s)", repo.GetGoPath(), found.GetGoPath(), found.GetLastTag(), dep.Version)
} }
*/ */
} }
@ -61,21 +61,21 @@ func findNext() bool {
for all.Scan() { for all.Scan() {
check := all.Next() check := all.Next()
if check.GetMasterBranchName() != check.GetCurrentBranchName() { if check.GetMasterBranchName() != check.GetCurrentBranchName() {
log.Info("YOU MUST BE ON THE MASTER BRANCH", check.GetNamespace()) log.Info("YOU MUST BE ON THE MASTER BRANCH", check.GetGoPath())
continue continue
} }
if check.IsDirty() { if check.IsDirty() {
log.Info("CAN NOT RELEASE DIRTY REPO", check.GetNamespace()) log.Info("CAN NOT RELEASE DIRTY REPO", check.GetGoPath())
continue continue
} }
if alreadyDone(check) { if alreadyDone(check) {
log.Info("findNext() alreadyDone. WHY IS THIS STILL CHECKING?", check.GetNamespace()) log.Info("findNext() alreadyDone. WHY IS THIS STILL CHECKING?", check.GetGoPath())
continue continue
} }
log.Info("CHECKING START:", check.GetNamespace()) log.Info("CHECKING START:", check.GetGoPath())
if me.forge.Config.IsPrivate(check.GetNamespace()) { if me.forge.Config.IsPrivate(check.GetGoPath()) {
log.Info("GOOD TO GO ON PRIVATE REPO", check.GetNamespace()) log.Info("GOOD TO GO ON PRIVATE REPO", check.GetGoPath())
setCurrentRepo(check, "should be good to release", "pretty sure") setCurrentRepo(check, "should be good to release", "pretty sure")
return true return true
} }
@ -102,23 +102,32 @@ func findNext() bool {
continue continue
} }
} }
/*
findCounter += 1
if !check.ParseGoSum() {
log.Info("ParseGoSum() failed", check.GetGoPath())
log.Info("ParseGoSum() failed", check.GetGoPath())
log.Info("ParseGoSum() failed", check.GetGoPath())
continue
}
*/
// fixGodeps(check)
if err := me.forge.FinalGoDepsCheckOk(check, argv.Verbose); err != nil { if err := me.forge.FinalGoDepsCheckOk(check, argv.Verbose); err != nil {
// if err := me.forge.FinalGoDepsCheckOk(check, false); err != nil { // if err := me.forge.FinalGoDepsCheckOk(check, false); err != nil {
log.Info("FinalGoDepsCheckOk() repo=", check.GetNamespace(), "err:", err) log.Info("FinalGoDepsCheckOk() repo=", check.GetGoPath(), "err:", err)
log.Info("CHECKING END:", check.GetNamespace()) log.Info("CHECKING END:", check.GetGoPath())
log.Info("") log.Info("")
continue continue
} }
log.Info("GOOD TO GO ON", check.GetNamespace()) log.Info("GOOD TO GO ON", check.GetGoPath())
setCurrentRepo(check, "should be good to release", "pretty sure") setCurrentRepo(check, "should be good to release", "pretty sure")
return true return true
} }
if findCounter == 0 { if findCounter == 0 {
log.Info("NOTHING TO UPDATE. findCounter =", findCounter, "found len =", me.found.Len()) log.Info("NOTHING TO UPDATE. findCounter =", findCounter, "found len =", me.found.Len())
if me.found.Len() == 0 { if me.found.Len() == 0 {
printDone()
okExit("") okExit("")
} }
} else { } else {
@ -130,6 +139,65 @@ func findNext() bool {
return false return false
} }
// tries to fix the go.mod and go.sum files
func fixGodepsOLD(check *gitpb.Repo) bool {
var good bool = true
check.GoDeps = nil
if result, err := check.RunQuiet([]string{"go-mod-clean", "--strict"}); err != nil {
for _, line := range result.Stdout {
log.Warn("stdout:", line)
}
for _, line := range result.Stderr {
log.Warn("stderr:", line)
}
return false
}
if check.ParseGoSum() {
return true
} else {
log.Info("ParseGoSum() failed but go-mod-clean --strict worked", check.GetGoPath())
return false
}
// skip primative ones
if check.GetGoPrimitive() {
if check.Exists("go.sum") {
log.Info("fixGoDeps() has go.sum but says it is primitive", check.GetGoPath())
return false
}
log.Info("fixGoDeps() skipping primitive", check.GetGoPath())
return true
}
log.Printf("current repo %s go dependancy count: %d\n", check.GetGoPath(), check.GoDepsLen())
log.Printf("current repo %s go dependancy count: %d\n", check.GetGoPath(), check.GoDepsLen())
log.Printf("current repo %s go dependancy count: %d\n", check.GetGoPath(), check.GoDepsLen())
deps := check.GoDeps.SortByGoPath()
for deps.Scan() {
depRepo := deps.Next()
// log.Info("found dep", depRepo.GetGoPath())
if me.forge.Config.IsReadOnly(depRepo.GetGoPath()) {
log.Info("IsReadOnly = true", depRepo.GetGoPath())
continue
} else {
// log.Info("IsReadOnly = false", depRepo.GetGoPath())
}
found := me.forge.FindByGoPath(depRepo.GetGoPath())
if found == nil {
log.Info("not found:", depRepo.GetGoPath())
continue
}
log.Printf("%-48s dep ver=%10s repo ver=%10s target ver=%10s\n", found.GetGoPath(), depRepo.GetVersion(), found.GetMasterVersion(), found.GetTargetVersion())
if depRepo.GetVersion() != found.GetMasterVersion() {
log.Printf("%-48s %10s (gitpb depRepo)\n", depRepo.GetGoPath(), depRepo.GetVersion())
log.Printf("%-48s %10s (gitpb found)\n", found.GetGoPath(), found.GetMasterVersion())
cmd := []string{"go", "get", depRepo.GetGoPath() + "@latest"}
check.RunVerbose(cmd)
}
}
return good
}
func setCurrentRepo(check *gitpb.Repo, s string, note string) bool { func setCurrentRepo(check *gitpb.Repo, s string, note string) bool {
me.current = check me.current = check
if check == nil { if check == nil {
@ -138,7 +206,7 @@ func setCurrentRepo(check *gitpb.Repo, s string, note string) bool {
me.release.releaseVersionB.SetText("nope") me.release.releaseVersionB.SetText("nope")
me.release.version.SetText("badver") me.release.version.SetText("badver")
} else { } else {
me.release.repo.SetText(check.GetNamespace()) me.release.repo.SetText(check.GetGoPath())
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.version.SetText(check.GetTargetVersion()) me.release.version.SetText(check.GetTargetVersion())
@ -146,6 +214,7 @@ func setCurrentRepo(check *gitpb.Repo, s string, note string) bool {
me.release.status.SetText(s) me.release.status.SetText(s)
me.release.notes.SetText(note) me.release.notes.SetText(note)
// me.release.openrepo.Enable() // me.release.openrepo.Enable()
return true return true
} }
@ -156,12 +225,12 @@ func testGoDepsCheckOk(godeps *gitpb.GoDeps, verbose bool) error {
all := godeps.SortByGoPath() all := godeps.SortByGoPath()
for all.Scan() { for all.Scan() {
depRepo := all.Next() depRepo := all.Next()
fullpath := filepath.Join(me.forge.Config.ReposDir, depRepo.GoPath) fullpath := filepath.Join(me.forge.GetGoSrc(), depRepo.GetGoPath())
found := me.found.FindByFullPath(fullpath) found := me.found.FindByFullPath(fullpath)
if found == nil { if found == nil {
continue continue
} }
return fmt.Errorf("dep is being upgraded %s", depRepo.GoPath) return fmt.Errorf("dep is being upgraded %s", depRepo.GetGoPath())
} }
return nil return nil
} }

11
http.go
View File

@ -85,6 +85,16 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
setCurrentRepo(repo, "HTTP", "doRelease() ?") setCurrentRepo(repo, "HTTP", "doRelease() ?")
return return
case "/fixNext":
check := me.forge.FindByGoPath(me.current.GetGoPath())
if check == nil {
log.Info("boo, you didn't git clone", me.current.GetGoPath())
return
}
// destroy and recreate the go.sum
fixGodepsOLD(check)
findOk = true
return
case "/showNext": case "/showNext":
check := me.forge.FindByGoPath(me.current.GetGoPath()) check := me.forge.FindByGoPath(me.current.GetGoPath())
if check == nil { if check == nil {
@ -93,7 +103,6 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
} }
testGoRepo(check) testGoRepo(check)
me.forge.HumanPrintRepo(check) me.forge.HumanPrintRepo(check)
log.Info("upgrade reason:", me.reason[check])
return return
case "/list": case "/list":
me.forge.PrintHumanTable(me.found) me.forge.PrintHumanTable(me.found)

51
main.go
View File

@ -8,9 +8,9 @@ import (
"path/filepath" "path/filepath"
"go.wit.com/dev/alexflint/arg" "go.wit.com/dev/alexflint/arg"
"go.wit.com/gui"
"go.wit.com/lib/fhelp" "go.wit.com/lib/fhelp"
"go.wit.com/lib/gadgets" "go.wit.com/lib/gadgets"
"go.wit.com/lib/gui/prep"
"go.wit.com/lib/gui/shell" "go.wit.com/lib/gui/shell"
"go.wit.com/lib/protobuf/forgepb" "go.wit.com/lib/protobuf/forgepb"
"go.wit.com/lib/protobuf/gitpb" "go.wit.com/lib/protobuf/gitpb"
@ -27,18 +27,27 @@ var argv args
func main() { func main() {
me = new(autoType) me = new(autoType)
prep.Bash(ARGNAME, argv.DoAutoComplete) // this line should be: prep.Bash(argv)
me.myGui = prep.Gui() // prepares the GUI package for go-args // parse the command line
me.pp = arg.MustParse(&argv) me.pp = arg.MustParse(&argv)
if argv.Bash {
argv.doBash()
os.Exit(0)
}
if len(argv.BashAuto) != 0 {
argv.doBashAuto()
os.Exit(0)
}
// load the ~/.config/forge/ config
me.forge = forgepb.Init() me.forge = forgepb.Init()
me.forge.ScanRepoDir() // looks for new dirs, checks existing repos for changes
me.found = new(gitpb.Repos) me.found = new(gitpb.Repos)
fhelp.CheckGoModCleanExit() fhelp.CheckGoModCleanExit()
// me.forge.ConfigPrintTable() // me.forge.ConfigPrintTable()
os.Setenv("REPO_WORK_PATH", me.forge.Config.ReposDir) os.Setenv("REPO_WORK_PATH", me.forge.GetGoSrc())
// save the ENV var here // save the ENV var here
me.releaseReasonS = os.Getenv("GUIRELEASE_REASON") me.releaseReasonS = os.Getenv("GUIRELEASE_REASON")
@ -52,7 +61,9 @@ func main() {
// user drops to a shell or xterm, then they shouldn't be set there either // user drops to a shell or xterm, then they shouldn't be set there either
os.Unsetenv("GO111MODULE") os.Unsetenv("GO111MODULE")
me.myGui.Start() // loads the GUI toolkit me.myGui = gui.New()
me.myGui.InitEmbed(resources)
me.myGui.Default()
// our main window // our main window
me.mainWindow = gadgets.RawBasicWindow("GUI release manager " + VERSION) me.mainWindow = gadgets.RawBasicWindow("GUI release manager " + VERSION)
@ -79,6 +90,10 @@ func main() {
log.Info("Creating the Release Window") log.Info("Creating the Release Window")
// initialize the repo list window
// which should be all the git repositories in ~/go/src & the .config file
// me.repos = makeRepoView()
// the left side of the window options // the left side of the window options
globalDisplayOptions(me.mainBox) globalDisplayOptions(me.mainBox)
@ -89,20 +104,13 @@ func main() {
me.release.box.Disable() me.release.box.Disable()
me.Disable() me.Disable()
// scan in the State of all the repos
// TODO: should not really be necessary directly after init()
// me.repos.View.ScanRepositoriesOld()
// todo: add this to forgepb // todo: add this to forgepb
me.startRepo = me.forge.FindWorkingDirRepo() me.startRepo = me.forge.FindWorkingDirRepo()
if _, count, _, err := me.forge.IsEverythingOnMaster(); err != nil {
log.Info("not everything is on the master branch (", count, "repos)")
if argv.Quick != nil {
// quick also means ignore the master branch check
argv.Force = true
}
if !argv.Force {
os.Exit(-1)
}
}
if me.startRepo == nil { if me.startRepo == nil {
pwd, _ := os.Getwd() pwd, _ := os.Getwd()
msg := fmt.Sprint("Can not run if pwd is not a repo", pwd) msg := fmt.Sprint("Can not run if pwd is not a repo", pwd)
@ -126,6 +134,15 @@ func main() {
me.Enable() me.Enable()
me.release.box.Enable() me.release.box.Enable()
/*
// intermittently scans the status indefinitly
me.repos.View.Watchdog(func() {
log.Info("In main()")
log.Sleep(10)
// processing is done. update the repo summary box
// me.summary.Update()
})
*/
// start the http server for polling status // start the http server for polling status
startHTTP() startHTTP()
} }

View File

@ -8,7 +8,6 @@ import (
"time" "time"
"go.wit.com/lib/gui/shell" "go.wit.com/lib/gui/shell"
"go.wit.com/lib/protobuf/forgepb"
"go.wit.com/lib/protobuf/gitpb" "go.wit.com/lib/protobuf/gitpb"
"go.wit.com/log" "go.wit.com/log"
) )
@ -38,7 +37,7 @@ func checkpkgcache(repo *gitpb.Repo) error {
} }
getpath := repo.GetGoPath() + "@" + repo.GetLastTag() getpath := repo.GetGoPath() + "@" + repo.GetLastTag()
log.Infof("~/go/pkg/mod/ IS MISSING %s so I'm running go get here.", getpath) log.Info("MISSING:", getpath)
_, err = me.startRepo.RunVerboseOnError([]string{"go", "get", getpath}) _, err = me.startRepo.RunVerboseOnError([]string{"go", "get", getpath})
return err return err
} }
@ -53,10 +52,10 @@ func rillPurge(repo *gitpb.Repo) error {
return nil return nil
} }
_, err := repo.RunQuiet([]string{"go-mod-clean", "purge"}) _, err := repo.RunQuiet([]string{"go-mod-clean", "--purge"})
rillcount += 1 rillcount += 1
if err != nil { if err != nil {
log.Info("go-mod-clean purge failed", repo.GetGoPath(), err) log.Info("go-mod-clean --smart failed", repo.GetGoPath(), err)
return err return err
} }
return nil return nil
@ -70,34 +69,22 @@ func rillRestore(repo *gitpb.Repo) error {
return nil return nil
} }
var err error _, err := repo.RunQuiet([]string{"go-mod-clean", "--smart"})
if argv.Verbose {
log.Info("go-mod-clean lax START", repo.GetGoPath())
result := repo.RunRealtime([]string{"go-mod-clean", "lax"})
log.Info("go-mod-clean lax END", repo.GetGoPath())
if result.Exit != 0 {
err = fmt.Errorf("repo %s failed %d", repo.GetGoPath(), result.Exit)
}
} else {
_, err = repo.RunQuiet([]string{"go-mod-clean", "lax"})
}
rillcount += 1 rillcount += 1
if err != nil { if err != nil {
log.Info("go-mod-clean lax failed", repo.GetGoPath(), err) log.Info("go-mod-clean --smart failed", repo.GetGoPath(), err)
return err return err
} }
return nil return nil
} }
func rePrepareRelease() { func rePrepareRelease() {
me.forge.ScanRepoDir() // looks for new dirs, checks existing repos for changes // reload the config
// me.forge = forgepb.Init()
me.found = new(gitpb.Repos) me.found = new(gitpb.Repos)
me.reason = make(map[*gitpb.Repo]string) // stores the reason repos need to be versioned & released
log.Printf("rePrepareRelease() START rill go-mod-clean lax (11 seconds?)") log.Printf("rePrepareRelease() START rill go-mod-clean --smart (11 seconds?)")
rillcount = 0 rillcount = 0
forgepb.RillX = 2
forgepb.RillY = 2
now := time.Now() now := time.Now()
me.forge.RillFuncError(rillRestore) me.forge.RillFuncError(rillRestore)
log.Printf("showRestore() (%d total repos) took:%s\n", rillcount, shell.FormatDuration(time.Since(now))) log.Printf("showRestore() (%d total repos) took:%s\n", rillcount, shell.FormatDuration(time.Since(now)))
@ -134,24 +121,11 @@ func rePrepareRelease() {
continue continue
} }
master := check.GetMasterVersion()
lastTag := check.GetLastTag()
if argv.Quick != nil {
// if argv has 'quick' don't do anything
// that doesn't actually have a patch
if master == lastTag {
continue
}
}
log.Info("LAST TAG", check.FullPath, master, lastTag)
// this is detailed. It makes sure the go.* files are absolutely perfect
if !me.forge.Config.IsPrivate(check.GetGoPath()) { if !me.forge.Config.IsPrivate(check.GetGoPath()) {
if err := checkPublishedGodeps(check); err != nil { if err := checkPublishedGodeps(check); err != nil {
// this means the published godeps are no longer up to date // this means the published godeps are no longer up to date
forceReleaseVersion(check) forceReleaseVersion(check)
me.found.AppendByFullPath(check) me.found.AppendByGoPath(check)
log.Info("checkPublishedGodeps failed with err", check.GetGoPath(), err) log.Info("checkPublishedGodeps failed with err", check.GetGoPath(), err)
continue continue
} else { } else {
@ -160,6 +134,8 @@ func rePrepareRelease() {
} }
// if master != lastTag, always increment // if master != lastTag, always increment
master := check.GetMasterVersion()
lastTag := check.GetLastTag()
if master != lastTag { if master != lastTag {
newmhash := check.GetTagHash(master) newmhash := check.GetTagHash(master)
oldlhash := check.GetTagHash(lastTag) oldlhash := check.GetTagHash(lastTag)
@ -180,14 +156,34 @@ func rePrepareRelease() {
// actually identical. do nothing // actually identical. do nothing
continue continue
} }
if b1 == 0 && b2 == 1 {
if ok, err := me.forge.ValidGoVersion(master); ok {
log.Info("GO version valid", check.GetGoPath(), master, lastTag)
} else {
log.Info("GO version invalid", check.GetGoPath(), master, lastTag, err)
forceReleaseVersion(check)
me.found.AppendByGoPath(check)
continue
}
// if check.GetGoPath() == "go.wit.com/log" {
log.Info("edge case. don't retag.", check.GetGoPath(), b1, b2)
log.Info("edge case. don't retag.", check.GetGoPath(), oldlhash, newmhash)
// }
// actually identical. do nothing
continue
}
if check.GetGoPath() == "go.wit.com/log" {
log.Info("got to log", b1, b2)
log.Info("got to log", oldlhash, newmhash)
os.Exit(-1)
}
if gitpb.IsGoTagVersionGreater(lastTag, master) { if gitpb.IsGoTagVersionGreater(lastTag, master) {
// this function is not right really. the hash error above should catch it correctly // this function is not right really. the hash error above should catch it correctly
// log.Printf("PROBABLY NOT NEE %-50s tag %s < %s\n", check.GetGoPath(), lastTag, master) // log.Printf("PROBABLY NOT NEE %-50s tag %s < %s\n", check.GetGoPath(), lastTag, master)
} }
log.Printf("NEED RELEASE FOR %-50s tag %s != %s\n", check.GetGoPath(), master, lastTag) log.Printf("NEED RELEASE FOR %-50s tag %s != %s\n", check.GetGoPath(), master, lastTag)
forceReleaseVersion(check) forceReleaseVersion(check)
me.found.AppendByFullPath(check) me.found.AppendByGoPath(check)
me.reason[check] = "master != lastTag"
continue continue
} }
@ -196,15 +192,27 @@ func rePrepareRelease() {
continue continue
} }
if argv.Quick != nil {
// if argv has 'quick' don't do anything
// that doesn't actually have a patch
if master == lastTag {
continue
}
}
if argv.Protobuf && check.GetRepoType() == "protobuf" { if argv.Protobuf && check.GetRepoType() == "protobuf" {
log.Printf("NEED RELEASE FOR %s err: %v\n", check.GetGoPath(), "because --protobuf") log.Printf("NEED RELEASE FOR %s err: %v\n", check.GetGoPath(), "because --protobuf")
// if --protobuf, this will force upgrade each one // if --protobuf, this will force upgrade each one
forceReleaseVersion(check) forceReleaseVersion(check)
me.found.AppendByFullPath(check) me.found.AppendByGoPath(check)
me.reason[check] = "protobuf repo deps changed"
continue continue
} }
if check.GetGoPath() == "go.wit.com/log" {
log.Info("got to log")
os.Exit(-1)
}
// if the repo is a go binary or plugin for a new release for // if the repo is a go binary or plugin for a new release for
// any library version change // any library version change
// if check.GetRepoType() == "binary" || check.GetRepoType() == "plugin" { // if check.GetRepoType() == "binary" || check.GetRepoType() == "plugin" {
@ -215,29 +223,18 @@ func rePrepareRelease() {
} else { } else {
log.Printf("NEED RELEASE FOR %-50s err: %v\n", check.GetGoPath(), err) log.Printf("NEED RELEASE FOR %-50s err: %v\n", check.GetGoPath(), err)
forceReleaseVersion(check) forceReleaseVersion(check)
me.found.AppendByFullPath(check) me.found.AppendByGoPath(check)
me.reason[check] = "FinalGoDepsCheckOk() failed even though master tag == last tag"
} }
} }
me.forge.PrintHumanTable(me.found) me.forge.PrintHumanTable(me.found)
// todo: verify each found repo is on the master branch
for repo := range me.found.IterAll() {
if repo.CurrentBranchName != repo.MasterBranchName {
log.Info("repo not on master branch", repo.FullPath)
if !argv.Force {
os.Exit(-1)
}
}
}
} }
func printDone() { func printDone() {
for _, gopath := range me.done { for _, gopath := range me.done {
log.Info("printDone() THESE WERE PUBLISHED", gopath) log.Info("printDone() THESE WERE PUBLISHED", gopath)
} }
log.Info("printDone() total finished so far:", len(me.done)) log.Sleep(1)
time.Sleep(time.Second)
} }
func alreadyDone(repo *gitpb.Repo) bool { func alreadyDone(repo *gitpb.Repo) bool {
@ -253,21 +250,6 @@ func alreadyDone(repo *gitpb.Repo) bool {
return false return false
} }
/*
func upgradeReason(repo *gitpb.Repo) string {
for _, gopath := range me.reason {
// log.Info("WARNING already done", gopath, repo.GetGoPath())
// log.Info("WARNING already done", gopath, repo.GetGoPath())
// log.Info("WARNING already done", gopath, repo.GetGoPath())
if repo.GetGoPath() == gopath {
log.Info("FOUND. RETURN TRUE. already done", gopath, repo.GetGoPath())
return true
}
}
return false
}
*/
func checkPublishedGodeps(repo *gitpb.Repo) error { func checkPublishedGodeps(repo *gitpb.Repo) error {
godepsOld, err := repo.GoSumFromPkgDir() godepsOld, err := repo.GoSumFromPkgDir()
if err != nil { if err != nil {
@ -277,6 +259,22 @@ func checkPublishedGodeps(repo *gitpb.Repo) error {
if err := me.forge.TestGoDepsCheckOk(godepsOld, argv.Verbose); err != nil { if err := me.forge.TestGoDepsCheckOk(godepsOld, argv.Verbose); err != nil {
return err return err
} }
/*
all := godepsOld.All()
for all.Scan() {
dep := all.Next()
// log.Info(repo.GetGoPath(), dep.GoPath, dep.Version)
// check if the package in question is waiting for another package to publish
found := me.forge.FindByGoPath(dep.GoPath)
if found == nil {
return fmt.Errorf("%s has godep %s which can not be found", repo.GetGoPath(), dep.GoPath)
}
if found.GetLastTag() != dep.Version {
return fmt.Errorf("%s with godep %s version mismatch %s vs %s", repo.GetGoPath(), dep.GoPath, found.GetLastTag(), dep.Version)
}
}
*/
} }
godepsNew, err := repo.GoSumFromRepo() godepsNew, err := repo.GoSumFromRepo()
if err != nil { if err != nil {
@ -295,3 +293,27 @@ func checkPublishedGodeps(repo *gitpb.Repo) error {
} }
return nil return nil
} }
/*
func checkGodeps(repo *gitpb.Repo, godeps *gitpb.GoDeps) error {
if godeps == nil {
}
return nil
all := godeps.All()
for all.Scan() {
dep := all.Next()
// log.Info(repo.GetGoPath(), dep.GoPath, dep.Version)
// check if the package in question is waiting for another package to publish
found := me.forge.FindByGoPath(dep.GoPath)
if found == nil {
return fmt.Errorf("%s has godep %s which can not be found", repo.GetGoPath(), dep.GoPath)
}
if found.GetLastTag() != dep.Version {
return fmt.Errorf("%s with godep %s version mismatch %s vs %s", repo.GetGoPath(), dep.GoPath, found.GetLastTag(), dep.Version)
}
log.Printf("%s with godep %s version match %s vs %s\n", repo.GetGoPath(), dep.GoPath, found.GetLastTag(), dep.Version)
}
return nil
}
*/

View File

@ -2,15 +2,11 @@
package main package main
import ( import (
"fmt"
"time"
"go.wit.com/gui" "go.wit.com/gui"
"go.wit.com/log" "go.wit.com/log"
"go.wit.com/lib/gadgets" "go.wit.com/lib/gadgets"
"go.wit.com/lib/gui/shell" "go.wit.com/lib/gui/repolist"
"go.wit.com/lib/protobuf/gitpb"
) )
type releaseStruct struct { type releaseStruct struct {
@ -32,7 +28,7 @@ type releaseStruct struct {
checkDirtyB *gui.Node checkDirtyB *gui.Node
sendVersionB *gui.Node sendVersionB *gui.Node
checkSafeB *gui.Node checkSafeB *gui.Node
// whitelist map[string]*repolist.RepoRow whitelist map[string]*repolist.RepoRow
} }
func (w *autoType) Disable() { func (w *autoType) Disable() {
@ -51,18 +47,15 @@ func createReleaseBox(box *gui.Node) {
me.release.releaseVersionB = me.release.grid.NewButton("release version", func() { me.release.releaseVersionB = me.release.grid.NewButton("release version", func() {
buttonDisable() buttonDisable()
fpath := me.current.FullPath
if err := doRelease(); err == nil { if err := doRelease(); err == nil {
buttonEnable() buttonEnable()
log.Info("doRelease() worked", fpath) log.Info("doRelease() worked")
} else { } else {
log.Info("doRelease() failed", err, fpath) log.Info("doRelease() failed", err)
log.Info("doRelease() FAILED", err, fpath) log.Info("doRelease() FAILED", err)
log.Info("doRelease() FAILED", err, fpath) log.Info("doRelease() FAILED", err)
log.Info("doRelease() FAILED", err, fpath) log.Info("doRelease() FAILED", err)
} }
skipToNext()
me.forge.PrintHumanTable(me.found)
}) })
me.release.grid.NewButton("Find Next", func() { me.release.grid.NewButton("Find Next", func() {
me.Disable() me.Disable()
@ -84,6 +77,14 @@ func createReleaseBox(box *gui.Node) {
me.release.grid.NextRow() me.release.grid.NextRow()
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() {
if repov := me.repos.View.FindByPath(me.current.GetGoPath()); repov != nil {
repov.Status.Toggle()
}
})
me.release.openrepo.Disable()
*/
me.release.grid.NextRow() me.release.grid.NextRow()
me.release.status = gadgets.NewOneLiner(me.release.grid, "status") me.release.status = gadgets.NewOneLiner(me.release.grid, "status")
me.release.grid.NextRow() me.release.grid.NextRow()
@ -105,69 +106,41 @@ func createReleaseBox(box *gui.Node) {
me.release.grid.NextRow() me.release.grid.NextRow()
// me.userHomePwd.SetText(homeDir) // me.userHomePwd.SetText(homeDir)
me.goSrcPwd.SetText(me.forge.Config.ReposDir) me.goSrcPwd.SetText(me.forge.GetGoSrc())
group := me.release.box.NewGroup("Run on Current Repo") group := me.release.box.NewGroup("Run on Current Repo")
grid := group.NewGrid("buildOptions", 0, 0) grid := group.NewGrid("buildOptions", 0, 0)
/*
grid.NewButton("whitelist", func() {
})
*/
grid.NextRow() grid.NextRow()
group = me.release.box.NewGroup("Publish until done") group = me.release.box.NewGroup("Publish until done")
grid = group.NewGrid("buildOptions", 0, 0) grid = group.NewGrid("buildOptions", 0, 0)
grid.NewButton("doRelease() all", func() { grid.NewButton("doRelease() all", func() {
buttonDisable() buttonDisable()
doReleaseAll() count := 0
for {
log.Info("START doRelease() LOOP count =", count, "len me.done =", len(me.done))
if err := doRelease(); err != nil {
break
}
count += 1
// never allow a loop longer than all the known repos
// this probably doesn't matter, but often this code is wrong
if count > me.forge.Repos.Len() {
// so this is a safety check. never remove this check.
break
}
}
buttonEnable() buttonEnable()
}) })
grid.NextRow() grid.NextRow()
} }
func doReleaseAll() {
count := 0
for {
log.Info("START doRelease() LOOP count =", count, "len me.done =", len(me.done))
if err := doRelease(); err != nil {
break
}
if err := skipToNext(); err != nil {
break
}
count += 1
if count > me.forge.Repos.Len() {
// never allow a loop longer than all the known repos
// this probably doesn't matter, but often this code is wrong
// so this is a safety check. never remove this check.
break
}
}
}
func skipToNext() error {
shell.RunVerbose([]string{"forge", "dirty"})
log.Info("Sleeping for 2 seconds for no reason.")
time.Sleep(1)
me.forge.ScanRepoDir() // looks for new dirs, checks existing repos for changes
me.found = new(gitpb.Repos)
me.current.ReloadCheck()
me.forge.SetConfigSave(true)
me.forge.ConfigSave()
log.Info("sleep 2")
time.Sleep(2 * time.Second)
printDone()
rePrepareRelease()
findNext()
if me.current == nil {
log.Info("NOT GOOD TO RUN ANOTHER DAY")
log.Info("took out all the loop code")
setCurrentRepo(nil, "loop by hand motherfucker", "fucknuts")
return fmt.Errorf("findNext returned next repo == nil")
}
log.Info("GOOD TO RUN ANOTHER DAY ON:", me.current.GetGoPath())
return nil
}
func buttonDisable() { func buttonDisable() {
me.Disable() me.Disable()
me.release.box.Disable() me.release.box.Disable()

View File

@ -1 +0,0 @@
* you can put toolkit .so binaries here

View File

@ -5,7 +5,6 @@ import (
"go.wit.com/dev/alexflint/arg" "go.wit.com/dev/alexflint/arg"
"go.wit.com/gui" "go.wit.com/gui"
"go.wit.com/lib/gadgets" "go.wit.com/lib/gadgets"
"go.wit.com/lib/gui/prep"
"go.wit.com/lib/protobuf/forgepb" "go.wit.com/lib/protobuf/forgepb"
"go.wit.com/lib/protobuf/gitpb" "go.wit.com/lib/protobuf/gitpb"
) )
@ -13,17 +12,16 @@ import (
var me *autoType var me *autoType
type autoType struct { type autoType struct {
pp *arg.Parser // for parsing the command line args. Yay to alexf lint! pp *arg.Parser // for parsing the command line args. Yay to alexf lint!
myGui *prep.GuiPrep // the gui handle itself myGui *gui.Node // the gui handle itself
releaseReasonS string // = "gocui dropdown select" releaseReasonS string // = "gocui dropdown select"
release releaseStruct // notsure release releaseStruct // notsure
reposbox *gui.Node // notsure reposbox *gui.Node // notsure
reposgrid *gui.Node // notsure reposgrid *gui.Node // notsure
reposgroup *gui.Node // notsure reposgroup *gui.Node // notsure
current *gitpb.Repo // tracks the next repo to publish current *gitpb.Repo // tracks the next repo to publish
found *gitpb.Repos // stores the list of repos to process things on found *gitpb.Repos // stores the list of repos to process things on
done []string // gopaths for repos already published done []string // gopaths for repos already published
reason map[*gitpb.Repo]string // the reason this package is going to be updated
// 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
@ -34,7 +32,32 @@ type autoType struct {
mainWindow *gadgets.BasicWindow mainWindow *gadgets.BasicWindow
mainBox *gui.Node mainBox *gui.Node
forge *forgepb.Forge // your customized repo preferences and settings // our view of the repositories
// repos *repoWindow
// your customized repo preferences and settings
forge *forgepb.Forge
// #### autotypist Global Build Options
// what to change all the branches to
// so, as a developer, you can move all the repos
// to the 'devel' branch and then test a devel branch build
// then switch back to your 'username' branch and do a build there
// toMoveToBranch string
// displays the preferred names used for the repo tree state
// mainBranch *gadgets.BasicCombobox
// develBranch *gadgets.BasicCombobox
// userBranch *gadgets.BasicCombobox
// this button will regenerate everyones go.mod & go.sum
rerunGoMod *gui.Node
// if checked, will stop trying to os.Exec() things after failure
stopOnErrors *gui.Node
// button to attempt to autorebuild
autoRebuildButton *gui.Node
// checkbox for --dry-run // checkbox for --dry-run
autoDryRun *gui.Node autoDryRun *gui.Node
@ -60,3 +83,9 @@ type autoType struct {
// show the time it took to do a scan // show the time it took to do a scan
duration *gui.Node duration *gui.Node
} }
/*
func (my *autoType) GoSrcPath() string {
return my.goSrcPwd.String()
}
*/