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

Side by Side Diff: tools/gardening/lib/src/luci_services.dart

Issue 3005443002: Additional tools for gardening. (Closed)
Patch Set: Added changes from johnniwinther Created 3 years, 3 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 | « tools/gardening/lib/src/luci_api.dart ('k') | tools/gardening/lib/src/try.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'dart:async';
6 import 'try.dart';
7 import 'logger.dart';
8 import 'cache_new.dart';
9 import 'luci_api.dart';
10
11 /// Fetches all builds for a given [commit]-hash, by searching the latest
12 /// [amount] builds.
13 Future<Try<List<BuildDetail>>> fetchBuildsForCommmit(LuciApi api, Logger logger,
14 String client, String commit, CreateCacheFunction createCache,
15 [int amount = 1]) async {
16 logger.debug("Finding primary bots for client $client");
17 var buildBots = await api.getPrimaryBuilders(
18 client, createCache(duration: new Duration(minutes: 30)));
19
20 var cache = createCache(duration: new Duration(minutes: 30));
21 return (await buildBots.bindAsync((List<LuciBuildBot> buildBots) async {
22 var buildBotBuilds = new List<List<BuildDetail>>();
23 for (var buildBot in buildBots) {
24 (await api.getBuildBotDetails(client, buildBot.name, cache, amount)).fold(
25 (ex, st) {
26 logger.error("Problem getting results", ex, st);
27 }, buildBotBuilds.add);
28 }
29 logger.debug("All latest $amount builds found for client $client. "
30 "Processing results...");
31 return buildBotBuilds.expand((id) => id).toList();
32 })).bind((List<BuildDetail> buildDetails) {
33 return buildDetails.where((BuildDetail buildDetail) {
34 return buildDetail.allChanges.any((change) => change.revision == commit);
35 });
36 });
37 }
OLDNEW
« no previous file with comments | « tools/gardening/lib/src/luci_api.dart ('k') | tools/gardening/lib/src/try.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698