path: root/bitbake/lib/toaster/orm/
diff options
authorElliot Smith <>2016-07-11 14:47:06 +0100
committerRichard Purdie <>2016-08-11 00:09:26 +0100
commitdd99cf957da5836dc9b48d200f15a66f0bbce245 (patch)
treee7b8b8fa6b88520aabd6f17bc41cc8410af66761 /bitbake/lib/toaster/orm/
parent952ffb3e1f4a00793e0c9c49bc0c8fb8729424c4 (diff)
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 <> Signed-off-by: Richard Purdie <>
Diffstat (limited to 'bitbake/lib/toaster/orm/')
1 files changed, 16 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/orm/ b/bitbake/lib/toaster/orm/
index 2df6d4910a..4641736add 100644
--- a/bitbake/lib/toaster/orm/
+++ b/bitbake/lib/toaster/orm/
@@ -397,9 +397,15 @@ class Build(models.Model):
completed_on = models.DateTimeField()
outcome = models.IntegerField(choices=BUILD_OUTCOME, default=IN_PROGRESS)
cooker_log_path = models.CharField(max_length=500)
- build_name = models.CharField(max_length=100)
+ build_name = models.CharField(max_length=100, default='')
bitbake_version = models.CharField(max_length=50)
+ # number of recipes to parse for this build
+ recipes_to_parse = models.IntegerField(default=1)
+ # number of recipes parsed so far for this build
+ recipes_parsed = models.IntegerField(default=0)
def get_recent(project=None):
@@ -615,6 +621,13 @@ class Build(models.Model):
return False
+ def is_parsing(self):
+ """
+ True if the build is still parsing recipes
+ """
+ return self.outcome == Build.IN_PROGRESS and \
+ self.recipes_parsed < self.recipes_to_parse
def get_state(self):
Get the state of the build; one of 'Succeeded', 'Failed', 'In Progress',
@@ -628,6 +641,8 @@ class Build(models.Model):
return 'Cancelling';
elif self.is_queued():
return 'Queued'
+ elif self.is_parsing():
+ return 'Parsing'
return self.get_outcome_text()