Skip to content
Snippets Groups Projects
Commit 8957b259 authored by joel.vonderwe's avatar joel.vonderwe
Browse files

Add allowSonarFailure

parent d15be9b1
Branches
No related tags found
No related merge requests found
...@@ -301,12 +301,17 @@ class AssignmentValidator { ...@@ -301,12 +301,17 @@ class AssignmentValidator {
const runSuccess = SonarAnalyzer.runAnalysis(assignment.sonarKey, assignment.language, assignmentFile.buildLine); const runSuccess = SonarAnalyzer.runAnalysis(assignment.sonarKey, assignment.language, assignmentFile.buildLine);
if ( runSuccess ) { if ( runSuccess ) {
this.emitError(`Sonar gate failed`, 'Sonar analysis failure', AssignmentCheckerError.SONAR_ANALYSIS_FAILED); if ( !assignment.allowSonarFailure ) {
return; this.emitError(`Sonar gate failed`, 'Sonar analysis failure', AssignmentCheckerError.SONAR_ANALYSIS_FAILED);
return;
} else {
this.endSubStep('Sonar gate failed, you should check the sonar project', false);
}
} else {
this.endSubStep('Sonar gate passed', false);
} }
this.endSubStep('Sonar gate passed', false);
this.endStep('Sonar analysis success', false); this.endStep('Sonar analysis finished', false);
} }
......
...@@ -13,6 +13,7 @@ interface Assignment { ...@@ -13,6 +13,7 @@ interface Assignment {
gitlabLastInfoDate: string; gitlabLastInfoDate: string;
published: boolean; published: boolean;
useSonar: boolean; useSonar: boolean;
allowSonarFailure: boolean;
sonarKey: string; sonarKey: string;
sonarCreationInfo: SonarProjectCreation; sonarCreationInfo: SonarProjectCreation;
language: Language; language: Language;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment