From patchwork Fri Oct 21 00:47:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zygmunt Krynicki X-Patchwork-Id: 4765 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id DE9BD23E03 for ; Fri, 21 Oct 2011 00:47:15 +0000 (UTC) Received: from mail-bw0-f52.google.com (mail-bw0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id C8121A1822B for ; Fri, 21 Oct 2011 00:47:15 +0000 (UTC) Received: by bkbzs2 with SMTP id zs2so5881470bkb.11 for ; Thu, 20 Oct 2011 17:47:15 -0700 (PDT) Received: by 10.223.77.69 with SMTP id f5mr21403429fak.3.1319158035416; Thu, 20 Oct 2011 17:47:15 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.1.71 with SMTP id 7cs143574lak; Thu, 20 Oct 2011 17:47:15 -0700 (PDT) Received: by 10.227.24.1 with SMTP id t1mr4636920wbb.107.1319158034248; Thu, 20 Oct 2011 17:47:14 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id em13si8344235wbb.92.2011.10.20.17.47.14 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Oct 2011 17:47:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1RH3GT-0007CD-MD for ; Fri, 21 Oct 2011 00:47:13 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 9D2CDFB81B for ; Fri, 21 Oct 2011 00:47:13 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-dashboard X-Launchpad-Branch: ~linaro-validation/lava-dashboard/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 274 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dashboard/trunk] Rev 274: Merge next tree Message-Id: <20111021004713.12879.76811.launchpad@ackee.canonical.com> Date: Fri, 21 Oct 2011 00:47:13 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14165"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 39a6c8c32ea5fa16f025c4b2387792c1ac065a14 Merge authors: Zygmunt Krynicki (zkrynicki) Related merge proposals: https://code.launchpad.net/~linaro-validation/lava-dashboard/next/+merge/79399 proposed by: Zygmunt Krynicki (zkrynicki) ------------------------------------------------------------ revno: 274 [merge] committer: Zygmunt Krynicki branch nick: lava-dashboard timestamp: Thu 2011-10-20 14:55:26 +0200 message: Merge next tree added: dashboard_app/static/css/dashboard.css modified: dashboard_app/extension.py dashboard_app/models.py dashboard_app/repositories/__init__.py dashboard_app/repositories/data_report.py dashboard_app/templates/dashboard_app/_extrahead.html dashboard_app/templates/dashboard_app/front_page_snippet.html dashboard_app/templates/dashboard_app/image_status_detail.html --- lp:lava-dashboard https://code.launchpad.net/~linaro-validation/lava-dashboard/trunk You are subscribed to branch lp:lava-dashboard. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dashboard/trunk/+edit-subscription === modified file 'dashboard_app/extension.py' --- dashboard_app/extension.py 2011-09-30 13:43:50 +0000 +++ dashboard_app/extension.py 2011-10-13 11:56:10 +0000 @@ -39,6 +39,12 @@ def front_page_template(self): return "dashboard_app/front_page_snippet.html" + def get_front_page_context(self): + from dashboard_app.models import DataReport + return { + 'report_list': DataReport.repository.filter(front_page=True) + } + @property def description(self): return "Validation Dashboard" @@ -56,10 +62,7 @@ def contribute_to_settings(self, settings_module): super(DashboardExtension, self).contribute_to_settings(settings_module) - settings_module['INSTALLED_APPS'].extend([ - "linaro_django_pagination", - "south", - ]) + settings_module['INSTALLED_APPS'].append("linaro_django_pagination") settings_module['MIDDLEWARE_CLASSES'].append( 'linaro_django_pagination.middleware.PaginationMiddleware') root_dir = os.path.normpath(os.path.join(os.path.dirname(__file__), "..")) === modified file 'dashboard_app/models.py' --- dashboard_app/models.py 2011-09-28 02:35:22 +0000 +++ dashboard_app/models.py 2011-10-13 11:55:44 +0000 @@ -1276,6 +1276,10 @@ def author(self): return self._data.get('author') + @property + def front_page(self): + return self._data['front_page'] + class ImageHealth(object): @@ -1332,6 +1336,10 @@ since = until - datetime.timedelta(days=last_n_days) return self.get_test_runs( ).select_related( + 'denormalization', + 'bundle', + 'bundle__bundle_stream', + 'test', ).filter( analyzer_assigned_date__range=(since, until) ).order_by('-analyzer_assigned_date') === modified file 'dashboard_app/repositories/__init__.py' --- dashboard_app/repositories/__init__.py 2011-07-22 00:04:21 +0000 +++ dashboard_app/repositories/__init__.py 2011-10-13 11:55:18 +0000 @@ -16,9 +16,13 @@ # You should have received a copy of the GNU Affero General Public License # along with Launch Control. If not, see . + +from __future__ import with_statement + import abc import logging import os +import thread from django.conf import settings @@ -126,19 +130,23 @@ __metaclass__ = abc.ABCMeta + loader_lock = thread.allocate_lock() + def __init__(self): self.item_cls = None # later patched by RepositoryItemMeta self._items = [] self._did_load = False def _queryset(self): - # In development mode always reload repository items - if getattr(settings, "DEBUG", False) is True: - self._did_load = False - if not self._did_load: - self._items = [] - self._load_default() - self._did_load = True + # HOT FIX: use a lock while loading the stuff from disk + with self.loader_lock: + # In development mode always reload repository items + if getattr(settings, "DEBUG", False) is True: + self._did_load = False + if not self._did_load: + self._items = [] + self._load_default() + self._did_load = True return RepositoryQuerySet(self.item_cls, self._items) def all(self): === modified file 'dashboard_app/repositories/data_report.py' --- dashboard_app/repositories/data_report.py 2011-07-22 00:07:21 +0000 +++ dashboard_app/repositories/data_report.py 2011-10-13 11:55:44 +0000 @@ -47,6 +47,7 @@ if "name" not in attrs: raise ValueError("Data report without a name") self.obj.name = attrs["name"] + self.obj.front_page = attrs.get('front_page') == "yes" elif name == "title" or name == "path": self._start_text() @@ -69,7 +70,8 @@ return self.item_cls( name=handler.obj.name, title=handler.obj.title, - path=handler.obj.path) + path=handler.obj.path, + front_page=handler.obj.front_page) __all__ = [ === added file 'dashboard_app/static/css/dashboard.css' --- dashboard_app/static/css/dashboard.css 1970-01-01 00:00:00 +0000 +++ dashboard_app/static/css/dashboard.css 2011-10-13 14:40:48 +0000 @@ -0,0 +1,6 @@ +.lava-chart { + width: 600px; + height: 250px; + margin: 1em auto; + padding: 1em; +} === modified file 'dashboard_app/templates/dashboard_app/_extrahead.html' --- dashboard_app/templates/dashboard_app/_extrahead.html 2011-07-13 11:07:18 +0000 +++ dashboard_app/templates/dashboard_app/_extrahead.html 2011-10-13 14:40:48 +0000 @@ -1,3 +1,4 @@ + === modified file 'dashboard_app/templates/dashboard_app/front_page_snippet.html' --- dashboard_app/templates/dashboard_app/front_page_snippet.html 2011-09-19 11:20:07 +0000 +++ dashboard_app/templates/dashboard_app/front_page_snippet.html 2011-10-13 14:40:48 +0000 @@ -1,29 +1,13 @@ -

