Klasse GitCommitsRecord

java.lang.Object
io.jenkins.plugins.forensics.git.reference.GitCommitsRecord
Alle implementierten Schnittstellen:
Action, ModelObject, Serializable, RunAction2

public class GitCommitsRecord extends Object implements RunAction2, Serializable
Stores all commits for a given build and provides a link to the latest commit. For each SCM repository a unique GitCommitsRecord instance will be used.
Autor:
Arne Schöntag
Siehe auch:
  • Konstruktordetails

    • GitCommitsRecord

      public GitCommitsRecord(Run<?,?> owner, String scmKey, edu.hm.hafner.util.FilteredLog logger, io.jenkins.plugins.forensics.git.reference.BuildCommits commits, String latestCommitLink)
      Creates a new GitCommitsRecord instance with the specified list of new commits.
      Parameter:
      owner - the current build as owner of the Git commits
      scmKey - the ID of the SCM repository
      logger - the logger
      commits - the latest commits in this build (since the previous build)
      latestCommitLink - hyperlink to the latest commit
  • Methodendetails

    • findRecordForScm

      public static Optional<GitCommitsRecord> findRecordForScm(Run<?,?> build, String scmKey)
      Tries to find a GitCommitsRecord for the specified SCM.
      Parameter:
      build - the build to search for corresponding GitCommitsRecord actions
      scmKey - the ID of the SCM repository
      Gibt zurück:
      the commits record, if found
    • getOwner

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

      public boolean isFirstBuild()
    • getScmKey

      public String getScmKey()
    • getLatestCommit

      public String getLatestCommit()
    • getLatestCommitLink

      public String getLatestCommitLink()
    • getTargetParentCommit

      public String getTargetParentCommit()
    • hasTargetParentCommit

      public boolean hasTargetParentCommit()
      Determines if the commits contain a merge commit with the target branch.
      Gibt zurück:
      true if the commits contain a merge commit with the target branch
    • getErrorMessages

      public List<String> getErrorMessages()
    • getInfoMessages

      public List<String> getInfoMessages()
    • size

      public int size()
      Returns the number of new commits.
      Gibt zurück:
      the number of new commits
    • getSize

      public int getSize()
    • isNotEmpty

      public boolean isNotEmpty()
    • isEmpty

      public boolean isEmpty()
    • getCommits

      public List<String> getCommits()
    • getCommitsWithMerge

      public List<String> getCommitsWithMerge()
      Returns all recorded new commits including the commits which belong to a merge, if it is part of this commit record. These affected merge commits consist of the latest commit of the target branch as well as the latest merge commit itself. The order is as follows:
      1. Latest merge commit
      2. Latest target branch commit
      3. Recorded new commits
      Gibt zurück:
      the hash codes of the found commits
    • contains

      public boolean contains(String commit)
      Returns true if the specified commit is part of the commits.
      Parameter:
      commit - the commit to search for
      Gibt zurück:
      true if the commits contain the specified commit, false otherwise
    • onAttached

      public void onAttached(Run<?,?> run)
      Angegeben von:
      onAttached in Schnittstelle RunAction2
    • onLoad

      public void onLoad(Run<?,?> run)
      Angegeben von:
      onLoad in Schnittstelle RunAction2
    • getIconFileName

      public String getIconFileName()
      Angegeben von:
      getIconFileName in Schnittstelle Action
    • getDisplayName

      public String getDisplayName()
      Angegeben von:
      getDisplayName in Schnittstelle Action
      Angegeben von:
      getDisplayName in Schnittstelle ModelObject
    • getUrlName

      public String getUrlName()
      Angegeben von:
      getUrlName in Schnittstelle Action
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
    • getReferencePoint

      public Optional<Run<?,?>> getReferencePoint(GitCommitsRecord referenceCommits, int maxCommits, boolean skipUnknownCommits)
      Tries to find a reference build using the specified GitCommitsRecord of the reference job as a starting point.
      Parameter:
      referenceCommits - the recorded commits of the build of the reference job that should be used as a starting point for the search
      maxCommits - maximal number of commits to look at
      skipUnknownCommits - determines whether a build with unknown commits should be skipped or not
      Gibt zurück:
      the found reference build or empty if none has been found