Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins disables project builds on branches after a pull request is issued

Note: I only have Jenkinsfile set up in one of my branches, not the master.

I have setup Git webhooks to monitor push events to my Github repository. However, I am noticing that my Jenkins builds are working fine (picking up push events, triggering builds) as branches, but after a pull request is issued, my branch build gets disabled in the Branches tab of my project.

enter image description here

However, I do see the new PR listed in my Pull Requests tab. But now, when I push to Github, the new commits are not triggering builds anymore. In my branches tab, my old branch is now crossed out. enter image description here

How do I force Jenkins to keep building my branches? I would like to continue building from a branch, even if a PR has been issued.

like image 312
Yu Chen Avatar asked Mar 28 '19 00:03

Yu Chen


People also ask

How can we make Jenkins pipeline jobs triggered by pull requests?

Configure your pipelineOn the Datalog Tagging tab, check “GitHub project”, and put your project URL in the field. On the Build Triggers tab, check “GitHub Pull Request Builder”. Then the GitHub API credentials is automatically filled in. Make sure the Admin list is filled in with at least one admin name.

How do you trigger a job in Jenkins when a pull request is created?

For Jenkins to receive PR events through the pull request plugin, you need to add the Jenkins pull request builder payload URL in the Github repository settings. If you need just the PR triggers, you can select the “Let me select individual events” option and select just the “Pull requests” option.

Why would a job in Jenkins Multibranch pipeline gets disabled?

If there is no Jenkinsfile at the root of the repository or if the name is misspelled or is with different letters casing, like JenkinsFile, the job will be disabled.

How do I disable some branches in Multibranch Jenkins builds?

Two ways to stop your branch from building. Enter the branch in "Exclude branch" and save the settings. If you don't have control of the project settings, the easy way is to rename the Jenkinsfile in the project/branch. This configuration will define to trigger a build if a branch/project has "Jenkinsfile" in it.


1 Answers

That's because you have an on going PR for that branch, whenever the PR reaches any final status, your disabled branch will be enabled again.

like image 87
jamlet Avatar answered Sep 26 '22 02:09

jamlet