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

Merge Before Build option has disappeared with Git Plugin 3.5.1

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • None

      After having upgraded Jenkins from 2.65 to 2.67 and upgraded Jenkins plugins, the Merge Before Build option has disappeared from the Git optional behaviors menu of the pipeline syntax helper.

      This is with upgrading the Git Plugin from 3.3.0 to 3.5.1

          [JENKINS-46036] Merge Before Build option has disappeared with Git Plugin 3.5.1

          Valentin Chartier created issue -
          Mark Waite made changes -
          Description Original: After having upgraded Jenkins from 1.65 to 1.67 and upgraded Jenkins plugins, the Merge Before Build option has disappeared from the Git optional behaviors menu.

          This is with upgrading the Git Plugin from 3.3.0 to 3.5.1
          New: After having upgraded Jenkins from 1.65 to 1.67 and upgraded Jenkins plugins, the Merge Before Build option has disappeared from the Git optional behaviors menu of the pipeline syntax helper.

          This is with upgrading the Git Plugin from 3.3.0 to 3.5.1
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]

          Mark Waite added a comment -

          PreBuild merge was intentionally removed from the plugin in the git plugin 3.4.0 version. A new trait has been added to the git plugin 3.5.1 which can be optionally extended by a new plugin that will allow prebuild merge. arty13 has submitted the changes to create that plugin.

          Mark Waite added a comment - PreBuild merge was intentionally removed from the plugin in the git plugin 3.4.0 version. A new trait has been added to the git plugin 3.5.1 which can be optionally extended by a new plugin that will allow prebuild merge. arty13 has submitted the changes to create that plugin.

          Art V added a comment -

          I have finished the new plugin/credentials process and as of this writing have published version 1.0 of git-prebuildmerge-trait-plugin
          According to the Jenkins Release process it may take up to 8 hours to show up on the Update Center.

          Art V added a comment - I have finished the new plugin/credentials process and as of this writing have published version 1.0 of git-prebuildmerge-trait-plugin According to the Jenkins Release process it may take up to 8 hours to show up on the Update Center.
          Valentin Chartier made changes -
          Description Original: After having upgraded Jenkins from 1.65 to 1.67 and upgraded Jenkins plugins, the Merge Before Build option has disappeared from the Git optional behaviors menu of the pipeline syntax helper.

          This is with upgrading the Git Plugin from 3.3.0 to 3.5.1
          New: After having upgraded Jenkins from 2.65 to 2.67 and upgraded Jenkins plugins, the Merge Before Build option has disappeared from the Git optional behaviors menu of the pipeline syntax helper.

          This is with upgrading the Git Plugin from 3.3.0 to 3.5.1

          Valentin Chartier added a comment - - edited

          I have tried the new prebuildmerge-trait-plugin allow with git plugin 3.5.1 but I had to roll it back to 3.3.0 because the "git push" at the end of the pipeline was failing with this error :
          + git push origin master
          error: src refspec master does not match any.
          error: failed to push some refs to <my-repository>

          The pre-build merge logs :

          Cloning the remote Git repository
          Cloning with configured refspecs honoured and without tags
          Cloning repository <my/repo.git>
          > git init /var/lib/jenkins/workspace/<mybranchname> # timeout=10
          Fetching upstream changes from <my/repo.git>
          > git --version # timeout=10
          using GIT_SSH to set credentials
          > git fetch --no-tags --progress <my/repo.git> +refs/heads/:refs/remotes/origin/
          > git config remote.origin.url <my/repo.git> # timeout=10
          > git config --add remote.origin.fetch +refs/heads/:refs/remotes/origin/ # timeout=10
          > git config remote.origin.url <my/repo.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 <my/repo.git>
          using GIT_SSH to set credentials
          > git fetch --no-tags --progress <my/repo.git> +refs/heads/:refs/remotes/origin/
          Merging Revision 687dbec7bfa1291f8d88cb860909f06fbf697a3f (<mybranchname>) to origin/master, UserMergeOptions{mergeRemote='origin', mergeTarget='master', mergeStrategy='default', fastForwardMode='--ff'}
          > git rev-parse origin/master^{commit} # timeout=10
          > git config core.sparsecheckout # timeout=10
          > git checkout -f origin/master
          > git merge --ff 687dbec7bfa1291f8d88cb860909f06fbf697a3f # timeout=10
          > git rev-parse HEAD^{commit} # timeout=10 

          Any idea why this would happen with the new prebuildmerge-trait-plugin 1.0 ?

          Valentin Chartier added a comment - - edited I have tried the new prebuildmerge-trait-plugin allow with git plugin 3.5.1 but I had to roll it back to 3.3.0 because the "git push" at the end of the pipeline was failing with this error : + git push origin master error: src refspec master does not match any. error: failed to push some refs to <my-repository> The pre-build merge logs : Cloning the remote Git repository Cloning with configured refspecs honoured and without tags Cloning repository <my/repo.git> > git init /var/lib/jenkins/workspace/<mybranchname> # timeout=10 Fetching upstream changes from <my/repo.git> > git --version # timeout=10 using GIT_SSH to set credentials > git fetch --no-tags --progress <my/repo.git> +refs/heads/ :refs/remotes/origin/ > git config remote.origin.url <my/repo.git> # timeout=10 > git config --add remote.origin.fetch +refs/heads/ :refs/remotes/origin/ # timeout=10 > git config remote.origin.url <my/repo.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 <my/repo.git> using GIT_SSH to set credentials > git fetch --no-tags --progress <my/repo.git> +refs/heads/ :refs/remotes/origin/ Merging Revision 687dbec7bfa1291f8d88cb860909f06fbf697a3f (<mybranchname>) to origin/master, UserMergeOptions{mergeRemote='origin', mergeTarget='master', mergeStrategy='default', fastForwardMode='--ff'} > git rev-parse origin/master^{commit} # timeout=10 > git config core.sparsecheckout # timeout=10 > git checkout -f origin/master > git merge --ff 687dbec7bfa1291f8d88cb860909f06fbf697a3f # timeout=10 > git rev-parse HEAD^{commit} # timeout=10  Any idea why this would happen with the new prebuildmerge-trait-plugin 1.0 ?

          Mark Waite added a comment -

          I would guess that the git repository in your workspace may not have created a branch named master. The git plugin defaults to checking out a specific SHA1, without creating a branch for that SHA1. You can add the additional behavior to "checkout to local branch" and it should create a branch in that repository.

          Mark Waite added a comment - I would guess that the git repository in your workspace may not have created a branch named master. The git plugin defaults to checking out a specific SHA1, without creating a branch for that SHA1. You can add the additional behavior to "checkout to local branch" and it should create a branch in that repository.

          Valentin Chartier added a comment - - edited

          @Mark Yes "checkout to specific local branch - Branch name : master" was there. 

          Valentin Chartier added a comment - - edited @Mark Yes "checkout to specific local branch - Branch name : master" was there. 
          Mark Waite made changes -
          Component/s New: git-prebuildmerge-trait-plugin [ 23049 ]
          Component/s Original: git-plugin [ 15543 ]

            Unassigned Unassigned
            valentin92 Valentin Chartier
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: