moved lots of logic to go-mod-clean

This commit is contained in:
Jeff Carr 2025-02-07 11:21:51 -06:00
parent 3ceb5d0bf5
commit 021c7774b2
4 changed files with 16 additions and 42 deletions

View File

@ -69,48 +69,19 @@ func findNext() bool {
log.Info("findNext() alreadyDone. WHY IS THIS STILL CHECKING?", check.GetGoPath()) log.Info("findNext() alreadyDone. WHY IS THIS STILL CHECKING?", check.GetGoPath())
continue continue
} }
log.Info("CHECKING:", check.GetGoPath()) log.Info("CHECKING START:", check.GetGoPath())
// _, err := check.RunVerboseOnError([]string{"go-mod-clean", "--strict"})
_, err := check.RunQuiet([]string{"go-mod-clean", "--smart"})
if err != nil {
log.Info("FAILED: findNext() go-mod-clean --smart", check.GetGoPath(), err)
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
}
/* /*
if err := me.forge.CleanGoDepsCheckOk(check); err != nil { findCounter += 1
log.Info("CleanGoDepsCheckOk() failed", check.GetGoPath(), err) if !check.ParseGoSum() {
log.Info("CleanGoDepsCheckOk() failed", check.GetGoPath(), err) log.Info("ParseGoSum() failed", check.GetGoPath())
log.Info("ParseGoSum() failed", check.GetGoPath())
log.Info("ParseGoSum() failed", check.GetGoPath())
continue continue
} }
*/ */
/* // fixGodeps(check)
if err := checkDeps(check); err != nil {
log.Info("CHECK DEPS FAILED", check.GetGoPath(), err)
log.Info("CHECK DEPS FAILED", check.GetGoPath(), err)
log.Info("CHECK DEPS FAILED", check.GetGoPath(), err)
continue
} else {
log.Info("Might be ok?", check.GetGoPath())
}
*/
fixGodeps(check)
/*
} else {
log.Info("SKIPPING FIX", check.GetGoPath())
log.Info("SKIPPING FIX", check.GetGoPath())
log.Info("SKIPPING FIX", check.GetGoPath())
}
*/
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 {
@ -138,7 +109,7 @@ func findNext() bool {
} }
// tries to fix the go.mod and go.sum files // tries to fix the go.mod and go.sum files
func fixGodeps(check *gitpb.Repo) bool { func fixGodepsOLD(check *gitpb.Repo) bool {
var good bool = true var good bool = true
check.GoDeps = nil check.GoDeps = nil

View File

@ -94,7 +94,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
return return
} }
// destroy and recreate the go.sum // destroy and recreate the go.sum
fixGodeps(check) fixGodepsOLD(check)
findOk = true findOk = true
return return
case "/showNext": case "/showNext":

View File

@ -51,10 +51,10 @@ func rillRestore(repo *gitpb.Repo) error {
return nil return nil
} }
_, err := repo.RunQuiet([]string{"go-mod-clean", "--restore"}) _, err := repo.RunQuiet([]string{"go-mod-clean", "--smart"})
rillcount += 1 rillcount += 1
if err != nil { if err != nil {
log.Info("go-mod-clean --restore failed", repo.GetGoPath(), err) log.Info("go-mod-clean --smart failed", repo.GetGoPath(), err)
return err return err
} }
return nil return nil
@ -65,7 +65,7 @@ func rePrepareRelease() {
// me.forge = forgepb.Init() // me.forge = forgepb.Init()
me.found = new(gitpb.Repos) me.found = new(gitpb.Repos)
log.Printf("rePrepareRelease() START rill go-mod-clean --restore (11 seconds?)") log.Printf("rePrepareRelease() START rill go-mod-clean --smart (11 seconds?)")
rillcount = 0 rillcount = 0
now := time.Now() now := time.Now()
me.forge.RillFuncError(rillRestore) me.forge.RillFuncError(rillRestore)

View File

@ -51,7 +51,10 @@ func createReleaseBox(box *gui.Node) {
buttonEnable() buttonEnable()
log.Info("doRelease() worked") log.Info("doRelease() worked")
} else { } else {
log.Info("doRelease() failed", err, me.current.GetGoPath()) log.Info("doRelease() failed", err)
log.Info("doRelease() FAILED", err)
log.Info("doRelease() FAILED", err)
log.Info("doRelease() FAILED", err)
} }
}) })
me.release.grid.NewButton("Find Next", func() { me.release.grid.NewButton("Find Next", func() {