Jesse Glick
added a comment - 2015-08-03 22:49 I had no immediate plans to work on it.
I suspect ParameterizedJobMixIn is the right home for this, though I have not analyzed it in detail; would just need to try doing the refactoring and see what kind of trouble ensues.

It would be nice if we can enable/disable the workflow job.
I configured it to run in cycle and handle many other jobs with various criteria and keep running. Only I can stop it and re-run it but cant disable it so that when required it got enabled and then started again with any jenkins admin.

bhupendra rathore
added a comment - 2016-08-23 09:15 It would be nice if we can enable/disable the workflow job.
I configured it to run in cycle and handle many other jobs with various criteria and keep running. Only I can stop it and re-run it but cant disable it so that when required it got enabled and then started again with any jenkins admin.

Christopher Siden
added a comment - 2016-09-13 17:35 I took a shot at adding disable support to pipeline jobs in two pull requests:
https://github.com/jenkinsci/jenkins/pull/2543
https://github.com/jenkinsci/workflow-job-plugin/pull/22
I haven't done Jenkins development before though, so I'm not sure this is the right way to go about it.

Owen Mehegan
added a comment - 2016-10-21 21:03 Folks, it's not helpful to keep posting +1 comments. This generates a fairly pointless email to everyone who is watching this issue. If you want the feature, just add a vote. Thanks.

Oleg Nenashev
added a comment - 2016-10-23 10:33 There is a pull request pending to the Jenkins core.
If somebody is interested to get it sooner, please feel free to contribute by reviewing and testing the changes (or proposing your own PRs).

Richard Lee
added a comment - 2017-01-31 22:57 Is this being actively worked on? There are a lot of votes for it, and it's really inconvenient that pipeline builds can't straightforwardly be temporarily disabled.

Having Disable Build/Project feature for pipelines would be somewhat a workaround for Safe Restart, since Safe Restart is broken for many pipeline steps. It's a pain to maintain Jenkins having many loooong pipelines. Keeps us away from droping Build Flow plugin completely in favour of pipeline.

Anna Tikhonova
added a comment - 2017-03-29 08:58 Having Disable Build/Project feature for pipelines would be somewhat a workaround for Safe Restart, since Safe Restart is broken for many pipeline steps. It's a pain to maintain Jenkins having many loooong pipelines. Keeps us away from droping Build Flow plugin completely in favour of pipeline.

Rob Ilott
added a comment - 2017-04-03 14:31 - edited This is becoming critical to our decision of whether to move from Build Flow to Pipeline for the majority of our projects.
The fact that we cannot simply disable a pipeline job hurts.

Idan Adar
added a comment - 2017-04-04 09:19 - edited Is this related to being able to disable/enable a multi-branch pipeline/job from the Jenkins UI in any way?
Assuming in a Jenkinsfile run I decide to disable some jobs, e.g:
post {
failure {
script {
def job = Jenkins.instance.getItem( "job-name" );
job.disable();
}
}
}
If this actually works, how could I then enable it given there is no button in the UI to enable/disable a multi-branch job.

Daniel Beck
added a comment - 2017-04-04 09:47 disable/enable a multi-branch pipeline/job
Multibranch Pipelines are basically folders with some additional behavior, the actual Pipeline jobs are the individual branches. AFAIUI, this is about the latter.

Yep. Btw, the two PRs in question working in tandem work to fix this issue. With just the workflow PR merged, we get some disabling (UI), disabling through manual DSL disable(), but a good number of plugins will view the job as not disabled, and the automatic DSL disable functionality doesn't work. Both PRs together seem to do what is intended.

Matthew Mitchell
added a comment - 2017-04-04 15:34 Yep. Btw, the two PRs in question working in tandem work to fix this issue. With just the workflow PR merged, we get some disabling (UI), disabling through manual DSL disable(), but a good number of plugins will view the job as not disabled, and the automatic DSL disable functionality doesn't work. Both PRs together seem to do what is intended.
https://github.com/jenkinsci/workflow-job-plugin/pull/23
https://github.com/jenkinsci/jenkins/pull/2544

Enable Ignore on push notifications in section Branch Sources of the pipeline job configuration. This way the job is not triggered upon a new commit. But please note that saving the configuration may trigger a branch scan.

Jochen Haag
added a comment - 2017-04-12 09:22 Here is a workaround which works for me when using Git:
Enable Ignore on push notifications in section Branch Sources of the pipeline job configuration. This way the job is not triggered upon a new commit. But please note that saving the configuration may trigger a branch scan.

I cannot use push notifications, so my own workaround is to create a freestyle "trigger" job which polls SCM and use the Parameterized Trigger plugin to trigger the pipeline job (standard trigger mechanism cannot be used with pipeline, another broken feature). I can then enable/disable the "trigger".

Daniel Beland
added a comment - 2017-04-12 12:44 I cannot use push notifications, so my own workaround is to create a freestyle "trigger" job which polls SCM and use the Parameterized Trigger plugin to trigger the pipeline job (standard trigger mechanism cannot be used with pipeline, another broken feature). I can then enable/disable the "trigger".

