Interface BranchAttributesDataProvider
-
- All Superinterfaces:
ServerExtension
,TeamCityExtension
- All Known Implementing Classes:
TestBranchAttributesDataProvider
public interface BranchAttributesDataProvider extends ServerExtension
An extension point for the attribute branch filters- Since:
- 2024.3
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
accepts(String logicalBranchName, BranchAttributesContext branchContext, Map<String,String> attributes)
BranchAttributesContext
getBranchContext(String logicalBranchName, SBuildType buildType, BranchAttributesPrecalculationContext precalcContext)
String
getId()
BranchAttributesPrecalculationContext
precalculateContextForFiltering(SBuildType buildType)
String
validate(Map<String,String> attributes)
-
-
-
Method Detail
-
getId
@NotNull String getId()
- Returns:
- id of the current provider. This id should be unique among all providers and will be used in branch filters as identifier for this provider
-
accepts
boolean accepts(@NotNull String logicalBranchName, @NotNull BranchAttributesContext branchContext, @Nullable Map<String,String> attributes)
- Parameters:
logicalBranchName
-branchContext
- a context calculated for the branchattributes
- a map of name value pairs, all names should be supported by the provider- Returns:
- true if the given branch has all the provided attributes in the given context
-
validate
@Nullable String validate(@Nullable Map<String,String> attributes)
- Returns:
- null if attributes valid, or the reason why the attributes are incorrect
-
precalculateContextForFiltering
@Nullable BranchAttributesPrecalculationContext precalculateContextForFiltering(@NotNull SBuildType buildType)
- Returns:
- a precalculation context which might be helpful when calculating branch context. This context is not always calculated for the filtered branch, only in some cases when multiple branches are being filtered
-
getBranchContext
@Nullable BranchAttributesContext getBranchContext(@NotNull String logicalBranchName, @NotNull SBuildType buildType, @Nullable BranchAttributesPrecalculationContext precalcContext)
- Parameters:
logicalBranchName
-buildType
- buildType for which this logicalBranchName was calculatedprecalcContext
- an optional precalculated context that was computed withprecalculateContextForFiltering(SBuildType)
. Should be used only to speed up calculation and should not be relied on because it is calculated only in cases when multiple branches are supposed to be filtered- Returns:
- branch context for the given logical branch, that will be used in
accepts(String, BranchAttributesContext, Map)
, can be null if context can't be calculated
-
-