refactor job_factory
@@ -305,7 +305,6 @@ func (d dashboardFactory) constructJobsForDashboard() ([]atc.JobSummary, error)
type nullableBuild struct {
id sql.NullInt64
name sql.NullString
- jobName sql.NullString
status sql.NullString
startTime pq.NullTime
endTime pq.NullTime
@@ -472,17 +471,13 @@ func (d dashboardFactory) fetchJobOutputs() (map[int][]atc.JobOutputSummary, err
func (d dashboardFactory) combineJobInputsAndOutputsWithDashboardJobs(dashboard []atc.JobSummary, jobInputs map[int][]atc.JobInputSummary, jobOutputs map[int][]atc.JobOutputSummary) []atc.JobSummary {
var finalDashboard []atc.JobSummary
for _, job := range dashboard {
- for _, input := range jobInputs[job.ID] {
- job.Inputs = append(job.Inputs, input)
- }
+ job.Inputs = append(job.Inputs, jobInputs[job.ID]...)
sort.Slice(job.Inputs, func(p, q int) bool {
return job.Inputs[p].Name < job.Inputs[q].Name
})
- for _, output := range jobOutputs[job.ID] {
- job.Outputs = append(job.Outputs, output)
- }
+ job.Outputs = append(job.Outputs, jobOutputs[job.ID]...)
sort.Slice(job.Outputs, func(p, q int) bool {
return job.Outputs[p].Name < job.Outputs[q].Name
