{"action":"created","issue":{"url":"https://api.github.com/repos/jenkinsci/jenkins/issues/2544","repository_url":"https://api.github.com/repos/jenkinsci/jenkins","labels_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/2544/labels{/name}","comments_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/2544/comments","events_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/2544/events","html_url":"https://github.com/jenkinsci/jenkins/pull/2544","id":176716143,"number":2544,"title":"[JENKINS-27299] refactor disable out of AbstractProject (alternate)","user":{"login":"csiden","id":529845,"avatar_url":"https://avatars0.githubusercontent.com/u/529845?v=3","gravatar_id":"","url":"https://api.github.com/users/csiden","html_url":"https://github.com/csiden","followers_url":"https://api.github.com/users/csiden/followers","following_url":"https://api.github.com/users/csiden/following{/other_user}","gists_url":"https://api.github.com/users/csiden/gists{/gist_id}","starred_url":"https://api.github.com/users/csiden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csiden/subscriptions","organizations_url":"https://api.github.com/users/csiden/orgs","repos_url":"https://api.github.com/users/csiden/repos","events_url":"https://api.github.com/users/csiden/events{/privacy}","received_events_url":"https://api.github.com/users/csiden/received_events","type":"User","site_admin":false},"labels":[{"id":271563319,"url":"https://api.github.com/repos/jenkinsci/jenkins/labels/needs-review","name":"needs-review","color":"207de5","default":false},{"id":271563413,"url":"https://api.github.com/repos/jenkinsci/jenkins/labels/needs-testcase","name":"needs-testcase","color":"eb6420","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-09-13T18:35:50Z","updated_at":"2017-05-02T21:39:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/2544","html_url":"https://github.com/jenkinsci/jenkins/pull/2544","diff_url":"https://github.com/jenkinsci/jenkins/pull/2544.diff","patch_url":"https://github.com/jenkinsci/jenkins/pull/2544.patch"},"body":"This is an alternative implementation of https://github.com/jenkinsci/jenkins/pull/2543 that would let plugins add support for disable to their jobs without bumping their minimum Jenkins version. I've copied over the relevant description to this new pull request.\n\nMy ultimate goal is to make it so that when I use the \"Disable removed jobs\" feature of the Job DSL plugin it works with Pipeline jobs. Today it does not work because a) pipeline jobs do not support disable at all, and b) the Job DSL plugin is doing the disable via AbstractProject.disable().\n\nTo fix this I think I need 3 updates:\n- This one to Jenkins core moves the disable-related methods from AbstractProject to Job<?,?> . Leaving the ones in AbstractProject as overrides. The default methods in Job<?,?> do nothing (isDisabled() always returns false, trying to disable a job throws an exception). Jobs subclasses that override these methods can support disable, and plugins that want to check the disabled/enabled status of a job can use Job.isDisabled()/disable() now instead of AbstractProject.isDisabled()/disable() (after checking Job.supportsDisable()).\n- An update to workflow-job-plugin to override supportsDisabled()/isDisabled()/disable() (without adding @Override to the new methods, this way the plugin doesn't need to bump it's minimum Jenkins version). jenkinsci/workflow-job-plugin#23\n- An update to the Job DSL plugin to use Job.disable() instead of AbstractProject.disable().\n\nI did some manual testing of this diff + the change to workflow-job-plugin described above. I was able to confirm that the Build button goes away, trying to build via directly inputting the URL fails with the same error as Freestyle jobs, disabling via the UI appears to work correctly, and cron and SCM triggers are ignored correctly when the job is disabled.\n\nThere would be a few issues with this, for example plugins that explicitly check for AbstractProject.isDisabled() would not notice disabled pipeline jobs. Also, when using a Jenkins core version that doesn't have the modifications to ListView.java and BuildCommand.java here Jenkins core would not properly identify disabled Pipeline jobs.\n"},"comment":{"url":"https://api.github.com/repos/jenkinsci/jenkins/issues/comments/298769478","html_url":"https://github.com/jenkinsci/jenkins/pull/2544#issuecomment-298769478","issue_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/2544","id":298769478,"user":{"login":"jglick","id":154109,"avatar_url":"https://avatars2.githubusercontent.com/u/154109?v=3","gravatar_id":"","url":"https://api.github.com/users/jglick","html_url":"https://github.com/jglick","followers_url":"https://api.github.com/users/jglick/followers","following_url":"https://api.github.com/users/jglick/following{/other_user}","gists_url":"https://api.github.com/users/jglick/gists{/gist_id}","starred_url":"https://api.github.com/users/jglick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jglick/subscriptions","organizations_url":"https://api.github.com/users/jglick/orgs","repos_url":"https://api.github.com/users/jglick/repos","events_url":"https://api.github.com/users/jglick/events{/privacy}","received_events_url":"https://api.github.com/users/jglick/received_events","type":"User","site_admin":false},"created_at":"2017-05-02T21:39:33Z","updated_at":"2017-05-02T21:39:33Z","body":"I hope to reimplement this."}}
{"actor":{"display_login":"jglick"}}