OneDev is an open source git hosting and CI/CD server. Unlike traditional code hosting platforms, it parses C# code to enable symbol search and navigation, both in source view and diff view:
The latest version also adds the ability to suggest CI/CD job templates for .net projects, as well as analyzing TRX formatted unit test report, coverlet coverage report and roslynator code analysis report to annotate source and pull request diff to facilitate code review.
Letโs test with a real project to demonstrate it:
-
First start up OneDev server with a one-liner on a Linux machine with docker installed:
docker run -it - rm -v $(pwd)/onedev:/opt/onedev -v /var/run/docker.sock:/var/run/docker.sock -p 6610:6610 1dev/server:9.1.5
-
Access http:localhost:6610 to set up the server, and then import a repository like below:
Specify url as https:github.com/bitwarden/server, and proceed with import with all others remain as default. After a while, we will see two projects get imported, respectively bitwarden, and bitwarden/server
-
Navigate to project bitwarden/server and click the link adding .onedev-buildspec.yml to set up CI/CD like below:
OneDev under the hood checks if the project root contains dotnet solution file, and suggest a dotnet ci job if it exists. You may further tune the job to meet your requirement. For this demo project, we simply commit the change without any modification and the CI job will be running.
-
We can open the running build, and check its log like below:
-
The job takes some time. After it finishes, we will see three new tabs summarizing unit tests, code coverages, and code problems:
From the reports, you may drill down problems to source view directly
-
When open source files in OneDev, coverage info and code problems will be displayed, and you can even comment the code problems to discuss with author:
This also works for diff view in pull request, and is especially useful when review the change. Thatโs all. Thanks for watching.
Top comments (0)