Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-50937

GitHub Multibranch PR: unclear error message for PR with merge conflicts

XMLWordPrintable

      When there is a merge conflict on a GitHub PR, Jenkins displays a cryptic exception instead of having a clear message with an hyperlink to the pull request on github.

      Branch indexing
      Connecting to https://api.github.com using admin/****** (GitHub Access Token)
      Checking out git https://github.com/cyrille-leclerc/my-spring-boot-app.git into /opt/jenkins-oss/jenkins_home/workspace/my-spring-boot-app_PR-1-DZVOWEKBTG4QNQLVIUGZDZT4OEREYWOQPQSIZTLS3MU4M6ZJ5Q3A@script to read Jenkinsfile
      Cloning the remote Git repository
      Cloning with configured refspecs honoured and without tags
      Cloning repository https://github.com/cyrille-leclerc/my-spring-boot-app.git
       > git init /opt/jenkins-oss/jenkins_home/workspace/my-spring-boot-app_PR-1-DZVOWEKBTG4QNQLVIUGZDZT4OEREYWOQPQSIZTLS3MU4M6ZJ5Q3A@script # timeout=10
      Fetching upstream changes from https://github.com/cyrille-leclerc/my-spring-boot-app.git
       > git --version # timeout=10
      using GIT_ASKPASS to set credentials GitHub Access Token
       > git fetch --no-tags --progress https://github.com/cyrille-leclerc/my-spring-boot-app.git +refs/pull/1/head:refs/remotes/origin/PR-1 +refs/heads/master:refs/remotes/origin/master
       > git config remote.origin.url https://github.com/cyrille-leclerc/my-spring-boot-app.git # timeout=10
       > git config --add remote.origin.fetch +refs/pull/1/head:refs/remotes/origin/PR-1 # timeout=10
       > git config --add remote.origin.fetch +refs/heads/master:refs/remotes/origin/master # timeout=10
       > git config remote.origin.url https://github.com/cyrille-leclerc/my-spring-boot-app.git # timeout=10
      Cleaning workspace
       > git rev-parse --verify HEAD # timeout=10
      No valid HEAD. Skipping the resetting
       > git clean -fdx # timeout=10
      Fetching without tags
      Fetching upstream changes from https://github.com/cyrille-leclerc/my-spring-boot-app.git
      using GIT_ASKPASS to set credentials GitHub Access Token
       > git fetch --no-tags --progress https://github.com/cyrille-leclerc/my-spring-boot-app.git +refs/pull/1/head:refs/remotes/origin/PR-1 +refs/heads/master:refs/remotes/origin/master
      Merging remotes/origin/master commit 922f0693827e23384386f0d154bf01514d606639 into PR head commit 48bc4f82dab3bac320aefe4fddb50896eb491339
       > git config core.sparsecheckout # timeout=10
       > git checkout -f 48bc4f82dab3bac320aefe4fddb50896eb491339
       > git merge 922f0693827e23384386f0d154bf01514d606639 # timeout=10
       > git config core.sparsecheckout # timeout=10
       > git checkout -f 48bc4f82dab3bac320aefe4fddb50896eb491339
      
      GitHub has been notified of this commit’s build result
      
      hudson.plugins.git.GitException: Command "git merge 922f0693827e23384386f0d154bf01514d606639" returned status code 1:
      stdout: Auto-merging Jenkinsfile
      CONFLICT (content): Merge conflict in Jenkinsfile
      Automatic merge failed; fix conflicts and then commit the result.
      
      stderr: 
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1996)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1964)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1960)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1597)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$3.execute(CliGitAPIImpl.java:697)
      	at jenkins.plugins.git.MergeWithGitSCMExtension.decorateRevisionToBuild(MergeWithGitSCMExtension.java:122)
      	at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:1068)
      	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1161)
      	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
      	at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:144)
      	at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:120)
      	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:296)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:429)
      Finished: FAILURE
      

            Unassigned Unassigned
            cleclerc Cyrille Le Clerc
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: