-
Notifications
You must be signed in to change notification settings - Fork 654
Feature/di #1861
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
Feature/di #1861
Conversation
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 whole-heartedly condone and applaud the changes you're doing here, @arturcic! 🎉 👏 ❤️
I just have a few questions and comments made inline. I also wonder whether with all the refactoring you're doing here, there might be an opportunity to move code from GitVersionExe
and GitVersionTask
into GitVersionCore
in order to tackle #883?
I think you meant |
a03bf5f
to
2788e4d
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.
I think this looks great. The only thing I oppose is your wish to use Autofac as the DI Container. I wouldn't mind that much if the DI Container integration was made plugin-based so different containers could be used, but if we need to add a dependency to a DI Container, I think Microsoft's own would be the most non-controversial choice. Thoughts?
Correct.
Ok. |
To be honest I was thinking of Autofac because I have used it before, and also Cake-Build team is using it. I think we can use the DI from the .net core generic host https://docs.microsoft.com/en-us/aspnet/core/fundamentals/host/generic-host?view=aspnetcore-3.0. Or you mean something else? |
c7c6ec6
to
b3312b7
Compare
Add ConsoleAppender, GitVersionApplication, extracted some interfaces
Add TestLogAppender
Add IConfigFileLocator
Are these changes so massive that they warrant a new major bump? |
It's more a cleanup/refactor than big changes. There are no major breaking changes. There is only one important change, but backward compatible for now. The |
This change was made to avoid the confusion between verbosity and loglevel. Now the LogLevel is used for the type of the log - Warn, Info and so on, and Verbosity for how verbose the log output is. |
and I think we can already merge this, I have a pending draft PR based on this PR that introduce the DI container that you suggested, and I will need some feedback on that one |
Excellent. Great work! |
Refactored code to prepare the addition of DI to improve the modularity/testability.
Some of the changes introduced:
This changes will allow gradually to introduce a DI (Autofac) so that we can later on split in modules some of the functionalities we currently support as addins/plugins call them whatever you want.
The GitVersion itself will just take as input the arguments and return as output the GitVersion information that later can be consumed by these plugins.
Example of plugins could be: