<?xml version="1.0" encoding="UTF-8"?>
<dsl-extension kind="buildFeature" type="InvestigationsAutoAssigner" generateDslJar="true">
  <class name="InvestigationsAutoAssigner">
    <description>
      A [build feature](https://www.jetbrains.com/help/teamcity/?Investigations+Auto+Assigner) assigning
      investigations of build failures automatically based on heuristics.
    </description>
  </class>
  <function name="investigationsAutoAssigner">
    <description>
      Configures Investigations Auto Assigner behaviour.
      @see InvestigationsAutoAssigner
    </description>
  </function>
  <params>
    <param name="defaultAssignee.username" dslName="defaultAssignee">
      <description>
        Username of a user to whom an investigation is assigned if no other possible investigator is found.
      </description>
    </param>
    <param name="excludeAssignees.usernames" dslName="excludeUsers">
      <description>
        The newline-separated list of usernames to exclude from investigation auto-assignment.
      </description>
    </param>
    <param name="ignoreBuildProblems.compilation" dslName="ignoreCompilationProblems">
      <description>
        When 'true', compilation build problems are ignored.
      </description>
    </param>
    <param name="ignoreBuildProblems.exitCode" dslName="ignoreExitCodeProblems">
      <description>
        When 'true', exit code build problems are ignored.
      </description>
    </param>
    <param name="assignOnSecondFailure" dslName="assignOnSecondFailure" type="boolean" trueValue="true" falseValue="">
      <description>
        Whether investigations auto-assigner should use "on second failure" strategy.
      </description>
    </param>
  </params>
  <examples>
    <example>
      <description>
        Adds a simple [Investigations Auto Assigner](https://www.jetbrains.com/help/teamcity/?Investigations+Auto+Assigner)
        build feature with specified default assignee
        (username of a user to assign the investigation to if no other assignee can be found).
        This build feature will assign investigations on the first build failure, after a short time-out.
      </description>
      <code>
        investigationsAutoAssigner {
            defaultAssignee = "username.default"
        }
      </code>
    </example>
    <example>
      <description>
        Adds an [Investigations Auto Assigner](https://www.jetbrains.com/help/teamcity/?Investigations+Auto+Assigner)
        with specified default assignee, users to ignore (newline-separated),
        and custom types of build problems to ignore in investigations auto-assignment.
        Additional option delays assignment of investigations until the failure repeats in two builds in a row.
        Use to prevent wrong assignments in projects with many flaky tests.
      </description>
      <code>
        investigationsAutoAssigner {
            defaultAssignee = "username.default"
            excludeUsers = """
                username.admin
                username.bot
            """.trimIndent()
            ignoreCompilationProblems = "true"
            ignoreExitCodeProblems = "true"
            assignOnSecondFailure = true
        }
      </code>
    </example>
  </examples>
</dsl-extension>