Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Commit

Permalink
#442 save wip
Browse files Browse the repository at this point in the history
  • Loading branch information
prayerslayer committed Dec 6, 2016
1 parent b220359 commit 3664905
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 10 additions & 2 deletions server/checks/Approval.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default class Approval extends Check {
static TYPE = 'approval'
static CONTEXT = context
static NAME = 'Approval check'
static HOOK_EVENTS = [EVENTS.PULL_REQUEST, EVENTS.ISSUE_COMMENT]
static HOOK_EVENTS = [EVENTS.PULL_REQUEST, EVENTS.ISSUE_COMMENT, EVENTS.PULL_REQUEST_REVIEW]

/**
* @param {GithubService} github
Expand Down Expand Up @@ -232,7 +232,7 @@ export default class Approval extends Check {

const approvals = (config.from || config.groups) ?
await this.getCommentStatsForConfig(repository, potentialApprovalComments, config, token) :
{total: potentialApprovalComments.map(c => c.user)}
{total: potentialApprovalComments.map(c => c.user)}


let vetos = []
Expand Down Expand Up @@ -493,6 +493,14 @@ export default class Approval extends Check {
}
info(`${repository.full_name}#${issue.number}: Comment added`)
await this.fetchApprovalsAndSetStatus(repository, pr, dbPR.last_push, config, token, frozenComments)
} else if (event === EVENTS.PULL_REQUEST_REVIEW) {
// native pr review was submitted
const {review} = hookPayload
if (action !== 'submitted') {
//TODO log something?
return
}

}
}
catch (e) {
Expand Down
4 changes: 4 additions & 0 deletions server/model/GithubEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,7 @@ export const TEAM_ADD = 'team_add'
* Any time a User stars a Repository.
*/
export const WATCH = 'watch'
/**
* Triggered when a pull request review is submitted into a non-pending state.
*/
export const PULL_REQUEST_REVIEW = 'pull_request_review'

0 comments on commit 3664905

Please sign in to comment.