copr-be: fix Pulp URLs for group projects like @copr/copr-dev

This commit is contained in:
Jakub Kadlcik
2025-09-22 16:56:58 +02:00
parent dee027c3e5
commit 234d1c955f

View File

@@ -268,14 +268,16 @@ if (count($path) >= 7) {
$buildid = ltrim(explode('-', $path[5])[0], '0');
$frontend_url = implode('/', [$frontend_baseurl, 'coprs', $owner, $project, 'build', $buildid]);
$frontend_url_text = 'Go to COPR frontend build';
$pulp_url = implode('/', [$pulp_baseurl, $owner, $project]);
$pulp_owner = $path[2];
$pulp_url = implode('/', [$pulp_baseurl, $pulp_owner, $project]);
$pulp_url_text = 'Go to Pulp results for this project';
} else if (count($path) >= 5) {
$owner = preg_replace('/^(@|%40)(.*)$/', 'g/$2', $path[2]);
$project = $path[3];
$frontend_url = implode('/', [$frontend_baseurl, 'coprs', $owner, $project]);
$frontend_url_text = 'Go to COPR frontend project';
$pulp_url = implode('/', [$pulp_baseurl, $owner, $project]);
$pulp_owner = $path[2];
$pulp_url = implode('/', [$pulp_baseurl, $pulp_owner, $project]);
$pulp_url_text = 'Go to Pulp results for this project';
} else {
$frontend_url = $frontend_baseurl;