mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-01 22:35:21 +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
|
class GitlabIssueBridge extends BridgeAbstract
|
||||||
{
|
{
|
||||||
const MAINTAINER = 'Mynacol';
|
const MAINTAINER = 'Mynacol';
|
||||||
const NAME = 'Gitlab Issue/Merge Request';
|
const NAME = 'Gitlab Issue/Merge Request/Epic';
|
||||||
const URI = 'https://gitlab.com/';
|
const URI = 'https://gitlab.com/';
|
||||||
const CACHE_TIMEOUT = 1800; // 30min
|
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 = [
|
const PARAMETERS = [
|
||||||
'global' => [
|
'global' => [
|
||||||
|
@ -43,6 +43,14 @@ class GitlabIssueBridge extends BridgeAbstract
|
||||||
'exampleValue' => '2099',
|
'exampleValue' => '2099',
|
||||||
'required' => true
|
'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':
|
case 'Merge Request comments':
|
||||||
$name .= ' MR !' . $this->getInput('i');
|
$name .= ' MR !' . $this->getInput('i');
|
||||||
break;
|
break;
|
||||||
|
case 'Epic comments':
|
||||||
|
$name .= ' Epic &' . $this->getInput('i');
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return parent::getName();
|
return parent::getName();
|
||||||
}
|
}
|
||||||
|
@ -74,6 +85,9 @@ class GitlabIssueBridge extends BridgeAbstract
|
||||||
case 'Merge Request comments':
|
case 'Merge Request comments':
|
||||||
$uri .= '-/merge_requests';
|
$uri .= '-/merge_requests';
|
||||||
break;
|
break;
|
||||||
|
case 'Epic comments':
|
||||||
|
$uri .= '-/epics';
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return $uri;
|
return $uri;
|
||||||
}
|
}
|
||||||
|
@ -107,8 +121,10 @@ class GitlabIssueBridge extends BridgeAbstract
|
||||||
foreach ($comments as $value) {
|
foreach ($comments as $value) {
|
||||||
foreach ($value->notes as $comment) {
|
foreach ($value->notes as $comment) {
|
||||||
$item = [];
|
$item = [];
|
||||||
$item['uri'] = $comment->noteable_note_url;
|
if ($comment->noteable_note_url !== null) {
|
||||||
$item['uid'] = $item['uri'];
|
$item['uri'] = $comment->noteable_note_url;
|
||||||
|
$item['uid'] = $item['uri'];
|
||||||
|
}
|
||||||
|
|
||||||
// TODO fix invalid timestamps (fdroid bot)
|
// TODO fix invalid timestamps (fdroid bot)
|
||||||
$item['timestamp'] = $comment->created_at ?? $comment->updated_at ?? $comment->last_edited_at;
|
$item['timestamp'] = $comment->created_at ?? $comment->updated_at ?? $comment->last_edited_at;
|
||||||
|
|
Loading…
Add table
Reference in a new issue