Hudson / jenkins continues to build a bad branch in git instead of a good one

I have jenkins to create any branch and merge it into master. I also have pre-acquisition scripts so that none of the developers can check the wizard if you are not a "hudson" user.

It works great in one of our repositories, but on the other hand, when someone pushes a new remote branch, hudson builds a suspended non-working branch and doesnโ€™t build, so every new push of the remote branch starts immediate assembly (post-receive script calls curl) but then he tries to build this bad branch instead of the one that the developer clicked.

NOTICE in the logs, it looks like it correctly determines that dhiller-1 was the last clicked, but then decides to build a dhiller-refactor, which is not complete but is stored in the remote repository, as it is a large refactor that is still in the process (and clicked only for backup)

magazines ...

Started by user anonymous Checkout:workspace / C:\AAROOT\Jenkins2\jobs\toolbar\workspace - hudson.remoting.LocalChannel@aab87f Using strategy: Default Last Built Revision: Revision 597af7a5d808b28f492257f311af9171f03e6891 (origin/dhiller-1) Checkout:workspace / C:\AAROOT\Jenkins2\jobs\toolbar\workspace - hudson.remoting.LocalChannel@aab87f Fetching changes from 1 remote Git repository Fetching upstream changes from ssh:// hudson@192.168.111.130 /opt/toolbar Seen branch in repository origin/HEAD Seen branch in repository origin/dhiller-1 Seen branch in repository origin/dhiller-2 Seen branch in repository origin/dhiller-refactor Seen branch in repository origin/dhiller-test Seen branch in repository origin/master Commencing build of Revision 2c56d8645871ea2929c717e15038a5b79c0b43e1 (origin/dhiller-refactor) Merging Revision 2c56d8645871ea2929c717e15038a5b79c0b43e1 (origin/dhiller-refactor) onto master ERROR: Branch not suitable for integration as it does not merge cleanly Build did not succeed and the project is configured to only push after a successful build, so no pushing will occur. Finished: FAILURE 
+6
source share
2 answers

Well, I finally fixed it by completely deleting this remote branch and creating a new one that had code from this bad branch, just using a copy of the files, so yes, I lost the history of this branch, but it fixed the problem ... this there was a lot of pain and seems to be working again.

+3
source

I had the same problem. The strange thing was that Jenkins (git-plugin) radiated

ERROR: the branch is not suitable for integration, since it does not merge cleanly.

while I did not check the Merge Before Build option. If you look at the source code of git-plugin here , he should have done it. Enabling this option, saving the configuration, disabling the option and saving the configuration again, fixed the problem for me; he is no longer trying to merge.

0
source

Source: https://habr.com/ru/post/905626/


All Articles