{"action":"created","comment":{"url":"https://api.github.com/repos/cfengine/masterfiles/pulls/comments/48606409","id":48606409,"diff_hunk":"@@ -382,6 +382,47 @@ bundle agent cmerge(name, varlist)\n       \"$(name)_str\" string => format(\"%S\", $(name)),    policy => \"free\";\n }\n \n+bundle agent collect(name, tag)\n+# @brief bundle to collect values from tagged variables into a data container\n+# @param name the variable name to create\n+# @param tag the tags to match\n+#\n+# The result will be in `collect.$(name)`.  You can also use\n+# `cmerge.$(name)_str` for a string version of the merged containers.\n+#\n+# The name is variable so you can call this bundle for more than one\n+# collection.\n+#\n+# If you merge a key-value map into an array or vice versa, the map\n+# always wins.  So this example will result in a key-value map even\n+# though `cmerge.$(name)` starts as an array.\n+#\n+# **Example:**\n+#\n+# ```cf3\n+# bundle agent run\n+# {\n+#   vars:\n+#       # the \"mymerge\" tag is user-defined\n+#       \"a\"       data  => parsejson('{ \"mark\": \"b\" }'), meta => { \"mymerge\" };\n+#       \"b\"       data  => parsejson('{ \"volker\": \"h\" }'), meta => { \"mymerge\" };","path":"lib/bundles.cf","position":27,"original_position":27,"commit_id":"a479211982ce7635f44f5fbd0b78d7a2b98738cd","original_commit_id":"a479211982ce7635f44f5fbd0b78d7a2b98738cd","user":{"login":"tzz","id":67764,"avatar_url":"https://avatars.githubusercontent.com/u/67764?v=3","gravatar_id":"","url":"https://api.github.com/users/tzz","html_url":"https://github.com/tzz","followers_url":"https://api.github.com/users/tzz/followers","following_url":"https://api.github.com/users/tzz/following{/other_user}","gists_url":"https://api.github.com/users/tzz/gists{/gist_id}","starred_url":"https://api.github.com/users/tzz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tzz/subscriptions","organizations_url":"https://api.github.com/users/tzz/orgs","repos_url":"https://api.github.com/users/tzz/repos","events_url":"https://api.github.com/users/tzz/events{/privacy}","received_events_url":"https://api.github.com/users/tzz/received_events","type":"User","site_admin":false},"body":"OK; done.","created_at":"2015-12-30T14:32:25Z","updated_at":"2015-12-30T14:32:25Z","html_url":"https://github.com/cfengine/masterfiles/pull/632#discussion_r48606409","pull_request_url":"https://api.github.com/repos/cfengine/masterfiles/pulls/632","_links":{"self":{"href":"https://api.github.com/repos/cfengine/masterfiles/pulls/comments/48606409"},"html":{"href":"https://github.com/cfengine/masterfiles/pull/632#discussion_r48606409"},"pull_request":{"href":"https://api.github.com/repos/cfengine/masterfiles/pulls/632"}}},"pull_request":{"url":"https://api.github.com/repos/cfengine/masterfiles/pulls/632","id":54506265,"html_url":"https://github.com/cfengine/masterfiles/pull/632","diff_url":"https://github.com/cfengine/masterfiles/pull/632.diff","patch_url":"https://github.com/cfengine/masterfiles/pull/632.patch","issue_url":"https://api.github.com/repos/cfengine/masterfiles/issues/632","number":632,"state":"open","locked":false,"title":"lib/bundles.cf: add collect bundle similar to cmerge","user":{"login":"tzz","id":67764,"avatar_url":"https://avatars.githubusercontent.com/u/67764?v=3","gravatar_id":"","url":"https://api.github.com/users/tzz","html_url":"https://github.com/tzz","followers_url":"https://api.github.com/users/tzz/followers","following_url":"https://api.github.com/users/tzz/following{/other_user}","gists_url":"https://api.github.com/users/tzz/gists{/gist_id}","starred_url":"https://api.github.com/users/tzz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tzz/subscriptions","organizations_url":"https://api.github.com/users/tzz/orgs","repos_url":"https://api.github.com/users/tzz/repos","events_url":"https://api.github.com/users/tzz/events{/privacy}","received_events_url":"https://api.github.com/users/tzz/received_events","type":"User","site_admin":false},"body":"@nickanderson pretty simple and clean, saves a step over `cmerge()`.","created_at":"2015-12-23T21:00:06Z","updated_at":"2015-12-30T14:32:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4ae846914a6910167f2ebe9c66c4303719ddebf2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cfengine/masterfiles/pulls/632/commits","review_comments_url":"https://api.github.com/repos/cfengine/masterfiles/pulls/632/comments","review_comment_url":"https://api.github.com/repos/cfengine/masterfiles/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cfengine/masterfiles/issues/632/comments","statuses_url":"https://api.github.com/repos/cfengine/masterfiles/statuses/a479211982ce7635f44f5fbd0b78d7a2b98738cd","head":{"label":"tzz:feature/collect","ref":"feature/collect","sha":"a479211982ce7635f44f5fbd0b78d7a2b98738cd","user":{"login":"tzz","id":67764,"avatar_url":"https://avatars.githubusercontent.com/u/67764?v=3","gravatar_id":"","url":"https://api.github.com/users/tzz","html_url":"https://github.com/tzz","followers_url":"https://api.github.com/users/tzz/followers","following_url":"https://api.github.com/users/tzz/following{/other_user}","gists_url":"https://api.github.com/users/tzz/gists{/gist_id}","starred_url":"https://api.github.com/users/tzz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tzz/subscriptions","organizations_url":"https://api.github.com/users/tzz/orgs","repos_url":"https://api.github.com/users/tzz/repos","events_url":"https://api.github.com/users/tzz/events{/privacy}","received_events_url":"https://api.github.com/users/tzz/received_events","type":"User","site_admin":false},"repo":{"id":12277860,"name":"masterfiles","full_name":"tzz/masterfiles","owner":{"login":"tzz","id":67764,"avatar_url":"https://avatars.githubusercontent.com/u/67764?v=3","gravatar_id":"","url":"https://api.github.com/users/tzz","html_url":"https://github.com/tzz","followers_url":"https://api.github.com/users/tzz/followers","following_url":"https://api.github.com/users/tzz/following{/other_user}","gists_url":"https://api.github.com/users/tzz/gists{/gist_id}","starred_url":"https://api.github.com/users/tzz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tzz/subscriptions","organizations_url":"https://api.github.com/users/tzz/orgs","repos_url":"https://api.github.com/users/tzz/repos","events_url":"https://api.github.com/users/tzz/events{/privacy}","received_events_url":"https://api.github.com/users/tzz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tzz/masterfiles","description":"Policy masterfiles that are shipped with CFEngine packages","fork":true,"url":"https://api.github.com/repos/tzz/masterfiles","forks_url":"https://api.github.com/repos/tzz/masterfiles/forks","keys_url":"https://api.github.com/repos/tzz/masterfiles/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tzz/masterfiles/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tzz/masterfiles/teams","hooks_url":"https://api.github.com/repos/tzz/masterfiles/hooks","issue_events_url":"https://api.github.com/repos/tzz/masterfiles/issues/events{/number}","events_url":"https://api.github.com/repos/tzz/masterfiles/events","assignees_url":"https://api.github.com/repos/tzz/masterfiles/assignees{/user}","branches_url":"https://api.github.com/repos/tzz/masterfiles/branches{/branch}","tags_url":"https://api.github.com/repos/tzz/masterfiles/tags","blobs_url":"https://api.github.com/repos/tzz/masterfiles/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tzz/masterfiles/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tzz/masterfiles/git/refs{/sha}","trees_url":"https://api.github.com/repos/tzz/masterfiles/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tzz/masterfiles/statuses/{sha}","languages_url":"https://api.github.com/repos/tzz/masterfiles/languages","stargazers_url":"https://api.github.com/repos/tzz/masterfiles/stargazers","contributors_url":"https://api.github.com/repos/tzz/masterfiles/contributors","subscribers_url":"https://api.github.com/repos/tzz/masterfiles/subscribers","subscription_url":"https://api.github.com/repos/tzz/masterfiles/subscription","commits_url":"https://api.github.com/repos/tzz/masterfiles/commits{/sha}","git_commits_url":"https://api.github.com/repos/tzz/masterfiles/git/commits{/sha}","comments_url":"https://api.github.com/repos/tzz/masterfiles/comments{/number}","issue_comment_url":"https://api.github.com/repos/tzz/masterfiles/issues/comments{/number}","contents_url":"https://api.github.com/repos/tzz/masterfiles/contents/{+path}","compare_url":"https://api.github.com/repos/tzz/masterfiles/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tzz/masterfiles/merges","archive_url":"https://api.github.com/repos/tzz/masterfiles/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tzz/masterfiles/downloads","issues_url":"https://api.github.com/repos/tzz/masterfiles/issues{/number}","pulls_url":"https://api.github.com/repos/tzz/masterfiles/pulls{/number}","milestones_url":"https://api.github.com/repos/tzz/masterfiles/milestones{/number}","notifications_url":"https://api.github.com/repos/tzz/masterfiles/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tzz/masterfiles/labels{/name}","releases_url":"https://api.github.com/repos/tzz/masterfiles/releases{/id}","created_at":"2013-08-21T18:21:57Z","updated_at":"2014-06-15T16:13:26Z","pushed_at":"2015-12-23T20:59:17Z","git_url":"git://github.com/tzz/masterfiles.git","ssh_url":"git@github.com:tzz/masterfiles.git","clone_url":"https://github.com/tzz/masterfiles.git","svn_url":"https://github.com/tzz/masterfiles","homepage":null,"size":37285,"stargazers_count":1,"watchers_count":1,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"cfengine:master","ref":"master","sha":"0e786ff568204f438c868f549dc68b5188f310e0","user":{"login":"cfengine","id":1239823,"avatar_url":"https://avatars.githubusercontent.com/u/1239823?v=3","gravatar_id":"","url":"https://api.github.com/users/cfengine","html_url":"https://github.com/cfengine","followers_url":"https://api.github.com/users/cfengine/followers","following_url":"https://api.github.com/users/cfengine/following{/other_user}","gists_url":"https://api.github.com/users/cfengine/gists{/gist_id}","starred_url":"https://api.github.com/users/cfengine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfengine/subscriptions","organizations_url":"https://api.github.com/users/cfengine/orgs","repos_url":"https://api.github.com/users/cfengine/repos","events_url":"https://api.github.com/users/cfengine/events{/privacy}","received_events_url":"https://api.github.com/users/cfengine/received_events","type":"Organization","site_admin":false},"repo":{"id":11657493,"name":"masterfiles","full_name":"cfengine/masterfiles","owner":{"login":"cfengine","id":1239823,"avatar_url":"https://avatars.githubusercontent.com/u/1239823?v=3","gravatar_id":"","url":"https://api.github.com/users/cfengine","html_url":"https://github.com/cfengine","followers_url":"https://api.github.com/users/cfengine/followers","following_url":"https://api.github.com/users/cfengine/following{/other_user}","gists_url":"https://api.github.com/users/cfengine/gists{/gist_id}","starred_url":"https://api.github.com/users/cfengine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfengine/subscriptions","organizations_url":"https://api.github.com/users/cfengine/orgs","repos_url":"https://api.github.com/users/cfengine/repos","events_url":"https://api.github.com/users/cfengine/events{/privacy}","received_events_url":"https://api.github.com/users/cfengine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cfengine/masterfiles","description":"Policy masterfiles that are shipped with CFEngine packages","fork":false,"url":"https://api.github.com/repos/cfengine/masterfiles","forks_url":"https://api.github.com/repos/cfengine/masterfiles/forks","keys_url":"https://api.github.com/repos/cfengine/masterfiles/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cfengine/masterfiles/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cfengine/masterfiles/teams","hooks_url":"https://api.github.com/repos/cfengine/masterfiles/hooks","issue_events_url":"https://api.github.com/repos/cfengine/masterfiles/issues/events{/number}","events_url":"https://api.github.com/repos/cfengine/masterfiles/events","assignees_url":"https://api.github.com/repos/cfengine/masterfiles/assignees{/user}","branches_url":"https://api.github.com/repos/cfengine/masterfiles/branches{/branch}","tags_url":"https://api.github.com/repos/cfengine/masterfiles/tags","blobs_url":"https://api.github.com/repos/cfengine/masterfiles/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cfengine/masterfiles/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cfengine/masterfiles/git/refs{/sha}","trees_url":"https://api.github.com/repos/cfengine/masterfiles/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cfengine/masterfiles/statuses/{sha}","languages_url":"https://api.github.com/repos/cfengine/masterfiles/languages","stargazers_url":"https://api.github.com/repos/cfengine/masterfiles/stargazers","contributors_url":"https://api.github.com/repos/cfengine/masterfiles/contributors","subscribers_url":"https://api.github.com/repos/cfengine/masterfiles/subscribers","subscription_url":"https://api.github.com/repos/cfengine/masterfiles/subscription","commits_url":"https://api.github.com/repos/cfengine/masterfiles/commits{/sha}","git_commits_url":"https://api.github.com/repos/cfengine/masterfiles/git/commits{/sha}","comments_url":"https://api.github.com/repos/cfengine/masterfiles/comments{/number}","issue_comment_url":"https://api.github.com/repos/cfengine/masterfiles/issues/comments{/number}","contents_url":"https://api.github.com/repos/cfengine/masterfiles/contents/{+path}","compare_url":"https://api.github.com/repos/cfengine/masterfiles/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cfengine/masterfiles/merges","archive_url":"https://api.github.com/repos/cfengine/masterfiles/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cfengine/masterfiles/downloads","issues_url":"https://api.github.com/repos/cfengine/masterfiles/issues{/number}","pulls_url":"https://api.github.com/repos/cfengine/masterfiles/pulls{/number}","milestones_url":"https://api.github.com/repos/cfengine/masterfiles/milestones{/number}","notifications_url":"https://api.github.com/repos/cfengine/masterfiles/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cfengine/masterfiles/labels{/name}","releases_url":"https://api.github.com/repos/cfengine/masterfiles/releases{/id}","created_at":"2013-07-25T10:03:46Z","updated_at":"2015-12-29T14:38:57Z","pushed_at":"2015-12-30T13:52:53Z","git_url":"git://github.com/cfengine/masterfiles.git","ssh_url":"git@github.com:cfengine/masterfiles.git","clone_url":"https://github.com/cfengine/masterfiles.git","svn_url":"https://github.com/cfengine/masterfiles","homepage":null,"size":5253,"stargazers_count":25,"watchers_count":25,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":74,"mirror_url":null,"open_issues_count":13,"forks":74,"open_issues":13,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cfengine/masterfiles/pulls/632"},"html":{"href":"https://github.com/cfengine/masterfiles/pull/632"},"issue":{"href":"https://api.github.com/repos/cfengine/masterfiles/issues/632"},"comments":{"href":"https://api.github.com/repos/cfengine/masterfiles/issues/632/comments"},"review_comments":{"href":"https://api.github.com/repos/cfengine/masterfiles/pulls/632/comments"},"review_comment":{"href":"https://api.github.com/repos/cfengine/masterfiles/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cfengine/masterfiles/pulls/632/commits"},"statuses":{"href":"https://api.github.com/repos/cfengine/masterfiles/statuses/a479211982ce7635f44f5fbd0b78d7a2b98738cd"}}}}