Skip to content
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

Closed
wants to merge 4 commits into from

Conversation

csiden
Copy link

@csiden csiden commented Sep 13, 2016

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.

@csiden
Copy link
Author

csiden commented Sep 21, 2016

@jglick Is just opening pull requests here the correct way to submit changes for this plugin? Thanks, Chris.

@jglick
Copy link
Member

jglick commented Sep 23, 2016

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 JobProperty is needed. Right now I cannot spare the time to review this properly.

@csiden
Copy link
Author

csiden commented Sep 23, 2016

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.

@jglick
Copy link
Member

jglick commented Nov 29, 2016

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 Jenkinsfile. Which may be for the best.

@jglick jglick self-assigned this Dec 1, 2016
makeDisabled(false);
}

@CLIMethod(name="disable-job")
Copy link
Member

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.

@jglick jglick removed their assignment May 2, 2017
@jglick
Copy link
Member

jglick commented May 2, 2017

I plan to reimplement this.

jglick added a commit to jglick/workflow-job-plugin that referenced this pull request May 5, 2017
@jglick
Copy link
Member

jglick commented May 12, 2017

Superseded.

@jglick jglick closed this May 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants