Interface VcsBranchDetector

All Superinterfaces:
IdentifyingExecutor<VcsBranchDetector>
All Known Implementing Classes:
BitbucketCloudBranchDetector, BitbucketServerBranchDetector, GitBranchDetector, GitHubBranchDetector, LegacyBranchDetector, SvnBranchDetector

public interface VcsBranchDetector extends IdentifyingExecutor<VcsBranchDetector>
Executor responsible for branch detection. Used server-side. Implementation should be stateless.
Since:
5.14
  • Method Details

    • usePollingForBranchDetection

      default boolean usePollingForBranchDetection(@NotNull @NotNull VcsRepositoryData repositoryData)
      Check if for specific repository configuration Bamboo needs to actively poll in order to detect new/deleted branches. If this method returns true, Bamboo will periodically contact the remote repository in order to update list of known branches. Return false if repository is capable of creating Bamboo Plan Branches using one of available "push" method, e.g. REST resource, remote event.
      Parameters:
      repositoryData -
      Returns:
    • getOpenBranches

      @NotNull @NotNull List<VcsBranch> getOpenBranches(@NotNull @NotNull VcsRepositoryData repositoryData) throws RepositoryException
      Set 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).
      Parameters:
      repositoryData -
      Returns:
      List of branch names. May be empty.
      Throws:
      RepositoryException
    • getLastCommit

      @NotNull @NotNull CommitContext getLastCommit(@NotNull @NotNull VcsRepositoryData repositoryData) throws RepositoryException
      Retrieve last commit on the branch set on this Repository. Method is used by Chain Branch automatic expiry. If this method returns null Chain Branch is not expired.
      Returns:
      the last commit
      Throws:
      RepositoryException
    • getFirstCommitApproximation

      @NotNull default @NotNull CommitContext getFirstCommitApproximation(@NotNull @NotNull VcsRepositoryData repositoryData) throws RepositoryException
      Retrieve an old, preferably the first commit on a branch. Implementations must not return null. The default implementation may return null.
      Throws:
      RepositoryException
    • getFirstCommit

      @Deprecated @Nullable default @Nullable CommitContext getFirstCommit(@NotNull @NotNull VcsRepositoryData repositoryData) throws RepositoryException
      Deprecated.
      since 6.0 use/implement getFirstCommitApproximation(VcsRepositoryData) instead
      Retrieve the commit that created the Branch (if that information is possible to retrieve)
      Returns:
      the first commit to the branch or null if N/A.
      Throws:
      RepositoryException