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

Side by Side Diff: milo/buildsource/buildbot/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/api/proto/pb.discovery.go ('k') | milo/buildsource/buildbucket/pubsub.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 2016 The LUCI Authors. 1 // Copyright 2016 The LUCI Authors.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 b.Currentstep = nil 224 b.Currentstep = nil
225 b.Text = append(b.Text, "Build expired on Milo") 225 b.Text = append(b.Text, "Build expired on Milo")
226 return datastore.Put(c, b) 226 return datastore.Put(c, b)
227 } 227 }
228 228
229 // saveBuildSummary summerizes a build into a model.BuildSummary and then saves it. 229 // saveBuildSummary summerizes a build into a model.BuildSummary and then saves it.
230 func saveBuildSummary(c context.Context, b *buildbotBuild) error { 230 func saveBuildSummary(c context.Context, b *buildbotBuild) error {
231 resp := renderBuild(c, b) 231 resp := renderBuild(c, b)
232 bs := model.BuildSummary{ 232 bs := model.BuildSummary{
233 BuildKey: datastore.KeyForObj(c, b), 233 BuildKey: datastore.KeyForObj(c, b),
234 SelfLink: fmt.Sprintf("/buildbot/%s/%s/%d", b.Master, b.Builder name, b.Number),
234 BuilderID: fmt.Sprintf("buildbot/%s/%s", b.Master, b.Buildername ), 235 BuilderID: fmt.Sprintf("buildbot/%s/%s", b.Master, b.Buildername ),
235 } 236 }
236 if err := resp.SummarizeTo(c, &bs); err != nil { 237 if err := resp.SummarizeTo(c, &bs); err != nil {
237 return err 238 return err
238 } 239 }
239 return datastore.Put(c, &bs) 240 return datastore.Put(c, &bs)
240 } 241 }
241 242
242 func doMaster(c context.Context, master *buildbotMaster, internal bool) int { 243 func doMaster(c context.Context, master *buildbotMaster, internal bool) int {
243 // Store the master json into the datastore. 244 // Store the master json into the datastore.
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 428
428 } 429 }
429 if master != nil { 430 if master != nil {
430 code := doMaster(c, master, internal) 431 code := doMaster(c, master, internal)
431 if code != 0 { 432 if code != 0 {
432 return code 433 return code
433 } 434 }
434 } 435 }
435 return http.StatusOK 436 return http.StatusOK
436 } 437 }
OLDNEW
« no previous file with comments | « milo/api/proto/pb.discovery.go ('k') | milo/buildsource/buildbucket/pubsub.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698