* [review-request] fix banner after customimage package add
@ 2016-02-19 22:23 Dave Lerner
2016-02-19 22:23 ` [PATCH 1/1] toaster: " Dave Lerner
0 siblings, 1 reply; 5+ messages in thread
From: Dave Lerner @ 2016-02-19 22:23 UTC (permalink / raw)
To: toaster, belen.barros.pena, michael.g.wood
Branch: toaster-next
Defect: 9101
Summary: toaster: fix banner after customimage package add
Test Setup
----------
Build core-image-sato in order to capture package dependencies for tests.
Create a new custom image based on core-image-minimal.
Test with the pacakge atk which has 3 unadded dependencies: libpcre, glib-2.0, and libffi.
Make certain that old orm_customimage_* tables are empty, no residuals from
priof runs.
Test cases and expected results
-------------------------------
Verify that adding a package with unaddded dependencies will add the dependencies visually and in the build by:
Click the 'add package' button for package atk.
Click 'add package' in the popup modal dialog to add the 3 dependencies.
Verify that all 4 packages, atk and 3 dependents, now show buttons with
labels 'remove package' instead of 'add...'
Build the image.
Verify in the built image under packages that all 4 packages are added
to the image using the right panel Packages and clicking each package.
Verify that adding a package with either
- dependencies already added or in the base image,
- witout dependencies
correctly shows the addition of 1 package in the banner.
Remove atk, then add it back atk.
Verify that banner says
"You have added <bold>1</bold> package to myimage : atk"
Note: only 1 package because dependencies were not removed in previous
step.
Verify removing the 'added' package and each of the dependencies removes those
packages visually and in the build.
Click 'remove package' for packages and in order:
atk, glib-2.0, libffi, libpcre.
Build the image.
Verify that the packages are not in the image.
Verify fix of the defect symptom that adding dependent package, then removing
dependent package and dependencies, then adding it back correctly
shows the dependencies as added, ie, with "remove package" button.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/1] toaster: fix banner after customimage package add
2016-02-19 22:23 [review-request] fix banner after customimage package add Dave Lerner
@ 2016-02-19 22:23 ` Dave Lerner
2016-02-22 14:29 ` Barros Pena, Belen
2016-02-22 16:57 ` Michael Wood
0 siblings, 2 replies; 5+ messages in thread
From: Dave Lerner @ 2016-02-19 22:23 UTC (permalink / raw)
To: toaster, belen.barros.pena, michael.g.wood
Correct formatting of the banner message after adding a package to a
custom image. Also, correct the tracking of dependent packages for the
added package, adding them to the set of packages appended to the
base image rather than the set originally included the base image.
[YOCTO #9101]
Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
---
bitbake/lib/toaster/toastergui/static/js/customrecipe.js | 7 +++++--
bitbake/lib/toaster/toastergui/views.py | 2 +-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/bitbake/lib/toaster/toastergui/static/js/customrecipe.js b/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
index a1fe486..3c57899 100644
--- a/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
+++ b/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
@@ -127,7 +127,8 @@ function customRecipePageInit(ctx) {
if (targetPkg.hasOwnProperty('depsAdded') &&
targetPkg.depsAdded.length > 0) {
- msg += "added " + (targetPkg.depsAdded.length + 1);
+ msg += "added ";
+ msg += "<strong>" + (targetPkg.depsAdded.length + 1) + "</strong>";
msg += " packages to " + ctx.recipe.name + ": ";
msg += "<strong>" + targetPkg.name + "</strong> and its dependencies";
@@ -150,7 +151,9 @@ function customRecipePageInit(ctx) {
(targetPkg.depsAdded.length + 1) + " packages added");
} else {
- msg += ' <strong>' + targetPkg.name + '<strong>';
+ msg += "added <strong>1</strong>";
+ msg += " package to " + ctx.recipe.name + ": ";
+ msg += "<strong>" + targetPkg.name + "</strong>";
inlineNotify.text("1 package added");
}
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index dfa256e..83ba536 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -2644,7 +2644,7 @@ if True:
cust_package = CustomImagePackage.objects.get(
name=dep.depends_on.name)
- recipe.includes_set.add(cust_package)
+ recipe.appends_set.add(cust_package)
except:
logger.warning("Could not add package's suggested"
"dependencies to the list")
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] toaster: fix banner after customimage package add
2016-02-19 22:23 ` [PATCH 1/1] toaster: " Dave Lerner
@ 2016-02-22 14:29 ` Barros Pena, Belen
2016-02-22 16:57 ` Michael Wood
1 sibling, 0 replies; 5+ messages in thread
From: Barros Pena, Belen @ 2016-02-22 14:29 UTC (permalink / raw)
To: Lerner, David M (Wind River), toaster@yoctoproject.org,
Wood, Michael G
On 19/02/2016 23:23, "toaster-bounces@yoctoproject.org on behalf of Dave
Lerner" <toaster-bounces@yoctoproject.org on behalf of
dave.lerner@windriver.com> wrote:
>Correct formatting of the banner message after adding a package to a
>custom image. Also, correct the tracking of dependent packages for the
>added package, adding them to the set of packages appended to the
>base image rather than the set originally included the base image.
>
>[YOCTO #9101]
This seems to be working for me. No incomplete notification messages, and
the correct button status for both package added and dependencies. Also,
correct build outcome.
Thanks!
Belén
>
>Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
>---
> bitbake/lib/toaster/toastergui/static/js/customrecipe.js | 7 +++++--
> bitbake/lib/toaster/toastergui/views.py | 2 +-
> 2 files changed, 6 insertions(+), 3 deletions(-)
>
>diff --git a/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
>b/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
>index a1fe486..3c57899 100644
>--- a/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
>+++ b/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
>@@ -127,7 +127,8 @@ function customRecipePageInit(ctx) {
> if (targetPkg.hasOwnProperty('depsAdded') &&
> targetPkg.depsAdded.length > 0) {
>
>- msg += "added " + (targetPkg.depsAdded.length + 1);
>+ msg += "added ";
>+ msg += "<strong>" + (targetPkg.depsAdded.length + 1) +
>"</strong>";
> msg += " packages to " + ctx.recipe.name + ": ";
> msg += "<strong>" + targetPkg.name + "</strong> and its
>dependencies";
>
>@@ -150,7 +151,9 @@ function customRecipePageInit(ctx) {
> (targetPkg.depsAdded.length + 1) + " packages added");
>
> } else {
>- msg += ' <strong>' + targetPkg.name + '<strong>';
>+ msg += "added <strong>1</strong>";
>+ msg += " package to " + ctx.recipe.name + ": ";
>+ msg += "<strong>" + targetPkg.name + "</strong>";
> inlineNotify.text("1 package added");
> }
>
>diff --git a/bitbake/lib/toaster/toastergui/views.py
>b/bitbake/lib/toaster/toastergui/views.py
>index dfa256e..83ba536 100755
>--- a/bitbake/lib/toaster/toastergui/views.py
>+++ b/bitbake/lib/toaster/toastergui/views.py
>@@ -2644,7 +2644,7 @@ if True:
> cust_package = CustomImagePackage.objects.get(
> name=dep.depends_on.name)
>
>- recipe.includes_set.add(cust_package)
>+ recipe.appends_set.add(cust_package)
> except:
> logger.warning("Could not add package's
>suggested"
> "dependencies to the list")
>--
>1.9.1
>
>--
>_______________________________________________
>toaster mailing list
>toaster@yoctoproject.org
>https://lists.yoctoproject.org/listinfo/toaster
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] toaster: fix banner after customimage package add
2016-02-19 22:23 ` [PATCH 1/1] toaster: " Dave Lerner
2016-02-22 14:29 ` Barros Pena, Belen
@ 2016-02-22 16:57 ` Michael Wood
2016-02-22 21:42 ` Lerner, Dave
1 sibling, 1 reply; 5+ messages in thread
From: Michael Wood @ 2016-02-22 16:57 UTC (permalink / raw)
To: Dave Lerner, toaster, belen.barros.pena
On 19/02/16 22:23, Dave Lerner wrote:
> Correct formatting of the banner message after adding a package to a
> custom image. Also, correct the tracking of dependent packages for the
> added package, adding them to the set of packages appended to the
> base image rather than the set originally included the base image.
>
> [YOCTO #9101]
>
> Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
> ---
> bitbake/lib/toaster/toastergui/static/js/customrecipe.js | 7 +++++--
> bitbake/lib/toaster/toastergui/views.py | 2 +-
> 2 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/bitbake/lib/toaster/toastergui/static/js/customrecipe.js b/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
> index a1fe486..3c57899 100644
> --- a/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
> +++ b/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
> @@ -127,7 +127,8 @@ function customRecipePageInit(ctx) {
> if (targetPkg.hasOwnProperty('depsAdded') &&
> targetPkg.depsAdded.length > 0) {
>
> - msg += "added " + (targetPkg.depsAdded.length + 1);
> + msg += "added ";
> + msg += "<strong>" + (targetPkg.depsAdded.length + 1) + "</strong>";
> msg += " packages to " + ctx.recipe.name + ": ";
> msg += "<strong>" + targetPkg.name + "</strong> and its dependencies";
>
> @@ -150,7 +151,9 @@ function customRecipePageInit(ctx) {
> (targetPkg.depsAdded.length + 1) + " packages added");
>
> } else {
> - msg += ' <strong>' + targetPkg.name + '<strong>';
> + msg += "added <strong>1</strong>";
> + msg += " package to " + ctx.recipe.name + ": ";
> + msg += "<strong>" + targetPkg.name + "</strong>";
> inlineNotify.text("1 package added");
> }
Belen tested the UI part and code looks fine to me.
>
> diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
> index dfa256e..83ba536 100755
> --- a/bitbake/lib/toaster/toastergui/views.py
> +++ b/bitbake/lib/toaster/toastergui/views.py
> @@ -2644,7 +2644,7 @@ if True:
> cust_package = CustomImagePackage.objects.get(
> name=dep.depends_on.name)
>
> - recipe.includes_set.add(cust_package)
> + recipe.appends_set.add(cust_package)
Packages included was the correct place for these to be added. This
includes_set is a list of all the packages that have *not* been added by
the user themselves, they get brought in when bitbake does the package
level dependency resolution. bitbake is in control of dependency
resolution, we aren't a package manager so we do a best guess based on
previous build, this gets corrected automatically after rebuilding the
recipe.
> except:
> logger.warning("Could not add package's suggested"
> "dependencies to the list")
Thanks,
Michael
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] toaster: fix banner after customimage package add
2016-02-22 16:57 ` Michael Wood
@ 2016-02-22 21:42 ` Lerner, Dave
0 siblings, 0 replies; 5+ messages in thread
From: Lerner, Dave @ 2016-02-22 21:42 UTC (permalink / raw)
To: WOOD, MICHAEL, toaster@yoctoproject.org,
belen.barros.pena@linux.intel.com
Thanks, see below
On Monday, February 22, 2016 10:57 AM, Michael Wood wrote:
> On 19/02/16 22:23, Dave Lerner wrote:
> > Correct formatting of the banner message after adding a package to a
> > custom image. Also, correct the tracking of dependent packages for the
> > added package, adding them to the set of packages appended to the
> > base image rather than the set originally included the base image.
> >
> > [YOCTO #9101]
> >
> > Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
> > ---
> > bitbake/lib/toaster/toastergui/static/js/customrecipe.js | 7 +++++--
> > bitbake/lib/toaster/toastergui/views.py | 2 +-
> > 2 files changed, 6 insertions(+), 3 deletions(-)
> >
> > diff --git a/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
> b/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
> > index a1fe486..3c57899 100644
> > --- a/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
> > +++ b/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
> > @@ -127,7 +127,8 @@ function customRecipePageInit(ctx) {
> > if (targetPkg.hasOwnProperty('depsAdded') &&
> > targetPkg.depsAdded.length > 0) {
> >
> > - msg += "added " + (targetPkg.depsAdded.length + 1);
> > + msg += "added ";
> > + msg += "<strong>" + (targetPkg.depsAdded.length + 1) + "</strong>";
> > msg += " packages to " + ctx.recipe.name + ": ";
> > msg += "<strong>" + targetPkg.name + "</strong> and its dependencies";
> >
> > @@ -150,7 +151,9 @@ function customRecipePageInit(ctx) {
> > (targetPkg.depsAdded.length + 1) + " packages added");
> >
> > } else {
> > - msg += ' <strong>' + targetPkg.name + '<strong>';
> > + msg += "added <strong>1</strong>";
> > + msg += " package to " + ctx.recipe.name + ": ";
> > + msg += "<strong>" + targetPkg.name + "</strong>";
> > inlineNotify.text("1 package added");
> > }
>
> Belen tested the UI part and code looks fine to me.
> >
> > diff --git a/bitbake/lib/toaster/toastergui/views.py
> b/bitbake/lib/toaster/toastergui/views.py
> > index dfa256e..83ba536 100755
> > --- a/bitbake/lib/toaster/toastergui/views.py
> > +++ b/bitbake/lib/toaster/toastergui/views.py
> > @@ -2644,7 +2644,7 @@ if True:
> > cust_package = CustomImagePackage.objects.get(
> > name=dep.depends_on.name)
> >
> > - recipe.includes_set.add(cust_package)
> > + recipe.appends_set.add(cust_package)
>
> Packages included was the correct place for these to be added. This
> includes_set is a list of all the packages that have *not* been added by
> the user themselves,
I also assumed that includes_set was only those packages not added by the user, but when the user acknowledges adding the dependencies in the modal dialog, then I considered those packages as 'user-added'. I will remove my change from the patch set, although my proposed patch fixed two previously existing bugs. There is another way to fix both of the bugs, outlined below:
Existing bugs back in play...
For uninstalled package C1, dependent on P1 (already installed) and P2 (not installed)...
A) user adds C1, acknowledges adding P2, (P1 not shown in modal) both get 'added'
B) user 'removes' C1 and then manually (until bug 9121 fix) removes 'P2'
C) user adds back C1, and modal dialog again shows 'P2' was added
* Bug 1 *
D) user looks at 'P2' but it appears unadded, showing "Add Package" not "Remove Package"
> they get brought in when bitbake does the package
> level dependency resolution. bitbake is in control of dependency
> resolution, we aren't a package manager so we do a best guess based on
> previous build, this gets corrected automatically after rebuilding the
> recipe.
* Bug 2 *
Not everything gets corrected after a build: after building, recycling toaster, P2 still looks like it wasn't added, showing the "Add Package" button, not the "Remove Package" button, even though it was brought in and built by adding C1 at step (C).
> Thanks,
> Michael
If I revert my original fix, then I can fix this issue by, in addition to adding the dependent packages to the includes set, removing those entries from the excludes set.
Michael, assuming I revert my original views.py fix, do you want me to write up a new defect for the two bugs or do you want me to roll in the excludes fix into the current patch set?
Thanks,
Dave
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-02-22 21:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-19 22:23 [review-request] fix banner after customimage package add Dave Lerner
2016-02-19 22:23 ` [PATCH 1/1] toaster: " Dave Lerner
2016-02-22 14:29 ` Barros Pena, Belen
2016-02-22 16:57 ` Michael Wood
2016-02-22 21:42 ` Lerner, Dave
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.