if (detectedVendors.size() == 1) {
CiVendor vendor = detectedVendors.get(0);
- LOG.info("Detected {}", vendor.getName());
+ LOG.info("Auto-configuring with CI '{}'", vendor.getName());
return vendor.loadConfiguration();
}
return new EmptyCiConfiguration();
import static org.apache.commons.lang.StringUtils.isNotBlank;
public class Jenkins implements CiVendor {
- private final static Logger log = Loggers.get(Jenkins.class);
+ private static final Logger LOG = Loggers.get(Jenkins.class);
private final System2 system;
private final DefaultInputProject inputProject;
return ref.getObjectId().getName();
}
} catch (Exception e) {
- log.debug("Couldn't find git sha1 in '{}': {}", refName, e.getMessage());
+ LOG.debug("Couldn't find git sha1 in '{}': {}", refName, e.getMessage());
}
return null;
}
private void addScmInformation(ScannerReport.Metadata.Builder builder) {
try {
- scmRevision.get().ifPresent(builder::setScmRevisionId);
+ scmRevision.get().ifPresent(revisionId -> {
+ LOG.debug("SCM revision ID '{}'", revisionId);
+ builder.setScmRevisionId(revisionId);
+ });
} catch (UnsupportedOperationException e) {
LOG.debug(e.getMessage());
}
.execute();
assertThat(logTester.logs()).contains("1 file indexed");
- assertThat(logTester.logs()).contains("'src" + File.separator + "sample.unknown' indexed with language 'null'");
+ assertThat(logTester.logs()).contains("'src" + File.separator + "sample.unknown' indexed with no language");
assertThat(logTester.logs()).contains("'src/sample.unknown' generated metadata with charset 'UTF-8'");
DefaultInputFile inputFile = (DefaultInputFile) result.inputFile("src/sample.unknown");
assertThat(result.getReportComponent(inputFile)).isNotNull();
.build())
.execute();
- assertThat(logTester.logs()).containsOnlyOnce("'src" + File.separator + "myfile.binary' indexed with language 'null'");
+ assertThat(logTester.logs()).containsOnlyOnce("'src" + File.separator + "myfile.binary' indexed with no language");
assertThat(logTester.logs()).doesNotContain("Evaluate issue exclusions for 'src/myfile.binary'");
assertThat(logTester.logs()).containsOnlyOnce("Evaluate issue exclusions for 'src/sample.xoo'");
}