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

Side by Side Diff: milo/appengine/buildbucket/buckets.go

Issue 2801463002: Milo: Use custom config caching layer (Closed)
Patch Set: Review: Remove double logging Created 3 years, 8 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/appengine/buildbot/pubsub_test.go ('k') | milo/appengine/buildbucket/builder.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 "errors" 8 "errors"
9 "fmt" 9 "fmt"
10 10
11 "golang.org/x/net/context" 11 "golang.org/x/net/context"
12 12
13 "github.com/luci/luci-go/common/logging"
14 "github.com/luci/luci-go/milo/api/resp" 13 "github.com/luci/luci-go/milo/api/resp"
15 "github.com/luci/luci-go/milo/appengine/common" 14 "github.com/luci/luci-go/milo/appengine/common"
16 ) 15 )
17 16
18 func GetAllBuilders(c context.Context) (*resp.CIService, error) { 17 func GetAllBuilders(c context.Context) (*resp.CIService, error) {
19 » settings, err := common.GetSettings(c) 18 » settings := common.GetSettings(c)
20 » if err != nil {
21 » » logging.WithError(err).Errorf(c, "could not get settings for bui ldbucket")
22 » » return nil, err
23 » }
24 bucketSettings := settings.Buildbucket 19 bucketSettings := settings.Buildbucket
25 if bucketSettings == nil { 20 if bucketSettings == nil {
26 return nil, errors.New("buildbucket settings missing in config") 21 return nil, errors.New("buildbucket settings missing in config")
27 } 22 }
28 result := &resp.CIService{ 23 result := &resp.CIService{
29 Name: "Swarmbucket", 24 Name: "Swarmbucket",
30 Host: &resp.Link{ 25 Host: &resp.Link{
31 Label: bucketSettings.Name, 26 Label: bucketSettings.Name,
32 URL: "https://" + bucketSettings.Host, 27 URL: "https://" + bucketSettings.Host,
33 }, 28 },
(...skipping 16 matching lines...) Expand all
50 group.Builders[j] = resp.Link{ 45 group.Builders[j] = resp.Link{
51 Label: builder.Name, 46 Label: builder.Name,
52 URL: fmt.Sprintf("/buildbucket/%s/%s", bucket. Name, builder.Name), 47 URL: fmt.Sprintf("/buildbucket/%s/%s", bucket. Name, builder.Name),
53 } 48 }
54 } 49 }
55 result.BuilderGroups[i] = group 50 result.BuilderGroups[i] = group
56 } 51 }
57 52
58 return result, nil 53 return result, nil
59 } 54 }
OLDNEW
« no previous file with comments | « milo/appengine/buildbot/pubsub_test.go ('k') | milo/appengine/buildbucket/builder.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698