Repository :
http://git.fedorahosted.org/cgit/copr.git
On branch : new
---------------------------------------------------------------
commit 3b75ef02f36b96b5976354a145422ad3248cafe6
Author: Richard Marko <rmarko(a)fedoraproject.org>
Date: Tue Jan 21 13:46:25 2014 +0100
[frontend] allow resubmitting builds from monitor
Signed-off-by: Richard Marko <rmarko(a)fedoraproject.org>
---------------------------------------------------------------
.../coprs/templates/coprs/detail/monitor.html | 13 +++++++++++--
.../coprs/views/coprs_ns/coprs_general.py | 6 +++---
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/coprs_frontend/coprs/templates/coprs/detail/monitor.html
b/coprs_frontend/coprs/templates/coprs/detail/monitor.html
index dea1c1c..a2d9ab6 100644
--- a/coprs_frontend/coprs/templates/coprs/detail/monitor.html
+++ b/coprs_frontend/coprs/templates/coprs/detail/monitor.html
@@ -20,8 +20,17 @@
{% for package, states in packages %}
<tr>
<td>{{ package }}</td>
- {% for state in states %}
- <td class="centered build-{{ state }}">{{ state
}}</td>
+ {% for build_id, state in states %}
+ <td class="centered build-{{ state }}">
+ {% if state %}
+ {{ state }}
+ {% else %}
+ <a href="{{ url_for('coprs_ns.copr_repeat_build',
+ username=copr.owner.name,
+ coprname=copr.name,
+ build_id=build_id) }}">resubmit</a>
+ {% endif %}
+ </td>
{% endfor %}
</tr>
{% endfor %}
diff --git a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
index c103401..21705b9 100644
--- a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
+++ b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
@@ -368,7 +368,7 @@ def copr_build_monitor(username, coprname):
# the only reason why this is necessary is non-existent
# database design
#
- # loop goes through last 50 builds trying to approximate
+ # loop goes through builds trying to approximate
# per-package results based on previous builds
# - it can't determine build results if build contains
# more than one package as this data is not available
@@ -391,9 +391,9 @@ def copr_build_monitor(username, coprname):
build_results = []
for chroot_name in chroots:
if chroot_name in chroot_results:
- build_results.append(chroot_results[chroot_name])
+ build_results.append((build.id, chroot_results[chroot_name]))
else:
- build_results.append('not submitted yet')
+ build_results.append((build.id, None))
for pkg_url in build.pkgs.split():
pkg = os.path.basename(pkg_url)