public boolean isUpToDate()

in src/main/java/com/googlesource/gerrit/plugins/multisite/index/GroupCheckerImpl.java [47:77]


  public boolean isUpToDate(Optional<GroupIndexEvent> groupIndexEvent) {
    if (!groupIndexEvent.isPresent()) {
      logger.atWarning().log("Group Index empty, considering this group up-to-date");
      return true;
    }
    GroupIndexEvent event = groupIndexEvent.get();
    AccountGroup.UUID groupUUID = AccountGroup.uuid(event.groupUUID);

    if (event.sha1 == null) {
      logger.atWarning().log(
          "Event for group '%s' does not contain sha1, consider group up-to-date for compatibility.",
          groupUUID);
      return true;
    }

    try (Repository repo = repoManager.openRepository(allUsers)) {
      if (commitExistsInRepo(repo, event.sha1)) {
        logger.atInfo().log(
            "Group '%s' up-to-date: sha1 '%s' exists in All-Users", groupUUID, event.sha1);
        return true;
      } else {
        logger.atWarning().log(
            "Group '%s' NOT up-to-date: sha1 '%s' still missing in All-Users",
            groupUUID, event.sha1);
      }
    } catch (Exception e) {
      logger.atSevere().withCause(e).log(
          "Could not check whether Group '%s' is up-to-date", groupUUID);
    }
    return false;
  }