Click on image description to see automatic QA report

-{% regroup dashboard.interesting_images by rootfs_type as rootfs_list %} -{% for rootfs in rootfs_list %} - -
-

{{ rootfs.grouper|capfirst }}

- -
-{% endfor %} -
+{% for report in report_list %} +

{{ report }}

+{{ report.get_html|safe }} +{% empty %} +

Currently no reports are configured for +display on the front page

+{% endfor %} === modified file 'dashboard_app/templates/dashboard_app/image_status_detail.html' --- dashboard_app/templates/dashboard_app/image_status_detail.html 2011-08-19 04:06:47 +0000 +++ dashboard_app/templates/dashboard_app/image_status_detail.html 2011-10-11 12:02:02 +0000 @@ -110,58 +110,70 @@ }); - +
{% regroup recent_test_run_list by analyzer_assigned_date|date:"Y-m-d" as test_run_cluster_list %} {% for test_run_cluster in test_run_cluster_list %} - + + + + + {% for test_run in test_run_cluster.list %} - {% with test_run.test_results.all.order_by as all_results %} - + {% with test_run.denormalization as denormalization %} + + + + + {% endwith %} {% endfor %} {% endfor %}
Tests ran on {{ test_run_cluster.grouper }}Tests ran on {{ test_run_cluster.grouper }}PassFailSkipUnknown
{{ test_run.test }}{{ all_results.count }} {% spaceless %} - {% regroup all_results|dictsort:"result" by result as result_group_list %} - {% for result_group in result_group_list %} - {% if result_group.list|length > 300 %} -
-
...
-
- {% else %} -
- {% endif %} - {% endfor %} +
+
+
+
{% endspaceless %} - {% endwith %}
{{ denormalization.count_pass }}{{ denormalization.count_fail }}{{ denormalization.count_skip }}{{ denormalization.count_unknown }}