{"action":"created","comment":{"url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/pulls/comments/197739469","pull_request_review_id":131538975,"id":197739469,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NzczOTQ2OQ==","diff_hunk":"@@ -351,6 +353,21 @@ class RestJobManagement extends AbstractJobManagement implements DeferredJobMana\n         }\n \n         if (isXmlDifferent(existingXml, item.xml)) {\n+            if (item instanceof Folder) {\n+                /*\n+                Folders can contain credentials scoped to the items they contain. The credentials are\n+                stored in the folder XML and not in the Jenkins configuration files, so we copy over any\n+                manually set properties from the existing folders.\n+                Approach suggested in https://issues.jenkins-ci.org/browse/JENKINS-44681\n+                 */\n+                def existingXmlParsed = new XmlParser().parseText(existingXml)\n+                if (existingXmlParsed.properties != null) {\n+                    def newXmlParsed = new XmlParser().parseText(item.xml)\n+                    Node node = existingXmlParsed.properties[0] as Node\n+                    newXmlParsed.properties[0].replaceNode(node)","path":"plugin/src/main/groovy/com/here/gradle/plugins/jobdsl/RestJobManagement.groovy","position":30,"original_position":30,"commit_id":"ee6680ec20465d4eabbc1c33200b2f50d1218d0a","original_commit_id":"ee6680ec20465d4eabbc1c33200b2f50d1218d0a","user":{"login":"mnonnenmacher","id":2741977,"node_id":"MDQ6VXNlcjI3NDE5Nzc=","avatar_url":"https://avatars2.githubusercontent.com/u/2741977?v=4","gravatar_id":"","url":"https://api.github.com/users/mnonnenmacher","html_url":"https://github.com/mnonnenmacher","followers_url":"https://api.github.com/users/mnonnenmacher/followers","following_url":"https://api.github.com/users/mnonnenmacher/following{/other_user}","gists_url":"https://api.github.com/users/mnonnenmacher/gists{/gist_id}","starred_url":"https://api.github.com/users/mnonnenmacher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mnonnenmacher/subscriptions","organizations_url":"https://api.github.com/users/mnonnenmacher/orgs","repos_url":"https://api.github.com/users/mnonnenmacher/repos","events_url":"https://api.github.com/users/mnonnenmacher/events{/privacy}","received_events_url":"https://api.github.com/users/mnonnenmacher/received_events","type":"User","site_admin":false},"body":"Shouldn't we add the node only if there is no node in `newXmlParsed`. You could configure credentials using the Job DSL configure closure which would not be possible anymore with this approach (at least it could be changed after the first creation).","created_at":"2018-06-25T09:52:46Z","updated_at":"2018-06-25T09:53:29Z","html_url":"https://github.com/heremaps/gradle-jenkins-jobdsl-plugin/pull/86#discussion_r197739469","pull_request_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/pulls/86","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/pulls/comments/197739469"},"html":{"href":"https://github.com/heremaps/gradle-jenkins-jobdsl-plugin/pull/86#discussion_r197739469"},"pull_request":{"href":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/pulls/86"}}},"pull_request":{"url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/pulls/86","id":196182834,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2MTgyODM0","html_url":"https://github.com/heremaps/gradle-jenkins-jobdsl-plugin/pull/86","diff_url":"https://github.com/heremaps/gradle-jenkins-jobdsl-plugin/pull/86.diff","patch_url":"https://github.com/heremaps/gradle-jenkins-jobdsl-plugin/pull/86.patch","issue_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/issues/86","number":86,"state":"open","locked":false,"title":"Inherit folder properties when updating existing items","user":{"login":"Ruenzuo","id":346590,"node_id":"MDQ6VXNlcjM0NjU5MA==","avatar_url":"https://avatars0.githubusercontent.com/u/346590?v=4","gravatar_id":"","url":"https://api.github.com/users/Ruenzuo","html_url":"https://github.com/Ruenzuo","followers_url":"https://api.github.com/users/Ruenzuo/followers","following_url":"https://api.github.com/users/Ruenzuo/following{/other_user}","gists_url":"https://api.github.com/users/Ruenzuo/gists{/gist_id}","starred_url":"https://api.github.com/users/Ruenzuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ruenzuo/subscriptions","organizations_url":"https://api.github.com/users/Ruenzuo/orgs","repos_url":"https://api.github.com/users/Ruenzuo/repos","events_url":"https://api.github.com/users/Ruenzuo/events{/privacy}","received_events_url":"https://api.github.com/users/Ruenzuo/received_events","type":"User","site_admin":false},"body":"If a folder contains properties, like a credential store, the dslUpdateJenkins task would remove these properties as they're declared in the XML. Storing secrets like this in the JobDSL scripts is not a good alternative, so this change allow us to inherit folder properties when updating existing folder items.","created_at":"2018-06-20T15:32:43Z","updated_at":"2018-06-25T09:53:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6d479d46f799766b82265886478dff0c4cde8793","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/pulls/86/commits","review_comments_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/pulls/86/comments","review_comment_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/issues/86/comments","statuses_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/statuses/ee6680ec20465d4eabbc1c33200b2f50d1218d0a","head":{"label":"Ruenzuo:support_folder_properties","ref":"support_folder_properties","sha":"ee6680ec20465d4eabbc1c33200b2f50d1218d0a","user":{"login":"Ruenzuo","id":346590,"node_id":"MDQ6VXNlcjM0NjU5MA==","avatar_url":"https://avatars0.githubusercontent.com/u/346590?v=4","gravatar_id":"","url":"https://api.github.com/users/Ruenzuo","html_url":"https://github.com/Ruenzuo","followers_url":"https://api.github.com/users/Ruenzuo/followers","following_url":"https://api.github.com/users/Ruenzuo/following{/other_user}","gists_url":"https://api.github.com/users/Ruenzuo/gists{/gist_id}","starred_url":"https://api.github.com/users/Ruenzuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ruenzuo/subscriptions","organizations_url":"https://api.github.com/users/Ruenzuo/orgs","repos_url":"https://api.github.com/users/Ruenzuo/repos","events_url":"https://api.github.com/users/Ruenzuo/events{/privacy}","received_events_url":"https://api.github.com/users/Ruenzuo/received_events","type":"User","site_admin":false},"repo":{"id":128749160,"node_id":"MDEwOlJlcG9zaXRvcnkxMjg3NDkxNjA=","name":"gradle-jenkins-jobdsl-plugin","full_name":"Ruenzuo/gradle-jenkins-jobdsl-plugin","owner":{"login":"Ruenzuo","id":346590,"node_id":"MDQ6VXNlcjM0NjU5MA==","avatar_url":"https://avatars0.githubusercontent.com/u/346590?v=4","gravatar_id":"","url":"https://api.github.com/users/Ruenzuo","html_url":"https://github.com/Ruenzuo","followers_url":"https://api.github.com/users/Ruenzuo/followers","following_url":"https://api.github.com/users/Ruenzuo/following{/other_user}","gists_url":"https://api.github.com/users/Ruenzuo/gists{/gist_id}","starred_url":"https://api.github.com/users/Ruenzuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ruenzuo/subscriptions","organizations_url":"https://api.github.com/users/Ruenzuo/orgs","repos_url":"https://api.github.com/users/Ruenzuo/repos","events_url":"https://api.github.com/users/Ruenzuo/events{/privacy}","received_events_url":"https://api.github.com/users/Ruenzuo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Ruenzuo/gradle-jenkins-jobdsl-plugin","description":"A plugin for Gradle to manage Jenkins Job DSL projects.","fork":true,"url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin","forks_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/forks","keys_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/teams","hooks_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/hooks","issue_events_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/events","assignees_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/tags","blobs_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/languages","stargazers_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/stargazers","contributors_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/contributors","subscribers_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/subscribers","subscription_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/subscription","commits_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/merges","archive_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/downloads","issues_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/labels{/name}","releases_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/Ruenzuo/gradle-jenkins-jobdsl-plugin/deployments","created_at":"2018-04-09T09:41:33Z","updated_at":"2018-04-09T09:41:35Z","pushed_at":"2018-06-22T08:10:06Z","git_url":"git://github.com/Ruenzuo/gradle-jenkins-jobdsl-plugin.git","ssh_url":"git@github.com:Ruenzuo/gradle-jenkins-jobdsl-plugin.git","clone_url":"https://github.com/Ruenzuo/gradle-jenkins-jobdsl-plugin.git","svn_url":"https://github.com/Ruenzuo/gradle-jenkins-jobdsl-plugin","homepage":"https://plugins.gradle.org/plugin/com.here.jobdsl","size":443,"stargazers_count":0,"watchers_count":0,"language":"Groovy","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"heremaps:master","ref":"master","sha":"079e0f234346197bb1d3aedbd3a9812303fa594a","user":{"login":"heremaps","id":2835506,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MzU1MDY=","avatar_url":"https://avatars0.githubusercontent.com/u/2835506?v=4","gravatar_id":"","url":"https://api.github.com/users/heremaps","html_url":"https://github.com/heremaps","followers_url":"https://api.github.com/users/heremaps/followers","following_url":"https://api.github.com/users/heremaps/following{/other_user}","gists_url":"https://api.github.com/users/heremaps/gists{/gist_id}","starred_url":"https://api.github.com/users/heremaps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heremaps/subscriptions","organizations_url":"https://api.github.com/users/heremaps/orgs","repos_url":"https://api.github.com/users/heremaps/repos","events_url":"https://api.github.com/users/heremaps/events{/privacy}","received_events_url":"https://api.github.com/users/heremaps/received_events","type":"Organization","site_admin":false},"repo":{"id":93070513,"node_id":"MDEwOlJlcG9zaXRvcnk5MzA3MDUxMw==","name":"gradle-jenkins-jobdsl-plugin","full_name":"heremaps/gradle-jenkins-jobdsl-plugin","owner":{"login":"heremaps","id":2835506,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MzU1MDY=","avatar_url":"https://avatars0.githubusercontent.com/u/2835506?v=4","gravatar_id":"","url":"https://api.github.com/users/heremaps","html_url":"https://github.com/heremaps","followers_url":"https://api.github.com/users/heremaps/followers","following_url":"https://api.github.com/users/heremaps/following{/other_user}","gists_url":"https://api.github.com/users/heremaps/gists{/gist_id}","starred_url":"https://api.github.com/users/heremaps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heremaps/subscriptions","organizations_url":"https://api.github.com/users/heremaps/orgs","repos_url":"https://api.github.com/users/heremaps/repos","events_url":"https://api.github.com/users/heremaps/events{/privacy}","received_events_url":"https://api.github.com/users/heremaps/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/heremaps/gradle-jenkins-jobdsl-plugin","description":"A plugin for Gradle to manage Jenkins Job DSL projects.","fork":false,"url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin","forks_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/forks","keys_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/teams","hooks_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/hooks","issue_events_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/events","assignees_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/tags","blobs_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/languages","stargazers_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/stargazers","contributors_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/contributors","subscribers_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/subscribers","subscription_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/subscription","commits_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/merges","archive_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/downloads","issues_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/labels{/name}","releases_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/deployments","created_at":"2017-06-01T15:12:24Z","updated_at":"2018-06-13T09:55:38Z","pushed_at":"2018-06-22T08:44:27Z","git_url":"git://github.com/heremaps/gradle-jenkins-jobdsl-plugin.git","ssh_url":"git@github.com:heremaps/gradle-jenkins-jobdsl-plugin.git","clone_url":"https://github.com/heremaps/gradle-jenkins-jobdsl-plugin.git","svn_url":"https://github.com/heremaps/gradle-jenkins-jobdsl-plugin","homepage":"https://plugins.gradle.org/plugin/com.here.jobdsl","size":445,"stargazers_count":25,"watchers_count":25,"language":"Groovy","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":16,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":3,"open_issues":16,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/pulls/86"},"html":{"href":"https://github.com/heremaps/gradle-jenkins-jobdsl-plugin/pull/86"},"issue":{"href":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/issues/86"},"comments":{"href":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/issues/86/comments"},"review_comments":{"href":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/pulls/86/comments"},"review_comment":{"href":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/pulls/86/commits"},"statuses":{"href":"https://api.github.com/repos/heremaps/gradle-jenkins-jobdsl-plugin/statuses/ee6680ec20465d4eabbc1c33200b2f50d1218d0a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mnonnenmacher"}}