public class BranchDetectionServiceImpl extends Object implements BranchDetectionService
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) |
Modifier and Type | Method and Description |
---|---|
PlanKey |
createChainBranch(ImmutableChain chain,
PlanBranchWorkflow planBranchWorkflow,
String branchName,
VcsBranch vcsBranch,
BuildConfiguration buildConfiguration,
PlanCreationService.EnablePlan enablePlan,
boolean enableExpiry)
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.
|
PlanKey |
createChainBranch(ImmutableChain chain,
String branchName,
VcsBranch vcsBranch,
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) |
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)
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.
|
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)
public boolean scheduleBranchListInitialisation(@NotNull Chain chain)
BranchDetectionService
scheduleBranchListInitialisation
in interface BranchDetectionService
public boolean scheduleBranchDetectionForChain(@NotNull ImmutableChain chain)
BranchDetectionService
scheduleBranchDetectionForChain
in interface BranchDetectionService
public void detectBranchesForChain(@NotNull ImmutableChain chain)
BranchDetectionService
detectBranchesForChain
in interface BranchDetectionService
protected void createNewBranchesForChainNoLock(@NotNull ImmutableChain chain, @NotNull PlanRepositoryDefinition defaultRepositoryDefinition, boolean ignoreChainConfig)
@NotNull public Collection<PlanKey> createPlanBranches(@NotNull ImmutableChain chain, @NotNull Collection<VcsBranch> branches, @Nullable ErrorCollection errorCollection)
BranchDetectionService
createPlanBranches
in interface BranchDetectionService
chain
- 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)
BranchDetectionService
createPlanBranches
in interface BranchDetectionService
chain
- 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)
BranchDetectionService
createPlanBranches
in interface BranchDetectionService
chain
- 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 creation@Nullable public List<VcsBranch> getOpenBranches(@NotNull ImmutableChain chain, ErrorCollection errorCollection)
BranchDetectionService
getOpenBranches
in interface BranchDetectionService
chain
- to find branches for.errorCollection
- to add any errors to during detection@NotNull public PlanKey createChainBranch(@NotNull ImmutableChain chain, @NotNull String branchName, @Nullable VcsBranch vcsBranch, PlanCreationService.EnablePlan enablePlan, boolean enableExpiry) throws PlanCreationDeniedException
BranchDetectionService
createChainBranch
in interface BranchDetectionService
chain
- to create branches underbranchName
- to create.vcsBranch
- to use when overriding repository definition.enablePlan
- - 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
BranchDetectionService
createChainBranch
in interface BranchDetectionService
chain
- 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) throws PlanCreationDeniedException
BranchDetectionService
createChainBranch
in interface BranchDetectionService
chain
- 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 detectionPlanCreationDeniedException
- if chain branch creation was denied for any reasonpublic void deleteBambooVcsBranch(@NotNull Iterable<ImmutableChain> chains, @NotNull String branchName)
BranchDetectionService
deleteBambooVcsBranch
in interface BranchDetectionService
chains
- collection of chains/chain branches to search throughbranchName
- vcs branch name that was removedpublic void disableChainBranch(@NotNull Iterable<ImmutableChain> chains)
BranchDetectionService
SystemProperty.DISABLE_CLOSED_BRANCH_DETECTION
property is enabled.disableChainBranch
in interface BranchDetectionService
chains
- collection of chains/chain branches that should be disabledCopyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.