Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-27299

Refactor Disable Build feature out of AbstractProject for Pipeline Compatibility

      Currently the Disable Build function is available as part of AbstractProject. This should be refactored out to a place where WorkflowJob can also inherit the functionality.

          [JENKINS-27299] Refactor Disable Build feature out of AbstractProject for Pipeline Compatibility

          Scott Hebert added a comment -

          jglick Are you planning on working on this in the near future? If not, would I be able to take a stab at this?

          Thanks

          Scott

          Scott Hebert added a comment - jglick Are you planning on working on this in the near future? If not, would I be able to take a stab at this? Thanks Scott

          Jesse Glick added a comment -

          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.

          Jesse Glick added a comment - 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.

          Daniel Beck added a comment -

          mswyatt This is the original issue you should track for disabling workflows; the CLI command is just piggybacking on AbstractBuild's methods.

          Daniel Beck added a comment - mswyatt This is the original issue you should track for disabling workflows; the CLI command is just piggybacking on AbstractBuild's methods.

          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 - 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.

          This is a core feature in my mind. I'd love to see it fixed/added. Thanks!

          Andrew Erickson added a comment - This is a core feature in my mind. I'd love to see it fixed/added. Thanks!

          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.

          Christopher Siden added a comment - 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.

          fahd arshad added a comment -

          Guys, any luck on this?

          fahd arshad added a comment - Guys, any luck on this?

          Max Wahler added a comment -

          +1 for this feature!

          There are so many scenarios that require a job to be disabled that I also think that this is a core feature.

          Max Wahler added a comment - +1 for this feature! There are so many scenarios that require a job to be disabled that I also think that this is a core feature.

          +1 for this feature request please!

          Michael Bickett added a comment - +1 for this feature request please!

          +1. That this does not exist makes the gui inconsistent.

          Andreas Berheim Brudin added a comment - +1. That this does not exist makes the gui inconsistent.

          Mike Hay added a comment -

          +1

          Mike Hay added a comment - +1

          David Yerkess added a comment -

          +1 I am loving pipelines, but keep finding various small things that seem to be missing even when they seem important.

          David Yerkess added a comment - +1 I am loving pipelines, but keep finding various small things that seem to be missing even when they seem important.

          Owen Mehegan added a comment -

          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.

          Owen Mehegan added a comment - 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 -

          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).

          Oleg Nenashev added a comment - 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).

          Jesse Glick added a comment -

          Most of the onus is on me to review it, probably. I have not had time.

          Jesse Glick added a comment - Most of the onus is on me to review it, probably. I have not had time.

          clausfod added a comment -

          jglick: Any news ? We need this functionality to be able to disable or enable release jobs from criterias in other jobs.

          clausfod added a comment - jglick : Any news ? We need this functionality to be able to disable or enable release jobs from criterias in other jobs.

          +1 to getting this finished off

          Nathan Sullivan added a comment - +1 to getting this finished off

          Richard Lee added a comment -

          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.

          Richard Lee added a comment - 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.

          mishal shah added a comment -

          What is the current status of this issue? This is major issue, can we change the priority?

          mishal shah added a comment - What is the current status of this issue? This is major issue, can we change the priority?

          Jesse Glick added a comment -

          Nobody pays attention to the priority field. This is on my to-do list. I have not had time to work on it yet.

          Jesse Glick added a comment - Nobody pays attention to the priority field. This is on my to-do list. I have not had time to work on it yet.

          I feel like this should be a higher priority. This makes using pipeline in conjunction with job dsl difficult.

          Matthew Mitchell added a comment - I feel like this should be a higher priority. This makes using pipeline in conjunction with job dsl difficult.

          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 - 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.

          Was really surprised disabling pipeline builds was not supported. +1 for resolving this issue.

          Omer van Kloeten added a comment - Was really surprised disabling pipeline builds was not supported. +1 for resolving this issue.

          Rob Ilott added a comment - - 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.

          Rob Ilott added a comment - - 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 - - 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.

          Idan Adar added a comment - - 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 -

          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.

          Daniel Beck added a comment - 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.

           

          https://github.com/jenkinsci/workflow-job-plugin/pull/23

          https://github.com/jenkinsci/jenkins/pull/2544

           

          Matthew Mitchell added a comment - 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  

          Idan Adar added a comment -

          Thanks for the explanation. Hopefully this ticket will happen sooner than later...

          Idan Adar added a comment - Thanks for the explanation. Hopefully this ticket will happen sooner than later...

          Jochen Haag added a comment -

          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.

           

          Jochen Haag added a comment - 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.  

          Daniel Beland added a comment -

          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 - 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 -

          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.

          Rob Ilott added a comment - 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.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          pom.xml
          src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java
          src/main/resources/org/jenkinsci/plugins/workflow/job/WorkflowJob/configure-entries.jelly
          src/main/resources/org/jenkinsci/plugins/workflow/job/WorkflowJob/main.jelly
          src/test/java/org/jenkinsci/plugins/workflow/job/WorkflowJobTest.java
          src/test/java/org/jenkinsci/plugins/workflow/job/WorkflowRunRestartTest.java
          src/test/java/org/jenkinsci/plugins/workflow/job/WorkflowRunTest.java
          http://jenkins-ci.org/commit/workflow-job-plugin/d1874be4417070ed07289faf0dd4ab5032e0b58f
          Log:
          Merge pull request #46 from jglick/WorkflowJob.disabled-JENKINS-27299

          JENKINS-27299 WorkflowJob.disabled

          Compare: https://github.com/jenkinsci/workflow-job-plugin/compare/cc4923e5d8ce...d1874be44170

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java src/main/resources/org/jenkinsci/plugins/workflow/job/WorkflowJob/configure-entries.jelly src/main/resources/org/jenkinsci/plugins/workflow/job/WorkflowJob/main.jelly src/test/java/org/jenkinsci/plugins/workflow/job/WorkflowJobTest.java src/test/java/org/jenkinsci/plugins/workflow/job/WorkflowRunRestartTest.java src/test/java/org/jenkinsci/plugins/workflow/job/WorkflowRunTest.java http://jenkins-ci.org/commit/workflow-job-plugin/d1874be4417070ed07289faf0dd4ab5032e0b58f Log: Merge pull request #46 from jglick/WorkflowJob.disabled- JENKINS-27299 JENKINS-27299 WorkflowJob.disabled Compare: https://github.com/jenkinsci/workflow-job-plugin/compare/cc4923e5d8ce...d1874be44170

          Jesse Glick added a comment -

          Main fix not dependent on older cores released as workflow-job 2.11.

          Jesse Glick added a comment - Main fix not dependent on older cores released as workflow-job 2.11 .

          Code changed in jenkins
          User: Jesse Glick
          Path:
          cli/pom.xml
          core/move-l10n.groovy
          core/pom.xml
          core/src/main/java/hudson/cli/BuildCommand.java
          core/src/main/java/hudson/cli/declarative/CLIRegisterer.java
          core/src/main/java/hudson/cli/handlers/ParameterizedJobOptionHandler.java
          core/src/main/java/hudson/model/AbstractItem.java
          core/src/main/java/hudson/model/AbstractProject.java
          core/src/main/java/hudson/model/ListView.java
          core/src/main/java/jenkins/model/ParameterizedJobMixIn.java
          core/src/main/java/jenkins/model/lazy/LazyBuildMixIn.java
          core/src/main/java/jenkins/triggers/SCMTriggerItem.java
          core/src/main/resources/hudson/model/AbstractProject/main.jelly
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled.jelly
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_ar.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_bg.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_ca.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_cs.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_da.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_de.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_es.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_et.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_fi.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_fr.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_he.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_hu.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_it.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_ja.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_ko.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_lt.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_lv.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_nb_NO.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_nl.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_pl.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_pt_BR.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_pt_PT.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_ro.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_ru.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_sk.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_sl.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_sr.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_sv_SE.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_tr.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_uk.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_zh_CN.properties
          core/src/main/resources/hudson/model/AbstractProject/makeDisabled_zh_TW.properties
          core/src/main/resources/hudson/model/Messages.properties
          core/src/main/resources/hudson/model/Messages_bg.properties
          core/src/main/resources/hudson/model/Messages_da.properties
          core/src/main/resources/hudson/model/Messages_de.properties
          core/src/main/resources/hudson/model/Messages_es.properties
          core/src/main/resources/hudson/model/Messages_it.properties
          core/src/main/resources/hudson/model/Messages_ja.properties
          core/src/main/resources/hudson/model/Messages_lt.properties
          core/src/main/resources/hudson/model/Messages_pt_BR.properties
          core/src/main/resources/hudson/model/Messages_sr.properties
          core/src/main/resources/hudson/model/Messages_zh_TW.properties
          core/src/main/resources/jenkins/model/Messages.properties
          core/src/main/resources/jenkins/model/Messages_bg.properties
          core/src/main/resources/jenkins/model/Messages_da.properties
          core/src/main/resources/jenkins/model/Messages_de.properties
          core/src/main/resources/jenkins/model/Messages_es.properties
          core/src/main/resources/jenkins/model/Messages_it.properties
          core/src/main/resources/jenkins/model/Messages_ja.properties
          core/src/main/resources/jenkins/model/Messages_lt.properties
          core/src/main/resources/jenkins/model/Messages_pt_BR.properties
          core/src/main/resources/jenkins/model/Messages_sr.properties
          core/src/main/resources/jenkins/model/Messages_zh_TW.properties
          core/src/main/resources/lib/hudson/project/config-disableBuild.jelly
          core/src/main/resources/lib/hudson/project/makeDisabled.jelly
          core/src/main/resources/lib/hudson/project/makeDisabled_ar.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_bg.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_ca.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_cs.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_da.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_de.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_es.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_et.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_fi.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_fr.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_he.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_hu.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_it.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_ja.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_ko.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_lt.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_lv.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_nb_NO.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_nl.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_pl.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_pt_BR.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_pt_PT.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_ro.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_ru.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_sk.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_sl.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_sr.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_sv_SE.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_tr.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_uk.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_zh_CN.properties
          core/src/main/resources/lib/hudson/project/makeDisabled_zh_TW.properties
          pom.xml
          test/src/test/groovy/hudson/cli/EnableJobCommandTest.groovy
          test/src/test/java/hudson/cli/EnableJobCommandTest.java
          http://jenkins-ci.org/commit/jenkins/3af0cc68cb1cea3047a21400486c075f1b555cf2
          Log:
          JENKINS-27299 Define disabled in ParameterizedJob rather than AbstractProject (#2866)

          • Offering default methods on ParameterizedJob.
          • Javadoc typo.
          • Cleaner use of default methods in ParameterizedJob.
          • Sketch of pulling disabled functionality into ParameterizedJob.
          • EnableJobCommandTest.groovy → EnableJobCommandTest.java, and replacing deprecated Remoting-based CLI calls with CLICommandInvoker.
          • All CLI commands could be broken by a missing CLI.*.shortDescription key on just one!
          • Forgot to move CLI method short descriptions to new package.
          • Needed a @CLIResolver for ParameterizedJob. Adding an OptionHandler while we are here.
          • Trying to fix up access-modifier versions; started failing in CI today for unknown reasons.
          • Introduced <p:makeDisabled/> by analogy with <p:config-disableBuild/>.
          • Using new type bounds.
          • access-modifier 1.11 released.
          • MatrixProject and MavenModuleSet both expect to have access to makeDisabled.jelly.
          • Trying to generalize some more.
          • Minor simplification.
          • isBuildable
          • Obsolete comment.
          • Updated comments.
          • bridge-method-injector 1.17
          • Unfortunately AbstractProject.schedulePolling cannot delegate to SCMTriggerItem.
          • bridge-method-injector 1.17

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: cli/pom.xml core/move-l10n.groovy core/pom.xml core/src/main/java/hudson/cli/BuildCommand.java core/src/main/java/hudson/cli/declarative/CLIRegisterer.java core/src/main/java/hudson/cli/handlers/ParameterizedJobOptionHandler.java core/src/main/java/hudson/model/AbstractItem.java core/src/main/java/hudson/model/AbstractProject.java core/src/main/java/hudson/model/ListView.java core/src/main/java/jenkins/model/ParameterizedJobMixIn.java core/src/main/java/jenkins/model/lazy/LazyBuildMixIn.java core/src/main/java/jenkins/triggers/SCMTriggerItem.java core/src/main/resources/hudson/model/AbstractProject/main.jelly core/src/main/resources/hudson/model/AbstractProject/makeDisabled.jelly core/src/main/resources/hudson/model/AbstractProject/makeDisabled_ar.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_bg.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_ca.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_cs.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_da.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_de.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_es.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_et.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_fi.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_fr.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_he.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_hu.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_it.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_ja.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_ko.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_lt.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_lv.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_nb_NO.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_nl.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_pl.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_pt_BR.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_pt_PT.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_ro.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_ru.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_sk.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_sl.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_sr.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_sv_SE.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_tr.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_uk.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_zh_CN.properties core/src/main/resources/hudson/model/AbstractProject/makeDisabled_zh_TW.properties core/src/main/resources/hudson/model/Messages.properties core/src/main/resources/hudson/model/Messages_bg.properties core/src/main/resources/hudson/model/Messages_da.properties core/src/main/resources/hudson/model/Messages_de.properties core/src/main/resources/hudson/model/Messages_es.properties core/src/main/resources/hudson/model/Messages_it.properties core/src/main/resources/hudson/model/Messages_ja.properties core/src/main/resources/hudson/model/Messages_lt.properties core/src/main/resources/hudson/model/Messages_pt_BR.properties core/src/main/resources/hudson/model/Messages_sr.properties core/src/main/resources/hudson/model/Messages_zh_TW.properties core/src/main/resources/jenkins/model/Messages.properties core/src/main/resources/jenkins/model/Messages_bg.properties core/src/main/resources/jenkins/model/Messages_da.properties core/src/main/resources/jenkins/model/Messages_de.properties core/src/main/resources/jenkins/model/Messages_es.properties core/src/main/resources/jenkins/model/Messages_it.properties core/src/main/resources/jenkins/model/Messages_ja.properties core/src/main/resources/jenkins/model/Messages_lt.properties core/src/main/resources/jenkins/model/Messages_pt_BR.properties core/src/main/resources/jenkins/model/Messages_sr.properties core/src/main/resources/jenkins/model/Messages_zh_TW.properties core/src/main/resources/lib/hudson/project/config-disableBuild.jelly core/src/main/resources/lib/hudson/project/makeDisabled.jelly core/src/main/resources/lib/hudson/project/makeDisabled_ar.properties core/src/main/resources/lib/hudson/project/makeDisabled_bg.properties core/src/main/resources/lib/hudson/project/makeDisabled_ca.properties core/src/main/resources/lib/hudson/project/makeDisabled_cs.properties core/src/main/resources/lib/hudson/project/makeDisabled_da.properties core/src/main/resources/lib/hudson/project/makeDisabled_de.properties core/src/main/resources/lib/hudson/project/makeDisabled_es.properties core/src/main/resources/lib/hudson/project/makeDisabled_et.properties core/src/main/resources/lib/hudson/project/makeDisabled_fi.properties core/src/main/resources/lib/hudson/project/makeDisabled_fr.properties core/src/main/resources/lib/hudson/project/makeDisabled_he.properties core/src/main/resources/lib/hudson/project/makeDisabled_hu.properties core/src/main/resources/lib/hudson/project/makeDisabled_it.properties core/src/main/resources/lib/hudson/project/makeDisabled_ja.properties core/src/main/resources/lib/hudson/project/makeDisabled_ko.properties core/src/main/resources/lib/hudson/project/makeDisabled_lt.properties core/src/main/resources/lib/hudson/project/makeDisabled_lv.properties core/src/main/resources/lib/hudson/project/makeDisabled_nb_NO.properties core/src/main/resources/lib/hudson/project/makeDisabled_nl.properties core/src/main/resources/lib/hudson/project/makeDisabled_pl.properties core/src/main/resources/lib/hudson/project/makeDisabled_pt_BR.properties core/src/main/resources/lib/hudson/project/makeDisabled_pt_PT.properties core/src/main/resources/lib/hudson/project/makeDisabled_ro.properties core/src/main/resources/lib/hudson/project/makeDisabled_ru.properties core/src/main/resources/lib/hudson/project/makeDisabled_sk.properties core/src/main/resources/lib/hudson/project/makeDisabled_sl.properties core/src/main/resources/lib/hudson/project/makeDisabled_sr.properties core/src/main/resources/lib/hudson/project/makeDisabled_sv_SE.properties core/src/main/resources/lib/hudson/project/makeDisabled_tr.properties core/src/main/resources/lib/hudson/project/makeDisabled_uk.properties core/src/main/resources/lib/hudson/project/makeDisabled_zh_CN.properties core/src/main/resources/lib/hudson/project/makeDisabled_zh_TW.properties pom.xml test/src/test/groovy/hudson/cli/EnableJobCommandTest.groovy test/src/test/java/hudson/cli/EnableJobCommandTest.java http://jenkins-ci.org/commit/jenkins/3af0cc68cb1cea3047a21400486c075f1b555cf2 Log: JENKINS-27299 Define disabled in ParameterizedJob rather than AbstractProject (#2866) Offering default methods on ParameterizedJob. Javadoc typo. Cleaner use of default methods in ParameterizedJob. Need to pick up https://github.com/infradna/bridge-method-injector/pull/15 to be able to build. Sketch of pulling disabled functionality into ParameterizedJob. EnableJobCommandTest.groovy → EnableJobCommandTest.java, and replacing deprecated Remoting-based CLI calls with CLICommandInvoker. All CLI commands could be broken by a missing CLI.*.shortDescription key on just one! Forgot to move CLI method short descriptions to new package. Needed a @CLIResolver for ParameterizedJob. Adding an OptionHandler while we are here. Trying to fix up access-modifier versions; started failing in CI today for unknown reasons. Introduced <p:makeDisabled/> by analogy with <p:config-disableBuild/>. Using new type bounds. access-modifier 1.11 released. MatrixProject and MavenModuleSet both expect to have access to makeDisabled.jelly. Trying to generalize some more. Minor simplification. JENKINS-34716 Generalizing doPolling and schedulePolling. isBuildable Obsolete comment. Updated comments. bridge-method-injector 1.17 Unfortunately AbstractProject.schedulePolling cannot delegate to SCMTriggerItem. bridge-method-injector 1.17

          jglick

          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?

          mohamed badran added a comment - jglick 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?

          Daniel Beck added a comment -

          Core change towards 2.61.

          Daniel Beck added a comment - Core change towards 2.61.

          Jesse Glick added a comment -

          mbadran

          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.

          Jesse Glick added a comment - mbadran 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.

          Sorin Sbarnea added a comment -

          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 - 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 -

          There is no plan for any feature permitting branch projects to be disabled per se. stephenconnolly argued against it and I agree. Anyway that would be a separate (linked) RFE.

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

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java
          src/main/resources/org/jenkinsci/plugins/workflow/job/WorkflowJob/main.jelly
          src/test/java/org/jenkinsci/plugins/workflow/job/WorkflowJobTest.java
          http://jenkins-ci.org/commit/workflow-job-plugin/8da02e98393c64ebe0f3500e20462adff50c6e67
          Log:
          Merge pull request #47 from jglick/WorkflowJob.disabled+core-JENKINS-27299

          JENKINS-27299 WorkflowJob.disabled on new core

          Compare: https://github.com/jenkinsci/workflow-job-plugin/compare/5a6f27764fbe...8da02e98393c

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java src/main/resources/org/jenkinsci/plugins/workflow/job/WorkflowJob/main.jelly src/test/java/org/jenkinsci/plugins/workflow/job/WorkflowJobTest.java http://jenkins-ci.org/commit/workflow-job-plugin/8da02e98393c64ebe0f3500e20462adff50c6e67 Log: Merge pull request #47 from jglick/WorkflowJob.disabled+core- JENKINS-27299 JENKINS-27299 WorkflowJob.disabled on new core Compare: https://github.com/jenkinsci/workflow-job-plugin/compare/5a6f27764fbe...8da02e98393c

          Idan Adar added a comment -

          jglick, 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?

          Idan Adar added a comment - jglick , 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?

          Jesse Glick added a comment -

          idanadar see my last comment above.

          Jesse Glick added a comment - idanadar see my last comment above.

          Idan Adar added a comment -

          So in this context what does "per se" mean? If there isn't should we ditch the multi branch job type then?

          Idan Adar added a comment - So in this context what does "per se" mean? If there isn't should we ditch the multi branch job type then?

          Jesse Glick added a comment -

          Again there are other ways to suppress triggering of builds from branch projects.

          Jesse Glick added a comment - Again there are other ways to suppress triggering of builds from branch projects.

          Idan Adar added a comment -

          Could you please point to these options? I may have missed it.

          Idan Adar added a comment - Could you please point to these options? I may have missed it.

          Jesse Glick added a comment -

          A topic for the user list, stackoverflow.com, or #jenkins.

          Jesse Glick added a comment - A topic for the user list, stackoverflow.com, or #jenkins.

          Sorin Sbarnea added a comment -

          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.

          Sorin Sbarnea added a comment - 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.

          Joe Harte added a comment -

          Joe Harte added a comment - https://issues.jenkins-ci.org/browse/JENKINS-49307

          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 - 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?

          Owen Mehegan added a comment -

          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 - 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 - 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 -

          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.

          Daniel Beck added a comment - 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.

            jglick Jesse Glick
            apemberton Andy Pemberton
            Votes:
            178 Vote for this issue
            Watchers:
            167 Start watching this issue

              Created:
              Updated:
              Resolved: