This commit is contained in:
Adam Majer 2024-08-02 15:34:44 +02:00
parent a8d392ea53
commit c7569c7f95
2 changed files with 37 additions and 0 deletions

View File

@ -229,6 +229,10 @@ func (r *BuildResultList) GetPackageList() []string {
}
func (r *BuildResultList) BuildResultSummary() (success, finished bool) {
if r == nil {
return true, true
}
finished = len(r.Result) > 0 && len(r.Result[0].Status) > 0
success = finished

View File

@ -96,6 +96,39 @@ func processBuildStatus(h *common.RequestHandler, project, refProject *common.Bu
panic("Should not happen -- BuiltResultSorter equal repos?")
}
slices.SortFunc(project.Result, BuildResultSorter)
if refProject == nil {
// just return if buid finished and have some successes, since new package
SomeSuccess := false
for i := 0; i < len(project.Result); i++ {
repoRes := &project.Result[i]
repoResStatus, ok := common.ObsRepoStatusDetails[repoRes.Code]
if !ok {
return BuildStatusSummaryUnknown
}
if !repoResStatus.Finished {
return BuildStatusSummaryBuilding
}
for _, pkg := range repoRes.Status {
pkgStatus, ok := common.ObsBuildStatusDetails[pkg.Code]
if !ok {
h.LogError("Unknown package build status: %s for %s", pkg.Code, pkg.Package)
h.LogError("Details: %s", pkg.Details)
return BuildStatusSummaryUnknown
}
if pkgStatus.Success {
SomeSuccess = true
}
}
}
if SomeSuccess {
return BuildStatusSummarySuccess
}
return BuildStatusSummaryFailed
}
slices.SortFunc(refProject.Result, BuildResultSorter)
j := 0