From: Sujith H <[email protected]> A new state CANCELLED is introduced to, distinguish the state of build.
[YOCTO #6787] Signed-off-by: Sujith H <[email protected]> Signed-off-by: Ed Bartosh <[email protected]> --- .../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 -- _______________________________________________ toaster mailing list [email protected] https://lists.yoctoproject.org/listinfo/toaster
