{"action":"created","comment":{"url":"https://api.github.com/repos/commercialhaskell/stack/pulls/comments/241956475","pull_request_review_id":185362312,"id":241956475,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MTk1NjQ3NQ==","diff_hunk":"@@ -387,41 +393,60 @@ parseArchive pli archive fp = do\n             case Map.lookup (seSource se) blobs of\n               Nothing -> error $ \"Impossible: blob not found for: \" ++ seSource se\n               Just blobKey -> pure (sfp, TreeEntry blobKey (seType se))\n-\n           -- parse the cabal file and ensure it has the right name\n-          (cabalPath, cabalEntry@(TreeEntry cabalBlobKey _)) <- findCabalFile pli tree\n+          (cabalPath, cabalEntry@(TreeEntry cabalBlobKey _), btype) <- findCabalOrHpackFile pli tree\n           mbs <- withStorage $ loadBlob cabalBlobKey\n           bs <-\n             case mbs of\n               Nothing -> throwIO $ TreeReferencesMissingBlob pli cabalPath cabalBlobKey\n               Just bs -> pure bs\n-          (_warnings, gpd) <- rawParseGPD (Left pli) bs\n+          cabalBs <- if btype == CabalFile\n+                     then return bs\n+                     else do\n+                       getCabalBS bs\n+          (_warnings, gpd) <- rawParseGPD (Left pli) cabalBs\n           let ident@(PackageIdentifier name _) = package $ packageDescription gpd\n-          when (cabalPath /= cabalFileName name) $\n+          when (cabalPath /= cabalFileName name && btype == CabalFile) $\n             throwIO $ WrongCabalFileName pli cabalPath name\n \n           -- It's good! Store the tree, let's bounce\n-          (_tid, treeKey) <- withStorage $ storeTree ident tree cabalEntry\n+          (_tid, treeKey) <- withStorage $ storeTree ident tree cabalEntry btype\n+          let tentry = if btype == CabalFile\n+                       then PCCabalFile cabalEntry\n+                       else PCHpack cabalEntry\n           pure Package\n             { packageTreeKey = treeKey\n             , packageTree = tree\n-            , packageCabalEntry = cabalEntry\n+            , packageCabalEntry = tentry\n             , packageIdent = ident\n             }\n \n-findCabalFile\n+findCabalOrHpackFile\n   :: MonadThrow m\n   => PackageLocationImmutable -- ^ for exceptions\n   -> Tree\n-  -> m (SafeFilePath, TreeEntry)\n-findCabalFile loc (TreeMap m) = do\n-  let isCabalFile (sfp, _) =\n+  -> m (SafeFilePath, TreeEntry, BuildFileType)\n+findCabalOrHpackFile loc (TreeMap m) = do\n+  let isCabalOrHpackFile (sfp, _) =\n+        let txt = unSafeFilePath sfp\n+         in not (\"/\" `T.isInfixOf` txt) && (\".cabal\" `T.isSuffixOf` txt || \"package.yaml\" == txt)\n+      isCabalFile (sfp, _) =\n         let txt = unSafeFilePath sfp\n-         in not (\"/\" `T.isInfixOf` txt) && \".cabal\" `T.isSuffixOf` txt\n-  case filter isCabalFile $ Map.toList m of\n+         in not (\"/\" `T.isInfixOf` txt) && (\".cabal\" `T.isSuffixOf` txt)\n+      isHpackFile (sfp, _) =\n+        let txt = unSafeFilePath sfp\n+         in not (\"/\" `T.isInfixOf` txt) && (\"package.yaml\" == txt)\n+  case filter isCabalOrHpackFile $ Map.toList m of\n     [] -> throwM $ TreeWithoutCabalFile loc\n-    [(key, te)] -> pure (key, te)\n-    xs -> throwM $ TreeWithMultipleCabalFiles loc $ map fst xs\n+    [v@(key, te)] -> if isHpackFile v\n+                     then pure (key, te, HPackFile)\n+                     else pure (key, te, CabalFile)\n+    xs -> case (filter isCabalFile xs, filter isHpackFile xs) of\n+            ([],[]) -> throwM $ TreeWithoutCabalFile loc\n+            ([(key,te)],_) -> return (key, te, CabalFile)\n+            ([],[(key,te)]) -> return (key, te, HPackFile)","path":"subs/pantry/src/Pantry/Archive.hs","position":null,"original_position":180,"commit_id":"a07b6497e97650c54c88623950148953e482ef11","original_commit_id":"7d9abc673e5ac68ce179c17eacd149ccb006664a","user":{"login":"psibi","id":737477,"node_id":"MDQ6VXNlcjczNzQ3Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/737477?v=4","gravatar_id":"","url":"https://api.github.com/users/psibi","html_url":"https://github.com/psibi","followers_url":"https://api.github.com/users/psibi/followers","following_url":"https://api.github.com/users/psibi/following{/other_user}","gists_url":"https://api.github.com/users/psibi/gists{/gist_id}","starred_url":"https://api.github.com/users/psibi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psibi/subscriptions","organizations_url":"https://api.github.com/users/psibi/orgs","repos_url":"https://api.github.com/users/psibi/repos","events_url":"https://api.github.com/users/psibi/events{/privacy}","received_events_url":"https://api.github.com/users/psibi/received_events","type":"User","site_admin":false},"body":"Fixed it.","created_at":"2018-12-15T18:03:08Z","updated_at":"2018-12-15T18:03:08Z","html_url":"https://github.com/commercialhaskell/stack/pull/4439#discussion_r241956475","pull_request_url":"https://api.github.com/repos/commercialhaskell/stack/pulls/4439","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/commercialhaskell/stack/pulls/comments/241956475"},"html":{"href":"https://github.com/commercialhaskell/stack/pull/4439#discussion_r241956475"},"pull_request":{"href":"https://api.github.com/repos/commercialhaskell/stack/pulls/4439"}},"in_reply_to_id":240508120},"pull_request":{"url":"https://api.github.com/repos/commercialhaskell/stack/pulls/4439","id":237378658,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM3Mzc4NjU4","html_url":"https://github.com/commercialhaskell/stack/pull/4439","diff_url":"https://github.com/commercialhaskell/stack/pull/4439.diff","patch_url":"https://github.com/commercialhaskell/stack/pull/4439.patch","issue_url":"https://api.github.com/repos/commercialhaskell/stack/issues/4439","number":4439,"state":"open","locked":false,"title":"[WIP] Fix Issue 4377 - Allows remote repo without cabal file and with package.yaml work","user":{"login":"psibi","id":737477,"node_id":"MDQ6VXNlcjczNzQ3Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/737477?v=4","gravatar_id":"","url":"https://api.github.com/users/psibi","html_url":"https://github.com/psibi","followers_url":"https://api.github.com/users/psibi/followers","following_url":"https://api.github.com/users/psibi/following{/other_user}","gists_url":"https://api.github.com/users/psibi/gists{/gist_id}","starred_url":"https://api.github.com/users/psibi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psibi/subscriptions","organizations_url":"https://api.github.com/users/psibi/orgs","repos_url":"https://api.github.com/users/psibi/repos","events_url":"https://api.github.com/users/psibi/events{/privacy}","received_events_url":"https://api.github.com/users/psibi/received_events","type":"User","site_admin":false},"body":"Note: Documentation fixes for https://docs.haskellstack.org/en/stable/ should target the \"stable\" branch, not master.\r\n\r\nPlease include the following checklist in your PR:\r\n\r\n* [ ] Any changes that could be relevant to users have been recorded in the ChangeLog.md\r\n* [ ] The documentation has been updated, if necessary.\r\n\r\nPlease also shortly describe how you tested your change. Bonus points for added tests!\r\n","created_at":"2018-12-10T16:15:16Z","updated_at":"2018-12-15T18:03:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2bee718e903c0e6501b3d09a186d51072b619385","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/commercialhaskell/stack/pulls/4439/commits","review_comments_url":"https://api.github.com/repos/commercialhaskell/stack/pulls/4439/comments","review_comment_url":"https://api.github.com/repos/commercialhaskell/stack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/commercialhaskell/stack/issues/4439/comments","statuses_url":"https://api.github.com/repos/commercialhaskell/stack/statuses/a07b6497e97650c54c88623950148953e482ef11","head":{"label":"psibi:issue-4377","ref":"issue-4377","sha":"a07b6497e97650c54c88623950148953e482ef11","user":{"login":"psibi","id":737477,"node_id":"MDQ6VXNlcjczNzQ3Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/737477?v=4","gravatar_id":"","url":"https://api.github.com/users/psibi","html_url":"https://github.com/psibi","followers_url":"https://api.github.com/users/psibi/followers","following_url":"https://api.github.com/users/psibi/following{/other_user}","gists_url":"https://api.github.com/users/psibi/gists{/gist_id}","starred_url":"https://api.github.com/users/psibi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psibi/subscriptions","organizations_url":"https://api.github.com/users/psibi/orgs","repos_url":"https://api.github.com/users/psibi/repos","events_url":"https://api.github.com/users/psibi/events{/privacy}","received_events_url":"https://api.github.com/users/psibi/received_events","type":"User","site_admin":false},"repo":{"id":38039023,"node_id":"MDEwOlJlcG9zaXRvcnkzODAzOTAyMw==","name":"stack","full_name":"psibi/stack","private":false,"owner":{"login":"psibi","id":737477,"node_id":"MDQ6VXNlcjczNzQ3Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/737477?v=4","gravatar_id":"","url":"https://api.github.com/users/psibi","html_url":"https://github.com/psibi","followers_url":"https://api.github.com/users/psibi/followers","following_url":"https://api.github.com/users/psibi/following{/other_user}","gists_url":"https://api.github.com/users/psibi/gists{/gist_id}","starred_url":"https://api.github.com/users/psibi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psibi/subscriptions","organizations_url":"https://api.github.com/users/psibi/orgs","repos_url":"https://api.github.com/users/psibi/repos","events_url":"https://api.github.com/users/psibi/events{/privacy}","received_events_url":"https://api.github.com/users/psibi/received_events","type":"User","site_admin":false},"html_url":"https://github.com/psibi/stack","description":"The Haskell Tool Stack","fork":true,"url":"https://api.github.com/repos/psibi/stack","forks_url":"https://api.github.com/repos/psibi/stack/forks","keys_url":"https://api.github.com/repos/psibi/stack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/psibi/stack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/psibi/stack/teams","hooks_url":"https://api.github.com/repos/psibi/stack/hooks","issue_events_url":"https://api.github.com/repos/psibi/stack/issues/events{/number}","events_url":"https://api.github.com/repos/psibi/stack/events","assignees_url":"https://api.github.com/repos/psibi/stack/assignees{/user}","branches_url":"https://api.github.com/repos/psibi/stack/branches{/branch}","tags_url":"https://api.github.com/repos/psibi/stack/tags","blobs_url":"https://api.github.com/repos/psibi/stack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/psibi/stack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/psibi/stack/git/refs{/sha}","trees_url":"https://api.github.com/repos/psibi/stack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/psibi/stack/statuses/{sha}","languages_url":"https://api.github.com/repos/psibi/stack/languages","stargazers_url":"https://api.github.com/repos/psibi/stack/stargazers","contributors_url":"https://api.github.com/repos/psibi/stack/contributors","subscribers_url":"https://api.github.com/repos/psibi/stack/subscribers","subscription_url":"https://api.github.com/repos/psibi/stack/subscription","commits_url":"https://api.github.com/repos/psibi/stack/commits{/sha}","git_commits_url":"https://api.github.com/repos/psibi/stack/git/commits{/sha}","comments_url":"https://api.github.com/repos/psibi/stack/comments{/number}","issue_comment_url":"https://api.github.com/repos/psibi/stack/issues/comments{/number}","contents_url":"https://api.github.com/repos/psibi/stack/contents/{+path}","compare_url":"https://api.github.com/repos/psibi/stack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/psibi/stack/merges","archive_url":"https://api.github.com/repos/psibi/stack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/psibi/stack/downloads","issues_url":"https://api.github.com/repos/psibi/stack/issues{/number}","pulls_url":"https://api.github.com/repos/psibi/stack/pulls{/number}","milestones_url":"https://api.github.com/repos/psibi/stack/milestones{/number}","notifications_url":"https://api.github.com/repos/psibi/stack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/psibi/stack/labels{/name}","releases_url":"https://api.github.com/repos/psibi/stack/releases{/id}","deployments_url":"https://api.github.com/repos/psibi/stack/deployments","created_at":"2015-06-25T08:58:47Z","updated_at":"2018-11-30T16:46:44Z","pushed_at":"2018-12-15T12:40:04Z","git_url":"git://github.com/psibi/stack.git","ssh_url":"git@github.com:psibi/stack.git","clone_url":"https://github.com/psibi/stack.git","svn_url":"https://github.com/psibi/stack","homepage":"https://www.stackage.org/","size":14944,"stargazers_count":1,"watchers_count":1,"language":"Haskell","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"commercialhaskell:master","ref":"master","sha":"8c29d445aab82fdb8ed805662115ec79ac95b9a6","user":{"login":"commercialhaskell","id":10633049,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNjMzMDQ5","avatar_url":"https://avatars1.githubusercontent.com/u/10633049?v=4","gravatar_id":"","url":"https://api.github.com/users/commercialhaskell","html_url":"https://github.com/commercialhaskell","followers_url":"https://api.github.com/users/commercialhaskell/followers","following_url":"https://api.github.com/users/commercialhaskell/following{/other_user}","gists_url":"https://api.github.com/users/commercialhaskell/gists{/gist_id}","starred_url":"https://api.github.com/users/commercialhaskell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercialhaskell/subscriptions","organizations_url":"https://api.github.com/users/commercialhaskell/orgs","repos_url":"https://api.github.com/users/commercialhaskell/repos","events_url":"https://api.github.com/users/commercialhaskell/events{/privacy}","received_events_url":"https://api.github.com/users/commercialhaskell/received_events","type":"Organization","site_admin":false},"repo":{"id":34817922,"node_id":"MDEwOlJlcG9zaXRvcnkzNDgxNzkyMg==","name":"stack","full_name":"commercialhaskell/stack","private":false,"owner":{"login":"commercialhaskell","id":10633049,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNjMzMDQ5","avatar_url":"https://avatars1.githubusercontent.com/u/10633049?v=4","gravatar_id":"","url":"https://api.github.com/users/commercialhaskell","html_url":"https://github.com/commercialhaskell","followers_url":"https://api.github.com/users/commercialhaskell/followers","following_url":"https://api.github.com/users/commercialhaskell/following{/other_user}","gists_url":"https://api.github.com/users/commercialhaskell/gists{/gist_id}","starred_url":"https://api.github.com/users/commercialhaskell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercialhaskell/subscriptions","organizations_url":"https://api.github.com/users/commercialhaskell/orgs","repos_url":"https://api.github.com/users/commercialhaskell/repos","events_url":"https://api.github.com/users/commercialhaskell/events{/privacy}","received_events_url":"https://api.github.com/users/commercialhaskell/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/commercialhaskell/stack","description":"The Haskell Tool Stack","fork":false,"url":"https://api.github.com/repos/commercialhaskell/stack","forks_url":"https://api.github.com/repos/commercialhaskell/stack/forks","keys_url":"https://api.github.com/repos/commercialhaskell/stack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/commercialhaskell/stack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/commercialhaskell/stack/teams","hooks_url":"https://api.github.com/repos/commercialhaskell/stack/hooks","issue_events_url":"https://api.github.com/repos/commercialhaskell/stack/issues/events{/number}","events_url":"https://api.github.com/repos/commercialhaskell/stack/events","assignees_url":"https://api.github.com/repos/commercialhaskell/stack/assignees{/user}","branches_url":"https://api.github.com/repos/commercialhaskell/stack/branches{/branch}","tags_url":"https://api.github.com/repos/commercialhaskell/stack/tags","blobs_url":"https://api.github.com/repos/commercialhaskell/stack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/commercialhaskell/stack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/commercialhaskell/stack/git/refs{/sha}","trees_url":"https://api.github.com/repos/commercialhaskell/stack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/commercialhaskell/stack/statuses/{sha}","languages_url":"https://api.github.com/repos/commercialhaskell/stack/languages","stargazers_url":"https://api.github.com/repos/commercialhaskell/stack/stargazers","contributors_url":"https://api.github.com/repos/commercialhaskell/stack/contributors","subscribers_url":"https://api.github.com/repos/commercialhaskell/stack/subscribers","subscription_url":"https://api.github.com/repos/commercialhaskell/stack/subscription","commits_url":"https://api.github.com/repos/commercialhaskell/stack/commits{/sha}","git_commits_url":"https://api.github.com/repos/commercialhaskell/stack/git/commits{/sha}","comments_url":"https://api.github.com/repos/commercialhaskell/stack/comments{/number}","issue_comment_url":"https://api.github.com/repos/commercialhaskell/stack/issues/comments{/number}","contents_url":"https://api.github.com/repos/commercialhaskell/stack/contents/{+path}","compare_url":"https://api.github.com/repos/commercialhaskell/stack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/commercialhaskell/stack/merges","archive_url":"https://api.github.com/repos/commercialhaskell/stack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/commercialhaskell/stack/downloads","issues_url":"https://api.github.com/repos/commercialhaskell/stack/issues{/number}","pulls_url":"https://api.github.com/repos/commercialhaskell/stack/pulls{/number}","milestones_url":"https://api.github.com/repos/commercialhaskell/stack/milestones{/number}","notifications_url":"https://api.github.com/repos/commercialhaskell/stack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/commercialhaskell/stack/labels{/name}","releases_url":"https://api.github.com/repos/commercialhaskell/stack/releases{/id}","deployments_url":"https://api.github.com/repos/commercialhaskell/stack/deployments","created_at":"2015-04-29T20:56:42Z","updated_at":"2018-12-15T17:21:20Z","pushed_at":"2018-12-15T12:40:06Z","git_url":"git://github.com/commercialhaskell/stack.git","ssh_url":"git@github.com:commercialhaskell/stack.git","clone_url":"https://github.com/commercialhaskell/stack.git","svn_url":"https://github.com/commercialhaskell/stack","homepage":"http://haskellstack.org","size":15190,"stargazers_count":2928,"watchers_count":2928,"language":"Haskell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":659,"mirror_url":null,"archived":false,"open_issues_count":816,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":659,"open_issues":816,"watchers":2928,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/commercialhaskell/stack/pulls/4439"},"html":{"href":"https://github.com/commercialhaskell/stack/pull/4439"},"issue":{"href":"https://api.github.com/repos/commercialhaskell/stack/issues/4439"},"comments":{"href":"https://api.github.com/repos/commercialhaskell/stack/issues/4439/comments"},"review_comments":{"href":"https://api.github.com/repos/commercialhaskell/stack/pulls/4439/comments"},"review_comment":{"href":"https://api.github.com/repos/commercialhaskell/stack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/commercialhaskell/stack/pulls/4439/commits"},"statuses":{"href":"https://api.github.com/repos/commercialhaskell/stack/statuses/a07b6497e97650c54c88623950148953e482ef11"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"psibi"}}