Class AbstractCheckRunFactory

java.lang.Object
io.jenkins.plugins.gerritchecksapi.rest.AbstractCheckRunFactory
Direct Known Subclasses:
GerritMultiBranchCheckRunFactory, GerritTriggerCheckRunFactory

public abstract class AbstractCheckRunFactory extends Object
  • Constructor Details

    • AbstractCheckRunFactory

      public AbstractCheckRunFactory()
  • Method Details

    • create

      public abstract CheckRun create(PatchSetId ps, Job<?,?> job, Run<?,?> run, int attempt)
    • computeActions

      protected abstract List<Action> computeActions(Run<?,?> run)
    • computeStatus

      public static io.jenkins.plugins.gerritchecksapi.rest.CheckRun.RunStatus computeStatus(Run<?,?> run)
    • computeFinishedTimeStamp

      public static String computeFinishedTimeStamp(Run<?,?> run)
    • computeCheckResults

      protected List<CheckResult> computeCheckResults(Run<?,?> run)
    • computeCheckResults

      public static List<CheckResult> computeCheckResults(Jenkins jenkins, Run<?,?> run, String resultIdPrefix, String runUrl)
      The results of a run: the result of the run itself, followed by the results of the stages of a Pipeline build.
      Parameters:
      resultIdPrefix - prefix of the result ID, which has to be unique within the CheckRun. The ID the CheckRun was created with is used for it.
    • computeCheckResults

      public static List<CheckResult> computeCheckResults(Run<?,?> run, String resultIdPrefix, String runUrl)
      The result of the run itself. The stages of a Pipeline build are results of their own, which computeCheckResults(Jenkins, Run, String, String) adds to it. A run that is still building has no result of its own yet.
      Parameters:
      resultIdPrefix - prefix of the result ID, which has to be unique within the CheckRun. The ID the CheckRun was created with is used for it.
    • computeStageResults

      public static List<CheckResult> computeStageResults(Jenkins jenkins, Run<?,?> run, String runUrl)
      Computes the results of the stages of a Pipeline build, which are to be added to the results of the run itself. Stages that are reported as check runs of their own are not results of the run, see computeStageCheckRuns(jenkins.model.Jenkins, io.jenkins.plugins.gerritchecksapi.PatchSetId, hudson.model.Run<?, ?>, io.jenkins.plugins.gerritchecksapi.rest.CheckRun, java.lang.String).
      Returns:
      the results of the stages, or an empty list for runs that are not Pipeline builds, for Jenkins instances without Pipeline installed, for the stages that are reported as check runs, and for the builds whose stages are reported once they have finished only
    • computeStageCheckRuns

      public static List<CheckRun> computeStageCheckRuns(Jenkins jenkins, PatchSetId ps, Run<?,?> run, CheckRun parent, String runUrl)
      Computes the check runs of the stages of a Pipeline build, which are to be added next to the check run of the run itself.
      Parameters:
      parent - the check run of the run itself
      Returns:
      the check runs of the stages, or an empty list for runs that are not Pipeline builds, for Jenkins instances without Pipeline installed, for the stages that are reported as results of their run, and for the builds whose stages are reported once they have finished only
    • childId

      public static String childId(String parentKey, String childKey)
      The ID of a check run that is a child of another one, e.g. a downstream build. The parent and the run parts are the runs' externalizable IDs.
    • getAbsoluteRunUrl

      protected String getAbsoluteRunUrl(Run<?,?> run)