| Index: tools/gardening/bin/luci_api.dart
|
| diff --git a/tools/gardening/bin/luci_api.dart b/tools/gardening/bin/luci_api.dart
|
| index 484408f53f85b00fa1f60195e310951b99f1dc05..6d53f63b138ce0dbbdef30a1e5fae08e41b2180a 100644
|
| --- a/tools/gardening/bin/luci_api.dart
|
| +++ b/tools/gardening/bin/luci_api.dart
|
| @@ -29,6 +29,17 @@ ArgParser setupArgs() {
|
| ..addFlag("build-bots-all",
|
| negatable: false,
|
| help: "Use this flag to see all build bots for --client.")
|
| + ..addFlag("master",
|
| + negatable: false,
|
| + help: "Use this flag to see information about master for --client.")
|
| + ..addFlag("build-groups",
|
| + negatable: false,
|
| + help: "Use this flag to see all builder-groups not -dev, -stable "
|
| + "or -integration for --client.")
|
| + ..addFlag("builders-in-group",
|
| + negatable: false,
|
| + help: "Use this flag as `--build-bot-details <group>` to see all "
|
| + "builders (incl. shards) for a build group <group>.")
|
| ..addFlag("build-bot-details",
|
| negatable: false,
|
| help: "Use this flag as `--build-bot-details <name>` where "
|
| @@ -39,11 +50,11 @@ ArgParser setupArgs() {
|
| help: "use this option as `--build-details <name> <buildNo>` where "
|
| "<name> is the name of the bot and "
|
| "<buildNo> is the number of the build.")
|
| - ..addFlag("commit-builds",
|
| + ..addFlag("builds-with-commit",
|
| negatable: false,
|
| - help: "Fetches all builds for a specific commit. Use this flag as "
|
| - "`--commit-builds <commit-hash>` where the <commit-hash> is the "
|
| - "hash of the commit");
|
| + help: "Fetches all builds with a specific commit. Use this flag as "
|
| + "`--builds-with-commit <commit-hash>` where the <commit-hash> is "
|
| + "the hash of the commit");
|
| }
|
|
|
| void printHelp(ArgParser parser) {
|
| @@ -73,11 +84,17 @@ main(List<String> args) async {
|
| await performBuildBotsPrimary(luciApi, createCache, results);
|
| } else if (results["build-bots-all"]) {
|
| await performBuildBotsAll(luciApi, createCache, results);
|
| + } else if (results["master"]) {
|
| + await performMaster(luciApi, createCache, results);
|
| + } else if (results["build-groups"]) {
|
| + await performBuilderGroups(luciApi, createCache, results);
|
| + } else if (results["builders-in-group"]) {
|
| + await performBuildersInGroup(luciApi, createCache, results);
|
| } else if (results["build-bot-details"]) {
|
| await performBuildBotDetails(luciApi, createCache, results);
|
| } else if (results["build-details"]) {
|
| await performBuildDetails(luciApi, createCache, results);
|
| - } else if (results["commit-builds"]) {
|
| + } else if (results["builds-with-commit"]) {
|
| await performFindBuildsForCommit(luciApi, createCache, logger, results);
|
| } else {
|
| printHelp(parser);
|
| @@ -88,8 +105,8 @@ main(List<String> args) async {
|
|
|
| Future performBuildBotsPrimary(
|
| LuciApi api, CreateCacheFunction createCache, ArgResults results) async {
|
| - var res = await api.getPrimaryBuilders(
|
| - results['client'], createCache(duration: new Duration(hours: 1)));
|
| + var res = await getPrimaryBuilders(
|
| + api, results['client'], createCache(duration: new Duration(hours: 1)));
|
| res.fold((ex, stackTrace) {
|
| print(ex);
|
| print(stackTrace);
|
| @@ -98,14 +115,49 @@ Future performBuildBotsPrimary(
|
|
|
| Future performBuildBotsAll(
|
| LuciApi api, CreateCacheFunction cache, ArgResults results) async {
|
| - var res = await api.getAllBuildBots(
|
| - results['client'], cache(duration: new Duration(hours: 1)));
|
| + var res = await getAllBuilders(
|
| + api, results['client'], cache(duration: new Duration(hours: 1)));
|
| res.fold((ex, stackTrace) {
|
| print(ex);
|
| print(stackTrace);
|
| }, (bots) => bots.forEach(print));
|
| }
|
|
|
| +Future performMaster(
|
| + LuciApi api, CreateCacheFunction cache, ArgResults results) async {
|
| + var res = await api.getMaster(
|
| + results['client'], cache(duration: new Duration(minutes: 15)));
|
| + res.fold((ex, stackTrace) {
|
| + print(ex);
|
| + print(stackTrace);
|
| + }, (res) => print(res));
|
| +}
|
| +
|
| +Future performBuilderGroups(
|
| + LuciApi api, CreateCacheFunction cache, ArgResults results) async {
|
| + var res = await getBuilderGroups(
|
| + api, results['client'], cache(duration: new Duration(minutes: 15)));
|
| + res.fold((ex, stackTrace) {
|
| + print(ex);
|
| + print(stackTrace);
|
| + }, (res) => res.forEach(print));
|
| +}
|
| +
|
| +Future performBuildersInGroup(
|
| + LuciApi api, CreateCacheFunction cache, ArgResults results) async {
|
| + if (results.rest.length == 0) {
|
| + print("No argument given for <group>. To see help, use --help");
|
| + return;
|
| + }
|
| +
|
| + var res = await getBuildersInBuilderGroup(api, results['client'],
|
| + cache(duration: new Duration(minutes: 15)), results.rest[0]);
|
| + res.fold((ex, stackTrace) {
|
| + print(ex);
|
| + print(stackTrace);
|
| + }, (res) => res.forEach(print));
|
| +}
|
| +
|
| Future performBuildBotDetails(
|
| LuciApi api, CreateCacheFunction cache, ArgResults results) async {
|
| if (results.rest.length == 0) {
|
|
|