From patchwork Mon Mar 26 21:21:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael-Doyle Hudson X-Patchwork-Id: 7472 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 2670423E01 for ; Mon, 26 Mar 2012 21:21:14 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id C006EA18826 for ; Mon, 26 Mar 2012 21:21:13 +0000 (UTC) Received: by iage36 with SMTP id e36so11628452iag.11 for ; Mon, 26 Mar 2012 14:21:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :content-type:mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state; bh=UW5xTRX9P1q2dIHJX/v5nRrwEazmcHSoiUEPlgBE46w=; b=Tx4YuCR14ioF6Q6Ab+t49aAR0kRWVvbiZLkMc66we/6balijDESCcsqCDj53ckAVon oARiG4NjDapyCQNSu8kWdK8IqrAh9PJ+iVTFN6Y1dfgc3itdtjgg1pqSNz4FCXegORre E4pA/I47e2ic7o7RgSfiRtqCcjhO3BtguwmnKssDIHOHUsVPEZ1dVrzVpIOgeT7PB/t8 o2MB39IPTYGjolmxTUzbZTki8SJzD1EQpNcxDbtQ7p6xRGdWX6+gbgLOL6L3IG5l3Dmg 6YlEWWrF2KO+3wp4SVNWr5nOr96eASi8beiRZy+PHTan+9TBjZQ3JJKwdIzwEKnT0Pje Tzyw== Received: by 10.50.191.233 with SMTP id hb9mr6757707igc.44.1332796873222; Mon, 26 Mar 2012 14:21:13 -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.231.5.205 with SMTP id 13csp1258ibw; Mon, 26 Mar 2012 14:21:12 -0700 (PDT) Received: by 10.180.102.102 with SMTP id fn6mr21875773wib.10.1332796871767; Mon, 26 Mar 2012 14:21:11 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id h14si17008996wiv.35.2012.03.26.14.21.11 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 26 Mar 2012 14:21:11 -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 1SCHLj-000255-2t for ; Mon, 26 Mar 2012 21:21:11 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 08C5EE0188 for ; Mon, 26 Mar 2012 21:21:11 +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: 310 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dashboard/trunk] Rev 310: remove the image status view Message-Id: <20120326212111.26242.68407.launchpad@ackee.canonical.com> Date: Mon, 26 Mar 2012 21:21:11 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="15008"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 517a10f6a84e1cf284d87d71732b8948704a2b72 X-Gm-Message-State: ALoCoQl6fcUZslziyQ2h0u17vbh9MPGCckwYe3grZbx8QrRNQG9gOp3bTXpwJu76mbgtUiz/LFBk Merge authors: Michael Hudson-Doyle (mwhudson) Related merge proposals: https://code.launchpad.net/~mwhudson/lava-dashboard/no-more-image-status-view/+merge/99251 proposed by: Michael Hudson-Doyle (mwhudson) review: Approve - Zygmunt Krynicki (zkrynicki) ------------------------------------------------------------ revno: 310 [merge] committer: Michael Hudson-Doyle branch nick: trunk timestamp: Tue 2012-03-27 10:19:11 +1300 message: remove the image status view modified: dashboard_app/extension.py dashboard_app/models.py dashboard_app/urls.py dashboard_app/views.py doc/changes.rst --- 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 2012-01-16 18:07:05 +0000 +++ dashboard_app/extension.py 2012-03-26 04:05:20 +0000 @@ -40,7 +40,6 @@ menu = super(DashboardExtension, self).get_menu() menu.sub_menu = [ Menu("About", reverse(self.main_view_name)), - Menu("Image Status", reverse("dashboard_app.views.image_status_list")), Menu("Testing Efforts", reverse("dashboard_app.views.testing_effort_list")), Menu("Bundle Streams", reverse("dashboard_app.views.bundle_stream_list")), Menu("Tests", reverse("dashboard_app.views.test_list")), @@ -53,25 +52,9 @@ return "dashboard_app/front_page_snippet.html" def get_front_page_context(self): - from dashboard_app.models import (DataReport, ImageHealth) + from dashboard_app.models import DataReport return { 'report_list': DataReport.repository.filter(front_page=True), - 'interesting_images': [ - ImageHealth('nano', 'panda'), - ImageHealth('nano', 'omap3'), - ImageHealth('nano', 'lt-panda'), - ImageHealth('developer', 'panda'), - ImageHealth('developer', 'omap3'), - ImageHealth('developer', 'lt-panda'), - ImageHealth('alip', 'panda'), - ImageHealth('alip', 'omap3'), - ImageHealth('alip', 'lt-panda'), - ImageHealth('alip', 'lt-panda-x11-base-natty'), - ImageHealth('ubuntu-desktop', 'panda'), - ImageHealth('ubuntu-desktop', 'omap3'), - ImageHealth('ubuntu-desktop', 'lt-panda'), - ImageHealth('ubuntu-desktop', 'lt-panda-x11-base-natty'), - ] } @property === modified file 'dashboard_app/models.py' --- dashboard_app/models.py 2012-03-15 03:08:00 +0000 +++ dashboard_app/models.py 2012-03-26 04:00:57 +0000 @@ -1364,124 +1364,6 @@ return self._data['front_page'] -class ImageHealth(object): - - def __init__(self, rootfs_type, hwpack_type): - self.rootfs_type = rootfs_type - self.hwpack_type = hwpack_type - - @models.permalink - def get_absolute_url(self): - return ("dashboard_app.views.image_status_detail", [ - self.rootfs_type, self.hwpack_type]) - - def get_tests(self): - return Test.objects.filter(test_runs__in=self.get_test_runs()).distinct() - - def current_health_for_test(self, test): - test_run = self.get_current_test_run(test) - test_results = test_run.test_results - fail_count = test_results.filter( - result=TestResult.RESULT_FAIL).count() - pass_count = test_results.filter( - result=TestResult.RESULT_PASS).count() - total_count = test_results.count() - return { - "test_run": test_run, - "total_count": total_count, - "fail_count": fail_count, - "pass_count": pass_count, - "other_count": total_count - (fail_count + pass_count), - "fail_percent": fail_count * 100.0 / total_count if total_count > 0 else None, - } - - def overall_health_for_test(self, test): - test_run_list = self.get_all_test_runs_for_test(test) - test_result_list = TestResult.objects.filter(test_run__in=test_run_list) - fail_result_list = test_result_list.filter(result=TestResult.RESULT_FAIL) - pass_result_list = test_result_list.filter(result=TestResult.RESULT_PASS) - - total_count = test_result_list.count() - fail_count = fail_result_list.count() - pass_count = pass_result_list.count() - fail_percent = fail_count * 100.0 / total_count if total_count > 0 else None - return { - "total_count": total_count, - "total_run_count": test_run_list.count(), - "fail_count": fail_count, - "pass_count": pass_count, - "other_count": total_count - fail_count - pass_count, - "fail_percent": fail_percent, - } - - def get_recent_test_runs(self, last_n_days=7 * 2): - until = datetime.datetime.now() - 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') - - def get_chart_data(self): - return TestResult.objects.select_related( - ).filter( - test_run__in=[run.pk for run in self.get_recent_test_runs().only('id').order_by()] - ).values( - 'test_run__analyzer_assigned_date' - ).extra( - select={'bucket': 'date(analyzer_assigned_date)'}, - ).values( - 'bucket', 'result' - ).annotate( - count=models.Count('result') - ).order_by('result') - - def get_test_runs(self): - return TestRun.objects.select_related( - ).filter( - bundle__bundle_stream__pathname="/anonymous/lava-daily/" - ).filter( - attributes__name='rootfs.type' - ).filter( - attributes__value=self.rootfs_type - ).filter( - attributes__name='hwpack.type' - ).filter( - attributes__value=self.hwpack_type - ) - - def get_current_test_run(self, test): - return self.get_all_test_runs_for_test(test).order_by('-analyzer_assigned_date')[0] - - def get_all_test_runs_for_test(self, test): - return self.get_test_runs().filter(test=test) - - @classmethod - def get_rootfs_list(self): - rootfs_list = [ - attr['value'] - for attr in NamedAttribute.objects.filter( - name='rootfs.type').values('value').distinct()] - try: - rootfs_list.remove('android') - except ValueError: - pass - return rootfs_list - - @classmethod - def get_hwpack_list(self): - hwpack_list = [ - attr['value'] - for attr in NamedAttribute.objects.filter( - name='hwpack.type').values('value').distinct()] - return hwpack_list - - class Tag(models.Model): """ Tag used for marking test runs. === modified file 'dashboard_app/urls.py' --- dashboard_app/urls.py 2012-03-16 03:31:30 +0000 +++ dashboard_app/urls.py 2012-03-26 04:00:57 +0000 @@ -66,9 +66,6 @@ url(r'^permalink/test-result/(?P[a-zA-Z0-9-]+)/(?P[0-9]+)/(?P.*)$', 'redirect_to_test_result'), url(r'^permalink/bundle/(?P[0-9a-z]+)/$', 'redirect_to_bundle'), url(r'^permalink/bundle/(?P[0-9a-z]+)/(?P.*)$', 'redirect_to_bundle'), - url(r'^image_status/$', 'image_status_list'), - url(r'^image_status/(?P[a-zA-Z0-9_-]+)\+(?P[a-zA-Z0-9_-]+)/$', 'image_status_detail'), - url(r'^image_status/(?P[a-zA-Z0-9_-]+)\+(?P[a-zA-Z0-9_-]+)/test-history/(?P[^/]+)/$', 'image_test_history'), url(r'^efforts/$', 'testing_effort_list'), url(r'^efforts/(?P[0-9]+)/$', 'testing_effort_detail'), url(r'^efforts/(?P[0-9]+)/update/$', 'testing_effort_update'), === modified file 'dashboard_app/views.py' --- dashboard_app/views.py 2012-03-20 21:19:58 +0000 +++ dashboard_app/views.py 2012-03-26 04:05:55 +0000 @@ -49,7 +49,6 @@ BundleStream, DataReport, DataView, - ImageHealth, Tag, Test, TestResult, @@ -721,55 +720,6 @@ return redirect_to(request, bundle, trailing) -@BreadCrumb("Image Status Matrix", parent=index) -def image_status_list(request): - return render_to_response( - "dashboard_app/image_status_list.html", { - 'hwpack_list': ImageHealth.get_hwpack_list(), - 'rootfs_list': ImageHealth.get_rootfs_list(), - 'ImageHealth': ImageHealth, - 'bread_crumb_trail': BreadCrumbTrail.leading_to(image_status_list) - }, RequestContext(request)) - - -@BreadCrumb( - "Image Status for {rootfs_type} + {hwpack_type}", - parent=image_status_list, - needs=["rootfs_type", "hwpack_type"]) -def image_status_detail(request, rootfs_type, hwpack_type): - image_health = ImageHealth(rootfs_type, hwpack_type) - return render_to_response( - "dashboard_app/image_status_detail.html", { - 'image_health': image_health, - 'bread_crumb_trail': BreadCrumbTrail.leading_to( - image_status_detail, - rootfs_type=rootfs_type, - hwpack_type=hwpack_type), - }, RequestContext(request)) - - -@BreadCrumb( - "Test history for {test_id}", - parent=image_status_detail, - needs=["rootfs_type", "hwpack_type", "test_id"]) -def image_test_history(request, rootfs_type, hwpack_type, test_id): - image_health = ImageHealth(rootfs_type, hwpack_type) - test = get_object_or_404(Test, test_id=test_id) - test_run_list = image_health.get_test_runs().filter(test=test) - return render_to_response( - "dashboard_app/image_test_history.html", { - 'test_run_list': test_run_list, - 'test': test, - 'image_health': image_health, - 'bread_crumb_trail': BreadCrumbTrail.leading_to( - image_test_history, - rootfs_type=rootfs_type, - hwpack_type=hwpack_type, - test=test, - test_id=test_id), - }, RequestContext(request)) - - @BreadCrumb("Testing efforts", parent=index) def testing_effort_list(request): return render_to_response( === modified file 'doc/changes.rst' --- doc/changes.rst 2012-03-26 20:44:00 +0000 +++ doc/changes.rst 2012-03-26 21:19:01 +0000 @@ -6,6 +6,8 @@ Version 0.15 ============ +* Remove the image status view. + .. _version_0_14: Version 0.14