Package jetbrains.buildServer.vcs
Interface VcsModificationHistoryEx
-
- All Superinterfaces:
VcsModificationHistory
- All Known Implementing Classes:
DBVcsModificationHistory
,SecuredVcsModificationHistory
public interface VcsModificationHistoryEx extends VcsModificationHistory
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
VcsModificationHistoryEx.ModificationDataPersistingCallback
static interface
VcsModificationHistoryEx.ModificationDataRelations
static interface
VcsModificationHistoryEx.ModificationDataRelationsSupplier
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
detachPendingChangesFromBuildType(SBuildType buildType, SVcsRoot parentRoot)
List<SVcsModification>
findExpiredModificationsRelatedToVcsRoot(VcsRootInstance vcsRootInstance, long startModId, int maxChangesToReturn)
This method is similar toVcsModificationHistory.findChangeById(long)
but it will search not only among cached changes, but also among changes that are already unloaded from the cache.SVcsModification
findModificationByVersion(VcsRootInstance root, String version)
Returns last modification with specified version in specified VCS rootLong
findModificationIdByVersion(VcsRootInstance root, String version)
List<SVcsModification>
findModificationsByDisplayVersion(String version)
Searches for all VCS modifications with given display versionVcsModification.getDisplayVersion()
Ordering: most recent modifications go first in the listList<SVcsModification>
findModificationsByVersion(String version)
Searches for all VCS modifications with given versionVcsModification.getVersion()
Ordering: most recent modifications go first in the listMap<String,SVcsModification>
findModificationsByVersions(VcsRootInstance root, Collection<String> versions)
List<SVcsModification>
getAllUserModifications(User user)
Returns all VCS modifications of specified userMap<String,String>
getAttributes(SVcsModification modification)
Load attributes of the given modification from DB.Set<SUser>
getChangeDescriptorCommitters(Collection<ChangeDescriptor> changes, boolean ignoreNonPersonalCommitters)
Returns committers from the specified collection of change descriptors.Set<SUser>
getChangesCommitters(Collection<SVcsModification> changes, boolean ignoreNonPersonalCommitters)
Returns committers from the specified collection of changes.Collection<SVcsModification>
getDuplicates(SVcsModification modification, boolean byDisplayVersion)
Get duplicate modifications for given one, (the given modification is not included)List<Map<String,RelationType>>
getEdgeRelations(VcsModification childCommit)
Returns list of relations for edges from parent commits to the given child commit.List<SVcsModification>
getLastModifications(int numberOfActiveDays)
Returns latest VCS modifications detected within the specified number of active days.List<SVcsModification>
getLastUserModifications(User user, int numberOfActiveDays)
Returns last stored modification detected for the specified user.DAG<Long>
getModificationIdDag(VcsRootInstance root)
Returns a DAG of modification ids of specified VCS root instanceDAG<Long>
getModificationIdDag(VcsRootInstance root, Long upperBoundModificationId, Long lowerBoundModificationId)
Returns a DAG of modification ids of specified VCS root instance in specified bounds.RelatedConfigurations
getModificationRelations(SVcsModification modification)
Returns relations the given modification has to build configurations.List<SVcsModification>
getModificationsInVersionsRange(VcsRootInstance root, String lowerBoundVersion, String upperBoundVersion)
Returns the list of modifications for the specified root, between specified versions (lower bound is excluded, upper bound is included).Collection<SVcsModification>
getParentModifications(SVcsModification modification)
Get parent modifications of the given one.List<String>
getParentRevisions(SVcsModification modification)
Get parent revisions of given modification.RepositoryState
getStateWithActiveBranches(VcsRootInstance root, RepositoryState state, long maxBranchAgeMillis)
Returns repository state which contains only active branches, i.e.Iterator<SVcsModification>
getUniqueModificationsIterator(List<SVcsModification> modifications)
Returns iterator over list of VCS modifications.int
getUserChangesCounter()
Returns total number of times user accounts were changed/created or removed.boolean
isVcsCacheInitialized()
void
loadMissingVcsRootModifications(VcsRootInstance rootInstance)
Loads VCS changes which could be persisted by some other node into the internal cacheSVcsModification
persistModification(ModificationData modificationData, Collection<SBuildType> relatedConfigurations)
Persists modification if there is no modification in the same root with the same version.SVcsModification
persistModification(ModificationData modificationData, Collection<SBuildType> relatedConfigurations, BuildTypeChangeRelationCalculator changeRelationCalculator)
List<SVcsModification>
persistModifications(List<ModificationData> modifications, VcsModificationHistoryEx.ModificationDataRelationsSupplier relationsSupplier, VcsModificationHistoryEx.ModificationDataPersistingCallback callback)
void
processBuildTypeModifications(SBuildType buildType, Predicate<VcsRootInstance> vcsRootInstancesFilter, ItemProcessor<SVcsModification> processor, Interval interval, Date minRegistrationDate, int expiredCommitsMaxNum, RelationType... relationTypes)
Processes VCS modifications related to specified build type within the specified interval.void
processModifications(ItemProcessor<SVcsModification> modificationsProcessor)
This method traverses all VCS modifications and passed them to the modificationsProcessor.void
scheduleDetachPendingChangesFromBuildType(SBuildType buildType, SVcsRoot parentRoot)
void
setModificationDescription(long modificationId, String newDescription)
Set and save modification description for modification with given ID-
Methods inherited from interface jetbrains.buildServer.vcs.VcsModificationHistory
filterBuildsWithChanges, findChangeById, getAllModifications, getAllModifications, getAllModifications, getAllModificationsDetectedSince, getFilteredChanges, getFixedModificationsCount, getLastModification, getLastModification, getLastModificationUpTo, getModificationsDetectedBetween, getModificationsInRange, getModificationsOrder, getModificationsSinceLastSuccessful, getPendingModifications
-
-
-
-
Method Detail
-
persistModification
@Nullable SVcsModification persistModification(@NotNull ModificationData modificationData, @NotNull Collection<SBuildType> relatedConfigurations)
Persists modification if there is no modification in the same root with the same version.- Parameters:
modificationData
- modification to persistrelatedConfigurations
- related configuration- Returns:
- persisted modification or null if modification with specified version in specified root was already persisted.
-
persistModification
@Nullable SVcsModification persistModification(@NotNull ModificationData modificationData, @NotNull Collection<SBuildType> relatedConfigurations, @NotNull BuildTypeChangeRelationCalculator changeRelationCalculator)
-
persistModifications
@NotNull List<SVcsModification> persistModifications(@NotNull List<ModificationData> modifications, @NotNull VcsModificationHistoryEx.ModificationDataRelationsSupplier relationsSupplier, @NotNull VcsModificationHistoryEx.ModificationDataPersistingCallback callback)
-
getLastUserModifications
List<SVcsModification> getLastUserModifications(User user, int numberOfActiveDays)
Returns last stored modification detected for the specified user. Ordering: last modifications go first in the list
-
getLastModifications
@NotNull List<SVcsModification> getLastModifications(int numberOfActiveDays)
Returns latest VCS modifications detected within the specified number of active days. Ordering: most recent modifications go first in the list- Returns:
- see above
- Since:
- 9.0.3
-
getModificationRelations
@NotNull RelatedConfigurations getModificationRelations(@NotNull SVcsModification modification)
Returns relations the given modification has to build configurations.- Parameters:
modification
- modification of interest- Returns:
- see above
- Since:
- 9.0
-
getEdgeRelations
@NotNull List<Map<String,RelationType>> getEdgeRelations(@NotNull VcsModification childCommit)
Returns list of relations for edges from parent commits to the given child commit. Index in the list is the number of the parent commit.
-
scheduleDetachPendingChangesFromBuildType
void scheduleDetachPendingChangesFromBuildType(@NotNull SBuildType buildType, @NotNull SVcsRoot parentRoot)
-
detachPendingChangesFromBuildType
void detachPendingChangesFromBuildType(@NotNull SBuildType buildType, @NotNull SVcsRoot parentRoot)
-
getChangesCommitters
@NotNull Set<SUser> getChangesCommitters(@NotNull Collection<SVcsModification> changes, boolean ignoreNonPersonalCommitters)
Returns committers from the specified collection of changes.- Parameters:
changes
- changes collectionignoreNonPersonalCommitters
- if true non personal changes committers will not be returned- Returns:
- committers
-
getChangeDescriptorCommitters
@NotNull Set<SUser> getChangeDescriptorCommitters(@NotNull Collection<ChangeDescriptor> changes, boolean ignoreNonPersonalCommitters)
Returns committers from the specified collection of change descriptors. Change descriptors for non-vcs changes are ignored.- Parameters:
changes
- change descriptors collectionignoreNonPersonalCommitters
- if true non personal changes committers will not be returned- Returns:
- see above
-
getUserChangesCounter
int getUserChangesCounter()
Returns total number of times user accounts were changed/created or removed. This counter is used by VcsModification to check whether its committers cache is actual.- Returns:
- see above
-
getDuplicates
@NotNull Collection<SVcsModification> getDuplicates(@NotNull SVcsModification modification, boolean byDisplayVersion)
Get duplicate modifications for given one, (the given modification is not included)- Parameters:
modification
- modification of interestbyDisplayVersion
- if true, modifications will be compared not by version but by displayVersion, which would join more modifications but modifications from different branches could be present (in a case of Perforce, at least)- Returns:
- collection of duplicate modifications
- Since:
- 6.0
-
getParentModifications
@NotNull Collection<SVcsModification> getParentModifications(@NotNull SVcsModification modification)
Get parent modifications of the given one. Returns an empty collection if VCS does not provide an information about parents or parents could not be found.- Parameters:
modification
- modification of interest- Returns:
- see above
- Since:
- 7.0
-
getParentRevisions
@NotNull List<String> getParentRevisions(@NotNull SVcsModification modification)
Get parent revisions of given modification. Returns an empty collection if VCS does not provide an information about parents or parents could not be found.- Parameters:
modification
- modification of interest- Returns:
- see above
- Since:
- 7.1
-
getAttributes
@NotNull Map<String,String> getAttributes(@NotNull SVcsModification modification)
Load attributes of the given modification from DB.- Parameters:
modification
- modification of interest- Returns:
- see above
- Since:
- 8.0
-
getAllUserModifications
@NotNull List<SVcsModification> getAllUserModifications(User user)
Returns all VCS modifications of specified user- Parameters:
user
- user of interest- Returns:
- see above
- Since:
- 6.0
-
processModifications
void processModifications(@NotNull ItemProcessor<SVcsModification> modificationsProcessor)
This method traverses all VCS modifications and passed them to the modificationsProcessor. Once modificationsProcessor returns false, the traversing stops.- Parameters:
modificationsProcessor
- SVcsModification items processor- Since:
- 2018.1
-
getUniqueModificationsIterator
@NotNull Iterator<SVcsModification> getUniqueModificationsIterator(List<SVcsModification> modifications)
Returns iterator over list of VCS modifications. This iterator returns only unique (non-duplicate) modifications from specified collection.- Parameters:
modifications
- list of VCS modifications- Returns:
- see above
-
findModificationByVersion
@Nullable SVcsModification findModificationByVersion(@NotNull VcsRootInstance root, @NotNull String version)
Returns last modification with specified version in specified VCS root- Parameters:
root
- VCS root of interestversion
- version of interest- Returns:
- see above
-
findModificationIdByVersion
@Nullable Long findModificationIdByVersion(@NotNull VcsRootInstance root, @Nullable String version)
-
findModificationsByVersion
@NotNull List<SVcsModification> findModificationsByVersion(@NotNull String version)
Searches for all VCS modifications with given versionVcsModification.getVersion()
Ordering: most recent modifications go first in the list- Parameters:
version
- VCS modification version- Returns:
- collection of found modifications
- Since:
- 2019.1.3
-
findModificationsByDisplayVersion
@NotNull List<SVcsModification> findModificationsByDisplayVersion(@NotNull String version)
Searches for all VCS modifications with given display versionVcsModification.getDisplayVersion()
Ordering: most recent modifications go first in the list- Parameters:
version
- VCS modification display version- Returns:
- collection of found modifications
- Since:
- 2019.1.3
-
getModificationIdDag
@NotNull DAG<Long> getModificationIdDag(@NotNull VcsRootInstance root)
Returns a DAG of modification ids of specified VCS root instance- Parameters:
root
- VCS root instance of interest- Returns:
- see above
-
getModificationIdDag
@NotNull DAG<Long> getModificationIdDag(@NotNull VcsRootInstance root, @Nullable Long upperBoundModificationId, @Nullable Long lowerBoundModificationId)
Returns a DAG of modification ids of specified VCS root instance in specified bounds. Both bounds can be null, which means open ended range- Parameters:
root
- VCS root instance of interestupperBoundModificationId
- upper boundlowerBoundModificationId
- lower bound- Returns:
- see above
-
getModificationsInVersionsRange
@NotNull List<SVcsModification> getModificationsInVersionsRange(@NotNull VcsRootInstance root, @Nullable String lowerBoundVersion, @Nullable String upperBoundVersion)
Returns the list of modifications for the specified root, between specified versions (lower bound is excluded, upper bound is included). Versions can be null, in this case open ended-intervals are used.- Parameters:
root
- the VCS root which modifications will be returnedfromVersion
- result contains modifications which happened after modification with version fromVersion if it specifiedtoVersion
- result contains modifications which happened before modification with version toVersion or are the same modifications- Returns:
- the list of detected modifications in the specified range
- See Also:
VcsModificationHistory.getModificationsOrder(VcsRootInstance, String, String)
,VcsModificationOrder
-
getStateWithActiveBranches
@NotNull RepositoryState getStateWithActiveBranches(@NotNull VcsRootInstance root, @NotNull RepositoryState state, long maxBranchAgeMillis)
Returns repository state which contains only active branches, i.e. branches with an age of the last modification smaller than themaxBranchAgeMillis
.- Parameters:
root
- VCS root of intereststate
- repository state to filtermaxBranchAgeMillis
- max age of branch in milliseconds- Returns:
- see above
-
setModificationDescription
void setModificationDescription(long modificationId, @NotNull String newDescription)
Set and save modification description for modification with given ID- Parameters:
modificationId
-newDescription
- non-empty new modification description
-
findModificationsByVersions
@NotNull Map<String,SVcsModification> findModificationsByVersions(@NotNull VcsRootInstance root, @NotNull Collection<String> versions)
-
processBuildTypeModifications
void processBuildTypeModifications(@NotNull SBuildType buildType, @NotNull Predicate<VcsRootInstance> vcsRootInstancesFilter, @NotNull ItemProcessor<SVcsModification> processor, @NotNull Interval interval, @Nullable Date minRegistrationDate, int expiredCommitsMaxNum, RelationType... relationTypes)
Processes VCS modifications related to specified build type within the specified interval. Most recent changes come first. Note: this processor traverses not only cached modifications but also expired once, which are already unloaded from the cache- Parameters:
buildType
-vcsRootInstancesFilter
- additional filter for VCS root instances, only SVcsModification objects from VCS roots accepted by this filter will be passed to the processorprocessor
-startModId
-minRegistrationDate
-expiredCommitsMaxNum
- max number of the expired commits to process (expired commit is one which exists in our DB but is unloaded from our in-memory cache), set to 0 to disable expired commits lookup
-
findExpiredModificationsRelatedToVcsRoot
@NotNull List<SVcsModification> findExpiredModificationsRelatedToVcsRoot(@NotNull VcsRootInstance vcsRootInstance, long startModId, int maxChangesToReturn)
This method is similar toVcsModificationHistory.findChangeById(long)
but it will search not only among cached changes, but also among changes that are already unloaded from the cache.- Parameters:
vcsRootInstance
-startModId
-- Returns:
- VCS modification with specified id belonging to the specified VCS root instance
-
loadMissingVcsRootModifications
void loadMissingVcsRootModifications(@NotNull VcsRootInstance rootInstance)
Loads VCS changes which could be persisted by some other node into the internal cache- Parameters:
rootInstance
- root instance whose changes will be loaded- Since:
- 2020.2.1
-
isVcsCacheInitialized
boolean isVcsCacheInitialized()
- Returns:
- true if VCS history cache is loaded from the database. Note: if the cache is not initialized, then many methods looking for SVcsModification instances will be hanging.
- Since:
- 2023.11
-
-