Uploaded image for project: 'SR for Bitbucket - Development'
  1. SR for Bitbucket - Development
  2. SRBITB-151

Block out of date pull requests fails when no common base found between branches

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3.7
    • Labels:
      None
    • Sprint:
      Sprint 26 - Ends Sept 1, Sprint 26 - Ends Oct 3
    • Critical Points:
      0

      Description

      When creating a pull request for an orphan branch with the block out of date pull request listener you can get the message:

      Pull request creation was canceled.
      A event handler failed to execute properly - contact an Administrator

      The logs contain:

      2016-09-01 08:31:06,583 ERROR [http-nio-7990-exec-10] jmort @RS4AT2x511x62015x0 e7ytk 185.46.209.50,127.0.0.1 "POST /projects/SR/repos/sr-for-connect-loadtest/pull-requests HTTP/1.1" c.o.s.bitbucket.InnerListener Event handler failed: event: com.atlassian.bitbucket.event.pull.PullRequestOpenRequestedEvent file: null
      com.atlassian.bitbucket.scm.CommandFailedException: '/usr/bin/git merge-base refs/heads/init-branch refs/heads/master' exited with code 1
              at com.atlassian.bitbucket.scm.DefaultCommandExitHandler.onError(DefaultCommandExitHandler.java:42) ~[bitbucket-spi-4.9.0.jar:na]
              at com.atlassian.bitbucket.scm.git.command.GitCommandExitHandler.evaluateThrowable(GitCommandExitHandler.java:104) ~[na:na]
              at com.atlassian.bitbucket.scm.git.command.GitCommandExitHandler.onError(GitCommandExitHandler.java:201) ~[na:na]
              at com.atlassian.bitbucket.scm.DefaultCommandExitHandler.onExit(DefaultCommandExitHandler.java:31) ~[bitbucket-spi-4.9.0.jar:na]
              at com.atlassian.bitbucket.scm.BaseCommand.callExitHandler(BaseCommand.java:146) ~[bitbucket-spi-4.9.0.jar:na]
              at com.atlassian.bitbucket.scm.BaseCommand$CommandFuture.internalGet(BaseCommand.java:272) ~[bitbucket-spi-4.9.0.jar:na]
              at com.atlassian.bitbucket.scm.BaseCommand$CommandFuture.get(BaseCommand.java:241) ~[bitbucket-spi-4.9.0.jar:na]
              at com.atlassian.bitbucket.scm.BaseCommand.call(BaseCommand.java:83) ~[bitbucket-spi-4.9.0.jar:na]
              at com.atlassian.bitbucket.scm.Command$call.call(Unknown Source) ~[na:na]
              at com.onresolve.scriptrunner.canned.bitbucket.pullrequests.PullRequestPolicies.isPullRequestUpToDate(PullRequestPolicies.groovy:54) ~[na:na]
              at com.onresolve.scriptrunner.canned.bitbucket.pullrequests.PullRequestPolicies$isPullRequestUpToDate.callCurrent(Unknown Source) ~[na:na]
              at com.onresolve.scriptrunner.canned.bitbucket.events.BlockOutOfDatePullRequests.doScript(BlockOutOfDatePullRequests.groovy:58) ~[na:na]
      Caused by: com.atlassian.utils.process.ProcessException: Non-zero exit code: 1
              at com.atlassian.bitbucket.scm.SummarizingProcessHandler.complete(SummarizingProcessHandler.java:47) ~[bitbucket-spi-4.9.0.jar:na]
              at com.atlassian.utils.process.ExternalProcessImpl.wrapUpProcess(ExternalProcessImpl.java:680) ~[atlassian-processutils-1.7.6.jar:na]
              at com.atlassian.utils.process.ExternalProcessImpl.finish(ExternalProcessImpl.java:161) ~[atlassian-processutils-1.7.6.jar:na]
              at com.atlassian.bitbucket.scm.BaseCommand$CommandFuture.get(BaseCommand.java:239) ~[bitbucket-spi-4.9.0.jar:na]
              ... 5 common frames omitted

      This happens when you do not branch off of master then create a pull request and the 2 branches do not share a common base which we work out using git merge-base.

      We should fail but with a better error message for the user telling them why this problem is happening and they can disable the listener if they wish to.

        Attachments

          Activity

            People

            Assignee:
            amarkham Adam Markham
            Reporter:
            awieczorek Andrzej Wieczorek
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: