Class ErrorExplanationAction

java.lang.Object
io.jenkins.plugins.explain_error.ErrorExplanationAction
All Implemented Interfaces:
Action, ModelObject, RunAction2

@ExportedBean(defaultVisibility=999) public class ErrorExplanationAction extends Object implements RunAction2
Build action to store and display error explanations.
  • Constructor Details

    • ErrorExplanationAction

      public ErrorExplanationAction(String explanation, String urlString, String originalErrorLogs, String providerName)
    • ErrorExplanationAction

      public ErrorExplanationAction(String explanation, String urlString, String originalErrorLogs, String providerName, String providerModel, int inputLogLineCount)
  • Method Details

    • readResolve

      public Object readResolve()
    • getIconFileName

      public String getIconFileName()
      Specified by:
      getIconFileName in interface Action
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface Action
      Specified by:
      getDisplayName in interface ModelObject
    • getUrlName

      public String getUrlName()
      Specified by:
      getUrlName in interface Action
    • getApi

      public Api getApi()
    • getExplanation

      @Exported public String getExplanation()
    • getOriginalErrorLogs

      public String getOriginalErrorLogs()
    • getErrorSummary

      @Exported(visibility=1) public String getErrorSummary()
    • getResolutionSteps

      @Exported(visibility=1) public List<String> getResolutionSteps()
    • getBestPractices

      @Exported(visibility=1) public List<String> getBestPractices()
    • getErrorSignature

      @Exported(visibility=1) public String getErrorSignature()
    • getLabels

      @NonNull public ExplanationLabels getLabels()
      The headings around the explanation, in the explanation's own language.
    • getTitle

      @Exported(visibility=1) @CheckForNull public String getTitle()
      A one-line title naming the root cause; null when the provider did not return one.
    • getHeading

      public String getHeading()
      The heading for this explanation: its title when there is one, with the provider's name.
    • isStructured

      public boolean isStructured()
      Whether the analysis is available field by field. Explanations stored by older plugin versions, and free-text answers, only have getExplanation().
    • getSummaryHtml

      @NonNull public String getSummaryHtml()
      The summary as HTML for the panel: escaped, with backtick spans as <code>.
    • getResolutionStepsHtml

      @NonNull public List<String> getResolutionStepsHtml()
    • getBestPracticesHtml

      @NonNull public List<String> getBestPracticesHtml()
    • getSummaryPreviewHtml

      @NonNull public String getSummaryPreviewHtml()
      The summary for the build's own page: all of it when it is short, otherwise cut at the end of a sentence, or failing that at a word. Escaped like getSummaryHtml().
    • getProviderLabel

      @NonNull public String getProviderLabel()
      Provider and model for the line under the explanation, leaving out what is not known.
    • getReusedFromBuild

      @Exported(visibility=1) public int getReusedFromBuild()
      Returns the number of the earlier build whose explanation was reused for this build because it failed the same way, or 0 if the explanation was generated for this build.
    • getReusedFromBuildUrl

      @CheckForNull public String getReusedFromBuildUrl()
      The address of the explanation this one was taken over from, relative to the Jenkins root, or null when it was not reused or that build no longer exists.
    • getTimestamp

      @Exported(visibility=1) public long getTimestamp()
    • getFormattedTimestamp

      @Exported(visibility=1) public String getFormattedTimestamp()
    • getProviderName

      @Exported(visibility=1) public String getProviderName()
    • getProviderModel

      @Exported(visibility=1) public String getProviderModel()
    • getUrlString

      @Exported(visibility=1) public String getUrlString()
    • getInputLogLineCount

      @Exported(visibility=1) public int getInputLogLineCount()
    • onAttached

      public void onAttached(Run<?,?> r)
      Specified by:
      onAttached in interface RunAction2
    • onLoad

      public void onLoad(Run<?,?> r)
      Specified by:
      onLoad in interface RunAction2
    • getRun

      public Run<?,?> getRun()
      Get the associated run.
      Returns:
      the run this action is attached to
    • hasValidExplanation

      public boolean hasValidExplanation()
      Check if this action has a valid explanation.
      Returns:
      true if explanation is not null, not empty, and not just whitespace