Closed lvlcn-t closed 3 months ago
I discussed whether we should merge this now with @lvlcn-t. We decided that it's best to leave this out-of-scope for now, as it is not required currently and to make future changes easier. We will keep the code around in case we need to implement the git integration later on
I'll still address your reviews. After the PR would be ready to merge I'll close it, and move the branch into my fork so it won't be accidentally deleted. Additional to that I'll close the issue as not planned for now and label it with out-of-scope
.
Motivation
We currently only support gitlab as remote registration backend through its API. This should change to support all git based repositories. For more information on that please refer to the issue.
Closes #66
Changes
I've introduced a new remote interactor type, that is able to perform our defined interactor interfaces' actions on any git repository. Currently the git interactor is only able to communicate via HTTP, but that could be changed in a future PR if a user needs ssh communication.
As you've already seen with my last two PRs regarding the issue, I've tried to do it as simple as possible so I hope the code is easy to understand. 😅 I'm also sorry that it's still ~1,5k lines changed but I think that was inevitable.
For additional information look at the commits.
Tests done
I've provided unit tests for the interactor. To do that I've done several things like hiding the remote interactions (Clone, Pull, Push) behind an interface so we can mock it and setup a
repomock
package that sets up a new local repository where the local git interactions are performed. I've consciously decided not to hide the whole go-git library behind an interface because it'd not bring us that much more benefit, but if you think we should still be able to test error cases of local git actions then we'd need to create an interface for it.Manual e2e tests
Config
Logs
Remote Git Repository
You can find the commit history of the repository here.
TODO