Interface MergeRequest


public interface MergeRequest
Represents a request to merge a pull request, intended to allow RepositoryMergeChecks to validate the intended merge and, potentially, veto(java.lang.String, java.lang.String) it.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves the proposed commit message, if one was provided.
    com.atlassian.bitbucket.pull.PullRequest
     
    boolean
    Retrieves a flag indicating whether this request is for a canMerge check or a real merge.
    boolean
     
    void
    veto(String summaryMessage, String detailedMessage)
    If called, signifies that the calling check wishes to veto the merge.
  • Method Details

    • getMessage

      @Nullable String getMessage()
      Retrieves the proposed commit message, if one was provided.

      On dry runs, the commit message will always be null.

      Returns:
      the proposed commit message, which will be null for canMerge checks and may be null for merge requests
    • getPullRequest

      @Nonnull com.atlassian.bitbucket.pull.PullRequest getPullRequest()
      Returns:
      the pull request to be merged
    • isDryRun

      boolean isDryRun()
      Retrieves a flag indicating whether this request is for a canMerge check or a real merge.

      This flag is intended to allow RepositoryMergeChecks to apply different validation, if necessary, between canMerge and merge requests. For example, a RepositoryMergeCheck to validate the commit message would not be applied on a dry run, because the commit message is only supplied when the merge is actually performed.

      Returns:
      true if this is a canMerge check; otherwise, false if it is a merge request
    • isVetoed

      boolean isVetoed()
      Returns:
      true if a previous RepositoryMergeCheck has already vetoed the merge; otherwise, false
    • veto

      void veto(@Nonnull String summaryMessage, @Nonnull String detailedMessage)
      If called, signifies that the calling check wishes to veto the merge.
      Parameters:
      summaryMessage - a simple summary of why the merge is being vetoed
      detailedMessage - a detailed explanation of why the merge is being vetoed