Package jetbrains.buildServer.vcs.impl
Class VcsLabeler
- java.lang.Object
-
- jetbrains.buildServer.vcs.impl.VcsLabeler
-
- All Implemented Interfaces:
ServerExtension
,VcsLabelManager
,TeamCityExtension
public class VcsLabeler extends Object implements VcsLabelManager
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_LABEL_MESSAGE
static String
FEATURE_TOGGLE_CUSTOM_LABEL_MESSAGE
static String
MANUAL_VCS_LABELING_REPEAT_ATTEMPTS
-
Constructor Summary
Constructors Constructor Description VcsLabeler(EventDispatcher<BuildServerListener> dispatcher, VcsRootInstancesManager vcsRootInstancesManager, BuildsManager builds, BranchSpecs specs, ExecutorServiceManager executors, SQLRunnerEx db, ServerResponsibilityEx serverResponsibility, BuildsRelatedMultiNodeTasks buildTasks)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<VcsLabel>
getLabels(Build build)
Returns all labels for the given buildboolean
isLabelingSupported(SBuild build, VcsRootInstance root)
Returns if it is possible to label the given build on the given vcs root.void
labelingFailed(Build build, VcsRootInstance root, String label, Throwable ex)
void
setLabel(SBuild build, String labelValue, String message, List<VcsRootInstance> rootsToLabel)
void
setLabel(SBuild build, String labelValue, List<VcsRootInstance> rootToLabel)
Sets label for the specified build on the specified vcs roots.void
updateBuildLabel(Build build, VcsRootInstance root, String label, VcsLabel.VcsLabelStatus status, String failureReason)
-
-
-
Field Detail
-
MANUAL_VCS_LABELING_REPEAT_ATTEMPTS
public static final String MANUAL_VCS_LABELING_REPEAT_ATTEMPTS
- See Also:
- Constant Field Values
-
FEATURE_TOGGLE_CUSTOM_LABEL_MESSAGE
public static final String FEATURE_TOGGLE_CUSTOM_LABEL_MESSAGE
- See Also:
- Constant Field Values
-
DEFAULT_LABEL_MESSAGE
public static final String DEFAULT_LABEL_MESSAGE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
VcsLabeler
public VcsLabeler(@NotNull EventDispatcher<BuildServerListener> dispatcher, @NotNull VcsRootInstancesManager vcsRootInstancesManager, @NotNull BuildsManager builds, @NotNull BranchSpecs specs, @NotNull ExecutorServiceManager executors, @NotNull SQLRunnerEx db, @NotNull ServerResponsibilityEx serverResponsibility, @NotNull BuildsRelatedMultiNodeTasks buildTasks)
-
-
Method Detail
-
updateBuildLabel
public void updateBuildLabel(@NotNull Build build, @NotNull VcsRootInstance root, @NotNull String label, @NotNull VcsLabel.VcsLabelStatus status, @Nullable String failureReason)
-
labelingFailed
public void labelingFailed(@NotNull Build build, @NotNull VcsRootInstance root, @NotNull String label, @NotNull Throwable ex)
-
getLabels
@NotNull public List<VcsLabel> getLabels(@NotNull Build build)
Description copied from interface:VcsLabelManager
Returns all labels for the given build- Specified by:
getLabels
in interfaceVcsLabelManager
- Parameters:
build
- specified build instance.- Returns:
- collection of labels set by TeamCity for the given build sources.
-
setLabel
public void setLabel(@NotNull SBuild build, @NotNull String labelValue, @NotNull List<VcsRootInstance> rootToLabel) throws VcsException
Description copied from interface:VcsLabelManager
Sets label for the specified build on the specified vcs roots.- Specified by:
setLabel
in interfaceVcsLabelManager
- Parameters:
build
- specified build.labelValue
- specified label text.rootToLabel
- roots to label list.- Throws:
VcsException
- problem to set label in version control.
-
setLabel
public void setLabel(@NotNull SBuild build, @NotNull String labelValue, @Nullable String message, @NotNull List<VcsRootInstance> rootsToLabel) throws VcsException
- Specified by:
setLabel
in interfaceVcsLabelManager
- Throws:
VcsException
-
isLabelingSupported
public boolean isLabelingSupported(@NotNull SBuild build, @NotNull VcsRootInstance root)
Description copied from interface:VcsLabelManager
Returns if it is possible to label the given build on the given vcs root.- Specified by:
isLabelingSupported
in interfaceVcsLabelManager
- Parameters:
build
- specified build.root
- specified root.- Returns:
true
if the root supports labeling and revision of the root fpr the build is not anull
,false
otherwise.
-
-