public interface SonarQualityGateService
Created by Vandeperre Maarten on 30/04/2016.
| Modifier and Type | Field and Description |
|---|---|
static java.time.format.DateTimeFormatter |
DATE_TIME_FORMATTER |
| Modifier and Type | Method and Description |
|---|---|
String |
composeSonarProjectKey(org.apache.maven.project.MavenProject project,
String projectKey,
String branchName)
Compose the project key used by SONAR based on the project key and an optional branch name.
|
java.time.LocalDateTime |
getLastRunTimeStamp(org.sonar.wsclient.SonarClient client,
String projectKey,
String qualityGateName)
Get the timestamp of the last sonar run.
|
void |
linkQualityGateToProject(org.sonar.wsclient.SonarClient client,
String projectKey,
String qualityGateName)
Link the given the given quality gate (i.e.
|
default void |
validateQualityGate(org.sonar.wsclient.SonarClient client,
String projectKey,
String qualityGateName)
Validate if the quality gate linked to the given project is passed.
|
void |
validateQualityGate(org.sonar.wsclient.SonarClient client,
String projectKey,
String qualityGateName,
java.time.LocalDateTime executionStart,
int secondsToWait)
Validate if the quality gate linked to the given project is passed.
|
static final java.time.format.DateTimeFormatter DATE_TIME_FORMATTER
default void validateQualityGate(org.sonar.wsclient.SonarClient client,
String projectKey,
String qualityGateName)
throws SonarQualityException
client, - the SONAR configuration.projectKey, - the identifier of the project (e.g. groupId:ArtifactId:branchId).qualityGateName, - the name of the quality gate.SonarQualityException - will be thrown when the given project doesn't pass the linked quality gate.void validateQualityGate(org.sonar.wsclient.SonarClient client,
String projectKey,
String qualityGateName,
java.time.LocalDateTime executionStart,
int secondsToWait)
throws SonarQualityException
client, - the SONAR configuration.projectKey, - the identifier of the project (e.g. groupId:ArtifactId:branchId).qualityGateName, - the name of the quality gate.executionStart, - a timestamp before the sonar validation run started (e.g. the last run timestamp).secondsToWait, - the interval that you will wait before going in a timeout (default set tot DEFAULT_WAIT_INTERVAL).
(this is the time that you will wait until the last run timestamp of the given sonar run is after the executionStart.
It will only be taken into account when the executionStart argument is passed and ignored when it's null.SonarQualityException - will be thrown when the given project doesn't pass the linked quality gate.void linkQualityGateToProject(org.sonar.wsclient.SonarClient client,
String projectKey,
String qualityGateName)
throws SonarQualityException
client, - the SONAR configuration.projectKey, - the identifier of the project (e.g. groupId:ArtifactId:branchId).qualityGateName, - the name of the quality gate to linkSonarQualityException - will be thrown when something goes wrong while linking the quality gate to the project.java.time.LocalDateTime getLastRunTimeStamp(org.sonar.wsclient.SonarClient client,
String projectKey,
String qualityGateName)
throws SonarQualityException
client, - the SONAR configuration.projectKey, - the identifier of the project (e.g. groupId:ArtifactId:branchId).qualityGateName, - the name of the quality gate.SonarQualityException - will be thrown when something goes wrong while fetching the last run timestamp.String composeSonarProjectKey(org.apache.maven.project.MavenProject project, String projectKey, String branchName)
projectKey, - the sonar project.projectKey, - the key of the project (i.e. groupId:artifactId).branchName, - the branchName (optional)Copyright © 2016. All rights reserved.