public class BranchDetectionServiceImpl extends Object implements BranchDetectionService
| Modifier and Type | Field and Description |
|---|---|
static String |
BANDANA_ENFORCE_POLLING |
| Constructor and Description |
|---|
BranchDetectionServiceImpl(PlanManager planManager,
ChainBranchCreationService chainBranchCreationService,
VcsBranchManager vcsBranchManager,
RepositoryCachingFacade repositoryCachingFacade,
ErrorHandler errorHandler,
ScopedExclusionService scopedExclusionService,
com.atlassian.event.api.EventPublisher eventPublisher,
JiraBranchLinkingService jiraBranchLinkingService,
CustomVariableContext customVariableContext,
org.springframework.orm.hibernate5.HibernateTemplate hibernateTemplate,
CachedPlanManager cachedPlanManager,
com.atlassian.struts.TextProvider textProvider,
ChainBranchManager chainBranchManager,
VcsRepositoryManager vcsRepositoryManager,
RawRepositoryConfigurationXmlConverter rawRepositoryConfigurationXmlConverter,
RepositoryDefinitionManager repositoryDefinitionManager,
com.atlassian.bandana.BandanaManager bandanaManager) |
| Modifier and Type | Method and Description |
|---|---|
PlanKey |
createChainBranch(ImmutableChain chain,
PlanBranchWorkflow planBranchWorkflow,
String branchName,
VcsBranch vcsBranch,
BuildConfiguration buildConfiguration,
PlanCreationService.EnablePlan enablePlan,
boolean enableExpiry,
Consumer<PlanKey> planBranchConsumer)
/**
Given a branch name and (optionally) vcs branch name, creates a plan branch, overriding repository definition.
|
PlanKey |
createChainBranch(ImmutableChain chain,
String branchName,
VcsBranch vcsBranch,
BuildConfiguration buildConfiguration,
PlanCreationService.EnablePlan enablePlan,
boolean enableExpiry)
Given a branch name and (optionally) vcs branch name, create Plan Branches with overriding repository
definitions.
|
protected void |
createNewBranchesForChainNoLock(ImmutableChain chain,
PlanRepositoryDefinition defaultRepositoryDefinition,
boolean ignoreChainConfig,
Consumer<PlanKey> consumer) |
PlanKey |
createOrEnableChainBranch(ImmutableChain chain,
PlanBranchWorkflow planBranchWorkflow,
VcsBranch vcsBranch,
BuildConfiguration buildConfiguration,
PlanCreationService.EnablePlan enablePlan,
boolean enableExpiry,
Consumer<PlanKey> planBranchConsumer)
Given a branch name and (optionally) vcs branch name, check if branch already exists.
|
Collection<PlanKey> |
createPlanBranches(ImmutableChain chain,
Collection<VcsBranch> branches,
ErrorCollection errorCollection)
Given a list of branch names, create Plan Branches for these, with overriding repository definitions.
|
Collection<PlanKey> |
createPlanBranches(ImmutableChain chain,
Collection<VcsBranch> branches,
ErrorCollection errorCollection,
PlanCreationService.EnablePlan enablePlan)
Given a list of branch names, create Plan Branches for these, with overriding repository definitions.
|
Collection<PlanKey> |
createPlanBranches(ImmutableChain chain,
PlanBranchWorkflow planBranchWorkflow,
Collection<VcsBranch> branches,
ErrorCollection errorCollection,
PlanCreationService.EnablePlan enablePlan,
Consumer<PlanKey> consumer)
Given a list of branch names, create plan branches for these, with overriding repository definitions.
|
void |
deleteBambooVcsBranch(Iterable<ImmutableChain> chains,
String branchName)
Deletes vcs branch from table
|
void |
detectBranchesForChain(ImmutableChain chain)
Immediately executes the detection for a given Chain and creates new
plan branches if new branches found in the plan's default repository.
|
void |
disableChainBranch(Iterable<ImmutableChain> chains)
Disables bamboo branches from given chain branches (or chains if it's default branch).
|
List<VcsBranch> |
getOpenBranches(ImmutableChain chain,
ErrorCollection errorCollection)
Returns a list of currently open branches for the chain's default repository
List ordering determined by underlying repository (preference is for native ordering e.g.
|
boolean |
scheduleBranchDetectionForChain(ImmutableChain chain)
Registers branch detection request for a given Chain.
|
boolean |
scheduleBranchListInitialisation(Chain chain)
Schedules initialisation of existing vcs branch list.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateChainBranch, createPlanBranchespublic static final String BANDANA_ENFORCE_POLLING
public BranchDetectionServiceImpl(PlanManager planManager, ChainBranchCreationService chainBranchCreationService, VcsBranchManager vcsBranchManager, RepositoryCachingFacade repositoryCachingFacade, ErrorHandler errorHandler, ScopedExclusionService scopedExclusionService, com.atlassian.event.api.EventPublisher eventPublisher, JiraBranchLinkingService jiraBranchLinkingService, CustomVariableContext customVariableContext, org.springframework.orm.hibernate5.HibernateTemplate hibernateTemplate, CachedPlanManager cachedPlanManager, com.atlassian.struts.TextProvider textProvider, ChainBranchManager chainBranchManager, VcsRepositoryManager vcsRepositoryManager, RawRepositoryConfigurationXmlConverter rawRepositoryConfigurationXmlConverter, RepositoryDefinitionManager repositoryDefinitionManager, com.atlassian.bandana.BandanaManager bandanaManager)
public boolean scheduleBranchListInitialisation(@NotNull
Chain chain)
BranchDetectionServicescheduleBranchListInitialisation in interface BranchDetectionServicepublic boolean scheduleBranchDetectionForChain(@NotNull
ImmutableChain chain)
BranchDetectionServicescheduleBranchDetectionForChain in interface BranchDetectionServicepublic void detectBranchesForChain(@NotNull
ImmutableChain chain)
BranchDetectionServicedetectBranchesForChain in interface BranchDetectionServiceprotected void createNewBranchesForChainNoLock(@NotNull
ImmutableChain chain,
@NotNull
PlanRepositoryDefinition defaultRepositoryDefinition,
boolean ignoreChainConfig,
Consumer<PlanKey> consumer)
@NotNull public Collection<PlanKey> createPlanBranches(@NotNull ImmutableChain chain, @NotNull Collection<VcsBranch> branches, @Nullable ErrorCollection errorCollection)
BranchDetectionServicecreatePlanBranches in interface BranchDetectionServicechain - to create branches underbranches - to create.errorCollection - - to add errors to, if you don't supply an error collection, they will just get logged.@NotNull public Collection<PlanKey> createPlanBranches(@NotNull ImmutableChain chain, @NotNull Collection<VcsBranch> branches, @Nullable ErrorCollection errorCollection, PlanCreationService.EnablePlan enablePlan)
BranchDetectionServicecreatePlanBranches in interface BranchDetectionServicechain - to create branches underbranches - to create.errorCollection - - to add errors to, if you don't supply an error collection, they will just get logged.enablePlan - - defines whether newly created branches should be enabled or disabled after creation@NotNull public Collection<PlanKey> createPlanBranches(@NotNull ImmutableChain chain, @NotNull PlanBranchWorkflow planBranchWorkflow, @NotNull Collection<VcsBranch> branches, @Nullable ErrorCollection errorCollection, @NotNull PlanCreationService.EnablePlan enablePlan, @NotNull Consumer<PlanKey> consumer)
BranchDetectionServicecreatePlanBranches in interface BranchDetectionServicechain - which chain to create branches underplanBranchWorkflow - which workflow led to creation of these branchesbranches - branches to createerrorCollection - to add errors to, if you don't supply an error collection, they will just get loggedenablePlan - defines whether newly created branches should be enabled or disabled after creationconsumer - code should be executed before triggering events that new plan created@Nullable public List<VcsBranch> getOpenBranches(@NotNull ImmutableChain chain, ErrorCollection errorCollection)
BranchDetectionServicegetOpenBranches in interface BranchDetectionServicechain - to find branches for.errorCollection - to add any errors to during detection@NotNull public PlanKey createOrEnableChainBranch(@NotNull ImmutableChain chain, @NotNull PlanBranchWorkflow planBranchWorkflow, @NotNull VcsBranch vcsBranch, @Nullable BuildConfiguration buildConfiguration, @NotNull PlanCreationService.EnablePlan enablePlan, boolean enableExpiry, Consumer<PlanKey> planBranchConsumer) throws PlanCreationDeniedException
BranchDetectionServicecreateOrEnableChainBranch in interface BranchDetectionServicechain - to create branches undervcsBranch - to use when overriding repository definition.buildConfiguration - - a default fragment of configuration to create the chain branch withenablePlan - - defines whether newly created branches should be enabled or disabled after creationenableExpiry - - defines whether created branch can be removed due to branch expiration detectionPlanCreationDeniedException@NotNull public PlanKey createChainBranch(@NotNull ImmutableChain chain, @NotNull String branchName, @Nullable VcsBranch vcsBranch, @Nullable BuildConfiguration buildConfiguration, PlanCreationService.EnablePlan enablePlan, boolean enableExpiry) throws PlanCreationDeniedException
BranchDetectionServicecreateChainBranch in interface BranchDetectionServicechain - to create branches underbranchName - to create.vcsBranch - to use when overriding repository definition.buildConfiguration - - a default fragment of configuration to create the chain branch withenablePlan - - defines whether newly created branches should be enabled or disabled after creationenableExpiry - - defines whether created branch can be removed due to branch expiration detectionPlanCreationDeniedException@NotNull public PlanKey createChainBranch(@NotNull ImmutableChain chain, @NotNull PlanBranchWorkflow planBranchWorkflow, @NotNull String branchName, @Nullable VcsBranch vcsBranch, @Nullable BuildConfiguration buildConfiguration, @NotNull PlanCreationService.EnablePlan enablePlan, boolean enableExpiry, Consumer<PlanKey> planBranchConsumer) throws PlanCreationDeniedException
BranchDetectionServicecreateChainBranch in interface BranchDetectionServicechain - chain to create branches underplanBranchWorkflow - which workflow led to creation of this chain branchbranchName - name of plan branch to createvcsBranch - VCS branch to use when overriding repository definitionbuildConfiguration - a default fragment of configuration to create the chain branch withenablePlan - defines whether newly created branches should be enabled or disabled after creationenableExpiry - defines whether created branch can be removed due to branch expiration detectionplanBranchConsumer - code should be executed before triggering events that new plan createdPlanCreationDeniedException - if chain branch creation was denied for any reasonpublic void deleteBambooVcsBranch(@NotNull
Iterable<ImmutableChain> chains,
@NotNull
String branchName)
BranchDetectionServicedeleteBambooVcsBranch in interface BranchDetectionServicechains - collection of chains/chain branches to search throughbranchName - vcs branch name that was removedpublic void disableChainBranch(@NotNull
Iterable<ImmutableChain> chains)
BranchDetectionServiceSystemProperty.DISABLE_CLOSED_BRANCH_DETECTION property is enabled.disableChainBranch in interface BranchDetectionServicechains - collection of chains/chain branches that should be disabledCopyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.