public class LightweightBranchCreationServiceImpl extends Object implements LightweightBranchCreationService
Constructor and Description |
---|
LightweightBranchCreationServiceImpl(CachedPlanManager cachedPlanManager,
ChainBranchCreationService chainBranchCreationService,
CustomVariableContext customVariableContext,
ErrorHandler errorHandler,
JiraBranchLinkingService jiraBranchLinkingService,
PlanManager planManager,
RawRepositoryConfigurationXmlConverter rawRepositoryConfigurationXmlConverter,
RepositoryDefinitionManager repositoryDefinitionManager,
VcsBranchManager vcsBranchManager,
VcsRepositoryManager vcsRepositoryManager,
TriggerTypeManager triggerTypeManager,
com.atlassian.event.api.EventPublisher eventPublisher) |
Modifier and Type | Method and Description |
---|---|
@NotNull ChainBranchCreationResult |
createChainBranch(@NotNull ImmutableChain chain,
@NotNull PlanBranchWorkflow planBranchWorkflow,
@NotNull String branchName,
@Nullable String branchDescription,
@Nullable PlanRepositoryDefinition defaultRepositoryDefinition,
@Nullable VcsRepositoryModuleDescriptor moduleDescriptor,
@Nullable VcsBranch newBranch,
@NotNull BuildConfiguration buildConfiguration,
PlanCreationService.EnablePlan enablePlan,
boolean enableExpiry,
@NotNull Consumer<PlanKey> branchPlanKeyConsumer,
boolean expectingDivergentBranch)
Creates a new lightweight plan branch for give chain.
|
@NotNull ChainBranchCreationResult |
createChainBranch(@NotNull ImmutableChain chain,
@NotNull PlanBranchWorkflow planBranchWorkflow,
@NotNull String branchName,
@Nullable String branchDescription,
@Nullable PlanRepositoryDefinition defaultRepositoryDefinition,
@Nullable VcsRepositoryModuleDescriptor moduleDescriptor,
@Nullable VcsBranch newBranch,
@NotNull BuildConfiguration buildConfiguration,
PlanCreationService.EnablePlan enablePlan,
boolean enableExpiry,
@NotNull Consumer<PlanKey> branchPlanKeyConsumer,
boolean expectingDivergentBranch,
Optional<VcsPullRequest> pullRequest)
Creates a new lightweight plan branch for give chain.
|
@NotNull Collection<ChainBranchCreationResult> |
createChainBranches(@NotNull ImmutableChain chain,
@NotNull PlanBranchWorkflow planBranchWorkflow,
@NotNull Collection<VcsBranch> branches,
@NotNull PlanRepositoryDefinition defaultRepositoryDefinition,
@Nullable ErrorCollection errorCollection,
PlanCreationService.EnablePlan enablePlan,
boolean enableExpiry,
@NotNull Consumer<PlanKey> consumer,
boolean expectingDivergentBranch)
Creates a new lightweight plan branch or enables existing one for each vcs branch in given collection under given
chain.
|
@NotNull ChainBranchCreationResult |
createOrEnableChainBranch(@NotNull ImmutableChain chain,
@NotNull PlanBranchWorkflow planBranchWorkflow,
@Nullable String branchName,
@NotNull Function<VcsBranchConfigurator,VcsBranch> vcsBranchProvider,
@Nullable BuildConfiguration buildConfiguration,
PlanCreationService.EnablePlan enablePlan,
boolean enableExpiry,
@NotNull Consumer<PlanKey> branchPlanKeyConsumer,
boolean expectingDivergentBranch)
Given a branch name and (optionally) vcs branch name, check if branch already exists.
|
@NotNull ChainBranchCreationResult |
createOrEnableChainBranch(@NotNull ImmutableChain chain,
@NotNull PlanBranchWorkflow planBranchWorkflow,
@Nullable String branchName,
@NotNull Function<VcsBranchConfigurator,VcsBranch> vcsBranchProvider,
@Nullable BuildConfiguration buildConfiguration,
PlanCreationService.EnablePlan enablePlan,
boolean enableExpiry,
@NotNull Consumer<PlanKey> branchPlanKeyConsumer,
boolean expectingDivergentBranch,
Optional<VcsPullRequest> pullRequest)
Given a branch name and (optionally) vcs branch name, check if branch already exists.
|
@NotNull ChainBranchCreationResult |
enableExistingChainBranch(@NotNull ImmutableChain chain,
@NotNull ImmutableChainBranch existingChainBranch,
@NotNull VcsBranch vcsBranch,
PlanCreationService.EnablePlan enablePlan,
boolean expectingDivergentBranch)
Enables existing chain branch.
|
void |
validateCreateChainBranch(@NotNull ImmutableChain chain,
@NotNull PlanBranchWorkflow planBranchWorkflow,
@NotNull String branchName,
@Nullable String branchDescription,
@Nullable PlanRepositoryDefinition defaultRepositoryDefinition,
@Nullable VcsRepositoryModuleDescriptor moduleDescriptor,
@Nullable VcsBranch newBranch,
boolean enableExpiry,
@NotNull com.atlassian.struts.ValidationAware validationAware)
Validates configuration for creating chain branch
|
public LightweightBranchCreationServiceImpl(CachedPlanManager cachedPlanManager, ChainBranchCreationService chainBranchCreationService, CustomVariableContext customVariableContext, ErrorHandler errorHandler, JiraBranchLinkingService jiraBranchLinkingService, PlanManager planManager, RawRepositoryConfigurationXmlConverter rawRepositoryConfigurationXmlConverter, RepositoryDefinitionManager repositoryDefinitionManager, VcsBranchManager vcsBranchManager, VcsRepositoryManager vcsRepositoryManager, TriggerTypeManager triggerTypeManager, com.atlassian.event.api.EventPublisher eventPublisher)
@NotNull public @NotNull Collection<ChainBranchCreationResult> createChainBranches(@NotNull @NotNull ImmutableChain chain, @NotNull @NotNull PlanBranchWorkflow planBranchWorkflow, @NotNull @NotNull Collection<VcsBranch> branches, @NotNull @NotNull PlanRepositoryDefinition defaultRepositoryDefinition, @Nullable @Nullable ErrorCollection errorCollection, @NotNull PlanCreationService.EnablePlan enablePlan, boolean enableExpiry, @NotNull @NotNull Consumer<PlanKey> consumer, boolean expectingDivergentBranch)
LightweightBranchCreationService
createChainBranches
in interface LightweightBranchCreationService
chain
- to create branches underplanBranchWorkflow
- which workflow led to creation of these branchesbranches
- collection ov vcs branches for which plan branches should be createddefaultRepositoryDefinition
- default repository of the given chain
errorCollection
- 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
creationenableExpiry
- defines whether created branch can be removed due to branch expiration
detectionconsumer
- code should be executed before triggering events that new plan createdexpectingDivergentBranch
- RSS will attempt updating this branch; post creation events should be deferred@NotNull public @NotNull ChainBranchCreationResult createOrEnableChainBranch(@NotNull @NotNull ImmutableChain chain, @NotNull @NotNull PlanBranchWorkflow planBranchWorkflow, @Nullable @Nullable String branchName, @NotNull @NotNull Function<VcsBranchConfigurator,VcsBranch> vcsBranchProvider, @Nullable @Nullable BuildConfiguration buildConfiguration, @NotNull PlanCreationService.EnablePlan enablePlan, boolean enableExpiry, @NotNull @NotNull Consumer<PlanKey> branchPlanKeyConsumer, boolean expectingDivergentBranch, Optional<VcsPullRequest> pullRequest) throws PlanCreationDeniedException
LightweightBranchCreationService
createOrEnableChainBranch
in interface LightweightBranchCreationService
chain
- to create branch underplanBranchWorkflow
- which workflow led to creation of branchbranchName
- optional name for the plan branch. If null name of vcs branch will be usedvcsBranchProvider
- provides VcsBranch to use when overriding repository definitionbuildConfiguration
- optional 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 detectionbranchPlanKeyConsumer
- code should be executed before triggering events that new plan createdexpectingDivergentBranch
- RSS will attempt updating this branch; post creation events should be deferredpullRequest
- optional pull requests object which contains potential source repository informationPlanCreationDeniedException
@NotNull public @NotNull ChainBranchCreationResult createOrEnableChainBranch(@NotNull @NotNull ImmutableChain chain, @NotNull @NotNull PlanBranchWorkflow planBranchWorkflow, @Nullable @Nullable String branchName, @NotNull @NotNull Function<VcsBranchConfigurator,VcsBranch> vcsBranchProvider, @Nullable @Nullable BuildConfiguration buildConfiguration, @NotNull PlanCreationService.EnablePlan enablePlan, boolean enableExpiry, @NotNull @NotNull Consumer<PlanKey> branchPlanKeyConsumer, boolean expectingDivergentBranch) throws PlanCreationDeniedException
LightweightBranchCreationService
createOrEnableChainBranch
in interface LightweightBranchCreationService
chain
- to create branch underplanBranchWorkflow
- which workflow led to creation of branchbranchName
- optional name for the plan branch. If null name of vcs branch will be usedvcsBranchProvider
- provides VcsBranch to use when overriding repository definitionbuildConfiguration
- optional 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 detectionbranchPlanKeyConsumer
- code should be executed before triggering events that new plan createdexpectingDivergentBranch
- RSS will attempt updating this branch; post creation events should be deferredPlanCreationDeniedException
@NotNull public @NotNull ChainBranchCreationResult enableExistingChainBranch(@NotNull @NotNull ImmutableChain chain, @NotNull @NotNull ImmutableChainBranch existingChainBranch, @NotNull @NotNull VcsBranch vcsBranch, @NotNull PlanCreationService.EnablePlan enablePlan, boolean expectingDivergentBranch)
LightweightBranchCreationService
enableExistingChainBranch
in interface LightweightBranchCreationService
@NotNull public @NotNull ChainBranchCreationResult createChainBranch(@NotNull @NotNull ImmutableChain chain, @NotNull @NotNull PlanBranchWorkflow planBranchWorkflow, @NotNull @NotNull String branchName, @Nullable @Nullable String branchDescription, @Nullable @Nullable PlanRepositoryDefinition defaultRepositoryDefinition, @Nullable @Nullable VcsRepositoryModuleDescriptor moduleDescriptor, @Nullable @Nullable VcsBranch newBranch, @NotNull @NotNull BuildConfiguration buildConfiguration, PlanCreationService.EnablePlan enablePlan, boolean enableExpiry, @NotNull @NotNull Consumer<PlanKey> branchPlanKeyConsumer, boolean expectingDivergentBranch, Optional<VcsPullRequest> pullRequest) throws PlanCreationDeniedException
LightweightBranchCreationService
createChainBranch
in interface LightweightBranchCreationService
chain
- to create branches underplanBranchWorkflow
- which workflow led to creation of branchbranchName
- optional plan branch namebranchDescription
- optional plan branch descriptiondefaultRepositoryDefinition
- optional default repository of the given chain
moduleDescriptor
- module descriptor of the given defaultRepositoryDefinition
newBranch
- VCS branch to usebuildConfiguration
- optional 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
detectionbranchPlanKeyConsumer
- code should be executed before triggering events that new plan createdexpectingDivergentBranch
- RSS will attempt updating this branch; post creation events should be deferredpullRequest
- optional pull requests object which contains potential source repository informationPlanCreationDeniedException
@NotNull public @NotNull ChainBranchCreationResult createChainBranch(@NotNull @NotNull ImmutableChain chain, @NotNull @NotNull PlanBranchWorkflow planBranchWorkflow, @NotNull @NotNull String branchName, @Nullable @Nullable String branchDescription, @Nullable @Nullable PlanRepositoryDefinition defaultRepositoryDefinition, @Nullable @Nullable VcsRepositoryModuleDescriptor moduleDescriptor, @Nullable @Nullable VcsBranch newBranch, @NotNull @NotNull BuildConfiguration buildConfiguration, PlanCreationService.EnablePlan enablePlan, boolean enableExpiry, @NotNull @NotNull Consumer<PlanKey> branchPlanKeyConsumer, boolean expectingDivergentBranch) throws PlanCreationDeniedException
LightweightBranchCreationService
createChainBranch
in interface LightweightBranchCreationService
chain
- to create branches underplanBranchWorkflow
- which workflow led to creation of branchbranchName
- optional plan branch namebranchDescription
- optional plan branch descriptiondefaultRepositoryDefinition
- optional default repository of the given chain
moduleDescriptor
- module descriptor of the given defaultRepositoryDefinition
newBranch
- VCS branch to usebuildConfiguration
- optional 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
detectionbranchPlanKeyConsumer
- code should be executed before triggering events that new plan createdexpectingDivergentBranch
- RSS will attempt updating this branch; post creation events should be deferredPlanCreationDeniedException
public void validateCreateChainBranch(@NotNull @NotNull ImmutableChain chain, @NotNull @NotNull PlanBranchWorkflow planBranchWorkflow, @NotNull @NotNull String branchName, @Nullable @Nullable String branchDescription, @Nullable @Nullable PlanRepositoryDefinition defaultRepositoryDefinition, @Nullable @Nullable VcsRepositoryModuleDescriptor moduleDescriptor, @Nullable @Nullable VcsBranch newBranch, boolean enableExpiry, @NotNull @NotNull com.atlassian.struts.ValidationAware validationAware)
LightweightBranchCreationService
validateCreateChainBranch
in interface LightweightBranchCreationService
chain
- to create branches underplanBranchWorkflow
- which workflow led to creation of branchbranchName
- optional plan branch namebranchDescription
- optional plan branch descriptiondefaultRepositoryDefinition
- optional default repository of the given chain
moduleDescriptor
- module descriptor of the given defaultRepositoryDefinition
newBranch
- VCS branch to useenableExpiry
- defines whether created branch can be removed due to branch expiration *
detectionvalidationAware
- to add errors toCopyright © 2023 Atlassian Software Systems Pty Ltd. All rights reserved.