From c10d3aa1089f63fa7590f3ff51930c5288fb529c Mon Sep 17 00:00:00 2001 From: Jakub Kadlcik Date: Fri, 4 Jul 2025 11:12:37 +0200 Subject: [PATCH] copr-be: add link to Pulp content for a given project Fix https://github.com/fedora-copr/copr/issues/3448 The only downside is that there IMHO isn't any way of distinguishing if a given project stores results in Pulp or not and therefore the link will be shown to all projects. If you think it will be confusing for users, we can merge once the majority of Copr projects uses Pulp. --- .../backend/templates/lighttpd/dir-generator.php.j2 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/roles/copr/backend/templates/lighttpd/dir-generator.php.j2 b/roles/copr/backend/templates/lighttpd/dir-generator.php.j2 index f70047015b..1f7fc0bd85 100755 --- a/roles/copr/backend/templates/lighttpd/dir-generator.php.j2 +++ b/roles/copr/backend/templates/lighttpd/dir-generator.php.j2 @@ -260,6 +260,7 @@ foreach($filelist as $file) { $frontend_baseurl = '{{ frontend_base_url }}'; +$pulp_baseurl = '{{ pulp_content_url }}'; $path = explode('/', $_SERVER['REQUEST_URI']); if (count($path) >= 7) { $owner = preg_replace('/^(@|%40)(.*)$/', 'g/$2', $path[2]); @@ -267,14 +268,20 @@ 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_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_url_text = 'Go to Pulp results for this project'; } else { $frontend_url = $frontend_baseurl; $frontend_url_text = 'Go to COPR frontend'; + $pulp_url = $pulp_baseurl; + $pulp_url_text = 'Go to Pulp'; } // Print ending stuff @@ -282,7 +289,10 @@ print "
Lighttpd Enhanced Directory Listing Script
-
".$frontend_url_text."
+
+ ".$frontend_url_text." | + ".$pulp_url_text." +