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

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

Issue 2979283002: Add manifest links and hack to index on revision. (Closed)
Patch Set: actually upload Created 3 years, 5 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 BuildKey: key, 157 BuildKey: key,
158 BuilderID: fmt.Sprintf("buildbucket/%s/%s", build.Bucket, builde rName), 158 BuilderID: fmt.Sprintf("buildbucket/%s/%s", build.Bucket, builde rName),
159 Created: parseTimestamp(build.CreatedTs), 159 Created: parseTimestamp(build.CreatedTs),
160 Summary: model.Summary{ 160 Summary: model.Summary{
161 Status: status, 161 Status: status,
162 Start: parseTimestamp(build.StartedTs), 162 Start: parseTimestamp(build.StartedTs),
163 }, 163 },
164 } 164 }
165 if entry.respBuild != nil { 165 if entry.respBuild != nil {
166 // Add info from the respBuild into the build summary if we have the data. 166 // Add info from the respBuild into the build summary if we have the data.
167 » » entry.respBuild.SummarizeTo(&bs) 167 » » if err := entry.respBuild.SummarizeTo(c, &bs); err != nil {
168 » » » return err
169 » » }
168 } 170 }
169 logging.Debugf(c, "Created build summary: %#v", bs) 171 logging.Debugf(c, "Created build summary: %#v", bs)
170 // Make datastore flakes transient errors 172 // Make datastore flakes transient errors
171 return transient.Tag.Apply(datastore.Put(c, &bs)) 173 return transient.Tag.Apply(datastore.Put(c, &bs))
172 } 174 }
173 175
174 func handlePubSubBuild(c context.Context, data *psMsg) error { 176 func handlePubSubBuild(c context.Context, data *psMsg) error {
175 host := data.Hostname 177 host := data.Hostname
176 build := &data.Build 178 build := &data.Build
177 // We only care about the "builder_name" key from the parameter. 179 // We only care about the "builder_name" key from the parameter.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 logging.WithError(err).Errorf(c, "could not parse pubsub message string") 230 logging.WithError(err).Errorf(c, "could not parse pubsub message string")
229 return err 231 return err
230 } 232 }
231 if err := json.Unmarshal(bData, &data); err != nil { 233 if err := json.Unmarshal(bData, &data); err != nil {
232 logging.WithError(err).Errorf(c, "could not parse pubsub message data") 234 logging.WithError(err).Errorf(c, "could not parse pubsub message data")
233 return err 235 return err
234 } 236 }
235 237
236 return handlePubSubBuild(c, &data) 238 return handlePubSubBuild(c, &data)
237 } 239 }
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