| OLD | NEW |
| 1 // Copyright 2016 The LUCI Authors. All rights reserved. | 1 // Copyright 2016 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package buildbot | 5 package buildbot |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "crypto/sha1" | 8 "crypto/sha1" |
| 9 "encoding/base64" | 9 "encoding/base64" |
| 10 "errors" | 10 "errors" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 for k := range master.Builders { | 203 for k := range master.Builders { |
| 204 keys = append(keys, k) | 204 keys = append(keys, k) |
| 205 } | 205 } |
| 206 sort.Strings(keys) | 206 sort.Strings(keys) |
| 207 return nil, errBuilderNotFound{masterName, builderName, keys} | 207 return nil, errBuilderNotFound{masterName, builderName, keys} |
| 208 } | 208 } |
| 209 // Extract pending builds out of the master json. | 209 // Extract pending builds out of the master json. |
| 210 result.PendingBuilds = make([]*resp.BuildSummary, len(p.PendingBuildStat
es)) | 210 result.PendingBuilds = make([]*resp.BuildSummary, len(p.PendingBuildStat
es)) |
| 211 logging.Debugf(c, "Number of pending builds: %d", len(p.PendingBuildStat
es)) | 211 logging.Debugf(c, "Number of pending builds: %d", len(p.PendingBuildStat
es)) |
| 212 for i, pb := range p.PendingBuildStates { | 212 for i, pb := range p.PendingBuildStates { |
| 213 » » start := time.Unix(int64(pb.SubmittedAt), 0) | 213 » » start := time.Unix(int64(pb.SubmittedAt), 0).UTC() |
| 214 result.PendingBuilds[i] = &resp.BuildSummary{ | 214 result.PendingBuilds[i] = &resp.BuildSummary{ |
| 215 PendingTime: resp.Interval{ | 215 PendingTime: resp.Interval{ |
| 216 Started: start, | 216 Started: start, |
| 217 » » » » Duration: time.Now().Sub(start), | 217 » » » » Duration: clock.Now(c).UTC().Sub(start), |
| 218 }, | 218 }, |
| 219 } | 219 } |
| 220 result.PendingBuilds[i].Blame = make([]*resp.Commit, len(pb.Sour
ce.Changes)) | 220 result.PendingBuilds[i].Blame = make([]*resp.Commit, len(pb.Sour
ce.Changes)) |
| 221 for j, cm := range pb.Source.Changes { | 221 for j, cm := range pb.Source.Changes { |
| 222 result.PendingBuilds[i].Blame[j] = &resp.Commit{ | 222 result.PendingBuilds[i].Blame[j] = &resp.Commit{ |
| 223 AuthorEmail: cm.Who, | 223 AuthorEmail: cm.Who, |
| 224 CommitURL: cm.Revlink, | 224 CommitURL: cm.Revlink, |
| 225 } | 225 } |
| 226 } | 226 } |
| 227 } | 227 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 253 } | 253 } |
| 254 result.CurrentBuilds = currentBuilds | 254 result.CurrentBuilds = currentBuilds |
| 255 | 255 |
| 256 for _, fb := range finishedBuilds { | 256 for _, fb := range finishedBuilds { |
| 257 if fb != nil { | 257 if fb != nil { |
| 258 result.FinishedBuilds = append(result.FinishedBuilds, fb
) | 258 result.FinishedBuilds = append(result.FinishedBuilds, fb
) |
| 259 } | 259 } |
| 260 } | 260 } |
| 261 return result, nil | 261 return result, nil |
| 262 } | 262 } |
| OLD | NEW |