-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JENKINS-33821] Pipeline jobs can't be disabled (alternate) #23
Conversation
@jglick Is just opening pull requests here the correct way to submit changes for this plugin? Thanks, Chris. |
Yes though for complex changes it is best to check with me in IRC or whatever first. I have to think about whether the approach taken here is really what we want, or if a |
Okay, this didn't take long to put together so I didn't bother asking first, but let me know when you have time to take a look, I'm happy to redo it in whatever way is most correct. |
Looks reasonable; I need to think a bit about how this will interact with multibranch. As written you would be able to manually enable/disable branch projects, but not do so via |
makeDisabled(false); | ||
} | ||
|
||
@CLIMethod(name="disable-job") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have to check what actually happens here. From a quick reading of CLIRegisterer
, looks like either this command will be broken for WorkflowJob
or it will be broken for AbstractProject
. Certainly deserves to be tested at least.
I plan to reimplement this. |
Superseded. |
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.