Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
[JENKINS-33821] Pipeline jobs can't be disabled (alternate) #23
This goes together with the Jenkins core change in jenkinsci/jenkins#2544. While the core change is related, it is not required to use the disable/enable functionality in this diff. I have tested this change with Jenkins core 1.642.3 (and with the pull request above) and disable/enable seems to work, including cancelling queued jobs, updating the job BallColor, blocking SCM polling, and blocking cron triggers. The core functionality of "don't do builds if a job is disabled" seems to work as long as WorkflowJob.isBuildable() returns 'false' when the job is disabled, which does not depend on the Jenkins core change.
However, because Jenkins core and plugins use AbstractProject.isDisabled() rather than Job.isDisabled() (introduced in jenkinsci/jenkins#2544) there may be some odd interactions until other plugins are updated, since they won't be able to tell when pipeline jobs are disabled.