I have two release branches for work for the current release in the next release. Rather then asking all my developers to commit to Relase1 and then merge it to Release2 I configured cloudbees to do the work using prebuild merges. That worked for a couple builds, but a recent update broke it. Now cloudbees builds does not attempt to do a prebuild merge
The relevant section from the log of the failing build:
commit notification c9f044eafa09e517d074d7a00f02cfced59bf6e0
commit notification c9f044eafa09e517d074d7a00f02cfced59bf6e0
commit notification c9f044eafa09e517d074d7a00f02cfced59bf6e0
Building remotely on 93ca72d3 in workspace /scratch/jenkins/workspace/da/b2.potter
Fetching changes from the remote Git repository
Fetching upstream changes from git@bitbucket.org:elosystemsteam/paypoint-potter.git
Checking out Revision c9f044eafa09e517d074d7a00f02cfced59bf6e0 (detached)
The relevant build configuration section:
<scm class="hudson.plugins.git.GitSCM" plugin="git@2.2.1">
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<url>
git@bitbucket.org:elosystemsteam/paypoint-potter.git
</url>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
<hudson.plugins.git.BranchSpec>
<name>*/B1-Bisque</name>
</hudson.plugins.git.BranchSpec>
</branches>
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
<browser class="hudson.plugins.git.browser.BitbucketWeb">
<url>
https://bitbucket.org/elosystemsteam/paypoint-potter
</url>
</browser>
<submoduleCfg class="list"/>
<extensions>
<hudson.plugins.git.extensions.impl.PreBuildMerge>
<options>
<mergeRemote/>
<mergeTarget>B2-Bisque</mergeTarget>
<mergeStrategy>default</mergeStrategy>
</options>
</hudson.plugins.git.extensions.impl.PreBuildMerge>
</extensions>
</scm>
The build log never says it does a merge against B2-Bisque and you can tell it doesn't because the post build git push fails:
Pushing HEAD to branch B2-Bisque of origin repository
ERROR: Failed to push merge to origin repository
hudson.plugins.git.GitException: Command "git push git@bitbucket.org:elosystemsteam/paypoint-potter.git HEAD:B2-Bisque" returned status code 1:
stdout:
stderr: To git@bitbucket.org:elosystemsteam/paypoint-potter.git
! [rejected] HEAD -> B2-Bisque (non-fast-forward)
error: failed to push some refs to 'git@bitbucket.org:elosystemsteam/paypoint-potter.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and merge the remote changes
hint: (e.g. 'git pull') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1276)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1146)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$200(CliGitAPIImpl.java:87)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$7.execute(CliGitAPIImpl.java:1331)
at org.jenkinsci.plugins.gitclient.LegacyCompatibleGitAPIImpl.push(LegacyCompatibleGitAPIImpl.java:98)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.push(CliGitAPIImpl.java:87)
at org.jenkinsci.plugins.gitclient.LegacyCompatibleGitAPIImpl.push(LegacyCompatibleGitAPIImpl.java:109)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.push(CliGitAPIImpl.java:87)
at hudson.plugins.git.GitAPI.push(GitAPI.java:66)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:299)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:280)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:239)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Build step 'Git Publisher' marked build as failure
It seems that merge before build not longer integrates with SCM triggered builds
The bitbucket plugin allows you to trigger builds when bitbucket is updated. However whenever bitbucket kicked off the build I got this:
commit notification 6ed77b52aa95a563a0052404ca72e4afdccc4d6c
commit notification 6ed77b52aa95a563a0052404ca72e4afdccc4d6c
commit notification 6ed77b52aa95a563a0052404ca72e4afdccc4d6c
Building remotely on 1b68e1c7 in workspace /scratch/jenkins/workspace/da/b2.potter
Fetching changes from the remote Git repository
Fetching upstream changes from git@bitbucket.org:elosystemsteam/paypoint-potter.git
Checking out Revision 6ed77b52aa95a563a0052404ca72e4afdccc4d6c (detached)
But when I kicked off the build manually I got this instead:
Started by user Michael Power
Building remotely on fef3883c in workspace /scratch/jenkins/workspace/da/b2.potter
Fetching changes from the remote Git repository
Fetching upstream changes from git@bitbucket.org:elosystemsteam/paypoint-potter.git
Seen branch in repository origin/###
...
Seen 191 remote branches
Merging Revision 6ed77b52aa95a563a0052404ca72e4afdccc4d6c (origin/B1-Bisque) onto origin/B2-Bisque using default strategy