private void report(UpgradeCheckResult result, UpgradeCheckRequest request, Collection<String> allUnsupported) throws AmbariException {
    if (allUnsupported.isEmpty()) {
      result.setStatus(UpgradeCheckStatus.PASS);
      return;
    }
    result.setFailedOn(new LinkedHashSet<>(allUnsupported));
    if (hasDeleteUnsupportedServicesAction(upgradePack(request))) {
      result.setStatus(UpgradeCheckStatus.WARNING);
      result.setFailReason(getFailReason(AUTO_REMOVE, result, request));
    } else {
      result.setStatus(UpgradeCheckStatus.FAIL);
      result.setFailReason(getFailReason(MANUAL_REMOVE, result, request));
    }
  }
The {@link ComponentsExistInRepoCheck} is used to determine if any of the
components scheduled for upgrade do not exist in the target repository or
stack.
ambari-server/src/main/java/org/apache/ambari/server/checks/ComponentsExistInRepoCheck.java