Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1209)

Side by Side Diff: milo/buildsource/buildbucket/pubsub.go

Issue 2991243002: Milo: Console improvements (Closed)
Patch Set: Review comments Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « milo/buildsource/buildbot/pubsub.go ('k') | milo/common/config.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The LUCI Authors. All rights reserved. 1 // Copyright 2017 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 buildbucket 5 package buildbucket
6 6
7 import ( 7 import (
8 "encoding/json" 8 "encoding/json"
9 "fmt" 9 "fmt"
10 "net/http" 10 "net/http"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 if err != nil { 148 if err != nil {
149 return err 149 return err
150 } 150 }
151 status, err := parseStatus(build) 151 status, err := parseStatus(build)
152 if err != nil { 152 if err != nil {
153 return err 153 return err
154 } 154 }
155 // TODO(hinoka): Console related items. 155 // TODO(hinoka): Console related items.
156 bs := model.BuildSummary{ 156 bs := model.BuildSummary{
157 BuildKey: key, 157 BuildKey: key,
158 SelfLink: build.Url,
158 BuilderID: fmt.Sprintf("buildbucket/%s/%s", build.Bucket, builde rName), 159 BuilderID: fmt.Sprintf("buildbucket/%s/%s", build.Bucket, builde rName),
159 Created: parseTimestamp(build.CreatedTs), 160 Created: parseTimestamp(build.CreatedTs),
160 Summary: model.Summary{ 161 Summary: model.Summary{
161 Status: status, 162 Status: status,
162 Start: parseTimestamp(build.StartedTs), 163 Start: parseTimestamp(build.StartedTs),
163 }, 164 },
164 } 165 }
165 if entry.respBuild != nil { 166 if entry.respBuild != nil {
166 // Add info from the respBuild into the build summary if we have the data. 167 // Add info from the respBuild into the build summary if we have the data.
167 if err := entry.respBuild.SummarizeTo(c, &bs); err != nil { 168 if err := entry.respBuild.SummarizeTo(c, &bs); err != nil {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 logging.WithError(err).Errorf(c, "could not parse pubsub message string") 231 logging.WithError(err).Errorf(c, "could not parse pubsub message string")
231 return err 232 return err
232 } 233 }
233 if err := json.Unmarshal(bData, &data); err != nil { 234 if err := json.Unmarshal(bData, &data); err != nil {
234 logging.WithError(err).Errorf(c, "could not parse pubsub message data") 235 logging.WithError(err).Errorf(c, "could not parse pubsub message data")
235 return err 236 return err
236 } 237 }
237 238
238 return handlePubSubBuild(c, &data) 239 return handlePubSubBuild(c, &data)
239 } 240 }
OLDNEW
« no previous file with comments | « milo/buildsource/buildbot/pubsub.go ('k') | milo/common/config.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698