Add Gitlab webhook

This commit is contained in:
Frédéric Guillot
2014-12-28 22:22:15 -05:00
parent d6530bd55f
commit 5266b82144
36 changed files with 597 additions and 58 deletions

View File

@@ -2,7 +2,8 @@
namespace Action;
use Model\GithubWebhook;
use Integration\GitlabWebhook;
use Integration\GithubWebhook;
use Model\Task;
/**
@@ -25,6 +26,8 @@ class TaskClose extends Base
Task::EVENT_MOVE_COLUMN,
GithubWebhook::EVENT_COMMIT,
GithubWebhook::EVENT_ISSUE_CLOSED,
GitlabWebhook::EVENT_COMMIT,
GitlabWebhook::EVENT_ISSUE_CLOSED,
);
}
@@ -39,6 +42,8 @@ class TaskClose extends Base
switch ($this->event_name) {
case GithubWebhook::EVENT_COMMIT:
case GithubWebhook::EVENT_ISSUE_CLOSED:
case GitlabWebhook::EVENT_COMMIT:
case GitlabWebhook::EVENT_ISSUE_CLOSED:
return array();
default:
return array('column_id' => t('Column'));
@@ -56,6 +61,8 @@ class TaskClose extends Base
switch ($this->event_name) {
case GithubWebhook::EVENT_COMMIT:
case GithubWebhook::EVENT_ISSUE_CLOSED:
case GitlabWebhook::EVENT_COMMIT:
case GitlabWebhook::EVENT_ISSUE_CLOSED:
return array('task_id');
default:
return array('task_id', 'column_id');
@@ -86,6 +93,8 @@ class TaskClose extends Base
switch ($this->event_name) {
case GithubWebhook::EVENT_COMMIT:
case GithubWebhook::EVENT_ISSUE_CLOSED:
case GitlabWebhook::EVENT_COMMIT:
case GitlabWebhook::EVENT_ISSUE_CLOSED:
return true;
default:
return $data['column_id'] == $this->getParam('column_id');