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

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

Issue 2977863002: [milo] Refactor all html knowledge out of backends. (Closed)
Patch Set: seems to work :) 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
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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 return time.Unix(microseconds/1e6, microseconds%1e6*1000).UTC() 298 return time.Unix(microseconds/1e6, microseconds%1e6*1000).UTC()
299 } 299 }
300 300
301 type newBuildsFirst []*resp.BuildSummary 301 type newBuildsFirst []*resp.BuildSummary
302 302
303 func (a newBuildsFirst) Len() int { return len(a) } 303 func (a newBuildsFirst) Len() int { return len(a) }
304 func (a newBuildsFirst) Swap(i, j int) { a[i], a[j] = a[j], a[i] } 304 func (a newBuildsFirst) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
305 func (a newBuildsFirst) Less(i, j int) bool { 305 func (a newBuildsFirst) Less(i, j int) bool {
306 return a[i].PendingTime.Started.After(a[j].PendingTime.Started) 306 return a[i].PendingTime.Started.After(a[j].PendingTime.Started)
307 } 307 }
308
309 // GetBuilder is used by buildsource.BuilderID.Get to obtain the resp.Builder.
310 func GetBuilder(ctx context.Context, bucket, builder string, limit int) (*resp.B uilder, error) {
311 // TODO(iannucci): set buildbucket host?
Ryan Tseng 2017/07/13 22:00:46 buildbucket:milo is a 1:1 relationship atm, so it'
iannucci 2017/07/14 19:00:22 yeah hence todo :)
312 var query builderQuery
Ryan Tseng 2017/07/13 22:00:46 nit: inline
iannucci 2017/07/14 19:00:22 Done.
313 query.Bucket = bucket
314 query.Builder = builder
315 query.Limit = limit
316 return builderImpl(ctx, query)
317 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698