Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 9392CE00C55; Mon, 22 Feb 2016 03:31:44 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.192.182 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from mail-pf0-f182.google.com (mail-pf0-f182.google.com [209.85.192.182]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id D7CFFE00C61 for ; Mon, 22 Feb 2016 03:31:27 -0800 (PST) Received: by mail-pf0-f182.google.com with SMTP id q63so91444909pfb.0 for ; Mon, 22 Feb 2016 03:31:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hq0loCCJ2ZQwq+3nrip27sw0kUc0AK/9mVA92ItVNuc=; b=gwZ4DSOJLNeqe8Q8AmhQmg49YFfZLWkqmhev/8FT0xO7sTMTRNqKqT9+aeEIdCq9QR r2rq0L+PvR02AM6rcW7ZbcrBYsjJpi2GTDi1evhsUPyErxSEnXWj1ZRQ52Oi35OOtfjs AooQJ8LsuqzQncOBmS+Mp47ejvmIXkdtBaN4jKvobfMlPG3PZ6eyy9j+9eWN0KzBVdQ7 ymc1ZzhuF0FqhjeSrKsi0KfxYFL85qAm0dKPkJR3667Fj38Z3CoknOhm0bVqRa8qQQoV yu0Cxo/lUXb84rc+5HcRFg2Lfaw4HwaUZNeLdceCAfWIDmJCug5rfVkqB94+yHXLcx7C E8uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hq0loCCJ2ZQwq+3nrip27sw0kUc0AK/9mVA92ItVNuc=; b=L6r1H73BJhNQMRkRKURrPIghQvu4CF8WndLn55r0QG/u/Le9GO2FP3KSD0y/9IjbN6 rofp3nREbvz0OyWahmNr5+bVOSXwL5wqBzJAbFGLSy2Aiw7DiIadFdkA1Hxj8GeJFcWF 59U/768YH9CVNufhiel40By4uHCFO8kL47ZpWD381myecnAIBsgeM0woTzNBU/QxAPHE PDlHJsX38f/gdCnC6f6yjB4E73ER+kogaqzJB8P95sOBiIyxHwmGw+WirUb4APbPpx2u QYfu5VhnKVYvXL218ficPiXcPjSybuUlMp+fyfZwssBz7hWbsMdE06A76hMcccX5A5ep VXzQ== X-Gm-Message-State: AG10YOTfn1KHZvdmPM9NVZYQUl51oug+dte+JSncm45Qc/XoyzSrWGjulASA83HbC2Zn/Vd/ X-Received: by 10.98.9.219 with SMTP id 88mr37879866pfj.0.1456140687262; Mon, 22 Feb 2016 03:31:27 -0800 (PST) Received: from dorado.ger.corp.intel.com (fmdmzpr01-ext.fm.intel.com. [192.55.54.36]) by smtp.gmail.com with ESMTPSA id n78sm36216801pfb.53.2016.02.22.03.31.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 Feb 2016 03:31:26 -0800 (PST) From: Michael Wood To: toaster@yoctoproject.org Date: Mon, 22 Feb 2016 11:31:02 +0000 Message-Id: <1456140666-5344-7-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456140666-5344-1-git-send-email-michael.g.wood@intel.com> References: <1456140666-5344-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH 06/10] toaster: models Add cancelled state to build outcome X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 11:31:44 -0000 From: Sujith H A new state CANCELLED is introduced to, distinguish the state of build. [YOCTO #6787] Signed-off-by: Sujith H --- .../orm/migrations/0007_add_cancelled_state.py | 19 +++++++++++++++++++ bitbake/lib/toaster/orm/models.py | 7 ++++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 bitbake/lib/toaster/orm/migrations/0007_add_cancelled_state.py diff --git a/bitbake/lib/toaster/orm/migrations/0007_add_cancelled_state.py b/bitbake/lib/toaster/orm/migrations/0007_add_cancelled_state.py new file mode 100644 index 0000000..8d025cc --- /dev/null +++ b/bitbake/lib/toaster/orm/migrations/0007_add_cancelled_state.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('orm', '0006_customimagerecipe_last_updated'), + ] + + operations = [ + migrations.AlterField( + model_name='build', + name='outcome', + field=models.IntegerField(default=2, choices=[(0, b'Succeeded'), (1, b'Failed'), (2, b'In Progress'), (3, b'Cancelled')]), + ), + ] diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index ab6940f..ed66a16 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py @@ -353,11 +353,13 @@ class Build(models.Model): SUCCEEDED = 0 FAILED = 1 IN_PROGRESS = 2 + CANCELLED = 3 BUILD_OUTCOME = ( (SUCCEEDED, 'Succeeded'), (FAILED, 'Failed'), (IN_PROGRESS, 'In Progress'), + (CANCELLED, 'Cancelled'), ) search_allowed_fields = ['machine', 'cooker_log_path', "target__target", "target__target_image_file__file_name"] @@ -385,7 +387,10 @@ class Build(models.Model): if project: builds = builds.filter(project=project) - finished_criteria = Q(outcome=Build.SUCCEEDED) | Q(outcome=Build.FAILED) + finished_criteria = \ + Q(outcome=Build.SUCCEEDED) | \ + Q(outcome=Build.FAILED) | \ + Q(outcome=Build.CANCELLED) recent_builds = list(itertools.chain( builds.filter(outcome=Build.IN_PROGRESS).order_by("-started_on"), -- 2.5.0