Project Quality Dashboard (Grafana, Sonar and Gitlab)

Architecture Diagram

Scheduler

REST API

Sonar Connector

HttpConnector connector = getHttpConnector();
WsClient wsClient = WsClientFactories.getDefault().newClient(connector);
SearchMyProjectsRequest projectSearchRequest = new SearchMyProjectsRequest();
projectSearchRequest = projectSearchRequest.setPs("10");
Projects.SearchMyProjectsWsResponse response = wsClient.projects().searchMyProjects(projectSearchRequest);
response.getProjectsCount();

log.info("Configured response page size.. {}", response.getPaging().getPageSize());

response.getProjectsList().forEach(project -> {
try {
projectService
.create(ProjectEntity
.builder()
.description(project.getDescription())
.createdDate(new Date())
.key(project.getKey())
.name(project.getName())
.isActive(false)
.build());
} catch (RunTimeException e) {
log.error("unable able to parse the incoming response..", e);
}
});

Gitlab Connector

GitLabApi gitLabApi = new GitLabApi(url, token);
try {
String name = p.getKey().substring(p.getKey().indexOf(":") + 1);
log.info("Making Gitlab call for project {}", name);
gitLabApi.getProjectApi().getProjects(name).forEach(project -> {
try {
gitLabApi.getRepositoryApi().getContributors(project.getId()).forEach( contributor->{

});
gitLabApi.getPipelineApi().getPipelines(project.getId(), 10).first().forEach(pipeline -> {
pipelineService
.create(PipelineEntity
.builder()
.id(pipeline.getSha())
.key(p.getKey())
.status(pipeline.getStatus().name())
.finishedDate(
pipeline.getFinishedAt() == null ? pipeline.getUpdatedAt() : pipeline.getFinishedAt())
.build());
});
;
} catch (GitLabApiException e) {
log.error("Error while fetching pipeline data.. ", e);
}
});
} catch (GitLabApiException e) {
log.error("Error while fetching group data.. ", e);
}

Scheduler

Dashboard

Dashboard

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Level Design in Unity 3D Part 5: Doors and Details

Personalized Pools for Market Makers

Taxa Developer Grant Program

Holidays are coming: Let Monika monitor your websites for you

Tabibitosan for Consecutive SQL problems

Automate your job search process with Python

Python — Variables

How It Felt To Be A Google Code-in Mentor

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
arun pandey

arun pandey

More from Medium

How to Dockerize Spring Boot and MongoDB Project using Microservice Architecture?

Identity Management with AWS Cognito in SpringBoot Application.

Spring Security, Powered by MSAL Part 2 (Resource Server)

Spring boot Initializr