{"action":"created","comment":{"url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls/comments/53179169","id":53179169,"diff_hunk":"@@ -0,0 +1,171 @@\n+package hudson.plugins.promoted_builds.integrations.jobdsl;\n+\n+import groovy.lang.Closure;\n+import groovy.util.Node;\n+\n+import java.util.HashMap;\n+import java.util.Map;\n+\n+import javaposse.jobdsl.dsl.Context;\n+import javaposse.jobdsl.dsl.FileJobManagement;\n+import javaposse.jobdsl.dsl.helpers.BuildParametersContext;\n+\n+import org.apache.commons.io.FileUtils;\n+\n+public class ConditionsContext implements Context {\n+\n+\t// Self Promotion Condition\n+\tprivate boolean isSelfPromotion = false;\n+\t\n+\tprivate boolean evenIfUnstable = false;\n+\t\n+\t// Parametzerized Self Promotion Condition\n+\tprivate boolean isParameterizedSelfPromotion = false;\n+\t\n+\tprivate boolean evenIfUnstableParameterized = false;\n+\t\n+\tprivate String parameterName = null;\n+\t\n+\tprivate String parameterValue = null;\n+\t\n+\t// Manual Promotion Condition\n+\tprivate boolean isManual = false;\n+\t\n+\tprivate String users = null;\n+\t\n+\tfinal Map<String, Node> params = new HashMap<String, Node>();\n+\t\n+\t// Release Build Condition\n+\tprivate boolean isReleaseBuild = false;\n+\t\n+\t// Downstream Build Condition\n+\tprivate boolean isDownstreamPass = false;\n+\t\n+\tprivate boolean evenIfUnstableDownstream = false;\n+\t\n+\tprivate String jobs = null;\n+\t\n+\t// Upstream Build Condition\n+\tprivate boolean isUpstreamPromotion = false;\n+\t\n+\tprivate String promotionNames = null;\n+\n+\tpublic void selfPromotion(Boolean evenIfUnstable) {\n+\t\tisSelfPromotion = true;\n+\t\tif (evenIfUnstable) {\n+\t\t\tthis.evenIfUnstable = evenIfUnstable;\n+\t\t}\n+\t}\n+\n+\tpublic void parameterizedSelfPromotion(Boolean evenIfUnstable, String parameterName, String parameterValue) {\n+\t\tisParameterizedSelfPromotion = true;\n+\t\tif (evenIfUnstable) {\n+\t\t\tthis.isParameterizedSelfPromotion = evenIfUnstable;\n+\t\t}\n+\t\tthis.parameterName = parameterName;\n+\t\tthis.parameterValue = parameterValue;\n+\t}\n+\n+\tpublic void manual(String users) {\n+\t\tisManual = true;\n+\t\tthis.users = users;\n+\t}\n+\n+\tpublic void manual(String users, Closure<?> parametersClosure) {\n+\t\tisManual = true;\n+\t\tthis.users = users;\n+\t\tparameters(parametersClosure);","path":"src/main/java/hudson/plugins/promoted_builds/integrations/jobdsl/ConditionsContext.java","position":77,"original_position":77,"commit_id":"2e78277c4e2ee826ad1542db477f3e6bc3b2405b","original_commit_id":"2e78277c4e2ee826ad1542db477f3e6bc3b2405b","user":{"login":"fgauthier-boutin","id":10144485,"avatar_url":"https://avatars.githubusercontent.com/u/10144485?v=3","gravatar_id":"","url":"https://api.github.com/users/fgauthier-boutin","html_url":"https://github.com/fgauthier-boutin","followers_url":"https://api.github.com/users/fgauthier-boutin/followers","following_url":"https://api.github.com/users/fgauthier-boutin/following{/other_user}","gists_url":"https://api.github.com/users/fgauthier-boutin/gists{/gist_id}","starred_url":"https://api.github.com/users/fgauthier-boutin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fgauthier-boutin/subscriptions","organizations_url":"https://api.github.com/users/fgauthier-boutin/orgs","repos_url":"https://api.github.com/users/fgauthier-boutin/repos","events_url":"https://api.github.com/users/fgauthier-boutin/events{/privacy}","received_events_url":"https://api.github.com/users/fgauthier-boutin/received_events","type":"User","site_admin":false},"body":"Verifiy this with JobDSL 1.43.","created_at":"2016-02-17T15:26:19Z","updated_at":"2016-02-17T15:26:19Z","html_url":"https://github.com/jenkinsci/promoted-builds-plugin/pull/82#discussion_r53179169","pull_request_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls/82","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls/comments/53179169"},"html":{"href":"https://github.com/jenkinsci/promoted-builds-plugin/pull/82#discussion_r53179169"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls/82"}}},"pull_request":{"url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls/82","id":57355291,"html_url":"https://github.com/jenkinsci/promoted-builds-plugin/pull/82","diff_url":"https://github.com/jenkinsci/promoted-builds-plugin/pull/82.diff","patch_url":"https://github.com/jenkinsci/promoted-builds-plugin/pull/82.patch","issue_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/issues/82","number":82,"state":"open","locked":false,"title":"[FIXED JENKINS-29776] Add Job DSL support for Promoted Builds Plugin","user":{"login":"denschu","id":488151,"avatar_url":"https://avatars.githubusercontent.com/u/488151?v=3","gravatar_id":"","url":"https://api.github.com/users/denschu","html_url":"https://github.com/denschu","followers_url":"https://api.github.com/users/denschu/followers","following_url":"https://api.github.com/users/denschu/following{/other_user}","gists_url":"https://api.github.com/users/denschu/gists{/gist_id}","starred_url":"https://api.github.com/users/denschu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/denschu/subscriptions","organizations_url":"https://api.github.com/users/denschu/orgs","repos_url":"https://api.github.com/users/denschu/repos","events_url":"https://api.github.com/users/denschu/events{/privacy}","received_events_url":"https://api.github.com/users/denschu/received_events","type":"User","site_admin":false},"body":"New PR which includes NOT the Findbugs fixes for better readability. Replaces the old PR: https://github.com/jenkinsci/promoted-builds-plugin/pull/81\r\n","created_at":"2016-01-27T12:49:55Z","updated_at":"2016-02-17T15:26:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4c63a49649c3438eaf32288c249de89e788a12f5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls/82/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls/82/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/issues/82/comments","statuses_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/statuses/2e78277c4e2ee826ad1542db477f3e6bc3b2405b","head":{"label":"denschu:master","ref":"master","sha":"2e78277c4e2ee826ad1542db477f3e6bc3b2405b","user":{"login":"denschu","id":488151,"avatar_url":"https://avatars.githubusercontent.com/u/488151?v=3","gravatar_id":"","url":"https://api.github.com/users/denschu","html_url":"https://github.com/denschu","followers_url":"https://api.github.com/users/denschu/followers","following_url":"https://api.github.com/users/denschu/following{/other_user}","gists_url":"https://api.github.com/users/denschu/gists{/gist_id}","starred_url":"https://api.github.com/users/denschu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/denschu/subscriptions","organizations_url":"https://api.github.com/users/denschu/orgs","repos_url":"https://api.github.com/users/denschu/repos","events_url":"https://api.github.com/users/denschu/events{/privacy}","received_events_url":"https://api.github.com/users/denschu/received_events","type":"User","site_admin":false},"repo":{"id":49714072,"name":"promoted-builds-plugin","full_name":"denschu/promoted-builds-plugin","owner":{"login":"denschu","id":488151,"avatar_url":"https://avatars.githubusercontent.com/u/488151?v=3","gravatar_id":"","url":"https://api.github.com/users/denschu","html_url":"https://github.com/denschu","followers_url":"https://api.github.com/users/denschu/followers","following_url":"https://api.github.com/users/denschu/following{/other_user}","gists_url":"https://api.github.com/users/denschu/gists{/gist_id}","starred_url":"https://api.github.com/users/denschu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/denschu/subscriptions","organizations_url":"https://api.github.com/users/denschu/orgs","repos_url":"https://api.github.com/users/denschu/repos","events_url":"https://api.github.com/users/denschu/events{/privacy}","received_events_url":"https://api.github.com/users/denschu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/denschu/promoted-builds-plugin","description":"Jenkins promoted-builds plugin","fork":true,"url":"https://api.github.com/repos/denschu/promoted-builds-plugin","forks_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/forks","keys_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/teams","hooks_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/hooks","issue_events_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/events","assignees_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/tags","blobs_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/languages","stargazers_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/stargazers","contributors_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/contributors","subscribers_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/subscribers","subscription_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/subscription","commits_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/merges","archive_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/downloads","issues_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/labels{/name}","releases_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/denschu/promoted-builds-plugin/deployments","created_at":"2016-01-15T11:01:39Z","updated_at":"2016-01-15T11:01:40Z","pushed_at":"2016-01-28T18:03:17Z","git_url":"git://github.com/denschu/promoted-builds-plugin.git","ssh_url":"git@github.com:denschu/promoted-builds-plugin.git","clone_url":"https://github.com/denschu/promoted-builds-plugin.git","svn_url":"https://github.com/denschu/promoted-builds-plugin","homepage":"http://jenkins-ci.org/","size":773,"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":"79e2c8e063cdca83bdb4b4ce4a77585b19568b24","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":1163731,"name":"promoted-builds-plugin","full_name":"jenkinsci/promoted-builds-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/promoted-builds-plugin","description":"Jenkins promoted-builds plugin","fork":false,"url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin","forks_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/forks","keys_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/teams","hooks_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/events","assignees_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/tags","blobs_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/subscription","commits_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/merges","archive_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/downloads","issues_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/deployments","created_at":"2010-12-13T05:51:37Z","updated_at":"2016-02-11T17:25:39Z","pushed_at":"2016-02-17T13:12:01Z","git_url":"git://github.com/jenkinsci/promoted-builds-plugin.git","ssh_url":"git@github.com:jenkinsci/promoted-builds-plugin.git","clone_url":"https://github.com/jenkinsci/promoted-builds-plugin.git","svn_url":"https://github.com/jenkinsci/promoted-builds-plugin","homepage":"http://jenkins-ci.org/","size":891,"stargazers_count":62,"watchers_count":62,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":101,"mirror_url":null,"open_issues_count":12,"forks":101,"open_issues":12,"watchers":62,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls/82"},"html":{"href":"https://github.com/jenkinsci/promoted-builds-plugin/pull/82"},"issue":{"href":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/issues/82"},"comments":{"href":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/issues/82/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls/82/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls/82/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/statuses/2e78277c4e2ee826ad1542db477f3e6bc3b2405b"}}}}