-
Notifications
You must be signed in to change notification settings - Fork 127
gitbase/repository_pool: change repository to be an interface #384
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
gitbase/repository_pool: change repository to be an interface #384
Conversation
Why do we need to add billy repositories to gitbase? IMHO, testing some more filesystem errors might not be worth introducing all this exclusively for testing. |
@erizocosmico moved |
fs_error_test.go
Outdated
} | ||
|
||
var brokenFS billy.Filesystem | ||
if brokenType == 0 { |
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.
what's 0? do we need a const for this?
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.
It means no broken flags, I've just added a constant.
What I mean is: do we really benefit from making Repository an interface and the complexity this comes with just to test some FS errors? |
Even if we don't add more types of repositories and move to other ways to test errors (maybe fixtures with broken packfiles) I still think it makes sense. It puts the different logic for siva and git repos in one place instead of different code paths in other parts: https://github.com/src-d/gitbase/pull/384/files#diff-b7e4ef15e429a4c21afc4a8822b635beL129 |
Also add billyRepo for billy filesystems Signed-off-by: Javi Fontan <jfontan@gmail.com>
Signed-off-by: Javi Fontan <jfontan@gmail.com>
Also delete leftover from previous implementation Signed-off-by: Javi Fontan <jfontan@gmail.com>
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.
@jfontan rebase and LGTM
@ajnavarro I've just rebased |
Also add
billyRepo
for billy filesystems.I'm not totally happy with the naming of
repository
interface as there's already aRepository
structure and all thegitRepository
/gitRepo
for struct and constructor. Suggestions welcome.