当前位置: 首页>>代码示例>>Java>>正文


Java GHPullRequestReviewComment类代码示例

本文整理汇总了Java中org.kohsuke.github.GHPullRequestReviewComment的典型用法代码示例。如果您正苦于以下问题:Java GHPullRequestReviewComment类的具体用法?Java GHPullRequestReviewComment怎么用?Java GHPullRequestReviewComment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GHPullRequestReviewComment类属于org.kohsuke.github包,在下文中一共展示了GHPullRequestReviewComment类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createOrUpdateReviewComment

import org.kohsuke.github.GHPullRequestReviewComment; //导入依赖的package包/类
public void createOrUpdateReviewComment(InputFile inputFile, Integer line, String body) {
  String fullpath = getPath(inputFile);
  Integer lineInPatch = patchPositionMappingByFile.get(fullpath).get(line);
  try {
    if (existingReviewCommentsByLocationByFile.containsKey(fullpath) && existingReviewCommentsByLocationByFile.get(fullpath).containsKey(lineInPatch)) {
      GHPullRequestReviewComment existingReview = existingReviewCommentsByLocationByFile.get(fullpath).get(lineInPatch);
      if (!existingReview.getBody().equals(body)) {
        existingReview.update(body);
      }
      reviewCommentToBeDeletedById.remove(existingReview.getId());
    } else {
      pr.createReviewComment(body, pr.getHead().getSha(), fullpath, lineInPatch);
    }
  } catch (IOException e) {
    throw new IllegalStateException("Unable to create or update review comment in file " + fullpath + " at line " + line, e);
  }

}
 
开发者ID:SonarSource,项目名称:sonar-github,代码行数:19,代码来源:PullRequestFacade.java

示例2: loadExistingReviewComments

import org.kohsuke.github.GHPullRequestReviewComment; //导入依赖的package包/类
/**
 * Load all previous comments made by provided github account.
 */
private void loadExistingReviewComments() throws IOException {
  for (GHPullRequestReviewComment comment : pr.listReviewComments()) {
    if (!myself.equals(comment.getUser().getLogin())) {
      // Ignore comments from other users
      continue;
    }
    if (!existingReviewCommentsByLocationByFile.containsKey(comment.getPath())) {
      existingReviewCommentsByLocationByFile.put(comment.getPath(), new HashMap<Integer, GHPullRequestReviewComment>());
    }
    // By default all previous comments will be marked for deletion
    reviewCommentToBeDeletedById.put(comment.getId(), comment);
    existingReviewCommentsByLocationByFile.get(comment.getPath()).put(comment.getPosition(), comment);
  }
}
 
开发者ID:SonarSource,项目名称:sonar-github,代码行数:18,代码来源:PullRequestFacade.java

示例3: deleteOutdatedComments

import org.kohsuke.github.GHPullRequestReviewComment; //导入依赖的package包/类
public void deleteOutdatedComments() {
  for (GHPullRequestReviewComment reviewToDelete : reviewCommentToBeDeletedById.values()) {
    try {
      reviewToDelete.delete();
    } catch (IOException e) {
      throw new IllegalStateException("Unable to delete review comment with id " + reviewToDelete.getId(), e);
    }
  }
}
 
开发者ID:SonarSource,项目名称:sonar-github,代码行数:10,代码来源:PullRequestFacade.java

示例4: makeComment

import org.kohsuke.github.GHPullRequestReviewComment; //导入依赖的package包/类
private void makeComment(final PagedIterable<GHPullRequestReviewComment> allReviewComments, final PrintStream logger, final GHPullRequest pullRequest, final LineComment comment) throws IOException {
    final GHPullRequestReviewComment existingComment = Iterables.find(allReviewComments, new Predicate<GHPullRequestReviewComment>() {
        @Override
        public boolean apply(final GHPullRequestReviewComment reviewComment) {
            return comment.isSameAs(reviewComment);
        }
    }, null);
    if (existingComment == null) {
        logger.println("Commenting on " + comment.line.getLineNo() + " at Pos: " + comment.line.getPos());
        pullRequest.createReviewComment(comment.comment, pullRequest.getHead().getSha(), comment.fileName, comment.line.getPos());
    }
}
 
开发者ID:groupon,项目名称:DotCi-Plugins-Starter-Pack,代码行数:13,代码来源:AnalysisCollectorPluginAdapter.java

示例5: isSameAs

import org.kohsuke.github.GHPullRequestReviewComment; //导入依赖的package包/类
public boolean isSameAs(final GHPullRequestReviewComment reviewComment) {
    return reviewComment.getPosition() == this.line.getPos()
            && this.comment.equals(reviewComment.getBody())
            && this.fileName.equals(reviewComment.getPath());
}
 
开发者ID:groupon,项目名称:DotCi-Plugins-Starter-Pack,代码行数:6,代码来源:AnalysisCollectorPluginAdapter.java


注:本文中的org.kohsuke.github.GHPullRequestReviewComment类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。