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

Use standard in option for piping refs to git rev-list when reading raw commits

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 4.3.10
    • Fix Version/s: 4.3.14
    • Labels:
      None
    • Sprint:
      Sprint 27 - Ends Nov 1
    • Critical Points:
      0.3

      Description

      Using the enforce trusted commit authors hook with a large number of branches results in the following exception because the excluded branches list is too long on Windows.

      com.atlassian.bitbucket.ServerException: An error occurred while executing an external process: CreateProcess error=206, The filename or extension is too long
      at com.atlassian.bitbucket.scm.git.command.GitCommandExitHandler.evaluateThrowable(GitCommandExitHandler.java:113) ~[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.1.jar:na]
      at com.atlassian.bitbucket.scm.BaseCommand.callExitHandler(BaseCommand.java:146) ~[bitbucket-spi-4.9.1.jar:na]
      at com.atlassian.bitbucket.scm.BaseCommand$CommandFuture.internalGet(BaseCommand.java:272) ~[bitbucket-spi-4.9.1.jar:na]
      at com.atlassian.bitbucket.scm.BaseCommand$CommandFuture.get(BaseCommand.java:241) ~[bitbucket-spi-4.9.1.jar:na]
      at com.atlassian.bitbucket.scm.BaseCommand.call(BaseCommand.java:83) ~[bitbucket-spi-4.9.1.jar:na]
      at com.atlassian.bitbucket.scm.Command$call.call(Unknown Source) ~[na:na]
      at com.onresolve.scriptrunner.canned.bitbucket.util.RawCommitsPageProvider.get(RawCommitsPageProvider.groovy:49) ~[na:na]
      at com.atlassian.bitbucket.util.PagedIterable.iterator(PagedIterable.java:27) ~[bitbucket-util-4.9.1.jar:na]
      at com.onresolve.scriptrunner.canned.bitbucket.hooks.TrustedCommitAuthors.doScript(TrustedCommitAuthors.groovy:170) ~[na:na]
      Caused by: java.io.IOException: CreateProcess error=206, The filename or extension is too long
      at com.atlassian.utils.process.ExternalProcessImpl.createDefaultProcess(ExternalProcessImpl.java:377) ~[atlassian-processutils-1.7.6.jar:na]
      at com.atlassian.utils.process.ExternalProcessImpl.createProcess(ExternalProcessImpl.java:385) ~[atlassian-processutils-1.7.6.jar:na]
      at com.atlassian.utils.process.ExternalProcessImpl.start(ExternalProcessImpl.java:339) ~[atlassian-processutils-1.7.6.jar:na]
      at com.atlassian.bitbucket.scm.BaseCommand.doStart(BaseCommand.java:209) ~[bitbucket-spi-4.9.1.jar:na]
      at com.atlassian.bitbucket.scm.BaseCommand.call(BaseCommand.java:80) ~[bitbucket-spi-4.9.1.jar:na]
      ... 4 common frames omitted
      

      We should use the stdin option for git rev-list to get the raw commits to limit the maximum command size in Windows. This seems to be what Atlassian do when reading the commits

        Attachments

          Activity

            People

            Assignee:
            amarkham Adam Markham
            Reporter:
            amarkham Adam Markham
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: