Architecture overview
Introduction
This document does not describe the modules of SCM-Manager nor does it explain the technologies that are used. It simply shows which application layers exist in the SCM-Manager and how they are connected.
Technology stack
Overview
SCM-Manager is mainly written in Java and Typescript. In the chart below the core technologies are listed. Self-written libraries like "spotter", our annotation processor or ui-components are not included in this overview. They are kinda part of the product instead of own technologies/libraries.
Integrations
Internal and external integrations
Integration is one main feature of SCM-Manager as we support different kinds of integrations to optimize workflows. The important point is that integration should not be built directly to SCM-Manager core but most parts are outsourced to plugins.
CI Integration Example
As you can see besides the SCM-Manager core we have several plugins which manage the communication between each other and the external systems.
To prevent confusion it should be clarified that we actually have two different Jenkins plugins.
The first one which runs on the SCM-Manager server, and the second one named Jenkins-SCM-Manager-Plugin
which is a Jenkins plugin.
The following shows the general flow, where a Jenkins build is triggered by a change of a pull request and the result of the build is sent back to the SCM-Manager:
- The
Review plugin
notifies theJenkins plugin
as a new pull request was created. - The
Jenkins plugin
sends a build notification to theJenkins-SCM-Manager-Plugin
which is installed on the Jenkins Server. - The
Jenkins-SCM-Manager-Plugin
processes the build notification and creates a new build job for our pull request. - As soon as the build is finished, the
Jenkins-SCM-Manager-Plugin
checks for the build result. - The build result is reported to the
CI plugin
. This is required to show the CI status on the pull request in SCM-Manager. - During the Jenkins build an external Sonar analysis was triggered.
- After the analysis is done, Sonar reports the results to the
Sonar plugin
. - Finally, the
Sonar plugin
processes the analysis results and creates a related CI status via theCI plugin
.
Front to Back
Frontend
SCM-Manager has a modern UI which is built with React. The frontend is detached from the server and communicates mainly over REST requests with the SCM server.
REST Layer
The REST layer of SCM-Manager is built with maturity level 3 and also uses HATEOAS. This means the data output can be enriched with links and embedded data. The links are enriched based on the permissions the user has, and the functionality which is available. SCM-Manager uses this pattern to show the ui elements in the frontend based on which links exist on the data object.
Service Layer
The service layer is the middle part in the backend, so to speak. After the server receives a request, the REST layer invokes some kind of service. The service layer consists largely of the business logic.
Repository Command Layer
One of the main services is the repository service. Underneath this special service the repository command api layer is located. This service provides an abstract api that version control systems like Git, Mercurial and Subversion can implement. The repository service gets initialized for a specific repository and uses the concrete command implementation for the repository type. A typical repository command can be given a specific request object if needed, which is built beforehand using the builder pattern.
DAO Layer
SCM-Manager provides a DAO (data access object) layer to persist data like users or the repository metadata.
Store Layer
For data persistence beneath the DAO layer, the store layer should be used. Different types of stores can persist data globally or repository specific.
Examples
Fetch all repositories
One of the main pages in SCM-Manager is the repository overview. To show all available repositories the following actions in frontend and backend are executed.
Create new branch
Another core function of SCM-Manager is to create new branches using the Web UI. Creating a new branch over the SCM-Manager UI would lead to the following actions. The SCM-Manager Subversion API does not support the branch and branches commands, so this feature is not available for Subversion repositories.