prow/cmd/deck/pr_history.go
func getPRBuildData(bucket storageBucket, jobs []jobBuilds) []buildData {
	buildch := make(chan buildData)
	defer close(buildch)
	expected := 0
	for _, job := range jobs {
		for j, buildPrefix := range job.buildPrefixes {
			go func(j int, jobName, buildPrefix string) {
				build, err := getBuildData(bucket, buildPrefix)
				if err != nil {
					logrus.WithError(err).Warningf("build %s information incomplete", buildPrefix)
				}
				split := strings.Split(strings.TrimSuffix(buildPrefix, "/"), "/")
				build.SpyglassLink = path.Join(spyglassPrefix, bucket.getName(), buildPrefix)
				build.ID = split[len(split)-1]
				build.jobName = jobName
				build.prefix = buildPrefix
				build.index = j
				buildch <- build
			}(j, job.name, buildPrefix)
			expected++
		}
	}
	builds := []buildData{}
	for k := 0; k < expected; k++ {
		build := <-buildch
		builds = append(builds, build)
	}
	return builds
}
func getPRBuildData(bucket storageBucket, jobs []jobBuilds) []buildData {
	buildch := make(chan buildData)
	defer close(buildch)
	expected := 0
	for _, job := range jobs {
		for j, buildPrefix := range job.buildPrefixes {
			go func(j int, jobName, buildPrefix string) {
				build, err := getBuildData(bucket, buildPrefix)
				if err != nil {
					logrus.WithError(err).Warningf("build %s information incomplete", buildPrefix)
				}
				split := strings.Split(strings.TrimSuffix(buildPrefix, "/"), "/")
				build.SpyglassLink = path.Join(spyglassPrefix, bucket.getName(), buildPrefix)
				build.ID = split[len(split)-1]
				build.jobName = jobName
				build.prefix = buildPrefix
				build.index = j
				buildch <- build
			}(j, job.name, buildPrefix)
			expected++
		}
	}
	builds := []buildData{}
	for k := 0; k < expected; k++ {
		build := <-buildch
		builds = append(builds, build)
	}
	return builds
}
func getPRBuildData ( bucket storageBucket , jobs [ ] jobBuilds ) [ ] buildData { buildch := make ( chan buildData ) defer close ( buildch ) expected := 0 for _ , job := range jobs { for j , buildPrefix := range job . buildPrefixes { go func ( j int , jobName , buildPrefix string ) { build , err := getBuildData ( bucket , buildPrefix ) if err != nil { logrus . WithError ( err ) . Warningf ( " " , buildPrefix ) } split := strings . Split ( strings . TrimSuffix ( buildPrefix , " " ) , " " ) build . SpyglassLink = path . Join ( spyglassPrefix , bucket . getName ( ) , buildPrefix ) build . ID = split [ len ( split ) - 1 ] build . jobName = jobName build . prefix = buildPrefix build . index = j buildch <- build } ( j , job . name , buildPrefix ) expected ++ } } builds := [ ] buildData { } for k := 0 ; k < expected ; k ++ { build := <- buildch builds = append ( builds , build ) } return builds }
// getPRBuildData concurrently fetches metadata on each build of each job run on a PR
getPRBuildData concurrently fetches metadata on each build of each job run on a PR