Skip to content
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

Create a proper BaseRepo backend which is API agnostic. Make Gitlab an implementation. #95

Closed
brhoades opened this issue Jan 19, 2018 · 3 comments · Fixed by #102
Closed
Milestone

Comments

@brhoades
Copy link
Member

brhoades commented Jan 19, 2018

Edit:
In baserepo.py, there are three primary classes: BaseRepo, Repo, and StudentRepo. Those three classes form a backend for interfacing with Gitlab.

Let's make BaseRepo an abstract base of Repo and house it in backends/base.py. Additionally, let's add BaseStudentRepo which is a BaseRepo that's an abstract base for StudentRepo. We can also define the BaseBackend in this file which is an abstract base for a backend. BaseBackend, for now, will contain generically named class variables (such as student_repo and repo) so that assigner commands can be agnostic of the backend. Later this backend can do more fancy stuff.

Our current Repo and StudentRepo can then be implementations of BaseRepo and BaseStudentRepo respectively. They can be housed in backends/gitlab.py. A new GitlabBackend (BaseBackend) will also need to be created.

@LinuxMercedes
Copy link
Member

Frankly, we really ought to split the GitLab and Git parts of BaseRepo...at the very least, I will make a helper GitLab module because #87 will also need to hit the GitLab API without a "repository" associated.

@LinuxMercedes LinuxMercedes added this to the Quality Code milestone Jan 19, 2018
@brhoades
Copy link
Member Author

brhoades commented Jan 19, 2018

I agree, BaseRepo has too much meat.

brhoades added a commit that referenced this issue Jan 23, 2018
* Added travis config file.

* Added pylint to requirements. Fixed travis call.

* Resolved most pylint errors.

* StudentRepo.name -> StudentRepo.build_name

name was being shadowed by an instance var.

* Removed FIXME for something that was fixed, created #95 for the other.

* Small changes after a second pass.

* Updated changelog.

* Updated changelog (again).

* Restored ={} default params, split changelog.

* Added pylint ignore for ={}, cleaned up unused params.

* Added requirements.txt information to CONTRIBUTING.

* Passing params that were unused through in baserepo, updated changelog.

Made dangerous-default-args a warning again.
@brhoades brhoades changed the title Repo.get_user_id should be housed elsewhere Create a proper BaseRepo backend which is API agnostic. Make Gitlab an implementation. Jan 23, 2018
@brhoades
Copy link
Member Author

@LinuxMercedes changed the scope of this issue. Seems pretty doable. Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants