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

Side by Side Diff: milo/common/config.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/buildbucket/pubsub.go ('k') | milo/common/model/build_summary.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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 if err != nil { 291 if err != nil {
292 return nil, err 292 return nil, err
293 } 293 }
294 for _, cs := range p.Consoles { 294 for _, cs := range p.Consoles {
295 if cs.Name == consoleName { 295 if cs.Name == consoleName {
296 return cs, nil 296 return cs, nil
297 } 297 }
298 } 298 }
299 return nil, fmt.Errorf("Console %s not found in project %s", consoleName , projName) 299 return nil, fmt.Errorf("Console %s not found in project %s", consoleName , projName)
300 } 300 }
301
302 // ProjectConsole is a simple tuple type for GetConsolesForBuilder.
303 type ProjectConsole struct {
304 ProjectID string
305 Console *config.Console
306 }
307
308 // GetConsolesForBuilder retrieves all the console definitions that this builder
309 // belongs to.
310 func GetConsolesForBuilder(c context.Context, builderName string) ([]*ProjectCon sole, error) {
311 projs, err := GetAllProjects(c)
312 if err != nil {
313 return nil, err
314 }
315 ret := []*ProjectConsole{}
316 for _, p := range projs {
317 for _, con := range p.Consoles {
318 for _, b := range con.Builders {
319 if b.Name == builderName {
320 ret = append(ret, &ProjectConsole{p.ID, con})
321 }
322 }
323 }
324 }
325 return ret, nil
326 }
OLDNEW
« no previous file with comments | « milo/buildsource/buildbucket/pubsub.go ('k') | milo/common/model/build_summary.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698