From: Michael Tremer Date: Fri, 12 May 2023 22:49:07 +0000 (+0000) Subject: builds: Show which repository a build is in X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3aff0b4763cf40f5d589a3a45cd01caeeed6c30b;p=pbs.git builds: Show which repository a build is in Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/repository.py b/src/buildservice/repository.py index 5ab73ed3..2c57dcae 100644 --- a/src/buildservice/repository.py +++ b/src/buildservice/repository.py @@ -563,6 +563,24 @@ class Repository(base.DataObject): return list(builds) + def get_added_at_for_build(self, build): + res = self.db.get(""" + SELECT + added_at + FROM + repository_builds + WHERE + repository_builds.repo_id = %s + AND + repository_builds.build_id = %s + AND + repository_builds.removed_at IS NULL + """, self.id, build, + ) + + if res: + return res.added_at + @lazy_property def total_builds(self): res = self.db.get(""" diff --git a/src/templates/builds/show.html b/src/templates/builds/show.html index babb3d97..1b2e6e5a 100644 --- a/src/templates/builds/show.html +++ b/src/templates/builds/show.html @@ -130,6 +130,8 @@ {% if build.jobs %}
+
{{ _("Jobs")}}
+ {% module JobsList(build.jobs, show_arch_only=True, show_packages=True) %}
@@ -156,6 +158,25 @@ {% end %} + {# Repos #} + {% if build.repos %} +
+
+
{{ _("Repositories") }}
+ + {% module ReposList(build.repos, build=build) %} + + {% if current_user == build.owner %} + + {% end %} +
+
+ {% end %} + {# Log #}
diff --git a/src/templates/repos/modules/list.html b/src/templates/repos/modules/list.html index 3a1f6f9b..3ce2f2ca 100644 --- a/src/templates/repos/modules/list.html +++ b/src/templates/repos/modules/list.html @@ -1,9 +1,34 @@ -{% for repo in repos %} -
-
-
- {{ repo }} -
-
-
-{% end %} + diff --git a/src/web/repos.py b/src/web/repos.py index 06782e30..a9bae9c7 100644 --- a/src/web/repos.py +++ b/src/web/repos.py @@ -192,5 +192,5 @@ class MirrorlistHandler(BaseHandler): class ListModule(ui_modules.UIModule): - def render(self, repos): - return self.render_string("repos/modules/list.html", repos=repos) + def render(self, repos, build=None): + return self.render_string("repos/modules/list.html", repos=repos, build=build)