@Internal public class StashRepositoryImpl extends AbstractStandaloneRepository implements StashRepository
CachingAwareRepository.CachableOperationBUILD_TRIGGER_IP, buildDirectoryManager, buildLoggerManager, customVariableContext, featureManager, REPO_PREFIX, repositoryModuleDescriptor, templateRenderer, textProvidermoduleDescriptorREPOSITORY_STASH_APPLICATION, REPOSITORY_STASH_BRANCH, REPOSITORY_STASH_COMMAND_TIMEOUT, REPOSITORY_STASH_FETCH_WHOLE_REPOSITORY, REPOSITORY_STASH_IS_REPOSITORY_STORED_KEY, REPOSITORY_STASH_LFS_REPOSITORY, REPOSITORY_STASH_PRIVATE_KEY, REPOSITORY_STASH_PROJECT_KEY, REPOSITORY_STASH_PUBLIC_KEY, REPOSITORY_STASH_REPOSITORY_ID, REPOSITORY_STASH_REPOSITORY_SLUG, REPOSITORY_STASH_REPOSITORY_URL, REPOSITORY_STASH_USE_REMOTE_AGENT_CACHE, REPOSITORY_STASH_USE_SHALLOW_CLONES, REPOSITORY_STASH_USE_SUBMODULES, REPOSITORY_STASH_VERBOSE_LOGSSELECTED_REPOSITORY, UNKNOWN_HOSTGIT_REPOSITORIES_OF_PLANFILTER_PATTERN_EXCLUDE, FILTER_PATTERN_INCLUDE, FILTER_PATTERN_NONE, FILTER_PATTERN_OPTION, FILTER_PATTERN_REGEXCHANGESET_FILTER_PATTERN_REGEX, MAVEN_RELEASE_PLUGIN_EXCLUSION_PATTERN| Constructor and Description |
|---|
StashRepositoryImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addDefaultValues(BuildConfiguration buildConfiguration)
Extension point for adding default values to the form for
RenderableBuildConfiguration.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan) |
void |
beforeEditPageRendering(org.apache.commons.configuration.HierarchicalConfiguration buildConfiguration)
Action to be taken before rendering the edit page.
|
ErrorCollection |
beforeSave(org.apache.commons.configuration.HierarchicalConfiguration configuration)
Action to be taken before repository is saved from the UI.
|
BuildRepositoryChanges |
collectChangesForRevision(PlanKey planKey,
String targetRevision)
Collects the changes for the targetRevision.
|
BuildRepositoryChanges |
collectChangesSinceLastBuild(String planKey,
String lastVcsRevisionKey)
Collects the changes since the lastVcsRevisionKey.
|
String |
commit(File sourceDirectory,
String message)
Perform a commit (dvcs commit).
|
com.atlassian.applinks.api.ApplicationLink |
getApplicationLink() |
CacheId |
getCacheId(CachingAwareRepository.CachableOperation cachableOperation)
Cache id has to fulfill the following:
Given two Repository objects A and B, returning equal CacheId (in terms of equals()) and a cachable operation foo(),
in the following sequence of calls made in a short time period:
1.
|
CapabilityContext |
getCapabilityContext() |
int |
getCommandTimeout() |
Map<String,String> |
getCustomVariables()
Return a map containing name->value mapping of the variables.
|
TriggerModuleDescriptor |
getDefaultTriggerModule() |
CommitContext |
getFirstCommit()
Retrieve the commit that created the Branch.
|
GitRepository |
getGitRepository() |
String |
getHost()
What's the repository server host
|
CommitContext |
getLastCommit()
Retrieve last commit on the branch set on this Repository.
|
String |
getName()
The display name for the repository type
|
List<VcsBranch> |
getOpenBranches(String context)
Set of open branches that are discovered in the repository. |
String |
getOptionDescription() |
Map<String,String> |
getPlanRepositoryVariables()
Return a map containing name->value mapping of the plan repository format variables.
|
String |
getRepositoryUrl() |
Set<Requirement> |
getRequirements() |
String |
getScm()
Get a string representing the name of the repository type.
|
String |
getStashProjectKey() |
String |
getStashRepositoryId() |
String |
getStashRepositorySlug() |
VcsBranch |
getVcsBranch() |
boolean |
getVerboseLogs() |
boolean |
isCachingSupportedFor(CachingAwareRepository.CachableOperation cachableOperation) |
boolean |
isFetchWholeRepository() |
boolean |
isLfs() |
boolean |
isMergingSupported() |
boolean |
isRepositoryDifferent(Repository repository)
Checks if the current repo is the same as the given repository
|
boolean |
isUseRemoteAgentCache() |
boolean |
isUseShallowClones() |
boolean |
isUseSubmodules() |
boolean |
mergeWorkspaceWith(BuildContext buildContext,
File checkoutDirectory,
String targetRevision)
Merges a workspace located in checkout directory with the target revision.
|
void |
populateFromConfig(org.apache.commons.configuration.HierarchicalConfiguration config)
Update the current object with data in the
HierarchicalConfiguration |
void |
prepareConfigObject(BuildConfiguration buildConfiguration)
Do any preprocessing work before validation occurs.
|
void |
pushRevision(File sourceDirectory,
String vcsRevisionKey)
Push the specified revision to the remote directory.
|
String |
retrieveSourceCode(BuildContext buildContext,
PlanVcsRevisionData planVcsRevisionData,
File sourceDirectory,
int depth) |
String |
retrieveSourceCode(BuildContext buildContext,
String vcsRevisionKey,
File sourceDirectory)
Checks out the latest source code from an appropriate repository to specified directory
|
String |
retrieveSourceCode(BuildContext buildContext,
String vcsRevisionKey,
File sourceDirectory,
int depth)
Checks out the latest source code from an appropriate repository to specified directory
|
void |
setAdministrationConfigurationAccessor(AdministrationConfigurationAccessor administrationConfigurationAccessor) |
void |
setBambooAuthenticationContext(BambooAuthenticationContext bambooAuthenticationContext) |
void |
setCapabilityContext(CapabilityContext capabilityContext) |
void |
setI18nResolver(com.atlassian.sal.api.message.I18nResolver i18nResolver) |
void |
setRepositoryId(long repositoryId) |
void |
setRepositoryManager(RepositoryManager repositoryManager) |
void |
setStashCapabilityProvider(StashCapabilityProvider stashCapabilityProvider) |
void |
setStashClientFactory(com.atlassian.stash.rest.client.applinks.ApplinkStashClientFactory stashClientFactory) |
void |
setVcsBranch(VcsBranch vcsBranch)
Set and prepare the repository for using an arbitrary branch.
|
boolean |
stashServerRemoteEventsAreWorking() |
boolean |
stashServerSupportsRemoteEvents() |
org.apache.commons.configuration.HierarchicalConfiguration |
toConfiguration()
Generate a
HierarchicalConfiguration from the current state of the object |
boolean |
usePollingForBranchDetection()
If Bamboo generic detection polling should be used for this repository
|
ErrorCollection |
validate(BuildConfiguration buildConfiguration)
Validates the properties in the
BuildConfiguration object. |
getAdvancedEditHtml, getAdvancedViewHtml, getEditHtml, getViewHtml, getViewHtmlcheckConnection, customizeBuildRequirements, getAdvancedEditHtml, getAdvancedViewHtml, getBranchIntegrationEditHtml, getChangesetFilterPatternRegex, getDescription, getEditHtml, getFilterFilePatternOption, getFilterFilePatternRegex, getKey, getLocationIdentifier, getMavenPomCheckoutAccessEditHtml, getMaxCommitsToReturn, getMaxRetries, getMinimalEditHtml, getPollingTriggerModule, getQuietPeriod, getShortKey, getSourceCodeDirectory, getSystemWideExclusionPatterns, getViewHtml, getWorkingDirectory, init, isAdvancedOptionEnabled, isQuietPeriodEnabled, isWorkspaceEmpty, removeBuildRequirements, setBuildDirectoryManager, setBuildLoggerManager, setChangesetFilterPatternRegex, setCustomVariableContext, setFeatureManager, setFilterFilePatternOption, setFilterFilePatternRegex, setTemplateRenderer, setTextProvider, setWorkingDir, substituteString, toMergeCapableRepositorygetTemplateRenderer, populateContextForEdit, populateContextForViewclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAdvancedEditHtml, getAdvancedViewHtmlcheckConnection, getKey, getLocationIdentifier, getMinimalEditHtml, getShortKeygetSourceCodeDirectorycustomizeBuildRequirements, removeBuildRequirementsisConfigurationMissinginitgetEditHtml, getViewHtmlgetDescriptiongetBranchIntegrationEditHtmlgetViewHtmlgetAdvancedEditHtml, getAdvancedViewHtml, getEditHtml, getViewHtml@NotNull public String getName()
RepositorygetName in interface RepositorygetName in interface DescriptionProvidergetName in interface NameProviderpublic String getHost()
RepositorygetHost in interface Repositorypublic boolean isRepositoryDifferent(@NotNull
Repository repository)
RepositoryV2isRepositoryDifferent in interface RepositoryV2repository - to compare againstpublic void addDefaultValues(@NotNull
BuildConfiguration buildConfiguration)
BuildConfigurationAwarePluginRenderableBuildConfiguration.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan)addDefaultValues in interface BuildConfigurationAwarePluginaddDefaultValues in class AbstractRepositorybuildConfiguration - -public void prepareConfigObject(@NotNull
BuildConfiguration buildConfiguration)
BuildConfigurationAwarePluginprepareConfigObject in interface BuildConfigurationAwarePluginprepareConfigObject in class BaseBuildConfigurationAwarePluginbuildConfiguration - -public void populateFromConfig(@NotNull
org.apache.commons.configuration.HierarchicalConfiguration config)
ConvertibleFromConfigHierarchicalConfigurationpopulateFromConfig in interface ConvertibleFromConfigpopulateFromConfig in class AbstractRepository@NotNull public org.apache.commons.configuration.HierarchicalConfiguration toConfiguration()
ConvertibleFromConfigHierarchicalConfiguration from the current state of the objecttoConfiguration in interface ConvertibleFromConfigtoConfiguration in class AbstractRepositoryHierarchicalConfiguration. Never null@NotNull public ErrorCollection validate(@NotNull BuildConfiguration buildConfiguration)
BuildConfigurationAwarePluginBuildConfiguration object. The name of the properties match those passed
in through the form fragments in RenderableBuildConfiguration.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan) template.validate in interface BuildConfigurationAwarePluginvalidate in class AbstractRepositorybuildConfiguration - -ErrorCollection keyed by the field name.public void beforeEditPageRendering(@NotNull
org.apache.commons.configuration.HierarchicalConfiguration buildConfiguration)
EditActionAwareRepositorybeforeEditPageRendering in interface EditActionAwareRepositorybuildConfiguration - configuration to be loaded into the UIpublic ErrorCollection beforeSave(@NotNull org.apache.commons.configuration.HierarchicalConfiguration configuration)
EditActionAwareRepositorybeforeSave in interface EditActionAwareRepository@NotNull public String getScm()
ScmTypePublishingRepositorygetScm in interface ScmTypePublishingRepository@NotNull public BuildRepositoryChanges collectChangesForRevision(@NotNull PlanKey planKey, @NotNull String targetRevision) throws RepositoryException
OnceOffCapableRepositorycollectChangesForRevision in interface OnceOffCapableRepositorycollectChangesForRevision in class AbstractRepositoryRepositoryException - if something goes wrong@NotNull public BuildRepositoryChanges collectChangesSinceLastBuild(@NotNull String planKey, @Nullable String lastVcsRevisionKey) throws RepositoryException
RepositoryV2collectChangesSinceLastBuild in interface RepositoryV2lastVcsRevisionKey - can be null, if null you should ensure the correct vcsrevisionkey is returned in the BuildChanges object.RepositoryException - if something goes wrong@NotNull public String retrieveSourceCode(@NotNull BuildContext buildContext, @Nullable String vcsRevisionKey, @NotNull File sourceDirectory) throws RepositoryException
CustomSourceDirectoryAwareRepositoryretrieveSourceCode in interface CustomSourceDirectoryAwareRepositoryvcsRevisionKey - - may be null if you want latest codesourceDirectory - - directory to checkout toRepositoryException@NotNull public String retrieveSourceCode(@NotNull BuildContext buildContext, @Nullable String vcsRevisionKey, @NotNull File sourceDirectory, int depth) throws RepositoryException
BranchMergingAwareRepositoryretrieveSourceCode in interface BranchMergingAwareRepositoryvcsRevisionKey - - may be null if you want latest codesourceDirectory - - directory to checkout todepth - - how many historical revisions we'd like to check out (-1 means all revisions)RepositoryException@NotNull public String retrieveSourceCode(@NotNull BuildContext buildContext, @Nullable PlanVcsRevisionData planVcsRevisionData, @NotNull File sourceDirectory, int depth) throws RepositoryException
retrieveSourceCode in interface CheckoutCustomRevisionDataAwareRepositoryRepositoryException@NotNull public Set<Requirement> getRequirements()
getRequirements in interface RequirementsAwareRepositorypublic boolean stashServerSupportsRemoteEvents()
stashServerSupportsRemoteEvents in interface StashRepositorypublic boolean stashServerRemoteEventsAreWorking()
stashServerRemoteEventsAreWorking in interface StashRepositorypublic TriggerModuleDescriptor getDefaultTriggerModule()
getDefaultTriggerModule in class AbstractRepositorypublic void setRepositoryId(long repositoryId)
setRepositoryId in interface RequiresRepositoryDatapublic void setStashCapabilityProvider(StashCapabilityProvider stashCapabilityProvider)
public void setI18nResolver(com.atlassian.sal.api.message.I18nResolver i18nResolver)
public void setRepositoryManager(RepositoryManager repositoryManager)
public CapabilityContext getCapabilityContext()
getCapabilityContext in interface StashRepositorypublic void setCapabilityContext(CapabilityContext capabilityContext)
public void setAdministrationConfigurationAccessor(AdministrationConfigurationAccessor administrationConfigurationAccessor)
setAdministrationConfigurationAccessor in class AbstractRepositorypublic void setStashClientFactory(com.atlassian.stash.rest.client.applinks.ApplinkStashClientFactory stashClientFactory)
public void setBambooAuthenticationContext(BambooAuthenticationContext bambooAuthenticationContext)
public String getOptionDescription()
getOptionDescription in interface StashRepositorypublic CacheId getCacheId(@NotNull CachingAwareRepository.CachableOperation cachableOperation)
CachingAwareRepositorygetCacheId in interface CachingAwareRepositorypublic boolean isCachingSupportedFor(@NotNull
CachingAwareRepository.CachableOperation cachableOperation)
isCachingSupportedFor in interface CachingAwareRepository@NotNull public List<VcsBranch> getOpenBranches(@Nullable String context) throws RepositoryException
BranchDetectionCapableRepositorySet of open branches that are discovered in the repository. Returns empty collection if no branches at
all (can that happen?). Used for monitoring repositories for new branches.
An open branch is a branch that is considered 'open' by underlying VCS - it has nothing to do with the actual
development on that branch (recent commits or so).getOpenBranches in interface BranchDetectionCapableRepositoryList of branch names. May be empty.RepositoryExceptionpublic CommitContext getFirstCommit() throws RepositoryException
BranchDetectionCapableRepositorygetFirstCommit in interface BranchDetectionCapableRepositoryRepositoryExceptionpublic CommitContext getLastCommit() throws RepositoryException
BranchDetectionCapableRepositorygetLastCommit in interface BranchDetectionCapableRepositoryRepositoryExceptionpublic boolean mergeWorkspaceWith(@NotNull
BuildContext buildContext,
@NotNull
File checkoutDirectory,
@NotNull
String targetRevision)
throws RepositoryException
BranchMergingAwareRepositorymergeWorkspaceWith in interface BranchMergingAwareRepositorybuildContext - the build context of build doing the mergecheckoutDirectory - the workspace to use for mergetargetRevision - the revision to merge withRepositoryExceptionpublic boolean isMergingSupported()
isMergingSupported in interface BranchMergingAwareRepositorypublic void pushRevision(@NotNull
File sourceDirectory,
@Nullable
String vcsRevisionKey)
throws RepositoryException
PushCapableRepositorypushRevision in interface PushCapableRepositorysourceDirectory - - the working directory of the repository we want to push fromvcsRevisionKey - - the revisionKey (usually a branch name) to pushRepositoryException - - when something goes wrong@NotNull public String commit(@NotNull File sourceDirectory, @NotNull String message) throws RepositoryException
PushCapableRepositorycommit in interface PushCapableRepositorysourceDirectory - - which workspace directory to perform the commitmessage - - what message use for commitRepositoryException - - when something goes wrong@NotNull public Map<String,String> getCustomVariables()
CustomVariableProviderRepositoryNull values will be filtered out so it's safe to put them in the map.
getCustomVariables in interface CustomVariableProviderRepositorypublic boolean usePollingForBranchDetection()
BranchInformationProviderusePollingForBranchDetection in interface BranchInformationProvider@NotNull public Map<String,String> getPlanRepositoryVariables()
CustomVariableProviderRepositoryNull values will be filtered out so it's safe to put them in the map.
getPlanRepositoryVariables in interface CustomVariableProviderRepository@Nullable public com.atlassian.applinks.api.ApplicationLink getApplicationLink()
getApplicationLink in interface StashRepositorypublic String getStashProjectKey()
getStashProjectKey in interface StashRepositorypublic String getStashRepositorySlug()
getStashRepositorySlug in interface StashRepositorypublic String getStashRepositoryId()
getStashRepositoryId in interface StashRepositorypublic String getRepositoryUrl()
getRepositoryUrl in interface StashRepositorypublic boolean isUseShallowClones()
isUseShallowClones in interface StashRepositorypublic boolean isUseSubmodules()
isUseSubmodules in interface StashRepositorypublic int getCommandTimeout()
getCommandTimeout in interface StashRepositorypublic boolean getVerboseLogs()
getVerboseLogs in interface StashRepositorypublic boolean isUseRemoteAgentCache()
isUseRemoteAgentCache in interface StashRepositorypublic boolean isFetchWholeRepository()
isFetchWholeRepository in interface StashRepositorypublic boolean isLfs()
@NotNull public VcsBranch getVcsBranch()
getVcsBranch in interface BranchAwareRepositorypublic void setVcsBranch(@NotNull
VcsBranch vcsBranch)
BranchAwareRepositorysetVcsBranch in interface BranchAwareRepository@Nullable public GitRepository getGitRepository()
getGitRepository in interface GitRepositoryFacadeCopyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.