Class GitHubBambooSpecsHandler
java.lang.Object
com.atlassian.bamboo.plugins.github.AbstractGitHubExecutor
com.atlassian.bamboo.plugins.github.GitHubBambooSpecsHandler
- All Implemented Interfaces:
BambooSpecsHandler
-
Field Summary
Fields inherited from class com.atlassian.bamboo.plugins.github.AbstractGitHubExecutor
vcsRepositoryManagerFields inherited from interface com.atlassian.bamboo.vcs.BambooSpecsHandler
BAMBOO_SPECS_DIRECTORY, BAMBOO_YAML_FILES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondetectSpecRevision(@NotNull VcsRepositoryData repositoryData, @NotNull Object source) Attempts to obtain latest revision from the repository which may have changed Bamboo Specs.booleandivergentBranchesEnabled(@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 revisionsrev1andrev2.booleanisNewer(@NotNull VcsRepositoryData repositoryData, @NotNull String rev1, @NotNull String rev2) Returns true ifrev2is a newer revision in the repository thanrev1and therefore the specs should be run.booleanbooleanMethods inherited from class com.atlassian.bamboo.plugins.github.AbstractGitHubExecutor
getGitModuleDescriptor, githubToGitData
-
Constructor Details
-
GitHubBambooSpecsHandler
-
-
Method Details
-
detectSpecRevision
@NotNull public @NotNull Optional<String> detectSpecRevision(@NotNull @NotNull VcsRepositoryData repositoryData, @NotNull @NotNull Object source) throws RepositoryException Description copied from interface:BambooSpecsHandlerAttempts to obtain latest revision from the repository which may have changed Bamboo Specs.- Specified by:
detectSpecRevisionin interfaceBambooSpecsHandler- 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
BambooSpecsHandler.BAMBOO_SPECS_DIRECTORYdoesn't exist. - Throws:
RepositoryException
-
isNewer
public boolean isNewer(@NotNull @NotNull VcsRepositoryData repositoryData, @NotNull @NotNull String rev1, @NotNull @NotNull String rev2) throws RepositoryException Description copied from interface:BambooSpecsHandlerReturns true ifrev2is a newer revision in the repository thanrev1and therefore the specs should be run. In typical cases, returns true if it is possible to reachrev1by 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.- Specified by:
isNewerin interfaceBambooSpecsHandler- Throws:
RepositoryException
-
findCommitsToSpecs
@NotNull public @NotNull List<CommitContext> findCommitsToSpecs(@NotNull @NotNull VcsRepositoryData repositoryData, @NotNull @NotNull String rev1, @NotNull @NotNull String rev2) throws RepositoryException Description copied from interface:BambooSpecsHandlerExtracts a list of commits related to Bamboo Specs, which occurred between revisionsrev1andrev2.- Specified by:
findCommitsToSpecsin interfaceBambooSpecsHandler- Throws:
RepositoryException
-
isWebhookRequired
public boolean isWebhookRequired()- Specified by:
isWebhookRequiredin interfaceBambooSpecsHandler- Returns:
- true if vcs requires setting webhook for Bamboo Specs processing, false otherwise
-
supportsDivergentBranches
public boolean supportsDivergentBranches()- Specified by:
supportsDivergentBranchesin interfaceBambooSpecsHandler- Returns:
- true if repository type supports divergent branches, false otherwise
-
divergentBranchesEnabled
- Specified by:
divergentBranchesEnabledin interfaceBambooSpecsHandler- Returns:
- true if particular repository data supports divergent branches, false otherwise
-