{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments/24068018","id":24068018,"diff_hunk":"@@ -119,6 +120,20 @@ def insync?(is)\n       result\n     end\n \n+    def property_matches?(current, desired)\n+      basic = super\n+      # The inherited equality is always accepted, so use it if valid.\n+      time_types = [\"mtime\", \"ctime\"]\n+      return basic if basic || !time_types.include?(checksum_type.to_s)\n+      return false unless current && desired\n+      begin\n+        raise \"not a time checksum\" if !time_types.include?(sumtype(current)) || !time_types.include?(sumtype(desired))\n+        DateTime.parse(current) >= DateTime.parse(desired)","path":"lib/puppet/type/file/content.rb","position":20,"original_position":20,"commit_id":"9b08c9167ea1bd97375d13f44c14cd05eff00451","original_commit_id":"9b08c9167ea1bd97375d13f44c14cd05eff00451","user":{"login":"joshcooper","id":737664,"avatar_url":"https://avatars.githubusercontent.com/u/737664?v=3","gravatar_id":"","url":"https://api.github.com/users/joshcooper","html_url":"https://github.com/joshcooper","followers_url":"https://api.github.com/users/joshcooper/followers","following_url":"https://api.github.com/users/joshcooper/following{/other_user}","gists_url":"https://api.github.com/users/joshcooper/gists{/gist_id}","starred_url":"https://api.github.com/users/joshcooper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshcooper/subscriptions","organizations_url":"https://api.github.com/users/joshcooper/orgs","repos_url":"https://api.github.com/users/joshcooper/repos","events_url":"https://api.github.com/users/joshcooper/events{/privacy}","received_events_url":"https://api.github.com/users/joshcooper/received_events","type":"User","site_admin":false},"body":"So `current` and `desired` are of the form `{mtime}2015-02-03 23:02:42 -0800`, and I have no idea how `DateTime.parse` is working, but that seems super suprising. It might be better to only parse the `sumdata`: \r\n\r\n```\r\nself.fail \"Not a time checksum #{current}\" if !time_types.include?(sumtype(current))\r\nself.fail \"Not a time checksum #{desired}\" if !time_types.include?(sumtype(desired))\r\nbegin\r\n  DateTime.parse(sumdata(current)) >= DateTime.parse(sumdata(desired))\r\nrescue => detail\r\n```\r\n\r\nAlso self.fail (is mixed into each type) and provides context about the resource that generated the errored (both on the console and in the report's logs).","created_at":"2015-02-04T08:08:12Z","updated_at":"2015-02-04T08:08:12Z","html_url":"https://github.com/puppetlabs/puppet/pull/3535#discussion_r24068018","pull_request_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/3535","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments/24068018"},"html":{"href":"https://github.com/puppetlabs/puppet/pull/3535#discussion_r24068018"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/3535"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/puppet/pulls/3535","id":28243744,"html_url":"https://github.com/puppetlabs/puppet/pull/3535","diff_url":"https://github.com/puppetlabs/puppet/pull/3535.diff","patch_url":"https://github.com/puppetlabs/puppet/pull/3535.patch","issue_url":"https://api.github.com/repos/puppetlabs/puppet/issues/3535","number":3535,"state":"open","locked":false,"title":"(PUP-3890) Fix mtime/ctime checksum type","user":{"login":"MikaelSmith","id":8162496,"avatar_url":"https://avatars.githubusercontent.com/u/8162496?v=3","gravatar_id":"","url":"https://api.github.com/users/MikaelSmith","html_url":"https://github.com/MikaelSmith","followers_url":"https://api.github.com/users/MikaelSmith/followers","following_url":"https://api.github.com/users/MikaelSmith/following{/other_user}","gists_url":"https://api.github.com/users/MikaelSmith/gists{/gist_id}","starred_url":"https://api.github.com/users/MikaelSmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikaelSmith/subscriptions","organizations_url":"https://api.github.com/users/MikaelSmith/orgs","repos_url":"https://api.github.com/users/MikaelSmith/repos","events_url":"https://api.github.com/users/MikaelSmith/events{/privacy}","received_events_url":"https://api.github.com/users/MikaelSmith/received_events","type":"User","site_admin":false},"body":"Makes file contents that use mtime or ctime for checksum_type\r\ncompare to ensure the target mtime/ctime is newer than the source.","created_at":"2015-01-29T00:34:13Z","updated_at":"2015-02-04T08:08:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d35098a536f636f001fea293f3c0ec635694c13f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/3535/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/3535/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments/{number}","comments_url":"https://api.github.com/repos/puppetlabs/puppet/issues/3535/comments","statuses_url":"https://api.github.com/repos/puppetlabs/puppet/statuses/9b08c9167ea1bd97375d13f44c14cd05eff00451","head":{"label":"MikaelSmith:bug/master/PUP-3890-fix-time-checksum-compare","ref":"bug/master/PUP-3890-fix-time-checksum-compare","sha":"9b08c9167ea1bd97375d13f44c14cd05eff00451","user":{"login":"MikaelSmith","id":8162496,"avatar_url":"https://avatars.githubusercontent.com/u/8162496?v=3","gravatar_id":"","url":"https://api.github.com/users/MikaelSmith","html_url":"https://github.com/MikaelSmith","followers_url":"https://api.github.com/users/MikaelSmith/followers","following_url":"https://api.github.com/users/MikaelSmith/following{/other_user}","gists_url":"https://api.github.com/users/MikaelSmith/gists{/gist_id}","starred_url":"https://api.github.com/users/MikaelSmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikaelSmith/subscriptions","organizations_url":"https://api.github.com/users/MikaelSmith/orgs","repos_url":"https://api.github.com/users/MikaelSmith/repos","events_url":"https://api.github.com/users/MikaelSmith/events{/privacy}","received_events_url":"https://api.github.com/users/MikaelSmith/received_events","type":"User","site_admin":false},"repo":{"id":22081114,"name":"puppet","full_name":"MikaelSmith/puppet","owner":{"login":"MikaelSmith","id":8162496,"avatar_url":"https://avatars.githubusercontent.com/u/8162496?v=3","gravatar_id":"","url":"https://api.github.com/users/MikaelSmith","html_url":"https://github.com/MikaelSmith","followers_url":"https://api.github.com/users/MikaelSmith/followers","following_url":"https://api.github.com/users/MikaelSmith/following{/other_user}","gists_url":"https://api.github.com/users/MikaelSmith/gists{/gist_id}","starred_url":"https://api.github.com/users/MikaelSmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikaelSmith/subscriptions","organizations_url":"https://api.github.com/users/MikaelSmith/orgs","repos_url":"https://api.github.com/users/MikaelSmith/repos","events_url":"https://api.github.com/users/MikaelSmith/events{/privacy}","received_events_url":"https://api.github.com/users/MikaelSmith/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MikaelSmith/puppet","description":"Server automation framework and application","fork":true,"url":"https://api.github.com/repos/MikaelSmith/puppet","forks_url":"https://api.github.com/repos/MikaelSmith/puppet/forks","keys_url":"https://api.github.com/repos/MikaelSmith/puppet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MikaelSmith/puppet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MikaelSmith/puppet/teams","hooks_url":"https://api.github.com/repos/MikaelSmith/puppet/hooks","issue_events_url":"https://api.github.com/repos/MikaelSmith/puppet/issues/events{/number}","events_url":"https://api.github.com/repos/MikaelSmith/puppet/events","assignees_url":"https://api.github.com/repos/MikaelSmith/puppet/assignees{/user}","branches_url":"https://api.github.com/repos/MikaelSmith/puppet/branches{/branch}","tags_url":"https://api.github.com/repos/MikaelSmith/puppet/tags","blobs_url":"https://api.github.com/repos/MikaelSmith/puppet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MikaelSmith/puppet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MikaelSmith/puppet/git/refs{/sha}","trees_url":"https://api.github.com/repos/MikaelSmith/puppet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MikaelSmith/puppet/statuses/{sha}","languages_url":"https://api.github.com/repos/MikaelSmith/puppet/languages","stargazers_url":"https://api.github.com/repos/MikaelSmith/puppet/stargazers","contributors_url":"https://api.github.com/repos/MikaelSmith/puppet/contributors","subscribers_url":"https://api.github.com/repos/MikaelSmith/puppet/subscribers","subscription_url":"https://api.github.com/repos/MikaelSmith/puppet/subscription","commits_url":"https://api.github.com/repos/MikaelSmith/puppet/commits{/sha}","git_commits_url":"https://api.github.com/repos/MikaelSmith/puppet/git/commits{/sha}","comments_url":"https://api.github.com/repos/MikaelSmith/puppet/comments{/number}","issue_comment_url":"https://api.github.com/repos/MikaelSmith/puppet/issues/comments/{number}","contents_url":"https://api.github.com/repos/MikaelSmith/puppet/contents/{+path}","compare_url":"https://api.github.com/repos/MikaelSmith/puppet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MikaelSmith/puppet/merges","archive_url":"https://api.github.com/repos/MikaelSmith/puppet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MikaelSmith/puppet/downloads","issues_url":"https://api.github.com/repos/MikaelSmith/puppet/issues{/number}","pulls_url":"https://api.github.com/repos/MikaelSmith/puppet/pulls{/number}","milestones_url":"https://api.github.com/repos/MikaelSmith/puppet/milestones{/number}","notifications_url":"https://api.github.com/repos/MikaelSmith/puppet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MikaelSmith/puppet/labels{/name}","releases_url":"https://api.github.com/repos/MikaelSmith/puppet/releases{/id}","created_at":"2014-07-21T21:34:58Z","updated_at":"2015-02-03T02:07:10Z","pushed_at":"2015-02-04T02:35:24Z","git_url":"git://github.com/MikaelSmith/puppet.git","ssh_url":"git@github.com:MikaelSmith/puppet.git","clone_url":"https://github.com/MikaelSmith/puppet.git","svn_url":"https://github.com/MikaelSmith/puppet","homepage":"http://www.puppetlabs.com/puppet/introduction/","size":45662,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"puppetlabs:master","ref":"master","sha":"988e92fb5b66e46dcf4df27a4f1a26c51c26f02b","user":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","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":910744,"name":"puppet","full_name":"puppetlabs/puppet","owner":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","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","description":"Server automation framework and application","fork":false,"url":"https://api.github.com/repos/puppetlabs/puppet","forks_url":"https://api.github.com/repos/puppetlabs/puppet/forks","keys_url":"https://api.github.com/repos/puppetlabs/puppet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/puppet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/puppet/teams","hooks_url":"https://api.github.com/repos/puppetlabs/puppet/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/puppet/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/puppet/events","assignees_url":"https://api.github.com/repos/puppetlabs/puppet/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/puppet/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/puppet/tags","blobs_url":"https://api.github.com/repos/puppetlabs/puppet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/puppet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/puppet/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/puppet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/puppet/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/puppet/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/puppet/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/puppet/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/puppet/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/puppet/subscription","commits_url":"https://api.github.com/repos/puppetlabs/puppet/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/puppet/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/puppet/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/puppet/issues/comments/{number}","contents_url":"https://api.github.com/repos/puppetlabs/puppet/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/puppet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/puppet/merges","archive_url":"https://api.github.com/repos/puppetlabs/puppet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/puppet/downloads","issues_url":"https://api.github.com/repos/puppetlabs/puppet/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/puppet/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/puppet/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/puppet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/puppet/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/puppet/releases{/id}","created_at":"2010-09-14T19:26:44Z","updated_at":"2015-02-04T05:12:28Z","pushed_at":"2015-02-04T05:12:28Z","git_url":"git://github.com/puppetlabs/puppet.git","ssh_url":"git@github.com:puppetlabs/puppet.git","clone_url":"https://github.com/puppetlabs/puppet.git","svn_url":"https://github.com/puppetlabs/puppet","homepage":"http://www.puppetlabs.com/puppet/introduction/","size":106121,"stargazers_count":2941,"watchers_count":2941,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1261,"mirror_url":null,"open_issues_count":36,"forks":1261,"open_issues":36,"watchers":2941,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/3535"},"html":{"href":"https://github.com/puppetlabs/puppet/pull/3535"},"issue":{"href":"https://api.github.com/repos/puppetlabs/puppet/issues/3535"},"comments":{"href":"https://api.github.com/repos/puppetlabs/puppet/issues/3535/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/3535/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/3535/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/puppet/statuses/9b08c9167ea1bd97375d13f44c14cd05eff00451"}}}}