diff options
| author | David Reyna <David.Reyna@windriver.com> | 2017-06-27 13:44:29 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-28 16:02:15 +0100 |
| commit | 43aaa802c35ecc9d972f3b9adcd060033de1d9de (patch) | |
| tree | bd8e0fd2ec8c01df2316538ac07527fe67823e6b /bitbake/lib/toaster/orm | |
| parent | d74bcbeaf241a67871d62b7e2c17900ae900642e (diff) | |
| download | poky-43aaa802c35ecc9d972f3b9adcd060033de1d9de.tar.gz | |
bitbake: toaster: git clone progress bar
If a project has a lot of additional layers, the build may
appear to hang while those layers are checked out.
This patch adds a clone progress bar that is visible before
the parsing progress appears.
[YOCTO #9916]
(Bitbake rev: 0c94d947b74c4dee23d7b9d255facd3cf839ccbe)
Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/orm')
| -rw-r--r-- | bitbake/lib/toaster/orm/migrations/0016_clone_progress.py | 24 | ||||
| -rw-r--r-- | bitbake/lib/toaster/orm/models.py | 15 |
2 files changed, 39 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/orm/migrations/0016_clone_progress.py b/bitbake/lib/toaster/orm/migrations/0016_clone_progress.py new file mode 100644 index 0000000000..852b8785fe --- /dev/null +++ b/bitbake/lib/toaster/orm/migrations/0016_clone_progress.py | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | # -*- coding: utf-8 -*- | ||
| 2 | from __future__ import unicode_literals | ||
| 3 | |||
| 4 | from django.db import migrations, models | ||
| 5 | |||
| 6 | class Migration(migrations.Migration): | ||
| 7 | |||
| 8 | dependencies = [ | ||
| 9 | ('orm', '0015_layer_local_source_dir'), | ||
| 10 | ] | ||
| 11 | |||
| 12 | operations = [ | ||
| 13 | migrations.AddField( | ||
| 14 | model_name='build', | ||
| 15 | name='repos_cloned', | ||
| 16 | field=models.IntegerField(default=0), | ||
| 17 | ), | ||
| 18 | migrations.AddField( | ||
| 19 | model_name='build', | ||
| 20 | name='repos_to_clone', | ||
| 21 | field=models.IntegerField(default=1), | ||
| 22 | ), | ||
| 23 | ] | ||
| 24 | |||
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index a49f9a432a..13bd11704a 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py | |||
| @@ -437,6 +437,12 @@ class Build(models.Model): | |||
| 437 | # number of recipes parsed so far for this build | 437 | # number of recipes parsed so far for this build |
| 438 | recipes_parsed = models.IntegerField(default=0) | 438 | recipes_parsed = models.IntegerField(default=0) |
| 439 | 439 | ||
| 440 | # number of repos to clone for this build | ||
| 441 | repos_to_clone = models.IntegerField(default=1) | ||
| 442 | |||
| 443 | # number of repos cloned so far for this build | ||
| 444 | repos_cloned = models.IntegerField(default=0) | ||
| 445 | |||
| 440 | @staticmethod | 446 | @staticmethod |
| 441 | def get_recent(project=None): | 447 | def get_recent(project=None): |
| 442 | """ | 448 | """ |
| @@ -667,6 +673,13 @@ class Build(models.Model): | |||
| 667 | else: | 673 | else: |
| 668 | return False | 674 | return False |
| 669 | 675 | ||
| 676 | def is_cloning(self): | ||
| 677 | """ | ||
| 678 | True if the build is still cloning repos | ||
| 679 | """ | ||
| 680 | return self.outcome == Build.IN_PROGRESS and \ | ||
| 681 | self.repos_cloned < self.repos_to_clone | ||
| 682 | |||
| 670 | def is_parsing(self): | 683 | def is_parsing(self): |
| 671 | """ | 684 | """ |
| 672 | True if the build is still parsing recipes | 685 | True if the build is still parsing recipes |
| @@ -698,6 +711,8 @@ class Build(models.Model): | |||
| 698 | return 'Cancelling'; | 711 | return 'Cancelling'; |
| 699 | elif self.is_queued(): | 712 | elif self.is_queued(): |
| 700 | return 'Queued' | 713 | return 'Queued' |
| 714 | elif self.is_cloning(): | ||
| 715 | return 'Cloning' | ||
| 701 | elif self.is_parsing(): | 716 | elif self.is_parsing(): |
| 702 | return 'Parsing' | 717 | return 'Parsing' |
| 703 | elif self.is_starting(): | 718 | elif self.is_starting(): |
