Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id BECECE00D15; Thu, 25 Feb 2016 10:21:37 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 27F34E00D0E for ; Thu, 25 Feb 2016 10:21:35 -0800 (PST) Received: by mail-wm0-f46.google.com with SMTP id g62so43395575wme.0 for ; Thu, 25 Feb 2016 10:21:35 -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=WuP2S/MElC888SvqntVauLlCX4ajwFoRMUEAVRUFQIk=; b=gJbrY8ZOdA0vDc3+grmcc48drLZ0PKKRPLGiDpn5mgf2enF5Hi9a7uF/UDwnieXonA XGFUJss+HZMoO92Opodm5Q/QF9LzST/CTfuSzo6w2gae63aKFS/6AQDY1dWPlXwR3upY dSZeR5jPX61c0h76MlphupCnthCRgsiTQXcnM+xAn4AEY19ZiN/XqGGB5YOWH51Jab2H T5DOibMTEqPN5PW7cFVtFGooUQFDkDiB+RMUoVtOl3N//ElcDkiepp59QAv0gULdtbuR xRsxQP3NFgVFQsaUEbVuPv8CMtOWgi3XYXgEdqGzQ6sAtulzf48E+knGhMjHr6gM1t0j 7ZXQ== 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=WuP2S/MElC888SvqntVauLlCX4ajwFoRMUEAVRUFQIk=; b=fHSIkUZcu+GE+Rd2QlYbyOVa2xoDeNu8QKKdqTEiiAAMGW2zl1+optR1ELVfbk8efZ qaWDN8LKDAN+kcajyVMeVUm59m1OxmFDElbPTIoraK31yFUJ2IWmMybsdhFjwqNe6SqI XYQkc7bsWGhe3vLN8kX/K5ma+J5eH9oHMZ0ORMJWnZAaWvznwaDJqvC4O7rNk6LZDPwi YiSTzbtwnVsONm35volw+sDSSycZMq9QZ1+mlf/XTAifjcExPA8RlY60pvPUyLBbQcBJ OjUtZj2Zr6Q9NQzcuQYi4/wLc1Z7a9ktNRnTw50bQVi4enGlpxKfYhPVRQX5kNvJSHTg elWg== X-Gm-Message-State: AG10YOR0/NZuVQZQX1GTa5vcG19XaRKQWytSU0MlQgFdRLFTGiN3kjxsyE3bnIC2QhW03oxI X-Received: by 10.28.145.8 with SMTP id t8mr2104wmd.103.1456424494981; Thu, 25 Feb 2016 10:21:34 -0800 (PST) Received: from draco.icx.intel.com ([83.217.123.106]) by smtp.gmail.com with ESMTPSA id az8sm3084010wjc.17.2016.02.25.10.21.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Feb 2016 10:21:34 -0800 (PST) From: Michael Wood To: toaster@yoctoproject.org Date: Thu, 25 Feb 2016 18:21:20 +0000 Message-Id: <1456424485-6566-7-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456424485-6566-1-git-send-email-michael.g.wood@intel.com> References: <1456424485-6566-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH 06/11] 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: Thu, 25 Feb 2016 18:21:37 -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/0006_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/0006_add_cancelled_state.py diff --git a/bitbake/lib/toaster/orm/migrations/0006_add_cancelled_state.py b/bitbake/lib/toaster/orm/migrations/0006_add_cancelled_state.py new file mode 100644 index 0000000..f8ec65a --- /dev/null +++ b/bitbake/lib/toaster/orm/migrations/0006_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', '0004_provides'), + ] + + 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 93b5df3..ba0a8a0 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.1.4