Skip to content

Commit

Permalink
[FEATURE] Add review webhooks (#78)
Browse files Browse the repository at this point in the history
* parse comment in utilities

* Add events for CR

At this stage they do nothing. They should write data on the pull request object

* Also support deleted\edited review comment

* fix all bugs found by testing

* change test now that getPullRequestIdFromEventData behavior have changed
  • Loading branch information
thatkookooguy committed Feb 23, 2017
1 parent 2b5fa29 commit e6128bd
Show file tree
Hide file tree
Showing 4 changed files with 289 additions and 99 deletions.
23 changes: 3 additions & 20 deletions achievibitDB.js
Expand Up @@ -363,13 +363,7 @@ function getExtraPRData(pullRequest, givenCallback) {
var reactionsRequests = [];

_.forEach(comments, function(comment) {
var commentParsed = {
author: utilities.parseUser(comment.user),
message: comment.body,
createdOn: comment.created_at,
edited: !_.isEqual(comment.created_at, comment.updated_at),
apiUrl: comment.url
};
var commentParsed = utilities.parseComment(comment);
pullRequest.comments.push(commentParsed);

reactionsRequests.push(getReactions(commentParsed));
Expand All @@ -395,19 +389,8 @@ function getExtraPRData(pullRequest, givenCallback) {
var reactionsRequests = [];

_.forEach(inlineComments, function(inlineComment) {
var inlineCommentParsed = {
file: inlineComment.path,
author: utilities.parseUser(inlineComment.user),
message: inlineComment.body,
createdOn: inlineComment.created_at,
edited: !_.isEqual(
inlineComment.created_at,
inlineComment.updated_at
),
commit: inlineComment.commit_id,
apiUrl: inlineComment.url

};
var inlineCommentParsed =
utilities.parseComment(inlineComment, true /* isInlineComment */);
pullRequest.inlineComments.push(inlineCommentParsed);
reactionsRequests.push(getReactions(inlineCommentParsed));
});
Expand Down

0 comments on commit e6128bd

Please sign in to comment.