< prev index next >

bots/bridgekeeper/src/main/java/org/openjdk/skara/bots/bridgekeeper/BridgekeeperBotFactory.java

Print this page
*** 22,10 ***
--- 22,11 ---
   */
  package org.openjdk.skara.bots.bridgekeeper;
  
  import org.openjdk.skara.bot.*;
  
+ import java.time.Duration;
  import java.util.*;
  
  public class BridgekeeperBotFactory implements BotFactory {
      @Override
      public String name() {

*** 35,13 ***
      @Override
      public List<Bot> create(BotConfiguration configuration) {
          var ret = new ArrayList<Bot>();
          var specific = configuration.specific();
  
!         for (var repo : specific.get("repositories").asArray()) {
!             var bot = new BridgekeeperBot(configuration.repository(repo.asString()));
              ret.add(bot);
          }
- 
          return ret;
      }
  }
--- 36,17 ---
      @Override
      public List<Bot> create(BotConfiguration configuration) {
          var ret = new ArrayList<Bot>();
          var specific = configuration.specific();
  
!         for (var repo : specific.get("mirrors").asArray()) {
!             var bot = new PullRequestCloserBot(configuration.repository(repo.asString()));
+             ret.add(bot);
+         }
+         for (var repo : specific.get("pruned").fields()) {
+             var maxAge = Duration.parse(repo.value().get("maxage").asString());
+             var bot = new PullRequestPrunerBot(configuration.repository(repo.name()), maxAge);
              ret.add(bot);
          }
          return ret;
      }
  }
< prev index next >