Class AutoFixAction

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

public class AutoFixAction extends Object implements RunAction2
A Jenkins RunAction2 that stores auto-fix results and provides a UI page under the build's action sidebar.
  • Constructor Details

    • AutoFixAction

      public AutoFixAction(AutoFixStatus status, String prUrl, String branchName, String message, String prTitle, long timestamp, String scmType)
      Creates an AutoFixAction with all fields.
      Parameters:
      status - the result status
      prUrl - the URL of the created PR, or null
      branchName - the fix branch name, or null
      message - human-readable status message
      prTitle - the PR title, or null
      timestamp - epoch millis when this action was created
      scmType - "GITHUB", "GITLAB", "BITBUCKET", or null
  • Method Details

    • getIconFileName

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

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

      @NonNull public String getUrlName()
      Specified by:
      getUrlName in interface Action
    • onAttached

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

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

      protected Object readResolve()
      Used for XStream deserialization backward compatibility. All fields are final and serialized; no migration needed.
    • getStatus

      @NonNull public AutoFixStatus getStatus()
    • getPrUrl

      @CheckForNull public String getPrUrl()
    • getBranchName

      @CheckForNull public String getBranchName()
    • getMessage

      @NonNull public String getMessage()
    • getPrTitle

      @CheckForNull public String getPrTitle()
    • getTimestamp

      public long getTimestamp()
    • getScmType

      @CheckForNull public String getScmType()
    • getRun

      @CheckForNull public Run<?,?> getRun()
    • setSuggestion

      public void setSuggestion(@CheckForNull FixSuggestion suggestion)
      Keeps what the AI proposed, so that a fix that did not become a pull request can still be read and applied by hand.
    • hasSuggestion

      public boolean hasSuggestion()
      Whether there is anything from the AI to show: its reasoning, or changes.
    • hasProposedChanges

      public boolean hasProposedChanges()
    • getProposedChanges

      @NonNull public List<AutoFixAction.ProposedChange> getProposedChanges()
    • getSuggestedTitle

      @CheckForNull public String getSuggestedTitle()
    • getSuggestedExplanation

      @CheckForNull public String getSuggestedExplanation()
    • getSuggestedConfidence

      @CheckForNull public String getSuggestedConfidence()
    • getSuggestedFixType

      @CheckForNull public String getSuggestedFixType()
    • hasCreatedPr

      public boolean hasCreatedPr()
      Returns true when this action represents a successfully created PR.
    • getBranchUrl

      @CheckForNull public String getBranchUrl()
      Returns the page of the fix branch on the SCM host, worked out from the pull request URL, or null when the URL is not one of a pull request on a known host.
    • getStatusDisplayName

      @NonNull public String getStatusDisplayName()
      Returns a human-readable label for the current status.
    • getFormattedTimestamp

      @NonNull public String getFormattedTimestamp()
      Returns a formatted date/time string for the action timestamp.