Class CommitStatisticsBuildAction

java.lang.Object
hudson.model.InvisibleAction
io.jenkins.plugins.forensics.miner.CommitStatisticsBuildAction
All Implemented Interfaces:
Action, ModelObject, Serializable, RunAction2, SimpleBuildStep.LastBuildAction

public class CommitStatisticsBuildAction extends InvisibleAction implements SimpleBuildStep.LastBuildAction, RunAction2, Serializable
Controls the life cycle of the commit statistics in a job. This action persists the results of a build and displays a summary on the build page. The actual visualization of the results is defined in the matching summary.jelly file.
Author:
Ullrich Hafner
See Also:
  • Constructor Details

    • CommitStatisticsBuildAction

      public CommitStatisticsBuildAction(Run<?,?> owner, String scmKey, CommitStatistics commitStatistics)
      Creates a new instance of CommitStatisticsBuildAction.
      Parameters:
      owner - the associated build that created the statistics
      scmKey - key of the repository
      commitStatistics - the statistics to persist with this action
  • Method Details

    • getOwner

      public Run<?,?> getOwner()
    • getScmKey

      public String getScmKey()
    • getCommitStatistics

      public CommitStatistics getCommitStatistics()
    • hasReferenceBuild

      public boolean hasReferenceBuild()
      Returns whether the statistics are based on a reference build or on the previous build.
      Returns:
      true if there is a reference build defined, false otherwise
    • getReferenceBuild

      @CheckForNull public ReferenceBuild getReferenceBuild()
      Returns the reference build action if present.
      Returns:
      the action
    • getReferenceBuildLink

      public String getReferenceBuildLink()
      Returns a link that can be used in Jelly views to navigate to the reference build.
      Returns:
      the link
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • onAttached

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

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

      public Collection<? extends Action> getProjectActions()
      Specified by:
      getProjectActions in interface SimpleBuildStep.LastBuildAction