本文整理汇总了Java中org.eclipse.egit.github.core.service.IssueService.createComment方法的典型用法代码示例。如果您正苦于以下问题:Java IssueService.createComment方法的具体用法?Java IssueService.createComment怎么用?Java IssueService.createComment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.egit.github.core.service.IssueService
的用法示例。
在下文中一共展示了IssueService.createComment方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createObviousFixCommentIfNecessary
import org.eclipse.egit.github.core.service.IssueService; //导入方法依赖的package包/类
/**
* Add a "disarming" comment.
* @param pullRequestId
* @param userMentionMarkdown
* @param issues
* @param claUserComments
* @throws IOException
*/
private void createObviousFixCommentIfNecessary(PullRequestId pullRequestId, String userMentionMarkdown,
IssueService issues, List<Comment> claUserComments) throws IOException {
// only if not already present and if a comment says "please sign the CLA"
if (claUserComments.stream().anyMatch(c -> c.getBody().contains(PLEASE_SIGN))
&& !claUserComments.stream().anyMatch(c -> c.getBody().contains(OBVIOUS_FIX_CLA_NOT_REQUIRED))) {
if (claUserComments.stream().anyMatch(c -> c.getBody().contains(THANK_YOU))) {
return;
}
String claNotRequiredBody = String.format("%s %s", userMentionMarkdown, OBVIOUS_FIX_CLA_NOT_REQUIRED);
issues.createComment(pullRequestId.getRepositoryId(), pullRequestId.getId(), claNotRequiredBody);
}
}
示例2: commentPullRequest
import org.eclipse.egit.github.core.service.IssueService; //导入方法依赖的package包/类
/**
* Adds comment to provided pull request.
*
* @param owner of repository
* @param pullRequest pull request owner
* @param comment message
* @return created remote comment
*/
public Comment commentPullRequest(String owner, String repositoryName, PullRequest pullRequest, String comment)
{
RepositoryContext bySlug = repositoryBySlug.get(getSlug(owner, repositoryName));
IssueService issueService = new IssueService(getGitHubClient(owner));
try
{
return issueService.createComment(bySlug.repository,
pullRequest.getIssueUrl().substring(pullRequest.getIssueUrl().lastIndexOf('/') + 1), comment);
}
catch (IOException e)
{
throw new RuntimeException(e);
}
}
示例3: closeReviewIssue
import org.eclipse.egit.github.core.service.IssueService; //导入方法依赖的package包/类
static void closeReviewIssue(GitHubClient client, Repo repo, String reviewer, String comment) throws IOException {
IssueService issueService = new IssueService(client);
for(Issue issue : issueService.getIssues(repo.repoOwner, repo.repoName, null)) {
if(issue.getAssignee() != null) {
if(issue.getTitle().startsWith("Reviewer - ") && issue.getAssignee().getLogin().equals(reviewer)) {
issueService.createComment(repo.repoOwner, repo.repoName, issue.getNumber(), comment);
issue.setState("closed");
issueService.editIssue(repo.repoOwner, repo.repoName, issue);
}
}
}
}
示例4: updateIssue
import org.eclipse.egit.github.core.service.IssueService; //导入方法依赖的package包/类
private void updateIssue(Repo repo, PdfComment comment, IssueService issueService)
throws IOException {
System.out.println("Looking for "+repo.repoOwner+'/'+repo.repoName);
Issue issue = issueService.getIssue(repo.repoOwner, repo.repoName, comment.getIssueNumber());
String issueText = comment.getComment();
if(!issue.getBody().equals(issueText)) {
// makes a comment if the text has changed
issueService.createComment(repo.repoOwner, repo.repoName, comment.getIssueNumber(), issueText);
}
List<Label> existingLabels = issue.getLabels();
List<Label> labels = new ArrayList<>();
for(Tag tag : comment.getTags()) {
Label l = new Label();
l.setName(tag.name());
labels.add(l);
}
boolean shouldUpdateLabels = labels.size() != existingLabels.size();
if(!shouldUpdateLabels) {
for(Label l1 : labels) {
shouldUpdateLabels = true;
for(Label l2 : existingLabels) {
if(l1.getName().equals(l2.getName())) {
shouldUpdateLabels = false;
break;
}
}
if(shouldUpdateLabels)
break;
}
}
if(shouldUpdateLabels) {
issue.setLabels(labels);
issueService.editIssue(repo.repoOwner, repo.repoName, issue);
}
}