Skip to content

Commit

Permalink
[GITLAB] don't fail, if no new coverage condition is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
tisoft committed Feb 12, 2020
1 parent 3e64c23 commit 32b060c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ public void decorateQualityGateStatus(AnalysisDetails analysis, AlmSettingDto al
}
}

QualityGate.Condition newCoverageCondition = analysis.findQualityGateCondition(CoreMetrics.NEW_COVERAGE_KEY)
.orElseThrow(() -> new IllegalStateException("Could not find New Coverage Condition in analysis"));
String coverageValue = newCoverageCondition.getStatus().equals(QualityGate.EvaluationStatus.NO_VALUE) ? "0" : newCoverageCondition.getValue();

String coverageValue = analysis.findQualityGateCondition(CoreMetrics.NEW_COVERAGE_KEY)
.filter(condition -> condition.getStatus() != QualityGate.EvaluationStatus.NO_VALUE)
.map(QualityGate.Condition::getValue)
.orElse("0");

List<PostAnalysisIssueVisitor.ComponentIssue> openIssues = analysis.getPostAnalysisIssueVisitor().getIssues().stream().filter(i -> OPEN_ISSUE_STATUSES.contains(i.getIssue().getStatus())).collect(Collectors.toList());

Expand Down

0 comments on commit 32b060c

Please sign in to comment.