Rob Ilott
added a comment - 2017-04-12 12:58 We used to use separate trigger jobs, but for the particular type of workflow we're trying to move towards (where pipelines really help us) a trigger job is actually a bit of an inconvenience.

mohamed badran
added a comment - 2017-05-14 08:24 Jesse Glick
I've seen in the video of Cloudbees that the disable won't work on multibranch pipeline. Is there a way to disable the jobs generated from multibranch pipeline from polling?

Jesse Glick
added a comment - 2017-05-16 12:54 mohamed badran Is there a way to disable the jobs generated from multibranch pipeline from polling? There were already separate features designed to suppress commit triggers on branch projects, as discussed in the video. This is more a question for the user list.

I still hope we will see a user friendly option for disabling builds, on all kinds of jobs. The number of watchers on this ticket is a clear sign that something went wrong in the architecture phase of the pipelines.

Are not going towards a direction where we keep documentation inside videos? ...not to mention that the mentioned video is not even linked to this issue.

Sorin Sbarnea
added a comment - 2017-05-16 16:52 I still hope we will see a user friendly option for disabling builds, on all kinds of jobs. The number of watchers on this ticket is a clear sign that something went wrong in the architecture phase of the pipelines.
Are not going towards a direction where we keep documentation inside videos? ...not to mention that the mentioned video is not even linked to this issue.

Jesse Glick
added a comment - 2017-05-16 21:02 There is no plan for any feature permitting branch projects to be disabled per se. Stephen Connolly argued against it and I agree. Anyway that would be a separate (linked) RFE.

I've installed the Pipeline: Job plugin where the fix is. Now I'm looking at my multi-branch job, its main screen, the branch screen, the pull requests screen and in none one them do I see an enable/disable button.

When looking at the branch screen though, there is a "view configuration" button and there, under "Build Triggers" I do see "disable this project" with the following description:

When this option is checked, no new builds of this project will be executed.
This can be helpful when you want to temporarily prevent a project from being built. For example, if your project depends on some infrastructure — e.g. a test server, or a source code repository — and you know it will be unavailable for a period of time, you could disable the project to prevent unnecessary build failures (and any corresponding notifications) during this period.
You can also disable (or re-enable) this project by clicking the Disable Project (or Enable Project) button on this project's main page.

So am I supppose to see this somewhere in this job type? if not, what are our options for this case?

Idan Adar
added a comment - 2017-05-30 16:06 Jesse Glick , trying to understand where the fix is...
I've installed the Pipeline: Job plugin where the fix is. Now I'm looking at my multi-branch job, its main screen, the branch screen, the pull requests screen and in none one them do I see an enable/disable button.
When looking at the branch screen though, there is a "view configuration" button and there, under "Build Triggers" I do see "disable this project" with the following description:
When this option is checked, no new builds of this project will be executed.
This can be helpful when you want to temporarily prevent a project from being built. For example, if your project depends on some infrastructure — e.g. a test server, or a source code repository — and you know it will be unavailable for a period of time, you could disable the project to prevent unnecessary build failures (and any corresponding notifications) during this period.
You can also disable (or re-enable) this project by clicking the Disable Project (or Enable Project) button on this project's main page.
So am I supppose to see this somewhere in this job type? if not, what are our options for this case?

Here is your new car which looks great and even has an auto-pilot. BTW, we removed the break pedal because it was taking too much space and we moved it inside the trunk. Ask on the forum and people will tell you how they managed to use it.

Sorin Sbarnea
added a comment - 2017-05-30 20:21 From another dimension:
Here is your new car which looks great and even has an auto-pilot. BTW, we removed the break pedal because it was taking too much space and we moved it inside the trunk. Ask on the forum and people will tell you how they managed to use it.

This seems solved, however running recent versions of jenkins i cannot see how to disable builds. neither on specific branches or on repositories with multiple branches. Is there any documentation anywhere?

Mildred Ki'Lya
added a comment - 2018-05-04 10:07 This seems solved, however running recent versions of jenkins i cannot see how to disable builds. neither on specific branches or on repositories with multiple branches. Is there any documentation anywhere?

You would need to be logged in as a user who has access to write/configure builds. And if the build is Pipeline Multibranch you still won't see the disable button. If that's the case, you can append /disable to the project URL to disable it.

Owen Mehegan
added a comment - 2018-05-04 10:58 You would need to be logged in as a user who has access to write/configure builds. And if the build is Pipeline Multibranch you still won't see the disable button. If that's the case, you can append /disable to the project URL to disable it.

For a normal pipeline job I now have the button and can disable it, however it does not appear in views that filter on disabled jobs (List View section, Job Statuses Filter). Is this another bug that should be reported separately because it probably belongs to another component? If so, could you give me a hint which component this might belong to?

Wolfgang Kiendl
added a comment - 2018-05-04 15:19 For a normal pipeline job I now have the button and can disable it, however it does not appear in views that filter on disabled jobs (List View section, Job Statuses Filter). Is this another bug that should be reported separately because it probably belongs to another component? If so, could you give me a hint which component this might belong to?

Daniel Beck
added a comment - 2018-05-04 15:44 Might be https://plugins.jenkins.io/view-job-filters if you're using that, but core's List view also has a boolean flag to only include enabled jobs. Either, or both.