-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve and expose fetchRepos
/fetchReposRaw
#41
Improve and expose fetchRepos
/fetchReposRaw
#41
Conversation
306dfac
to
9ecd1ba
Compare
fetchRepos
/fetchReposRaw
fetchRepos
/fetchReposRaw
9ecd1ba
to
9bbcdb1
Compare
fetchRepos
/fetchReposRaw
fetchRepos
/fetchReposRaw
One thing this doesn't solve is this: if you add a new subdirectory to an exising git extra-dep, it will have to clone once more. I'm not sure if there's a way around that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The overall logic looks really solid, impressive work here given your first work on this code base, thank you! I've left some comments inline.
9bbcdb1
to
fc7de76
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, one minor comment for consideration. I'm OK merging as is though, so let me know whether you think that change is worth it or not. If not, I'll merge/release in the current state.
src/Pantry/Repo.hs
Outdated
where | ||
withCache inner = do | ||
pkgs <- forM aRepoSubdirs $ \(subdir, rpm) -> withStorage $ do | ||
loadRepoCache (Repo aRepoUrl aRepoCommit aRepoType subdir) subdir >>= \case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
-- | Repository without subdirectory information. | ||
-- | ||
-- @since 0.5.3 | ||
data SimpleRepo = SimpleRepo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
src/Pantry/Types.hs
Outdated
rToSimpleRepo Repo {..} = SimpleRepo { sRepoUrl = repoUrl, sRepoCommit = repoCommit, sRepoType = repoType } | ||
|
||
data AggregateRepo = AggregateRepo | ||
{ aRepoUrl :: !Text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a strong recommendation, but what about using SimpleRepo
here instead of duplicating the fields?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll give it a shot
68e989e
to
60ca785
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@snoyberg thanks, the next step would be the actual stack PR that calls |
Necessary for commercialhaskell/stack#5411
Please review this carefully. I don't understand most of pantry, but this seemed like the right place to inject and my manual tests succeeded.
Stack will then run
fetchReposRaw
at a specific place for pre-fetching. So we don't really change existing API.