{"action":"created","comment":{"url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/pulls/comments/72712298","id":72712298,"diff_hunk":"@@ -211,4 +230,135 @@\n         r.assertBuildStatusSuccess(r.waitForCompletion(b4));\n     }\n \n+    @Issue(\"JENKINS-34005\")\n+    @Test public void triggersProperty() throws Exception {\n+        WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, \"p\");\n+        // Verify the base case behavior.\n+        p.setDefinition(new CpsFlowDefinition(\"echo 'foo'\"));\n+\n+        assertTrue(p.getTriggers().isEmpty());\n+\n+        r.assertBuildStatusSuccess(p.scheduleBuild2(0));\n+\n+        // Make sure the triggers are still empty.\n+        assertTrue(p.getTriggers().isEmpty());\n+\n+        // Now add a trigger.\n+        p.setDefinition(new CpsFlowDefinition(\n+                (HAVE_SYMBOL ?\n+                        \"properties([pipelineTriggers([\\n\"\n+                                + \"  cron('@daily'), [$class: 'MockTrigger']])])\\n\" :\n+                        \"properties([pipelineTriggers(\\n\"\n+                                + \"  triggers: [[$class: 'TimerTrigger', spec: '@daily'],\\n\"\n+                                + \"    [$class: 'MockTrigger']])])\\n\"\n+                ) + \"echo 'foo'\"));\n+\n+        WorkflowRun b = r.assertBuildStatusSuccess(p.scheduleBuild2(0));\n+\n+        // Verify that we're seeing warnings due to running 'properties' in a non-multibranch job.\n+        r.assertLogContains(\"WARNING: The 'properties' step will remove all 'JobProperty's currently configured in this job, either from the UI or from an earlier 'properties' step.\", b);\n+        // Verify that we're not seeing warnings for any properties being removed, since there are no pre-existing ones.\n+        r.assertLogNotContains(\"WARNING: Removing existing job property\", b);\n+\n+        assertEquals(2, p.getTriggers().size());\n+\n+        PipelineTriggersJobProperty triggerProp = p.getTriggersJobProperty();\n+\n+        TimerTrigger timerTrigger = getTriggerFromList(TimerTrigger.class, triggerProp.getTriggers());\n+\n+        assertNotNull(timerTrigger);\n+\n+        assertEquals(\"@daily\", timerTrigger.getSpec());\n+\n+        MockTrigger mockTrigger = getTriggerFromList(MockTrigger.class, triggerProp.getTriggers());\n+\n+        assertNotNull(mockTrigger);\n+\n+        assertTrue(mockTrigger.isStarted);\n+\n+        assertEquals(\"[null, false]\", MockTrigger.startsAndStops.toString());\n+\n+        // Now run a properties step with a different property and verify that we still have a\n+        // PipelineTriggersJobProperty, but with no triggers in it.\n+        p.setDefinition(new CpsFlowDefinition(\"properties([disableConcurrentBuilds()])\\n\"\n+                + \"echo 'foo'\"));\n+\n+        WorkflowRun b2 = r.assertBuildStatusSuccess(p.scheduleBuild2(0));\n+\n+        // Verify that we're seeing warnings due to running 'properties' in a non-multibranch job.\n+        r.assertLogContains(\"WARNING: The 'properties' step will remove all 'JobProperty's currently configured in this job, either from the UI or from an earlier 'properties' step.\", b2);\n+        // Verify that we *are* seeing warnings for removing the triggers property.\n+        r.assertLogContains(\"WARNING: Removing existing job property 'Build triggers'\", b2);","path":"src/test/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStepTest.java","position":151,"original_position":151,"commit_id":"232eb756df59322a1281af2eddd59bec8e32e1ef","original_commit_id":"232eb756df59322a1281af2eddd59bec8e32e1ef","user":{"login":"jglick","id":154109,"avatar_url":"https://avatars.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},"body":":ant: ditto","created_at":"2016-07-28T22:08:33Z","updated_at":"2016-07-28T22:08:33Z","html_url":"https://github.com/jenkinsci/workflow-multibranch-plugin/pull/23#discussion_r72712298","pull_request_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/pulls/23","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/pulls/comments/72712298"},"html":{"href":"https://github.com/jenkinsci/workflow-multibranch-plugin/pull/23#discussion_r72712298"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/pulls/23","id":79081289,"html_url":"https://github.com/jenkinsci/workflow-multibranch-plugin/pull/23","diff_url":"https://github.com/jenkinsci/workflow-multibranch-plugin/pull/23.diff","patch_url":"https://github.com/jenkinsci/workflow-multibranch-plugin/pull/23.patch","issue_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/issues/23","number":23,"state":"open","locked":false,"title":"[FIXED JENKINS-37005] Warn users using properties outside multibranch","user":{"login":"abayer","id":120218,"avatar_url":"https://avatars.githubusercontent.com/u/120218?v=3","gravatar_id":"","url":"https://api.github.com/users/abayer","html_url":"https://github.com/abayer","followers_url":"https://api.github.com/users/abayer/followers","following_url":"https://api.github.com/users/abayer/following{/other_user}","gists_url":"https://api.github.com/users/abayer/gists{/gist_id}","starred_url":"https://api.github.com/users/abayer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abayer/subscriptions","organizations_url":"https://api.github.com/users/abayer/orgs","repos_url":"https://api.github.com/users/abayer/repos","events_url":"https://api.github.com/users/abayer/events{/privacy}","received_events_url":"https://api.github.com/users/abayer/received_events","type":"User","site_admin":false},"body":"[JENKINS-37005](https://issues.jenkins-ci.org/browse/JENKINS-37005)\r\n\r\nNote that this is on top of https://github.com/jenkinsci/workflow-multibranch-plugin/pull/20. Relevant commit is [this one](https://github.com/jenkinsci/workflow-multibranch-plugin/commit/487439ab137a86f5ab041816a7e861a10d21e548).\r\n\r\ncc @reviewbybees @jglick @rtyler","created_at":"2016-07-27T19:17:27Z","updated_at":"2016-07-28T22:08:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dbfc8161070c007fcaee9be3c8b46411899bf25a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/pulls/23/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/pulls/23/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/issues/23/comments","statuses_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/statuses/232eb756df59322a1281af2eddd59bec8e32e1ef","head":{"label":"abayer:jenkins-37005","ref":"jenkins-37005","sha":"232eb756df59322a1281af2eddd59bec8e32e1ef","user":{"login":"abayer","id":120218,"avatar_url":"https://avatars.githubusercontent.com/u/120218?v=3","gravatar_id":"","url":"https://api.github.com/users/abayer","html_url":"https://github.com/abayer","followers_url":"https://api.github.com/users/abayer/followers","following_url":"https://api.github.com/users/abayer/following{/other_user}","gists_url":"https://api.github.com/users/abayer/gists{/gist_id}","starred_url":"https://api.github.com/users/abayer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abayer/subscriptions","organizations_url":"https://api.github.com/users/abayer/orgs","repos_url":"https://api.github.com/users/abayer/repos","events_url":"https://api.github.com/users/abayer/events{/privacy}","received_events_url":"https://api.github.com/users/abayer/received_events","type":"User","site_admin":false},"repo":{"id":60202036,"name":"workflow-multibranch-plugin","full_name":"abayer/workflow-multibranch-plugin","owner":{"login":"abayer","id":120218,"avatar_url":"https://avatars.githubusercontent.com/u/120218?v=3","gravatar_id":"","url":"https://api.github.com/users/abayer","html_url":"https://github.com/abayer","followers_url":"https://api.github.com/users/abayer/followers","following_url":"https://api.github.com/users/abayer/following{/other_user}","gists_url":"https://api.github.com/users/abayer/gists{/gist_id}","starred_url":"https://api.github.com/users/abayer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abayer/subscriptions","organizations_url":"https://api.github.com/users/abayer/orgs","repos_url":"https://api.github.com/users/abayer/repos","events_url":"https://api.github.com/users/abayer/events{/privacy}","received_events_url":"https://api.github.com/users/abayer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abayer/workflow-multibranch-plugin","description":"","fork":true,"url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin","forks_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/forks","keys_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/teams","hooks_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/hooks","issue_events_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/events","assignees_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/tags","blobs_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/languages","stargazers_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/stargazers","contributors_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/contributors","subscribers_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/subscribers","subscription_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/subscription","commits_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/merges","archive_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/downloads","issues_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/labels{/name}","releases_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/abayer/workflow-multibranch-plugin/deployments","created_at":"2016-06-01T18:41:49Z","updated_at":"2016-06-01T18:41:50Z","pushed_at":"2016-07-28T21:00:16Z","git_url":"git://github.com/abayer/workflow-multibranch-plugin.git","ssh_url":"git@github.com:abayer/workflow-multibranch-plugin.git","clone_url":"https://github.com/abayer/workflow-multibranch-plugin.git","svn_url":"https://github.com/abayer/workflow-multibranch-plugin","homepage":"https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Multibranch+Plugin","size":328,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jenkinsci:master","ref":"master","sha":"2c9681a7e299bb4352092eb7840361c6f5c3d3bb","user":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":55543467,"name":"workflow-multibranch-plugin","full_name":"jenkinsci/workflow-multibranch-plugin","owner":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkinsci/workflow-multibranch-plugin","description":"","fork":false,"url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin","forks_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/forks","keys_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/teams","hooks_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/events","assignees_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/tags","blobs_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/subscription","commits_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/merges","archive_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/downloads","issues_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/deployments","created_at":"2016-04-05T20:28:20Z","updated_at":"2016-07-21T16:16:24Z","pushed_at":"2016-07-28T21:00:17Z","git_url":"git://github.com/jenkinsci/workflow-multibranch-plugin.git","ssh_url":"git@github.com:jenkinsci/workflow-multibranch-plugin.git","clone_url":"https://github.com/jenkinsci/workflow-multibranch-plugin.git","svn_url":"https://github.com/jenkinsci/workflow-multibranch-plugin","homepage":"https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Multibranch+Plugin","size":342,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":3,"forks":13,"open_issues":3,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/pulls/23"},"html":{"href":"https://github.com/jenkinsci/workflow-multibranch-plugin/pull/23"},"issue":{"href":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/issues/23"},"comments":{"href":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/workflow-multibranch-plugin/statuses/232eb756df59322a1281af2eddd59bec8e32e1ef"}}}}
{"actor":{"display_login":"jglick"}}