{"action":"created","comment":{"url":"https://api.github.com/repos/SEEK-Org/evaporate/pulls/comments/92167574","pull_request_review_id":12676788,"id":92167574,"diff_hunk":"@@ -44,31 +43,31 @@ inlineHashes hashedPaths bucketFiles@BucketFiles{..} =\n     prependWithHash :: MonadThrow m => Paths -> Text -> Text -> m Text\n     prependWithHash hashes path altPath =\n       maybe (throwHashNotFound path)\n-            (pure . pack . Posix.joinPath . (: [unpack altPath]) . unpack)\n+            (pure . pack . joinPath . (: [unpack altPath]) . unpack)\n             (HashMap.lookup path hashes)\n       where\n         throwHashNotFound filePath = throwM $ HashNotFound filePath\n \n-hashBucketFiles :: (MonadIO m, MonadThrow m) => BucketFiles -> m FileHashes\n+hashBucketFiles :: (MonadThrow m, MonadBaseControl IO m, MonadIO m) => BucketFiles -> m FileHashes\n hashBucketFiles BucketFiles{..} =\n   if _isHashed\n     then HashMap.traverseWithKey hashKey _paths\n     else return HashMap.empty\n   where\n-    hashKey :: (MonadIO m, MonadThrow m) => Text -> a -> m Text\n+    hashKey :: (MonadThrow m, MonadBaseControl IO m, MonadIO m) => Text -> a -> m Text\n     hashKey path _ = do\n       hash <- createHash $ unpack path\n       return $ (pack . show) hash\n \n-createHash :: (MonadThrow m, MonadIO m) => FilePath -> m (Digest SHA1)\n-createHash path = do\n-  files <- (liftIO . doesDirectoryExist) path >>= \\case\n-    True -> do\n-      directoryFiles <- (fmap . fmap) (\\x -> [path, x]) (liftIO . listDirectory $ path)\n-      return $ fmap joinPath directoryFiles\n+createHash :: (MonadThrow m, MonadBaseControl IO m, MonadIO m)\n+                    => FilePath\n+                    -> m (Digest SHA1)\n+createHash path =\n+  (liftIO . doesDirectoryExist) path >>= \\case","path":"src/Hash.hs","position":69,"original_position":69,"commit_id":"0879d6cc0551c2028876f1714f81a70f1dc4bb99","original_commit_id":"0879d6cc0551c2028876f1714f81a70f1dc4bb99","user":{"login":"screamish","id":328113,"avatar_url":"https://avatars.githubusercontent.com/u/328113?v=3","gravatar_id":"","url":"https://api.github.com/users/screamish","html_url":"https://github.com/screamish","followers_url":"https://api.github.com/users/screamish/followers","following_url":"https://api.github.com/users/screamish/following{/other_user}","gists_url":"https://api.github.com/users/screamish/gists{/gist_id}","starred_url":"https://api.github.com/users/screamish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/screamish/subscriptions","organizations_url":"https://api.github.com/users/screamish/orgs","repos_url":"https://api.github.com/users/screamish/repos","events_url":"https://api.github.com/users/screamish/events{/privacy}","received_events_url":"https://api.github.com/users/screamish/received_events","type":"User","site_admin":false},"body":"How about this?\r\n\r\n```\r\ncreateHash :: (MonadThrow m, MonadBaseControl IO m, MonadIO m)\r\n           => FilePath\r\n           -> m (Digest SHA1)\r\ncreateHash path = do\r\n  checkPath path >>= \\case\r\n    File f -> runConduitRes $ sourceFile f .| sinkHash\r\n    Directory d -> do\r\n      runConduitRes $\r\n          sourceDirectoryDeep True d\r\n        .| awaitForever sourceFile\r\n        .| sinkHash\r\n\r\ndata PathType = File FilePath | Directory FilePath\r\n  deriving (Show, Eq)\r\n\r\ncheckPath :: (MonadIO m, MonadThrow m) => FilePath -> m PathType\r\ncheckPath path = liftIO $ do\r\n  isFile <- doesFileExist path\r\n  if isFile then return $ File path\r\n  else do\r\n    isDir <- doesDirectoryExist path\r\n    if isDir then return $ Directory path\r\n    else throwM . FileOrFolderDoesNotExist . pack $ path\r\n```","created_at":"2016-12-13T13:29:11Z","updated_at":"2016-12-13T13:29:11Z","html_url":"https://github.com/SEEK-Org/evaporate/pull/10#discussion_r92167574","pull_request_url":"https://api.github.com/repos/SEEK-Org/evaporate/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/SEEK-Org/evaporate/pulls/comments/92167574"},"html":{"href":"https://github.com/SEEK-Org/evaporate/pull/10#discussion_r92167574"},"pull_request":{"href":"https://api.github.com/repos/SEEK-Org/evaporate/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/SEEK-Org/evaporate/pulls/10","id":97655090,"html_url":"https://github.com/SEEK-Org/evaporate/pull/10","diff_url":"https://github.com/SEEK-Org/evaporate/pull/10.diff","patch_url":"https://github.com/SEEK-Org/evaporate/pull/10.patch","issue_url":"https://api.github.com/repos/SEEK-Org/evaporate/issues/10","number":10,"state":"open","locked":false,"title":"Feature/conduit hash","user":{"login":"askoufis","id":20388750,"avatar_url":"https://avatars.githubusercontent.com/u/20388750?v=3","gravatar_id":"","url":"https://api.github.com/users/askoufis","html_url":"https://github.com/askoufis","followers_url":"https://api.github.com/users/askoufis/followers","following_url":"https://api.github.com/users/askoufis/following{/other_user}","gists_url":"https://api.github.com/users/askoufis/gists{/gist_id}","starred_url":"https://api.github.com/users/askoufis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/askoufis/subscriptions","organizations_url":"https://api.github.com/users/askoufis/orgs","repos_url":"https://api.github.com/users/askoufis/repos","events_url":"https://api.github.com/users/askoufis/events{/privacy}","received_events_url":"https://api.github.com/users/askoufis/received_events","type":"User","site_admin":false},"body":"This PR addresses #1 and #5, but #5 made me realise that the same bug applied to S3 folder uploads and zipping folders as well, so all the folder manipulation stuff has been rewritten to use conduits, namely the `sourceDirectoryDeep` conduit which works on nested folders, doesn't give you back folder names (I'm looking at you `listDirectory` :angry:) and also gives you relative file paths which is really nice for everything.\r\n\r\nThere's also some small logging improvements like region logging (#9) and some moving around of things.","created_at":"2016-12-12T23:16:49Z","updated_at":"2016-12-13T13:29:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"217f8e0573f4a0d859a903140950234573de7476","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/SEEK-Org/evaporate/pulls/10/commits","review_comments_url":"https://api.github.com/repos/SEEK-Org/evaporate/pulls/10/comments","review_comment_url":"https://api.github.com/repos/SEEK-Org/evaporate/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SEEK-Org/evaporate/issues/10/comments","statuses_url":"https://api.github.com/repos/SEEK-Org/evaporate/statuses/0879d6cc0551c2028876f1714f81a70f1dc4bb99","head":{"label":"SEEK-Org:feature/conduit-hash","ref":"feature/conduit-hash","sha":"0879d6cc0551c2028876f1714f81a70f1dc4bb99","user":{"login":"SEEK-Org","id":22927121,"avatar_url":"https://avatars.githubusercontent.com/u/22927121?v=3","gravatar_id":"","url":"https://api.github.com/users/SEEK-Org","html_url":"https://github.com/SEEK-Org","followers_url":"https://api.github.com/users/SEEK-Org/followers","following_url":"https://api.github.com/users/SEEK-Org/following{/other_user}","gists_url":"https://api.github.com/users/SEEK-Org/gists{/gist_id}","starred_url":"https://api.github.com/users/SEEK-Org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SEEK-Org/subscriptions","organizations_url":"https://api.github.com/users/SEEK-Org/orgs","repos_url":"https://api.github.com/users/SEEK-Org/repos","events_url":"https://api.github.com/users/SEEK-Org/events{/privacy}","received_events_url":"https://api.github.com/users/SEEK-Org/received_events","type":"Organization","site_admin":false},"repo":{"id":75586509,"name":"evaporate","full_name":"SEEK-Org/evaporate","owner":{"login":"SEEK-Org","id":22927121,"avatar_url":"https://avatars.githubusercontent.com/u/22927121?v=3","gravatar_id":"","url":"https://api.github.com/users/SEEK-Org","html_url":"https://github.com/SEEK-Org","followers_url":"https://api.github.com/users/SEEK-Org/followers","following_url":"https://api.github.com/users/SEEK-Org/following{/other_user}","gists_url":"https://api.github.com/users/SEEK-Org/gists{/gist_id}","starred_url":"https://api.github.com/users/SEEK-Org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SEEK-Org/subscriptions","organizations_url":"https://api.github.com/users/SEEK-Org/orgs","repos_url":"https://api.github.com/users/SEEK-Org/repos","events_url":"https://api.github.com/users/SEEK-Org/events{/privacy}","received_events_url":"https://api.github.com/users/SEEK-Org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SEEK-Org/evaporate","description":"Evaporate is a convention-based, simple CloudFormation Stack deployment tool.","fork":false,"url":"https://api.github.com/repos/SEEK-Org/evaporate","forks_url":"https://api.github.com/repos/SEEK-Org/evaporate/forks","keys_url":"https://api.github.com/repos/SEEK-Org/evaporate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SEEK-Org/evaporate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SEEK-Org/evaporate/teams","hooks_url":"https://api.github.com/repos/SEEK-Org/evaporate/hooks","issue_events_url":"https://api.github.com/repos/SEEK-Org/evaporate/issues/events{/number}","events_url":"https://api.github.com/repos/SEEK-Org/evaporate/events","assignees_url":"https://api.github.com/repos/SEEK-Org/evaporate/assignees{/user}","branches_url":"https://api.github.com/repos/SEEK-Org/evaporate/branches{/branch}","tags_url":"https://api.github.com/repos/SEEK-Org/evaporate/tags","blobs_url":"https://api.github.com/repos/SEEK-Org/evaporate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SEEK-Org/evaporate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SEEK-Org/evaporate/git/refs{/sha}","trees_url":"https://api.github.com/repos/SEEK-Org/evaporate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SEEK-Org/evaporate/statuses/{sha}","languages_url":"https://api.github.com/repos/SEEK-Org/evaporate/languages","stargazers_url":"https://api.github.com/repos/SEEK-Org/evaporate/stargazers","contributors_url":"https://api.github.com/repos/SEEK-Org/evaporate/contributors","subscribers_url":"https://api.github.com/repos/SEEK-Org/evaporate/subscribers","subscription_url":"https://api.github.com/repos/SEEK-Org/evaporate/subscription","commits_url":"https://api.github.com/repos/SEEK-Org/evaporate/commits{/sha}","git_commits_url":"https://api.github.com/repos/SEEK-Org/evaporate/git/commits{/sha}","comments_url":"https://api.github.com/repos/SEEK-Org/evaporate/comments{/number}","issue_comment_url":"https://api.github.com/repos/SEEK-Org/evaporate/issues/comments{/number}","contents_url":"https://api.github.com/repos/SEEK-Org/evaporate/contents/{+path}","compare_url":"https://api.github.com/repos/SEEK-Org/evaporate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SEEK-Org/evaporate/merges","archive_url":"https://api.github.com/repos/SEEK-Org/evaporate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SEEK-Org/evaporate/downloads","issues_url":"https://api.github.com/repos/SEEK-Org/evaporate/issues{/number}","pulls_url":"https://api.github.com/repos/SEEK-Org/evaporate/pulls{/number}","milestones_url":"https://api.github.com/repos/SEEK-Org/evaporate/milestones{/number}","notifications_url":"https://api.github.com/repos/SEEK-Org/evaporate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SEEK-Org/evaporate/labels{/name}","releases_url":"https://api.github.com/repos/SEEK-Org/evaporate/releases{/id}","deployments_url":"https://api.github.com/repos/SEEK-Org/evaporate/deployments","created_at":"2016-12-05T03:49:01Z","updated_at":"2016-12-05T12:49:37Z","pushed_at":"2016-12-13T03:11:39Z","git_url":"git://github.com/SEEK-Org/evaporate.git","ssh_url":"git@github.com:SEEK-Org/evaporate.git","clone_url":"https://github.com/SEEK-Org/evaporate.git","svn_url":"https://github.com/SEEK-Org/evaporate","homepage":null,"size":123,"stargazers_count":1,"watchers_count":1,"language":"Haskell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":10,"forks":2,"open_issues":10,"watchers":1,"default_branch":"master"}},"base":{"label":"SEEK-Org:master","ref":"master","sha":"8293cb4bcf055a5537f488cedb83562d532b44b6","user":{"login":"SEEK-Org","id":22927121,"avatar_url":"https://avatars.githubusercontent.com/u/22927121?v=3","gravatar_id":"","url":"https://api.github.com/users/SEEK-Org","html_url":"https://github.com/SEEK-Org","followers_url":"https://api.github.com/users/SEEK-Org/followers","following_url":"https://api.github.com/users/SEEK-Org/following{/other_user}","gists_url":"https://api.github.com/users/SEEK-Org/gists{/gist_id}","starred_url":"https://api.github.com/users/SEEK-Org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SEEK-Org/subscriptions","organizations_url":"https://api.github.com/users/SEEK-Org/orgs","repos_url":"https://api.github.com/users/SEEK-Org/repos","events_url":"https://api.github.com/users/SEEK-Org/events{/privacy}","received_events_url":"https://api.github.com/users/SEEK-Org/received_events","type":"Organization","site_admin":false},"repo":{"id":75586509,"name":"evaporate","full_name":"SEEK-Org/evaporate","owner":{"login":"SEEK-Org","id":22927121,"avatar_url":"https://avatars.githubusercontent.com/u/22927121?v=3","gravatar_id":"","url":"https://api.github.com/users/SEEK-Org","html_url":"https://github.com/SEEK-Org","followers_url":"https://api.github.com/users/SEEK-Org/followers","following_url":"https://api.github.com/users/SEEK-Org/following{/other_user}","gists_url":"https://api.github.com/users/SEEK-Org/gists{/gist_id}","starred_url":"https://api.github.com/users/SEEK-Org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SEEK-Org/subscriptions","organizations_url":"https://api.github.com/users/SEEK-Org/orgs","repos_url":"https://api.github.com/users/SEEK-Org/repos","events_url":"https://api.github.com/users/SEEK-Org/events{/privacy}","received_events_url":"https://api.github.com/users/SEEK-Org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SEEK-Org/evaporate","description":"Evaporate is a convention-based, simple CloudFormation Stack deployment tool.","fork":false,"url":"https://api.github.com/repos/SEEK-Org/evaporate","forks_url":"https://api.github.com/repos/SEEK-Org/evaporate/forks","keys_url":"https://api.github.com/repos/SEEK-Org/evaporate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SEEK-Org/evaporate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SEEK-Org/evaporate/teams","hooks_url":"https://api.github.com/repos/SEEK-Org/evaporate/hooks","issue_events_url":"https://api.github.com/repos/SEEK-Org/evaporate/issues/events{/number}","events_url":"https://api.github.com/repos/SEEK-Org/evaporate/events","assignees_url":"https://api.github.com/repos/SEEK-Org/evaporate/assignees{/user}","branches_url":"https://api.github.com/repos/SEEK-Org/evaporate/branches{/branch}","tags_url":"https://api.github.com/repos/SEEK-Org/evaporate/tags","blobs_url":"https://api.github.com/repos/SEEK-Org/evaporate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SEEK-Org/evaporate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SEEK-Org/evaporate/git/refs{/sha}","trees_url":"https://api.github.com/repos/SEEK-Org/evaporate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SEEK-Org/evaporate/statuses/{sha}","languages_url":"https://api.github.com/repos/SEEK-Org/evaporate/languages","stargazers_url":"https://api.github.com/repos/SEEK-Org/evaporate/stargazers","contributors_url":"https://api.github.com/repos/SEEK-Org/evaporate/contributors","subscribers_url":"https://api.github.com/repos/SEEK-Org/evaporate/subscribers","subscription_url":"https://api.github.com/repos/SEEK-Org/evaporate/subscription","commits_url":"https://api.github.com/repos/SEEK-Org/evaporate/commits{/sha}","git_commits_url":"https://api.github.com/repos/SEEK-Org/evaporate/git/commits{/sha}","comments_url":"https://api.github.com/repos/SEEK-Org/evaporate/comments{/number}","issue_comment_url":"https://api.github.com/repos/SEEK-Org/evaporate/issues/comments{/number}","contents_url":"https://api.github.com/repos/SEEK-Org/evaporate/contents/{+path}","compare_url":"https://api.github.com/repos/SEEK-Org/evaporate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SEEK-Org/evaporate/merges","archive_url":"https://api.github.com/repos/SEEK-Org/evaporate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SEEK-Org/evaporate/downloads","issues_url":"https://api.github.com/repos/SEEK-Org/evaporate/issues{/number}","pulls_url":"https://api.github.com/repos/SEEK-Org/evaporate/pulls{/number}","milestones_url":"https://api.github.com/repos/SEEK-Org/evaporate/milestones{/number}","notifications_url":"https://api.github.com/repos/SEEK-Org/evaporate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SEEK-Org/evaporate/labels{/name}","releases_url":"https://api.github.com/repos/SEEK-Org/evaporate/releases{/id}","deployments_url":"https://api.github.com/repos/SEEK-Org/evaporate/deployments","created_at":"2016-12-05T03:49:01Z","updated_at":"2016-12-05T12:49:37Z","pushed_at":"2016-12-13T03:11:39Z","git_url":"git://github.com/SEEK-Org/evaporate.git","ssh_url":"git@github.com:SEEK-Org/evaporate.git","clone_url":"https://github.com/SEEK-Org/evaporate.git","svn_url":"https://github.com/SEEK-Org/evaporate","homepage":null,"size":123,"stargazers_count":1,"watchers_count":1,"language":"Haskell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":10,"forks":2,"open_issues":10,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SEEK-Org/evaporate/pulls/10"},"html":{"href":"https://github.com/SEEK-Org/evaporate/pull/10"},"issue":{"href":"https://api.github.com/repos/SEEK-Org/evaporate/issues/10"},"comments":{"href":"https://api.github.com/repos/SEEK-Org/evaporate/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/SEEK-Org/evaporate/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/SEEK-Org/evaporate/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SEEK-Org/evaporate/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/SEEK-Org/evaporate/statuses/0879d6cc0551c2028876f1714f81a70f1dc4bb99"}}}}
{"actor":{"display_login":"screamish"}}