getAnalysis().map(a -> a.getDate().getTime()).orElse(system2.now()),
ScannerContextImpl.from(reportReader.readContextProperties()),
status == SUCCESS ? createQualityGate() : null,
- createBranch());
+ createBranch(),
+ reportReader.readMetadata().getScmRevisionId()
+ );
}
@CheckForNull
private final Branch branch;
@Nullable
private final Analysis analysis;
+ private final String scmRevisionId;
private ProjectAnalysisImpl(@Nullable Organization organization, CeTask ceTask, Project project,
@Nullable Analysis analysis, long date,
- ScannerContext scannerContext, @Nullable QualityGate qualityGate, @Nullable Branch branch) {
+ ScannerContext scannerContext, @Nullable QualityGate qualityGate, @Nullable Branch branch, String scmRevisionId) {
this.organization = organization;
this.ceTask = requireNonNull(ceTask, "ceTask can not be null");
this.project = requireNonNull(project, "project can not be null");
this.scannerContext = requireNonNull(scannerContext, "scannerContext can not be null");
this.qualityGate = qualityGate;
this.branch = branch;
+ this.scmRevisionId = scmRevisionId;
}
@Override
return scannerContext;
}
+ @Override
+ public String getScmRevisionId() {
+ return scmRevisionId;
+ }
+
@Override
public String toString() {
return "ProjectAnalysis{" +