Skip to content

Commit

Permalink
Remove blacklist code
Browse files Browse the repository at this point in the history
  • Loading branch information
zentol committed Feb 15, 2022
1 parent 9c4262a commit f0fea46
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions src/main/java/com/ververica/CiReport.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.EnumSet;
Expand All @@ -37,9 +33,6 @@ public class CiReport {

private static final Logger LOG = LoggerFactory.getLogger(CiReport.class);

private static final Path COMMIT_BLACK_LIST_PATH = Paths.get("commit_blacklist.txt");
private static Collection<String> commitBlackList = Collections.emptyList();

@Deprecated
private static final String REGEX_GROUP_COMMIT_HASH = "CommitHash";
@Deprecated
Expand Down Expand Up @@ -122,8 +115,6 @@ public static CiReport empty(int pullRequestID) {
}

public static CiReport fromComment(int pullRequestID, String comment, CiActionsLookup ciActionsLookup) {
loadCommitBlackList();

final Map<String, Build> builds = new LinkedHashMap<>();

final Matcher reportMatcher = REGEX_PATTERN_CI_REPORT.matcher(comment);
Expand Down Expand Up @@ -162,9 +153,7 @@ public static CiReport fromComment(int pullRequestID, String comment, CiActionsL
}
}

metaData.getMetaDataEntries().stream()
.filter(metaDataEntry -> !commitBlackList.contains(metaDataEntry.hash))
.forEach(metaDataEntry -> {
metaData.getMetaDataEntries().forEach(metaDataEntry -> {
final String commitHash = metaDataEntry.getHash();
final GitHubCheckerStatus.State state = metaDataEntry.getStatus();
final String url = metaDataEntry.url;
Expand Down Expand Up @@ -261,16 +250,6 @@ public int getPullRequestID() {
return pullRequestID;
}

private static void loadCommitBlackList() {
if (Files.exists(COMMIT_BLACK_LIST_PATH)) {
try {
commitBlackList = Files.readAllLines(COMMIT_BLACK_LIST_PATH);
} catch (IOException e) {
LOG.warn("Could not read commit blacklist.", e);
}
}
}

@Override
public String toString() {
return String.format(TEMPLATE_CI_REPORT, createMetaDataSection(), createUserDataSection());
Expand Down

0 comments on commit f0fea46

Please sign in to comment.