toaster: add rev dep column to image detail pages
PATCH v3 1/1 toaster: add rev dep column to image detail pages
In reply to Dave LernerAdd a column to the custom image pages that shows the reverse dependencies in a format matching the dependencies column:
- either blank or a button showing the count of reverse dependencies,
- when the button is clicked, a popover appears showing the list of reverse dependencies, with each package's size, and the total size of all of the reverse dependencies.
The implementation adds a packages table method to retreive the reverse dependency total size, and adds a separate 'popover' html template. Both of these changes follow the pattern for the dependencies column.
[YOCTO #9163]
--- bitbake/lib/toaster/orm/models.py | 7 +++++++ bitbake/lib/toaster/toastergui/tables.py | 6 ++++++ .../templates/snippets/pkg_revdependencies_popover.html | 15 +++++++++++++++ 3 files changed, 28 insertions(+)
bitbake/lib/toaster/orm/models.py +7 -0
@@ -813,6 +813,13 @@ class Package_DependencyManager(models.Manager): """ return self.all().aggregate(Sum('depends_on__size')) + def get_total_revdeps_size(self): + """ Returns the total file size of all the packages that depend on + this package. + """ + return self.all().aggregate(Sum('package_id__size')) + + def all_depends(self): """ Returns just the depends packages and not any other dep_type """ return self.filter(Q(dep_type=Package_Dependency.TYPE_RDEPENDS) |
bitbake/lib/toaster/toastergui/tables.py +6 -0
@@ -725,6 +725,12 @@ class PackagesTable(ToasterTable): static_data_template='\ {% include "snippets/pkg_dependencies_popover.html" %}') + self.add_column(title="Reverse dependencies", + static_data_name="reverse_dependencies", + static_data_template='\ + {% include "snippets/pkg_revdependencies_popover.html" %}', + hidden=True) + self.add_column(title="Recipe", field_name="recipe__name", orderable=True,
bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html new file +15 -0
@@ -0,0 +1,15 @@ +{# Popover that displays the reverse dependencies and sizes of a package 'data' used in the Packages table #} +{% with data.package_dependencies_target.all_depends.count as dep_count %} +{% load projecttags %} +{% if dep_count %} + <a data-content="<ul class='unstyled'> + {% for dep in data.package_dependencies_target.all_depends|dictsort:'package.name' %} + <li>{{dep.package.name}} {% if dep.package.size > 0 %}({{dep.package.size|filtered_filesizeformat}}){% endif %}</li> + {% endfor %} + </ul>" title="" class="btn" data-original-title=" + <strong>{{data.name}}</strong> reverse dependencies - <strong>{{data.package_dependencies_target.get_total_revdeps_size.package_id__size__sum|filtered_filesizeformat}}</strong>"> + {{dep_count}} +</a> +{% endif %} +{% endwith %} +
Signature · 1 line
2.7.4
PATCH v3 1/1 toaster: add rev dep column to image detail pages
Comment: Version 3 has
commit message format & typo corrections,
rebased to toaster-next as of 31Mar16,
retested,
pushed to the contrib branch below.
Poky Contrib Branch: dlerner/9163-revdep-columns-for-customimage-pages Target Branches: toaster-next master
Defect: 9163
Summary: toaster: add rev dep column to image detail pages
Commit
------
7ce5e52 toaster: add rev dep column to image detail pages
bitbake/lib/toaster/orm/models.py | 7 +++++++ bitbake/lib/toaster/toastergui/tables.py | 6 ++++++ .../templates/snippets/pkg_revdependencies_popover.html | 15 +++++++++++++++ 3 files changed, 28 insertions(+)
Hello Dave.
I've had a look at this, but have noticed an issue where there are some repeats of packages in the reverse dependencies list (and in the dependencies list). Several other team members have seen the same thing.
Consequently, I'm not sure whether to put your patches in for now. I've cc'd Brian for his opinion.
However, I am confident that this issue has nothing to do with your patches. I just didn't want to muddy the issue further in case anyone is already dealing with this.
Elliot
Quoted 93 lines · Dave Lerner
Add a column to the custom image pages that shows the reverse dependencies in a format matching the dependencies column:
- either blank or a button showing the count of reverse dependencies,
- when the button is clicked, a popover appears showing the list of reverse dependencies, with each package's size, and the total size of all of the reverse dependencies.The implementation adds a packages table method to retreive the reverse dependency total size, and adds a separate 'popover' html template. Both of these changes follow the pattern for the dependencies column.
[YOCTO #9163]
Signed-off-by Dave Lerner <[email protected]>--- bitbake/lib/toaster/orm/models.py | 7 +++++++ bitbake/lib/toaster/toastergui/tables.py | 6 ++++++ .../templates/snippets/pkg_revdependencies_popover.html | 15 +++++++++++++++ 3 files changed, 28 insertions(+)bitbake/lib/toaster/orm/models.py +7
-0@@ -813,6 +813,13 @@ class Package_DependencyManager(models.Manager): """ return self.all().aggregate(Sum('depends_on__size')) + def get_total_revdeps_size(self): + """ Returns the total file size of all the packages that depend on + this package. + """ + return self.all().aggregate(Sum('package_id__size')) + + def all_depends(self): """ Returns just the depends packages and not any other dep_type"""
return self.filter(Q(dep_type=Package_Dependency.TYPE_RDEPENDS) |bitbake/lib/toaster/toastergui/tables.py +6
-0@@ -725,6 +725,12 @@ class PackagesTable(ToasterTable): static_data_template='\ {% include "snippets/pkg_dependencies_popover.html" %}') + self.add_column(title="Reverse dependencies", + static_data_name="reverse_dependencies", + static_data_template='\ + {% include "snippets/pkg_revdependencies_popover.html" %}', + hidden=True) + self.add_column(title="Recipe",field_name="recipe__name", orderable=True,diff --git a/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html b/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html new file mode 100644
index 0000000..04fd2d3
---/dev/null
+++
b/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.htmlbitbake/lib/toaster/toastergui/tables.py +1
-0@@ -0,0 +1,15 @@ +{# Popover that displays the reverse dependencies and sizes of a package'data' used in the Packages table #}
bitbake/lib/toaster/toastergui/tables.py +5
-0+{% with data.package_dependencies_target.all_depends.count as dep_count %} +{% load projecttags %} +{% if dep_count %} + <a data-content="<ul class='unstyled'> + {% for dep in data.package_dependencies_target.all_depends|dictsort:'package.name' %}
+ <li>{{dep.package.name}} {% if dep.package.size > 0 %}({{dep.package.size|filtered_filesizeformat}}){% endif %}</li>bitbake/lib/toaster/toastergui/tables.py +3
-0+ {% endfor %} + </ul>" title="" class="btn" data-original-title=" + <strong>{{data.name}}</strong> reverse dependencies -<strong>{{data.package_dependencies_target.get_total_revdeps_size.package_id__size__sum|filtered_filesizeformat}}</strong>">
bitbake/lib/toaster/toastergui/tables.py +5
-1+ {{dep_count}} +</a> +{% endif %} +{% endwith %} + --2.7.4
Signature · 3 lines
Elliot Smith Software Engineer Intel Open Source Technology Centre
Actually I have not seen this duplication with rev dep list, but I did see this with the normal dependency list a few times, that is until I spent some effort trying to reproduce the conditions cleanly, 2 projects, 2 custom-images; but I wasn't able to after a rebase. Note again, this was for the dependency, not the reverse dependency list.
I will be trying to duplicate the 'duplication' symptoms today, dep or rev-dep. Feel free to hold off submitting to give me more time to try and find the steps, and then the root-cause. I will try a systematic approach and publish the positive or negative findings later today. Dave
Quoted 124 lines
-----Original Message-----
From: Smith, Elliot [mailto:[email protected]]
Sent: Monday, April 04, 2016 3:31 AM
To: Lerner, Dave
Cc: [email protected]; Belen Barros Pena (Intel); AVERY, BRIAN
Subject: Re: [Toaster] [review-request v3] [Patch 1/1] toaster: add rev dep column to image detail pagesHello Dave.
I've had a look at this, but have noticed an issue where there are some repeats of packages in the reverse dependencies list (and in the dependencies list). Several other team members have seen the same thing.
Consequently, I'm not sure whether to put your patches in for now. I've cc'd Brian for his opinion.
However, I am confident that this issue has nothing to do with your patches. I just didn't want to muddy the issue further in case anyone is already dealing with this.
Elliot
On 31 March 2016 at 19:56, Dave Lerner <[email protected]> wrote:
Add a column to the custom image pages that shows the reverse dependencies in a format matching the dependencies column:
- either blank or a button showing the count of reverse dependencies,
- when the button is clicked, a popover appears showing the list of reverse dependencies, with each package's size, and the total size of all of the reverse dependencies.The implementation adds a packages table method to retreive the reverse dependency total size, and adds a separate 'popover' html template. Both of these changes follow the pattern for the dependencies column.
[YOCTO #9163]
Signed-off-by Dave Lerner <[email protected]>---
bitbake/lib/toaster/orm/models.py| 7 +++++++
bitbake/lib/toaster/toastergui/tables.py| 6 ++++++
.../templates/snippets/pkg_revdependencies_popover.html | 15 +++++++++++++++
3 files changed, 28 insertions(+)diff --git
a/bitbake/lib/toaster/orm/models.pyb/bitbake/lib/toaster/orm/models.pyindex 6ae6316..cfab7b7 100644
---a/bitbake/lib/toaster/orm/models.py
+++b/bitbake/lib/toaster/orm/models.py
@@ -813,6 +813,13 @@ classPackage_DependencyManager(models.Manager):
"""
return self.all().aggregate(Sum('depends_on__size'))+ def
get_total_revdeps_size(self):
+ """ Returns the total file size of all the packages that depend on
+ this package.
+ """
+ return self.all().aggregate(Sum('package_id__size'))
+
+
defall_depends(self):
""" Returns just the depends packages and not any otherdep_type""" return self.filter(Q(dep_type=Package_Dependency.TYPE_RDEPENDS) |
diff --gita/bitbake/lib/toaster/toastergui/tables.pyb/bitbake/lib/toaster/toastergui/tables.py
index 67a6592..c677ec5 100644
---a/bitbake/lib/toaster/toastergui/tables.py
+++b/bitbake/lib/toaster/toastergui/tables.py
@@ -725,6 +725,12 @@ class PackagesTable(ToasterTable):
static_data_template='\
{% include "snippets/pkg_dependencies_popover.html" %}')+ self.add_column(title="Reverse dependencies",
+ static_data_name="reverse_dependencies",
+ static_data_template='\
+ {% include "snippets/pkg_revdependencies_popover.html"
%}',+ hidden=True) + self.add_column(title="Recipe", field_name="recipe__name", orderable=True, diff --git a/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html b/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html new file mode 100644 index 0000000..04fd2d3 --- /dev/null +++ b/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html @@ -0,0 +1,15 @@ +{# Popover that displays the reverse dependencies and sizes of a package 'data' used in the Packages table #} +{% with data.package_dependencies_target.all_depends.count as dep_count %} +{% load projecttags %} +{% if dep_count %} + <a data-content="<ul class='unstyled'> + {% for dep indata.package_dependencies_target.all_depends|dictsort:'package.name' %}
+ <li>{{dep.package.name}} {% if dep.package.size > 0
%}({{dep.package.size|filtered_filesizeformat}}){% endif %}</li>
+ {% endfor %}
+ </ul>" title="" class="btn" data-original-title="
+ <strong>{{data.name}}</strong> reverse dependencies -
<strong>{{data.package_dependencies_target.get_total_revdeps_size.package_id__size__sum| filtered_filesizeformat}}</strong>">+ {{dep_count}} +</a> +{% endif %} +{% endwith %} + -- 2.7.4--
Elliot Smith
Software Engineer
Intel Open Source Technology Centre
Tested again. I still sometimes see the duplicates, but haven't narrowed down why.
I am convinced the duplication is not due to this patch, so I submitted it upstream to bitbake-devel and added it to toaster-next.
Elliot
Quoted 164 lines · David M (Wind River)
Actually I have not seen this duplication with rev dep list, but I did see this with the normal dependency list a few times, that is until I spent some effort trying to reproduce the conditions cleanly, 2 projects, 2 custom-images; but I wasn't able to after a rebase. Note again, this was for the dependency, not the reverse dependency list.
I will be trying to duplicate the 'duplication' symptoms today, dep or rev-dep. Feel free to hold off submitting to give me more time to try and find the steps, and then the root-cause. I will try a systematic approach and publish the positive or negative findings later today. Dave
Quoted 6 lines
-----Original Message-----
From: Smith, Elliot [mailto:[email protected]]
Sent: Monday, April 04, 2016 3:31 AM
To: Lerner, Dave
Cc: [email protected]; Belen Barros Pena (Intel); AVERY, BRIAN
Subject: Re: [Toaster] [review-request v3] [Patch 1/1] toaster: add revdep column to
Quoted 5 lines
image detail pages
Hello Dave.
I've had a look at this, but have noticed an issue where there are some
repeats of
Quoted 1 line
packages in the reverse dependencies list (and in the dependencies
list). Several other
Quoted 3 lines
team members have seen the same thing.
Consequently, I'm not sure whether to put your patches in for now. I've
cc'd Brian for
Quoted 3 lines
his opinion.
However, I am confident that this issue has nothing to do with your
patches. I just
Quoted 1 line
didn't want to muddy the issue further in case anyone is already dealing
with this.
Quoted 4 lines
Elliot
On 31 March 2016 at 19:56, Dave Lerner <[email protected]>
Quoted 5 lines · wrote:
Add a column to the custom image pages that shows the reverse dependencies in a format matching the dependencies column:
- either blank or a button showing the count of reversedependencies,
Quoted 2 lines
- when the button is clicked, a popover appears showing the list of reverse dependencies, with each package's size, and the
total
Quoted 3 lines
size of all of the reverse dependencies.
The implementation adds a packages table method to retreive the
reverse
Quoted 1 line
dependency total size, and adds a separate 'popover' html
template. Both
Quoted 7 lines
of these changes follow the pattern for the dependencies column.
[YOCTO #9163]
Signed-off-by Dave Lerner <[email protected]>---
bitbake/lib/toaster/orm/models.py| 7+++++++
Quoted 1 line
bitbake/lib/toaster/toastergui/tables.py | 6++++++
Quoted 1 line
.../templates/snippets/pkg_revdependencies_popover.html | 15+++++++++++++++
Quoted 3 lines
3 files changed, 28 insertions(+)diff --git a/bitbake/lib/toaster/orm/models.py
b/bitbake/lib/toaster/orm/models.pyQuoted 4 lines
index 6ae6316..cfab7b7 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py @@ -813,6 +813,13 @@ class
Package_DependencyManager(models.Manager):Quoted 5 lines
"""
return self.all().aggregate(Sum('depends_on__size'))+ def
get_total_revdeps_size(self):
+ """ Returns the total file size of all the packages thatdepend on
Quoted 7 lines
+ this package. + """ + return self.all().aggregate(Sum('package_id__size')) + + def all_depends(self): """ Returns just the depends packages and not any other
dep_type"""Quoted 1 line
return
self.filter(Q(dep_type=Package_Dependency.TYPE_RDEPENDS) |
Quoted 8 lines
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py index 67a6592..c677ec5 100644 --- a/bitbake/lib/toaster/toastergui/tables.py +++ b/bitbake/lib/toaster/toastergui/tables.py @@ -725,6 +725,12 @@ class PackagesTable(ToasterTable): static_data_template='\ {% include"snippets/pkg_dependencies_popover.html" %}')
Quoted 5 lines
+ self.add_column(title="Reverse dependencies",
+ static_data_name="reverse_dependencies",
+ static_data_template='\
+ {% include"snippets/pkg_revdependencies_popover.html"
Quoted 8 lines
%}',
+ hidden=True) + self.add_column(title="Recipe", field_name="recipe__name", orderable=True, diff --gita/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html
Quoted 1 line
b/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html
Quoted 5 lines
new file mode 100644 index 0000000..04fd2d3 --- /dev/null +++b/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html
Quoted 2 lines
@@ -0,0 +1,15 @@
+{# Popover that displays the reverse dependencies and sizes of apackage 'data'
Quoted 2 lines
used in the Packages table #}
+{% with data.package_dependencies_target.all_depends.count as
dep_count%}Quoted 11 lines
+{% load projecttags %}
+{% ifdep_count%}
+ <a data-content="<ul class='unstyled'>
+ {% for dep in
data.package_dependencies_target.all_depends|dictsort:'package.name' %}
+ <li>{{dep.package.name}} {% if dep.package.size > 0
%}({{dep.package.size|filtered_filesizeformat}}){% endif %}</li>
+ {% endfor %}
+ </ul>" title="" class="btn" data-original-title="
+ <strong>{{data.name}}</strong> reverse dependencies -<strong>{{data.package_dependencies_target.get_total_revdeps_size.package_id__size__sum|
Quoted 19 lines
filtered_filesizeformat}}</strong>">
+ {{dep_count}} +</a> +{% endif %} +{% endwith %} + -- 2.7.4--
Elliot Smith
Software Engineer
Intel Open Source Technology Centre
Signature · 3 lines
Elliot Smith Software Engineer Intel Open Source Technology Centre