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

Status publisher not updating status when "Merge before build" (git) fails

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • gitlab-plugin
    • None
    • Jenkins 2.11 (openjdk version "1.8.0_91")
      Gitlab CE 8.9.3
      Gitlab plugin 2.5.0

      With a job configured as advised on https://github.com/jenkinsci/gitlab-plugin#jenkins-job-configuration.

      On a merge request, if a source branch doesn't merge cleanly to the target branch, the job building the merge request fails with :

      Merging Revision <redacted> (origin/feature) to origin/dev, UserMergeOptions{mergeRemote='origin', mergeTarget='${gitlabTargetBranch}', mergeStrategy='recursive', fastForwardMode='--ff'}
       > git rev-parse origin/dev^{commit} # timeout=10
       > git config core.sparsecheckout # timeout=10
       > git checkout -f origin/dev
       > git merge -s recursive --ff 8f3f6d45cb8bbbf73c8ae5c8a163da83706a94cb # timeout=10
       > git config core.sparsecheckout # timeout=10
       > git checkout -f 8f3f6d45cb8bbbf73c8ae5c8a163da83706a94cb
      ERROR: Branch not suitable for integration as it does not merge cleanly: Could not merge AnyObjectId[8f3f6d45cb8bbbf73c8ae5c8a163da83706a94cb]
      Failed to update Gitlab commit status: No (git-plugin) BuildData associated to current build
      

      It's expected for the build to fail, but the last line is a bug.
      The status on Gitlab is not updated and remains "pending" (shoud have been be updated to "failed").

            coderhugo Robin Müller
            tsbx tsbx
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: