Klasse GitCommitsRecord
java.lang.Object
io.jenkins.plugins.forensics.git.reference.GitCommitsRecord
- Alle implementierten Schnittstellen:
Action
,ModelObject
,Serializable
,RunAction2
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:
-
Konstruktorübersicht
KonstruktorBeschreibungGitCommitsRecord
(Run<?, ?> owner, String scmKey, edu.hm.hafner.util.FilteredLog logger, io.jenkins.plugins.forensics.git.reference.BuildCommits commits, String latestCommitLink) Creates a newGitCommitsRecord
instance with the specified list of new commits. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungboolean
Returnstrue
if the specified commit is part of the commits.static Optional
<GitCommitsRecord> findRecordForScm
(Run<?, ?> build, String scmKey) Tries to find aGitCommitsRecord
for the specified SCM.Returns all recorded newcommits
including the commits which belong to a merge, if it is part of this commit record.Run
<?, ?> getOwner()
getReferencePoint
(GitCommitsRecord referenceCommits, int maxCommits, boolean skipUnknownCommits) Tries to find a reference build using the specifiedGitCommitsRecord
of the reference job as a starting point.int
getSize()
boolean
Determines if the commits contain a merge commit with the target branch.boolean
isEmpty()
boolean
boolean
void
onAttached
(Run<?, ?> run) void
int
size()
Returns the number of new commits.toString()
-
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 newGitCommitsRecord
instance with the specified list of new commits.- Parameter:
owner
- the current build as owner of the Git commitsscmKey
- the ID of the SCM repositorylogger
- the loggercommits
- the latest commits in this build (since the previous build)latestCommitLink
- hyperlink to the latest commit
-
-
Methodendetails
-
findRecordForScm
Tries to find aGitCommitsRecord
for the specified SCM.- Parameter:
build
- the build to search for correspondingGitCommitsRecord
actionsscmKey
- the ID of the SCM repository- Gibt zurück:
- the commits record, if found
-
getOwner
-
isFirstBuild
public boolean isFirstBuild() -
getScmKey
-
getLatestCommit
-
getLatestCommitLink
-
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
-
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
-
getCommitsWithMerge
Returns all recorded newcommits
including the commits which belong to a merge, if it is part of this commit record. These affected merge commits consist of thelatest commit of the target branch
as well as the latest merge commit itself. The order is as follows:- Latest merge commit
- Latest target branch commit
- Recorded new commits
- Gibt zurück:
- the hash codes of the found commits
-
contains
Returnstrue
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
- Angegeben von:
onAttached
in SchnittstelleRunAction2
-
onLoad
- Angegeben von:
onLoad
in SchnittstelleRunAction2
-
getIconFileName
- Angegeben von:
getIconFileName
in SchnittstelleAction
-
getDisplayName
- Angegeben von:
getDisplayName
in SchnittstelleAction
- Angegeben von:
getDisplayName
in SchnittstelleModelObject
-
getUrlName
- Angegeben von:
getUrlName
in SchnittstelleAction
-
toString
-
getReferencePoint
public Optional<Run<?,?>> getReferencePoint(GitCommitsRecord referenceCommits, int maxCommits, boolean skipUnknownCommits) Tries to find a reference build using the specifiedGitCommitsRecord
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 searchmaxCommits
- maximal number of commits to look atskipUnknownCommits
- 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
-