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

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

Issue 2975023002: [milo] remove linkBase and calculate links directly. (Closed)
Patch Set: common url base 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 | « no previous file | milo/buildsource/swarming/build.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 "errors" 9 "errors"
10 "fmt" 10 "fmt"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 return nil, errors.New("no swarming hostname tag") 92 return nil, errors.New("no swarming hostname tag")
93 } 93 }
94 if task, ok = tags["swarming_task_id"]; !ok { 94 if task, ok = tags["swarming_task_id"]; !ok {
95 return nil, errors.New("no swarming task id") 95 return nil, errors.New("no swarming task id")
96 } 96 }
97 swarmingSvc, err := swarming.NewProdService(c, host) 97 swarmingSvc, err := swarming.NewProdService(c, host)
98 if err != nil { 98 if err != nil {
99 return nil, err 99 return nil, err
100 } 100 }
101 bl := swarming.BuildLoader{} 101 bl := swarming.BuildLoader{}
102 » // The linkBase is not necessary for the summary. 102 » return bl.SwarmingBuildImpl(c, swarmingSvc, task)
103 » return bl.SwarmingBuildImpl(c, swarmingSvc, "", task)
104 } 103 }
105 104
106 // processBuild queries swarming and logdog for annotation data, then adds or 105 // processBuild queries swarming and logdog for annotation data, then adds or
107 // updates a buildEntry in datastore. 106 // updates a buildEntry in datastore.
108 func processBuild( 107 func processBuild(
109 c context.Context, host string, build *bucketApi.ApiCommonBuildMessage) ( 108 c context.Context, host string, build *bucketApi.ApiCommonBuildMessage) (
110 *buildEntry, error) { 109 *buildEntry, error) {
111 110
112 now := clock.Now(c).UTC() 111 now := clock.Now(c).UTC()
113 entry := buildEntry{key: buildEntryKey(host, build.Id)} 112 entry := buildEntry{key: buildEntryKey(host, build.Id)}
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 logging.WithError(err).Errorf(c, "could not parse pubsub message string") 227 logging.WithError(err).Errorf(c, "could not parse pubsub message string")
229 return err 228 return err
230 } 229 }
231 if err := json.Unmarshal(bData, &data); err != nil { 230 if err := json.Unmarshal(bData, &data); err != nil {
232 logging.WithError(err).Errorf(c, "could not parse pubsub message data") 231 logging.WithError(err).Errorf(c, "could not parse pubsub message data")
233 return err 232 return err
234 } 233 }
235 234
236 return handlePubSubBuild(c, &data) 235 return handlePubSubBuild(c, &data)
237 } 236 }
OLDNEW
« no previous file with comments | « no previous file | milo/buildsource/swarming/build.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698