Skip to content

Commit a91abc6

Browse files
committed
Feature: Ability to disable BadWordChecker (as a slowest one) via env "BWC=disable" variable.
Fix: return references to CodeCoverage metrics and Opened PR's
1 parent d4b909c commit a91abc6

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

src/main/java/com/github/exadmin/ostm/collectors/impl/repos/devops/BadWordsChecker.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ protected TheColumn getColumnToAddValueInto(TheReportModel theReportModel) {
3030

3131
@Override
3232
protected TheCellValue checkOneRepository(GitHubRepository repo, GitHubFacade gitHubFacade, Path repoDirectory) {
33+
if ("disable".equalsIgnoreCase(System.getenv("BWC"))) return new TheCellValue("Disabled", 0, SeverityLevel.WARN);
34+
3335
Map<String, Pattern> badMap = BadWordsManager.getBadMap();
3436

3537
List<String> allFiles = FileUtils.findAllFilesRecursively(repoDirectory.toString(), shortFileName -> {

src/main/java/com/github/exadmin/ostm/collectors/impl/repos/quality/NumberOfOpenedPullRequests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ public TheCellValue getNumberOfOpenedPRs(GitHubRepository repo) {
5353
SeverityLevel severity = count > ERR_IF_PRS_MORE_THAN ? SeverityLevel.ERROR :
5454
count > WARN_IF_PRS_MORE_THAN ? SeverityLevel.WARN : SeverityLevel.OK;
5555

56-
return new TheCellValue(count, count, severity);
56+
return new TheCellValue(count, count, severity)
57+
.withHttpReference("https://github.com/Netcracker/" + repo.getName() + "/pulls");
5758
}
5859
}
5960

src/main/java/com/github/exadmin/ostm/collectors/impl/repos/quality/SonarCodeCoverage.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ public void collectDataInto(TheReportModel theReportModel, GitHubFacade gitHubFa
7474
String component = (String) mData.get("component");
7575

7676
String rowId = componentToRowIdMap.remove(component);
77-
column.addValue(rowId, new TheCellValue(value + "%", value, SeverityLevel.INFO));
77+
column.addValue(rowId,
78+
new TheCellValue(value + "%", value, SeverityLevel.INFO)
79+
.withHttpReference("https://sonarcloud.io/project/overview?id=" + component));
7880
}
7981
}
8082
}
@@ -87,7 +89,9 @@ public void collectDataInto(TheReportModel theReportModel, GitHubFacade gitHubFa
8789

8890
// at this step - componenToRowIdMap contains list of components with absent data
8991
for (Map.Entry<String, String> me : componentToRowIdMap.entrySet()) {
90-
column.addValue(me.getValue(), new TheCellValue("Not Registered", 0, SeverityLevel.ERROR));
92+
column.addValue(me.getValue(),
93+
new TheCellValue("Not Registered", 0, SeverityLevel.ERROR)
94+
.withHttpReference("https://sonarcloud.io/organizations/netcracker/projects"));
9195
}
9296
}
9397
}

0 commit comments

Comments
 (0)