From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 9823FE00B89; Wed, 23 Mar 2016 03:36:55 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [134.134.136.65 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 2AA0AE00B89 for ; Wed, 23 Mar 2016 03:36:36 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 23 Mar 2016 03:36:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,382,1455004800"; d="scan'208";a="674335791" Received: from linux.intel.com ([10.23.219.25]) by FMSMGA003.fm.intel.com with ESMTP; 23 Mar 2016 03:36:31 -0700 Received: from vmed.fi.intel.com (vmed.fi.intel.com [10.237.72.51]) by linux.intel.com (Postfix) with ESMTP id 4A2B56A4002 for ; Wed, 23 Mar 2016 04:24:14 -0700 (PDT) From: Ed Bartosh To: toaster@yoctoproject.org Date: Wed, 23 Mar 2016 10:15:15 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [PATCH v6 24/41] 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: Wed, 23 Mar 2016 10:36:55 -0000 From: Sujith H A new state CANCELLED is introduced to, distinguish the state of build. [YOCTO #6787] Signed-off-by: Sujith H Signed-off-by: Ed Bartosh --- .../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 6ae6316..bbfb200 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py @@ -358,11 +358,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"] @@ -389,7 +391,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