Package com.atlassian.bamboo.vcs
Interface BambooSpecsHandler
-
- All Known Implementing Classes:
BitbucketCloudBambooSpecsHandler
,BitbucketServerBambooSpecsHandler
,GitBambooSpecsHandler
,GitHubBambooSpecsHandler
,SvnBambooSpecsHandler
@ExperimentalApi public interface BambooSpecsHandler
Module responsible for working with Bamboo Specs.
-
-
Field Summary
Fields Modifier and Type Field Description static String
BAMBOO_SPECS_DIRECTORY
Directory in which Bamboo Specs are stored within a repository.static List<String>
BAMBOO_YAML_FILES
YAML files which contain YAML Bamboo Specs.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description @NotNull Optional<String>
detectSpecRevision(@NotNull VcsRepositoryData repositoryData, @NotNull Object source)
Attempts to obtain latest revision from the repository which may have changed Bamboo Specs.default boolean
divergentBranchesEnabled(@NotNull VcsRepositoryData vcsRepositoryData)
@NotNull List<CommitContext>
findCommitsToSpecs(@NotNull VcsRepositoryData repositoryData, @NotNull String rev1, @NotNull String rev2)
Extracts a list of commits related to Bamboo Specs, which occurred between revisionsrev1
andrev2
.boolean
isNewer(@NotNull VcsRepositoryData repositoryData, @NotNull String rev1, @NotNull String rev2)
Returns true ifrev2
is a newer revision in the repository thanrev1
and therefore the specs should be run.boolean
isWebhookRequired()
default boolean
supportsDivergentBranches()
-
-
-
Field Detail
-
BAMBOO_SPECS_DIRECTORY
static final String BAMBOO_SPECS_DIRECTORY
Directory in which Bamboo Specs are stored within a repository.
-
BAMBOO_YAML_FILES
static final List<String> BAMBOO_YAML_FILES
YAML files which contain YAML Bamboo Specs. Stored within theBAMBOO_SPECS_DIRECTORY
.
-
-
Method Detail
-
detectSpecRevision
@NotNull @NotNull Optional<String> detectSpecRevision(@NotNull @NotNull VcsRepositoryData repositoryData, @NotNull @NotNull Object source) throws RepositoryException
Attempts to obtain latest revision from the repository which may have changed Bamboo Specs.- Parameters:
repositoryData
- repositorysource
- entry point to begin scanning (for example: branch name), actual type may depend on repository type- Returns:
- latest revision or Optional.empty() if
BAMBOO_SPECS_DIRECTORY
doesn't exist. - Throws:
RepositoryException
-
isNewer
boolean isNewer(@NotNull @NotNull VcsRepositoryData repositoryData, @NotNull @NotNull String rev1, @NotNull @NotNull String rev2) throws RepositoryException
Returns true ifrev2
is a newer revision in the repository thanrev1
and therefore the specs should be run. In typical cases, returns true if it is possible to reachrev1
by following parent relationship starting fromrev2
. Exceptional cases involve suspected force push or 'clear' merges that don't result in changes in specs being connected to the merge commit. In those cases it assumed that rev2 is newer even though no ancestry path exists between rev1 and rev2.- Throws:
RepositoryException
-
findCommitsToSpecs
@NotNull @NotNull List<CommitContext> findCommitsToSpecs(@NotNull @NotNull VcsRepositoryData repositoryData, @NotNull @NotNull String rev1, @NotNull @NotNull String rev2) throws RepositoryException
Extracts a list of commits related to Bamboo Specs, which occurred between revisionsrev1
andrev2
.- Throws:
RepositoryException
-
isWebhookRequired
boolean isWebhookRequired()
- Returns:
- true if vcs requires setting webhook for Bamboo Specs processing, false otherwise
-
supportsDivergentBranches
default boolean supportsDivergentBranches()
- Returns:
- true if repository type supports divergent branches, false otherwise
-
divergentBranchesEnabled
default boolean divergentBranchesEnabled(@NotNull @NotNull VcsRepositoryData vcsRepositoryData)
- Returns:
- true if particular repository data supports divergent branches, false otherwise
-
-