public HeuristicResult findResponsibleUser()

in src/main/java/jetbrains/buildServer/investigationsAutoAssigner/heuristics/DefaultUserHeuristic.java [42:67]


  public HeuristicResult findResponsibleUser(@NotNull HeuristicContext heuristicContext) {
    HeuristicResult result = new HeuristicResult();

    SBuild build = heuristicContext.getBuild();
    String defaultResponsible = CustomParameters.getDefaultResponsible(build);
    if (StringUtil.isEmpty(defaultResponsible)) return result;

    UserEx responsibleUser = myUserModel.findUserAccount(null, defaultResponsible);
    if (responsibleUser == null) {
      LOGGER.warn("Ignoring heuristic \"DefaultUser\" as there is no TeamCity user with the username \"" +
                  defaultResponsible + "\" specified in the Investigations Auto-Assigner settings in the build: " +
                  LogUtil.describe(build) + "Affected build configuration: " +
                  LogUtil.describe(build.getBuildType()));
      return result;
    }

    boolean applyForSnapshotDependencyErrors = shouldApplyForSnapshotDependencyErrors(build);
    Responsibility responsibility = new DefaultUserResponsibility(responsibleUser);
    heuristicContext.getBuildProblems()
                    .stream()
                    .filter(buildProblem -> applyForSnapshotDependencyErrors || !snapshotDependencyErrorTypes.contains(buildProblem.getBuildProblemData().getType()))
                    .forEach(buildProblem -> result.addResponsibility(buildProblem, responsibility));
    heuristicContext.getTestRuns().forEach(testRun -> result.addResponsibility(testRun, responsibility));

    return result;
  }