Use web URLs for Gitlab support metadata (#10377)
parent
54123e4093
commit
f0060b7f56
|
@ -163,8 +163,12 @@ class GitLabDriver extends VcsDriver
|
||||||
|
|
||||||
if ($composer) {
|
if ($composer) {
|
||||||
// specials for gitlab (this data is only available if authentication is provided)
|
// specials for gitlab (this data is only available if authentication is provided)
|
||||||
if (!isset($composer['support']['issues']) && isset($this->project['_links']['issues'])) {
|
if (!isset($composer['support']['source']) && isset($this->project['web_url'])) {
|
||||||
$composer['support']['issues'] = $this->project['_links']['issues'];
|
$label = array_search($identifier, $this->getTags(), true) ?: array_search($identifier, $this->getBranches(), true) ?: $identifier;
|
||||||
|
$composer['support']['source'] = sprintf('%s/-/tree/%s', $this->project['web_url'], $label);
|
||||||
|
}
|
||||||
|
if (!isset($composer['support']['issues']) && !empty($this->project['issues_enabled']) && isset($this->project['web_url'])) {
|
||||||
|
$composer['support']['issues'] = sprintf('%s/-/issues', $this->project['web_url']);
|
||||||
}
|
}
|
||||||
if (!isset($composer['abandoned']) && !empty($this->project['archived'])) {
|
if (!isset($composer['abandoned']) && !empty($this->project['archived'])) {
|
||||||
$composer['abandoned'] = true;
|
$composer['abandoned'] = true;
|
||||||
|
|
|
@ -95,6 +95,8 @@ class GitLabDriverTest extends TestCase
|
||||||
"id": 17,
|
"id": 17,
|
||||||
"default_branch": "mymaster",
|
"default_branch": "mymaster",
|
||||||
"visibility": "private",
|
"visibility": "private",
|
||||||
|
"issues_enabled": true,
|
||||||
|
"archived": false,
|
||||||
"http_url_to_repo": "https://gitlab.com/mygroup/myproject.git",
|
"http_url_to_repo": "https://gitlab.com/mygroup/myproject.git",
|
||||||
"ssh_url_to_repo": "git@gitlab.com:mygroup/myproject.git",
|
"ssh_url_to_repo": "git@gitlab.com:mygroup/myproject.git",
|
||||||
"last_activity_at": "2014-12-01T09:17:51.000+01:00",
|
"last_activity_at": "2014-12-01T09:17:51.000+01:00",
|
||||||
|
|
Loading…
Reference in New Issue