summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/orm/models.py
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2016-07-11 14:47:06 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-11 00:09:26 +0100
commitdd99cf957da5836dc9b48d200f15a66f0bbce245 (patch)
treee7b8b8fa6b88520aabd6f17bc41cc8410af66761 /bitbake/lib/toaster/orm/models.py
parent952ffb3e1f4a00793e0c9c49bc0c8fb8729424c4 (diff)
downloadpoky-dd99cf957da5836dc9b48d200f15a66f0bbce245.tar.gz
bitbake: toaster: show progress of recipe parsing in recent builds area
Modify buildinfohelper and toasterui so that they record the recipe parse progress (from ParseProgress events in bitbake) on the Build object. Note that because the Build object is now created at the point when ParseStarted occurs, it is necessary to set the build name to the empty string initially (hence the migration). The build name can be set when the build properly starts, i.e. at the BuildStarted event. Then use this additional data to determine whether a Build is in a "Parsing" state, and report this in the JSON API. This enables the most recent builds area to show the recipe parse progress. Add additional logic to update the progress bar if the progress for a build object changes. [YOCTO #9631] (Bitbake rev: f33d51d46d70e73e04e325807c1bc4eb68462f7b) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/orm/models.py')
-rw-r--r--bitbake/lib/toaster/orm/models.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 2df6d4910a..4641736add 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -397,9 +397,15 @@ class Build(models.Model):
397 completed_on = models.DateTimeField() 397 completed_on = models.DateTimeField()
398 outcome = models.IntegerField(choices=BUILD_OUTCOME, default=IN_PROGRESS) 398 outcome = models.IntegerField(choices=BUILD_OUTCOME, default=IN_PROGRESS)
399 cooker_log_path = models.CharField(max_length=500) 399 cooker_log_path = models.CharField(max_length=500)
400 build_name = models.CharField(max_length=100) 400 build_name = models.CharField(max_length=100, default='')
401 bitbake_version = models.CharField(max_length=50) 401 bitbake_version = models.CharField(max_length=50)
402 402
403 # number of recipes to parse for this build
404 recipes_to_parse = models.IntegerField(default=1)
405
406 # number of recipes parsed so far for this build
407 recipes_parsed = models.IntegerField(default=0)
408
403 @staticmethod 409 @staticmethod
404 def get_recent(project=None): 410 def get_recent(project=None):
405 """ 411 """
@@ -615,6 +621,13 @@ class Build(models.Model):
615 else: 621 else:
616 return False 622 return False
617 623
624 def is_parsing(self):
625 """
626 True if the build is still parsing recipes
627 """
628 return self.outcome == Build.IN_PROGRESS and \
629 self.recipes_parsed < self.recipes_to_parse
630
618 def get_state(self): 631 def get_state(self):
619 """ 632 """
620 Get the state of the build; one of 'Succeeded', 'Failed', 'In Progress', 633 Get the state of the build; one of 'Succeeded', 'Failed', 'In Progress',
@@ -628,6 +641,8 @@ class Build(models.Model):
628 return 'Cancelling'; 641 return 'Cancelling';
629 elif self.is_queued(): 642 elif self.is_queued():
630 return 'Queued' 643 return 'Queued'
644 elif self.is_parsing():
645 return 'Parsing'
631 else: 646 else:
632 return self.get_outcome_text() 647 return self.get_outcome_text()
633 648