Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 408996 - Product detection should go over all IUs
Summary: Product detection should go over all IUs
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.9.0 Kepler   Edit
Hardware: PC Windows 7
: P3 critical (vote)
Target Milestone: Kepler RC3   Edit
Assignee: Pascal Rapicault CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-24 10:27 EDT by Pascal Rapicault CLA
Modified: 2013-05-31 06:00 EDT (History)
6 users (show)

See Also:
irbull: review+
pascal.rapicault: review? (mknauer)
john.arthorne: review+


Attachments
Patch (16.94 KB, patch)
2013-05-24 14:49 EDT, Pascal Rapicault CLA
no flags Details | Diff
Patch (29.38 KB, patch)
2013-05-27 17:07 EDT, Pascal Rapicault CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Rapicault CLA 2013-05-24 10:27:01 EDT
In the requestflexer, we check to see if there is a product in the existing install. However this check is only done on the root IUs instead of being done on all the IUs.
This means that in situations like the EPP packages where the SDK or Platform products are included, p2 will think that there is no product.
Comment 1 Pascal Rapicault CLA 2013-05-24 14:49:08 EDT
Created attachment 231499 [details]
Patch

The code fix is in RequestFlexer class.
The other changes are to:
- add a new test to cater for this use case
- enabled disabled product tests
- and hook the request flexer test suite to the overall p2 test suite.
Comment 2 Ian Bull CLA 2013-05-24 18:30:39 EDT
(In reply to comment #0)
> In the requestflexer, we check to see if there is a product in the existing
> install. However this check is only done on the root IUs instead of being
> done on all the IUs.
> This means that in situations like the EPP packages where the SDK or
> Platform products are included, p2 will think that there is no product.

I thought the idea was that the EPP Products themselves are 'products' so therefore we didn't need this any lower than the root?
Comment 3 Pascal Rapicault CLA 2013-05-24 21:28:25 EDT
(In reply to comment #2)
> (In reply to comment #0)
> > In the requestflexer, we check to see if there is a product in the existing
> > install. However this check is only done on the root IUs instead of being
> > done on all the IUs.
> > This means that in situations like the EPP packages where the SDK or
> > Platform products are included, p2 will think that there is no product.
> 
> I thought the idea was that the EPP Products themselves are 'products' so
> therefore we didn't need this any lower than the root?
   The EPP are apparently not built as products but they simply include the platform or the SDK as is. This is how they get the executable and a bunch of other files. In the end this is not something that is precluded and is a smart way to go about it. 

Now from the request flexer point of view, the only thing that he should / could care about is the fact that there is a product in the resulting installation no matter how it gets there. 
The other thing to note is that before this fix, the logic that checked "if there is already a product installed" is inconsistent with the logic that checks "if there will be a product installed", since the first one checks that there is product installed as root whereas the other one just check that there is an IU in the resulting plan. So all that to say that this fix is good :)
Comment 4 Markus Knauer CLA 2013-05-25 04:24:28 EDT
(In reply to comment #2)
> I thought the idea was that the EPP Products themselves are 'products'...

I have this idea since some years and I thought we could change it this year in EPP. But after EclipseCon I thought that this change is a substantial behaviour change in the EPP packages and could affect many consumers of the packages.
Comment 5 John Arthorne CLA 2013-05-27 14:49:59 EDT
This may be some kind of JUnit configuration difference on my end, but when I run with your patch, the new test suites are not included in the tests. I had to replace this new line from planner.AllTests#suite:

  suite.addTestSuite(AllRequestFlexerTests.class);

With this:

  suite.addTest(AllRequestFlexerTests.suite());

This is because AllRequestFlexerTests is not actually a test class, it just provides a suite that pulls in a bunch of other test classes. Once I make this change all the new tests run and pass for me (Win 7 64-bit, IBM Java 7).
Comment 6 John Arthorne CLA 2013-05-27 15:49:31 EDT
+1, with the change to the test suite as described in comment #5.
Comment 7 Pascal Rapicault CLA 2013-05-27 17:07:58 EDT
Created attachment 231590 [details]
Patch
Comment 8 Pascal Rapicault CLA 2013-05-27 17:09:23 EDT
I'm attaching a new patch. It includes the change mentioned by John but also includes a change that allows p2 remediation to take the obscure lineUp property found on product IU into account when trying to identify if something is a product or not.
I've also added a couple new test cases to test this.
Comment 9 Ian Bull CLA 2013-05-27 19:10:56 EDT
The patch looks good. I'm not a fan of adding more code to handle forwards compatibility, but it won't hurt (and it means that people can continue to build with old technology and target newer versions of Eclipse).
Comment 10 John Arthorne CLA 2013-05-28 09:11:04 EDT
(In reply to comment #8)
> I'm attaching a new patch. It includes the change mentioned by John but also
> includes a change that allows p2 remediation to take the obscure lineUp
> property found on product IU into account when trying to identify if
> something is a product or not.
> I've also added a couple new test cases to test this.

So this addresses the EPP case described in bug 409019?
Comment 11 Markus Knauer CLA 2013-05-28 09:58:28 EDT
I'd +1 this... but unfortunately I'm not able to run any tests right now.
Comment 13 Pascal Rapicault CLA 2013-05-30 20:51:21 EDT
Fixed