use of com.atlassian.stash.comment.Comment in project stashbot by palantir.
the class PullRequestListener method listenForComments.
@EventListener
public void listenForComments(PullRequestCommentEvent event) {
try {
final PullRequest pr = event.getPullRequest();
final Repository repo = pr.getToRef().getRepository();
final RepositoryConfiguration rc = cpm.getRepositoryConfigurationForRepository(repo);
if (!rc.getCiEnabled()) {
log.debug("Pull Request " + pr.toString() + " ignored, CI not enabled for target repo " + repo.toString());
return;
}
Comment c = event.getComment();
if (c.getText().contains(OVERRIDE_STRING)) {
log.debug("Pull Request override set to true for PR " + pr.toString());
cpm.setPullRequestMetadata(pr, null, null, true);
}
} catch (SQLException e) {
log.error("Error getting repository configuration", e);
}
}
Aggregations