track down logic error on detecting go 'primitive' packages

This commit is contained in:
Jeff Carr 2024-12-03 22:35:19 -06:00
parent 9b9df05f33
commit d6ecd246e0
4 changed files with 49 additions and 5 deletions

View File

@ -103,13 +103,15 @@ func doRelease() bool {
pb := me.forge.Repos.FindByGoPath(me.current.GoPath())
if pb != nil {
pb.UpdatePublished()
if !pb.GetGoPrimitive() {
/* remove. earlier protected against nil
if !pb.IsPrimitive() {
loop := pb.Published.SortByGoPath()
for loop.Scan() {
t := loop.Next()
log.Info("new Published dep:", t.GetGoPath(), t.GetVersion())
}
}
*/
me.forge.Repos.ConfigSave()
}

View File

@ -39,21 +39,50 @@ func findNext() bool {
log.Info("findNext() skipping dirty")
continue
}
log.Info("findNext()", repo.GoPath(), "is not a primative repo")
if findFix {
log.Info("findFix is true. running fixGoDeps()")
fixGodeps(check)
if fixGodeps(check) {
log.Info("fixGoDeps() returned true")
} else {
log.Info("fixGoDeps() returned false")
}
}
findCounter += 1
if check.Exists("go.mod") {
log.Info("go.mod exists here")
} else {
log.Info("go.mod is gone here")
}
if ok, err := check.ParseGoSum(); !ok {
log.Info("ParseGoSum() failed (probably repo needs go mod tidy)", err)
log.Info("ParseGoSum() findFix =", findFix, "findCounter =", findCounter)
if check.Exists("go.mod") {
log.Info("go.mod exists here")
} else {
log.Info("go.mod is gone here")
}
continue
}
if check.Exists("go.mod") {
log.Info("go.mod exists here")
} else {
log.Info("go.mod is gone here")
}
if me.forge.FinalGoDepsCheckOk(check) {
setCurrentRepo(repo, "should be good to release", "pretty sure")
if check.Exists("go.mod") {
log.Info("go.mod exists here")
} else {
log.Info("go.mod is gone here")
}
return true
}
if check.Exists("go.mod") {
log.Info("go.mod exists here")
} else {
log.Info("go.mod is gone here")
}
log.Info("findNext() got to the end. repo", repo.GoPath(), "did not work. trying to find a new one now")
}
if findCounter == 0 {
@ -72,7 +101,7 @@ func fixGodeps(check *gitpb.Repo) bool {
var good bool = true
// check if the package dependancies changed, if so, re-publish
// skip primative ones
if check.GetGoPrimitive() {
if ok, _ := check.IsPrimitive(); ok {
log.Info("fixGoDeps() skipping primitive", check.GoPath)
return true
}

View File

@ -124,5 +124,16 @@ func makePrepareRelease() {
}
}
}
findNext()
if findNext() {
log.Info("prepare release findNext() returned true")
me.release.box.Enable()
} else {
log.Info("prepare release findNext() returned false")
if findNext() {
log.Info("prepare release findNext() returned true")
me.release.box.Enable()
} else {
log.Info("prepare release findNext() returned false")
}
}
}

View File

@ -233,8 +233,10 @@ func createReleaseBox(box *gui.Node) {
func buttonDisable() {
me.Disable()
me.release.box.Disable()
}
func buttonEnable() {
me.Enable()
me.release.box.Enable()
}