fixes do to 'go mod' behavior changes

This commit is contained in:
Jeff Carr 2025-05-29 19:18:12 -05:00
parent c0b5f7da3a
commit 2f6b497b12
4 changed files with 42 additions and 18 deletions

View File

@ -93,3 +93,6 @@ safe-build: install
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/ && time GUIRELEASE_REASON="safe-build" guireleaser --gui andlabs
autocomplete:
guireleaser --bash > ~/.local/share/bash-completion/completions/guireleaser

View File

@ -93,6 +93,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
}
testGoRepo(check)
me.forge.HumanPrintRepo(check)
log.Info("upgrade reason:", me.reason[check])
return
case "/list":
me.forge.PrintHumanTable(me.found)

View File

@ -53,10 +53,10 @@ func rillPurge(repo *gitpb.Repo) error {
return nil
}
_, err := repo.RunQuiet([]string{"go-mod-clean", "--purge"})
_, err := repo.RunQuiet([]string{"go-mod-clean", "purge"})
rillcount += 1
if err != nil {
log.Info("go-mod-clean --smart failed", repo.GetGoPath(), err)
log.Info("go-mod-clean purge failed", repo.GetGoPath(), err)
return err
}
return nil
@ -72,18 +72,18 @@ func rillRestore(repo *gitpb.Repo) error {
var err error
if argv.Verbose {
log.Info("go-mod-clean --smart START", repo.GetGoPath())
result := repo.RunRealtime([]string{"go-mod-clean", "--smart"})
log.Info("go-mod-clean --smart END", repo.GetGoPath())
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", "--smart"})
_, err = repo.RunQuiet([]string{"go-mod-clean", "lax"})
}
rillcount += 1
if err != nil {
log.Info("go-mod-clean --smart failed", repo.GetGoPath(), err)
log.Info("go-mod-clean lax failed", repo.GetGoPath(), err)
return err
}
return nil
@ -93,8 +93,9 @@ func rePrepareRelease() {
// reload the config
// me.forge = forgepb.Init()
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 --smart (11 seconds?)")
log.Printf("rePrepareRelease() START rill go-mod-clean lax (11 seconds?)")
rillcount = 0
forgepb.RillX = 2
forgepb.RillY = 2
@ -176,6 +177,7 @@ func rePrepareRelease() {
log.Printf("NEED RELEASE FOR %-50s tag %s != %s\n", check.GetGoPath(), master, lastTag)
forceReleaseVersion(check)
me.found.AppendByGoPath(check)
me.reason[check] = "master != lastTag"
continue
}
@ -197,6 +199,7 @@ func rePrepareRelease() {
// if --protobuf, this will force upgrade each one
forceReleaseVersion(check)
me.found.AppendByGoPath(check)
me.reason[check] = "protobuf repo deps changed"
continue
}
@ -211,6 +214,7 @@ func rePrepareRelease() {
log.Printf("NEED RELEASE FOR %-50s err: %v\n", check.GetGoPath(), err)
forceReleaseVersion(check)
me.found.AppendByGoPath(check)
me.reason[check] = "FinalGoDepsCheckOk() failed even though master tag == last tag"
}
}
@ -238,6 +242,21 @@ func alreadyDone(repo *gitpb.Repo) bool {
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 {
godepsOld, err := repo.GoSumFromPkgDir()
if err != nil {

View File

@ -12,16 +12,17 @@ import (
var me *autoType
type autoType struct {
pp *arg.Parser // for parsing the command line args. Yay to alexf lint!
myGui *gui.Node // the gui handle itself
releaseReasonS string // = "gocui dropdown select"
release releaseStruct // notsure
reposbox *gui.Node // notsure
reposgrid *gui.Node // notsure
reposgroup *gui.Node // notsure
current *gitpb.Repo // tracks the next repo to publish
found *gitpb.Repos // stores the list of repos to process things on
done []string // gopaths for repos already published
pp *arg.Parser // for parsing the command line args. Yay to alexf lint!
myGui *gui.Node // the gui handle itself
releaseReasonS string // = "gocui dropdown select"
release releaseStruct // notsure
reposbox *gui.Node // notsure
reposgrid *gui.Node // notsure
reposgroup *gui.Node // notsure
current *gitpb.Repo // tracks the next repo to publish
found *gitpb.Repos // stores the list of repos to process things on
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
// make sure it never changes so go.mod and go.sum are always there