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

Side by Side Diff: milo/common/config.go

Issue 2984673002: [milo] get console in working shape. (Closed)
Patch Set: fix build 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/console.go ('k') | milo/frontend/appengine/templates/pages/console.html » ('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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 return merr 354 return merr
355 } 355 }
356 356
357 // GetAllConsoles returns all registered projects with the builder name. 357 // GetAllConsoles returns all registered projects with the builder name.
358 // If builderName is empty, then this retrieves all Consoles. 358 // If builderName is empty, then this retrieves all Consoles.
359 func GetAllConsoles(c context.Context, builderName string) ([]*Console, error) { 359 func GetAllConsoles(c context.Context, builderName string) ([]*Console, error) {
360 q := datastore.NewQuery("Console") 360 q := datastore.NewQuery("Console")
361 if builderName != "" { 361 if builderName != "" {
362 q = q.Eq("Builders", builderName) 362 q = q.Eq("Builders", builderName)
363 } 363 }
364 q.Order("ID")
365 con := []*Console{} 364 con := []*Console{}
366 err := datastore.GetAll(c, q, &con) 365 err := datastore.GetAll(c, q, &con)
367 return con, err 366 return con, err
368 } 367 }
369 368
370 // GetConsole returns the requested console. 369 // GetConsole returns the requested console.
371 func GetConsole(c context.Context, proj, id string) (*Console, error) { 370 func GetConsole(c context.Context, proj, id string) (*Console, error) {
372 // TODO(hinoka): Memcache this. 371 // TODO(hinoka): Memcache this.
373 con := Console{ 372 con := Console{
374 Parent: datastore.MakeKey(c, "Project", proj), 373 Parent: datastore.MakeKey(c, "Project", proj),
375 ID: id, 374 ID: id,
376 } 375 }
377 err := datastore.Get(c, &con) 376 err := datastore.Get(c, &con)
378 return &con, err 377 return &con, err
379 } 378 }
OLDNEW
« no previous file with comments | « milo/buildsource/console.go ('k') | milo/frontend/appengine/templates/pages/console.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698