{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/pulls/comments/172159015","pull_request_review_id":101127668,"id":172159015,"diff_hunk":"@@ -209,6 +211,27 @@ def my_provider\n         raise 'Execution encountered an error' if context.failed?\n       end\n \n+      def strict_check(current_state)\n+        return if Puppet.settings[:strict] == :off\n+\n+        # if strict checking is on we must notify if the values are changed by canonicalize\n+        # make a deep copy to perform the operation on and to compare against later\n+        state_clone = Marshal.load(Marshal.dump(current_state))\n+        state_clone = my_provider.canonicalize(context, [state_clone]).first\n+\n+        # compare the clone against the current state to see if changes have been made by canonicalize\n+        return unless state_clone && (current_state != state_clone)\n+        message = \"Canonicalization will modify values from #{current_state.inspect} to #{state_clone.inspect}\"\n+\n+        case Puppet.settings[:strict]\n+        when :warning\n+          Puppet.warning(message)\n+        when :error\n+          # TODO: get more context for the abort error message","path":"lib/puppet/resource_api.rb","position":45,"original_position":29,"commit_id":"35f1d5c6cd3a9c4c731a8845b319e07156820e48","original_commit_id":"2a3141e90b82e90057b6ba979ddcea22b376973a","user":{"login":"DavidS","id":27712,"avatar_url":"https://avatars2.githubusercontent.com/u/27712?v=4","gravatar_id":"","url":"https://api.github.com/users/DavidS","html_url":"https://github.com/DavidS","followers_url":"https://api.github.com/users/DavidS/followers","following_url":"https://api.github.com/users/DavidS/following{/other_user}","gists_url":"https://api.github.com/users/DavidS/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidS/subscriptions","organizations_url":"https://api.github.com/users/DavidS/orgs","repos_url":"https://api.github.com/users/DavidS/repos","events_url":"https://api.github.com/users/DavidS/events{/privacy}","received_events_url":"https://api.github.com/users/DavidS/received_events","type":"User","site_admin":false},"body":"What's the current output of, say, `puppet resource` when this is hit, and what should it be?","created_at":"2018-03-05T11:33:48Z","updated_at":"2018-03-05T11:52:29Z","html_url":"https://github.com/puppetlabs/puppet-resource_api/pull/30#discussion_r172159015","pull_request_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/pulls/30","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet-resource_api/pulls/comments/172159015"},"html":{"href":"https://github.com/puppetlabs/puppet-resource_api/pull/30#discussion_r172159015"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/puppet-resource_api/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/pulls/30","id":172546479,"html_url":"https://github.com/puppetlabs/puppet-resource_api/pull/30","diff_url":"https://github.com/puppetlabs/puppet-resource_api/pull/30.diff","patch_url":"https://github.com/puppetlabs/puppet-resource_api/pull/30.patch","issue_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/issues/30","number":30,"state":"open","locked":false,"title":"WIP (PDK-511) Add canonicalization checking if puppet strict is on.","user":{"login":"da-ar","id":1346683,"avatar_url":"https://avatars0.githubusercontent.com/u/1346683?v=4","gravatar_id":"","url":"https://api.github.com/users/da-ar","html_url":"https://github.com/da-ar","followers_url":"https://api.github.com/users/da-ar/followers","following_url":"https://api.github.com/users/da-ar/following{/other_user}","gists_url":"https://api.github.com/users/da-ar/gists{/gist_id}","starred_url":"https://api.github.com/users/da-ar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/da-ar/subscriptions","organizations_url":"https://api.github.com/users/da-ar/orgs","repos_url":"https://api.github.com/users/da-ar/repos","events_url":"https://api.github.com/users/da-ar/events{/privacy}","received_events_url":"https://api.github.com/users/da-ar/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-03-02T16:31:15Z","updated_at":"2018-03-05T11:52:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"94dd737a78ce16db217c1336f72a65633de2970f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/pulls/30/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/pulls/30/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/issues/30/comments","statuses_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/statuses/35f1d5c6cd3a9c4c731a8845b319e07156820e48","head":{"label":"da-ar:pdk-511-strict-checking","ref":"pdk-511-strict-checking","sha":"35f1d5c6cd3a9c4c731a8845b319e07156820e48","user":{"login":"da-ar","id":1346683,"avatar_url":"https://avatars0.githubusercontent.com/u/1346683?v=4","gravatar_id":"","url":"https://api.github.com/users/da-ar","html_url":"https://github.com/da-ar","followers_url":"https://api.github.com/users/da-ar/followers","following_url":"https://api.github.com/users/da-ar/following{/other_user}","gists_url":"https://api.github.com/users/da-ar/gists{/gist_id}","starred_url":"https://api.github.com/users/da-ar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/da-ar/subscriptions","organizations_url":"https://api.github.com/users/da-ar/orgs","repos_url":"https://api.github.com/users/da-ar/repos","events_url":"https://api.github.com/users/da-ar/events{/privacy}","received_events_url":"https://api.github.com/users/da-ar/received_events","type":"User","site_admin":false},"repo":{"id":116024913,"name":"puppet-resource_api","full_name":"da-ar/puppet-resource_api","owner":{"login":"da-ar","id":1346683,"avatar_url":"https://avatars0.githubusercontent.com/u/1346683?v=4","gravatar_id":"","url":"https://api.github.com/users/da-ar","html_url":"https://github.com/da-ar","followers_url":"https://api.github.com/users/da-ar/followers","following_url":"https://api.github.com/users/da-ar/following{/other_user}","gists_url":"https://api.github.com/users/da-ar/gists{/gist_id}","starred_url":"https://api.github.com/users/da-ar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/da-ar/subscriptions","organizations_url":"https://api.github.com/users/da-ar/orgs","repos_url":"https://api.github.com/users/da-ar/repos","events_url":"https://api.github.com/users/da-ar/events{/privacy}","received_events_url":"https://api.github.com/users/da-ar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/da-ar/puppet-resource_api","description":"This library provides a simple way to write new native resources for https://puppet.com.","fork":true,"url":"https://api.github.com/repos/da-ar/puppet-resource_api","forks_url":"https://api.github.com/repos/da-ar/puppet-resource_api/forks","keys_url":"https://api.github.com/repos/da-ar/puppet-resource_api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/da-ar/puppet-resource_api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/da-ar/puppet-resource_api/teams","hooks_url":"https://api.github.com/repos/da-ar/puppet-resource_api/hooks","issue_events_url":"https://api.github.com/repos/da-ar/puppet-resource_api/issues/events{/number}","events_url":"https://api.github.com/repos/da-ar/puppet-resource_api/events","assignees_url":"https://api.github.com/repos/da-ar/puppet-resource_api/assignees{/user}","branches_url":"https://api.github.com/repos/da-ar/puppet-resource_api/branches{/branch}","tags_url":"https://api.github.com/repos/da-ar/puppet-resource_api/tags","blobs_url":"https://api.github.com/repos/da-ar/puppet-resource_api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/da-ar/puppet-resource_api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/da-ar/puppet-resource_api/git/refs{/sha}","trees_url":"https://api.github.com/repos/da-ar/puppet-resource_api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/da-ar/puppet-resource_api/statuses/{sha}","languages_url":"https://api.github.com/repos/da-ar/puppet-resource_api/languages","stargazers_url":"https://api.github.com/repos/da-ar/puppet-resource_api/stargazers","contributors_url":"https://api.github.com/repos/da-ar/puppet-resource_api/contributors","subscribers_url":"https://api.github.com/repos/da-ar/puppet-resource_api/subscribers","subscription_url":"https://api.github.com/repos/da-ar/puppet-resource_api/subscription","commits_url":"https://api.github.com/repos/da-ar/puppet-resource_api/commits{/sha}","git_commits_url":"https://api.github.com/repos/da-ar/puppet-resource_api/git/commits{/sha}","comments_url":"https://api.github.com/repos/da-ar/puppet-resource_api/comments{/number}","issue_comment_url":"https://api.github.com/repos/da-ar/puppet-resource_api/issues/comments{/number}","contents_url":"https://api.github.com/repos/da-ar/puppet-resource_api/contents/{+path}","compare_url":"https://api.github.com/repos/da-ar/puppet-resource_api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/da-ar/puppet-resource_api/merges","archive_url":"https://api.github.com/repos/da-ar/puppet-resource_api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/da-ar/puppet-resource_api/downloads","issues_url":"https://api.github.com/repos/da-ar/puppet-resource_api/issues{/number}","pulls_url":"https://api.github.com/repos/da-ar/puppet-resource_api/pulls{/number}","milestones_url":"https://api.github.com/repos/da-ar/puppet-resource_api/milestones{/number}","notifications_url":"https://api.github.com/repos/da-ar/puppet-resource_api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/da-ar/puppet-resource_api/labels{/name}","releases_url":"https://api.github.com/repos/da-ar/puppet-resource_api/releases{/id}","deployments_url":"https://api.github.com/repos/da-ar/puppet-resource_api/deployments","created_at":"2018-01-02T14:42:13Z","updated_at":"2018-01-02T14:42:15Z","pushed_at":"2018-03-05T11:37:03Z","git_url":"git://github.com/da-ar/puppet-resource_api.git","ssh_url":"git@github.com:da-ar/puppet-resource_api.git","clone_url":"https://github.com/da-ar/puppet-resource_api.git","svn_url":"https://github.com/da-ar/puppet-resource_api","homepage":"","size":198,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"puppetlabs:master","ref":"master","sha":"fb825bed33c84b09bd4f410dc856ff8b5627ec26","user":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars0.githubusercontent.com/u/234268?v=4","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":101997158,"name":"puppet-resource_api","full_name":"puppetlabs/puppet-resource_api","owner":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars0.githubusercontent.com/u/234268?v=4","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/puppetlabs/puppet-resource_api","description":"This library provides a simple way to write new native resources for https://puppet.com.","fork":false,"url":"https://api.github.com/repos/puppetlabs/puppet-resource_api","forks_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/forks","keys_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/teams","hooks_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/events","assignees_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/tags","blobs_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/subscription","commits_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/merges","archive_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/downloads","issues_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/releases{/id}","deployments_url":"https://api.github.com/repos/puppetlabs/puppet-resource_api/deployments","created_at":"2017-08-31T12:11:51Z","updated_at":"2017-10-20T16:34:08Z","pushed_at":"2018-03-05T11:37:04Z","git_url":"git://github.com/puppetlabs/puppet-resource_api.git","ssh_url":"git@github.com:puppetlabs/puppet-resource_api.git","clone_url":"https://github.com/puppetlabs/puppet-resource_api.git","svn_url":"https://github.com/puppetlabs/puppet-resource_api","homepage":"","size":191,"stargazers_count":6,"watchers_count":6,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":9,"open_issues":2,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet-resource_api/pulls/30"},"html":{"href":"https://github.com/puppetlabs/puppet-resource_api/pull/30"},"issue":{"href":"https://api.github.com/repos/puppetlabs/puppet-resource_api/issues/30"},"comments":{"href":"https://api.github.com/repos/puppetlabs/puppet-resource_api/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/puppet-resource_api/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/puppet-resource_api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/puppet-resource_api/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/puppet-resource_api/statuses/35f1d5c6cd3a9c4c731a8845b319e07156820e48"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"DavidS"}}