mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-22 09:35:28 +03:00
[GitlabIssueBridge] Add support for GitLab Epics
This commit is contained in:
parent
0325c2414a
commit
18a8a51271
1 changed files with 20 additions and 4 deletions
|
@ -3,10 +3,10 @@
|
|||
class GitlabIssueBridge extends BridgeAbstract
|
||||
{
|
||||
const MAINTAINER = 'Mynacol';
|
||||
const NAME = 'Gitlab Issue/Merge Request';
|
||||
const NAME = 'Gitlab Issue/Merge Request/Epic';
|
||||
const URI = 'https://gitlab.com/';
|
||||
const CACHE_TIMEOUT = 1800; // 30min
|
||||
const DESCRIPTION = 'Returns comments of an issue/MR of a gitlab project';
|
||||
const DESCRIPTION = 'Returns comments of an issue/MR/Epic of a gitlab project';
|
||||
|
||||
const PARAMETERS = [
|
||||
'global' => [
|
||||
|
@ -43,6 +43,14 @@ class GitlabIssueBridge extends BridgeAbstract
|
|||
'exampleValue' => '2099',
|
||||
'required' => true
|
||||
]
|
||||
],
|
||||
'Epic comments' => [
|
||||
'i' => [
|
||||
'name' => 'Epic number',
|
||||
'type' => 'number',
|
||||
'exampleValue' => '2099',
|
||||
'required' => true
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
|
@ -56,6 +64,9 @@ class GitlabIssueBridge extends BridgeAbstract
|
|||
case 'Merge Request comments':
|
||||
$name .= ' MR !' . $this->getInput('i');
|
||||
break;
|
||||
case 'Epic comments':
|
||||
$name .= ' Epic &' . $this->getInput('i');
|
||||
break;
|
||||
default:
|
||||
return parent::getName();
|
||||
}
|
||||
|
@ -74,6 +85,9 @@ class GitlabIssueBridge extends BridgeAbstract
|
|||
case 'Merge Request comments':
|
||||
$uri .= '-/merge_requests';
|
||||
break;
|
||||
case 'Epic comments':
|
||||
$uri .= '-/epics';
|
||||
break;
|
||||
default:
|
||||
return $uri;
|
||||
}
|
||||
|
@ -107,8 +121,10 @@ class GitlabIssueBridge extends BridgeAbstract
|
|||
foreach ($comments as $value) {
|
||||
foreach ($value->notes as $comment) {
|
||||
$item = [];
|
||||
if ($comment->noteable_note_url !== null) {
|
||||
$item['uri'] = $comment->noteable_note_url;
|
||||
$item['uid'] = $item['uri'];
|
||||
}
|
||||
|
||||
// TODO fix invalid timestamps (fdroid bot)
|
||||
$item['timestamp'] = $comment->created_at ?? $comment->updated_at ?? $comment->last_edited_at;
|
||||
|
|
Loading…
Reference in a new issue