Bug 307789 - Better message when installing target stuff into IDE
Summary: Better message when installing target stuff into IDE
Status: CLOSED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.6   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 3.6 M7   Edit
Assignee: Thomas Watson CLA
QA Contact:
URL:
Whiteboard:
Keywords: polish
Depends on:
Blocks: 276000
  Show dependency tree
 
Reported: 2010-03-31 16:50 EDT by Jeff McAffer CLA
Modified: 2010-04-28 11:32 EDT (History)
6 users (show)

See Also:


Attachments
suggestion for improved message (4.48 KB, patch)
2010-04-19 11:32 EDT, Thomas Watson CLA
no flags Details | Diff
updated patch (4.77 KB, patch)
2010-04-20 16:46 EDT, Thomas Watson CLA
no flags Details | Diff
an alternative proposal, closer to the explanation architecture (4.99 KB, patch)
2010-04-21 16:20 EDT, Daniel Le Berre CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff McAffer CLA 2010-03-31 16:50:26 EDT
Related to bug 276000

We have a number of features in the release repos that are intended only to be installed into the target platform. In fact, if they are installed into the IDE they may kill the install (e.g., installing RAP is "a bad thing").

Given that we are very late in the release, I propose a hack to make the workflow better for the folks who, for whatever reason, try to install these features into the IDE.  Currently they see some spurious message talking about "A.PDE.Target.Platform" requirement not being satisfied. This is confusing for folks. My suggestion is to, at a very high level, look for that specific string in the error messages about to be presented and morph the message into something more readable (e.g., "You are trying to install <something> into your IDE that is intended only for Target Platforms.").

This is clearly not a robust solution but it will address the 90% usability problem without introducing any additional overhead or extensibility points.
Comment 1 Jeff McAffer CLA 2010-04-09 16:13:30 EDT
ping, any joy here for 3.6? This is something that is biting more and more people and hopefully could be a small tweak.
Comment 2 Pascal Rapicault CLA 2010-04-09 19:43:48 EDT
This would relate to new feature work which at this point as been put to an end according to the rules of engagements.
Comment 3 Jeff McAffer CLA 2010-04-11 14:41:18 EDT
Thanks for the clarification.  This is a polish item.  The functionality is there now but the user experience is less than optimal. I've attached the polish keyword to accurately reflect the nature of this bug report.
Comment 4 Jeff McAffer CLA 2010-04-16 18:05:58 EDT
Tom has been hacking around in this area and has had some success...
Comment 5 Thomas Watson CLA 2010-04-19 11:32:19 EDT
Created attachment 165304 [details]
suggestion for improved message

Here is a patch that uses a specific message if someone has selected an IU with a requirement on A.PDE.Target.Platform.  Here is the error message that gets used if RAP is selected:

<message>

Cannot complete the install because software was selected which is intended only for installation into a target platform for the Plug-in Development Environment (PDE).
  Rich Ajax Platform (RAP) Runtime SDK 1.3.0.20100201-1223 (org.eclipse.rap.runtime.sdk.feature.group 1.3.0.20100201-1223): If provisioning a target platform then try disabling the option 'Include required software'

</message>

I had to put the blurb "If provisioning a target platform then try disabling the option 'Include required software'" at the end because this message is also used by PDE for provisioning a target and will get displayed if you have the option 'include required software' enabled.
Comment 6 Jeff McAffer CLA 2010-04-19 20:21:47 EDT
(In reply to comment #5)
> <message>
> Cannot complete the install because software was selected which is intended
> only for installation into a target platform for the Plug-in Development
> Environment (PDE).
>   Rich Ajax Platform (RAP) Runtime SDK 1.3.0.20100201-1223
> (org.eclipse.rap.runtime.sdk.feature.group 1.3.0.20100201-1223): If
> provisioning a target platform then try disabling the option 'Include required
> software'
> </message>

Can I suggest some wording/formatting changes? (note, I am not sure how much control we have over formatting...)

<message>
The following software cannot be installed because it is intended
for use only in Plug-in Development Environment (PDE) target platforms.
Please deselect these items and retry the operation.
  Rich Ajax Platform (RAP) Runtime SDK 1.3.0.20100201-1223

If provisioning a target platform then try disabling the option 'Include required
software'
</message>

> I had to put the blurb "If provisioning a target platform then try disabling
> the option 'Include required software'" at the end because this message is also
> used by PDE for provisioning a target and will get displayed if you have the
> option 'include required software' enabled.

This seems off.  PDE should be putting the required capability into the planner when it is calling to provision the target platform.  If that is not happening then can you open a bug against PDE?

If we can get some joy on that then the "If provisioning..." sentence at the end can be removed.
Comment 7 Thomas Watson CLA 2010-04-20 09:45:01 EDT
(In reply to comment #6)
> This seems off.  PDE should be putting the required capability into the planner
> when it is calling to provision the target platform.  If that is not happening
> then can you open a bug against PDE?

This seems to fall under bug 276000.

> 
> If we can get some joy on that then the "If provisioning..." sentence at the
> end can be removed.

If we can get PDE to add the capability to the provisioned targets then would we be OK?
Comment 8 Thomas Watson CLA 2010-04-20 16:46:38 EDT
Created attachment 165499 [details]
updated patch

I opened a new PDE bug309863 to focus in on getting PDE to "do the right thing" for provisioning target platforms with a A.PDE.Target.Platform capability.

(In reply to comment #6)
> Can I suggest some wording/formatting changes? (note, I am not sure how much
> control we have over formatting...)

Of coarse you can, that is what I hoped for ;-)

> 
> <message>
> The following software cannot be installed because it is intended
> for use only in Plug-in Development Environment (PDE) target platforms.
> Please deselect these items and retry the operation.
>   Rich Ajax Platform (RAP) Runtime SDK 1.3.0.20100201-1223
> 
> If provisioning a target platform then try disabling the option 'Include
> required
> software'
> </message>

The attached patch uses the above wording and puts the blurb about 'included required software at the end in a separate IStatus instead of including it in the name of the software.

> 
> > I had to put the blurb "If provisioning a target platform then try disabling
> > the option 'Include required software'" at the end because this message is also
> > used by PDE for provisioning a target and will get displayed if you have the
> > option 'include required software' enabled.
> 
> This seems off.  PDE should be putting the required capability into the planner
> when it is calling to provision the target platform.  If that is not happening
> then can you open a bug against PDE?
> 
> If we can get some joy on that then the "If provisioning..." sentence at the
> end can be removed.

bug309863 has been opened against PDE.  I left the sentence in there for now but it can easily be removed if the PDE bug is fixed.


Notice that I have found the latest code in head for the director seems to behave badly if trying to install RAP into the IDE.  See bug306279
Comment 9 Daniel Le Berre CLA 2010-04-21 16:20:46 EDT
Created attachment 165635 [details]
an alternative proposal, closer to the explanation architecture

Here is another proposal that is cleaner IMHO.

I could not try it because I do not have test cases.

Thomas, it will give you the direction to customize the explanation messages for specific cases like this.

I did not know where to put your second message: I only included the first one.
Comment 10 Thomas Watson CLA 2010-04-21 17:17:25 EDT
(In reply to comment #9)
> Created an attachment (id=165635) [details]
> an alternative proposal, closer to the explanation architecture
> 
> Here is another proposal that is cleaner IMHO.
> 
> I could not try it because I do not have test cases.
> 
> Thomas, it will give you the direction to customize the explanation messages
> for specific cases like this.
> 

Thanks Daniel.  Putting this down lower in the Explanation makes it difficult to have a clear message to the end user.  With the latest patch we get a message like this when installing RAP into the IDE:

<message>
Cannot complete the install because some dependencies are not satisfiable
  Software being installed: Rich Ajax Platform (RAP) Runtime SDK 1.3.0.20100201-1223 (org.eclipse.rap.runtime.sdk.feature.group 1.3.0.20100201-1223)
  The following software Rich Ajax Platform (RAP) Runtime SDK 1.3.0.20100201-1223 (org.eclipse.rap.runtime.sdk.feature.group 1.3.0.20100201-1223) cannot be installed because it is intended for use only in Plug-in Development Environment (PDE) target platforms. Please deselect these items and retry the operation.
</message>

The first two parts of the message are not really that helpful to the end user.  We want to avoid using terms like "some dependencies are not satisfiable" when attempts are made to install "target platform only" IUs.  It is not that some dependencies were not satisfied (yes technically it is) but rather the user is simply trying to install something that is not valid to install.

The last part of the message is helpful.  This got generated by org.eclipse.equinox.internal.p2.director.Explanation.TargetPlatformProblem.toStatus().  But the issue here is that the problem is detected too low so we have no ability to gather up a list of all IUs that may have the same issue.  So if you selected multiple IUs with the A.PDE.Target.Platform requirement then you would get a separate message for each on containing:

"The following software ... cannot be installed because it is intended for use only in Plug-in Development Environment (PDE) target platforms. Please deselect these items and retry the operation."

Ideally we would like to only have this message listed once followed by the list of problematic IUs.  This is why I placed the logic in SimplePlanner.convertExplanationToStatus(Set<Explanation>).  This seemed like to most simple place to gather up the explanations and provide a specific message for this case.
Comment 11 Daniel Le Berre CLA 2010-04-21 17:42:02 EDT
The explanation elements are sorted using the orderValue() method.

Just change the current value (3) by something smaller (0 or even -1).

That way, you will get first the explanation, and could decide to remove the remaining elements from the explanation.

You can also define a new constant to detect easily what kind of explanation element you are meeting, instead of using an instead-of for instance.
Comment 12 Daniel Le Berre CLA 2010-04-21 17:49:12 EDT
The really great thing would be to automatically deselect those IUs, and just inform the user why they have been deselected :)
Comment 13 Thomas Watson CLA 2010-04-22 09:51:17 EDT
(In reply to comment #11)
> The explanation elements are sorted using the orderValue() method.
> 
> Just change the current value (3) by something smaller (0 or even -1).
> 
> That way, you will get first the explanation, and could decide to remove the
> remaining elements from the explanation.
> 
> You can also define a new constant to detect easily what kind of explanation
> element you are meeting, instead of using an instead-of for instance.

Thanks Daniel, I will work on a patch using this approach.  Before I do, can you confirm that I would remove any other elements from the explanation and possibly add other messages to the overall status in 

SimplePlanner.convertExplanationToStatus(Set<Explanation>)

Or are you expecting the Projector to do that.  It seems like the best place to do the conversion of the explanation set into a status is in convertExplanationToStatus.
Comment 14 Thomas Watson CLA 2010-04-22 09:52:31 EDT
(In reply to comment #12)
> The really great thing would be to automatically deselect those IUs, and just
> inform the user why they have been deselected :)

true, but at this point we are not looking for a heroic effort ;-)

A better message would for this situation is a good step in the right direction.
Comment 15 Daniel Le Berre CLA 2010-04-22 10:03:20 EDT
(In reply to comment #13)
 
> Thanks Daniel, I will work on a patch using this approach.  Before I do, can
> you confirm that I would remove any other elements from the explanation and
> possibly add other messages to the overall status in 
> 
> SimplePlanner.convertExplanationToStatus(Set<Explanation>)

yes, exactly.
Comment 16 Pascal Rapicault CLA 2010-04-22 12:51:29 EDT
Daniel and I discussed this and I don't think chaning the solver is a good thing. The change needs to stay where it currently is.
Comment 17 Thomas Watson CLA 2010-04-22 14:16:33 EDT
(In reply to comment #16)
> Daniel and I discussed this and I don't think chaning the solver is a good
> thing. The change needs to stay where it currently is.

Solver?  both patches are in the director.  My original patch was contained to SimplePlanner.  Daniel's suggestion involved a change to the Explanation and SimplePlanner.  Where exactly do you think the change needs to stay?  Only in SimplePlanner like my original suggestion or somewhere else?
Comment 18 Pascal Rapicault CLA 2010-04-22 14:49:26 EDT
Keep your initial approach.
Comment 19 Daniel Le Berre CLA 2010-04-22 14:51:18 EDT
We decided that it was better to take care of specific cases in SimplePlanner, as in your original patch, than changing the Projector and Explanation classes (which is the direct link to the solver).

That way, the projector can focus on providing an explanation, and the SimplePlanner can make sense of it. There is no shared responsibility as with my proposal.
Comment 20 Thomas Watson CLA 2010-04-22 14:55:52 EDT
Comment on attachment 165635 [details]
an alternative proposal, closer to the explanation architecture

OK, Then I suggest we release the last patch I attached.  We can clean up the message if PDE fixes bug309863
Comment 21 Daniel Le Berre CLA 2010-04-22 15:40:45 EDT
Fine with me.
Comment 22 Thomas Watson CLA 2010-04-22 15:54:24 EDT
(In reply to comment #21)
> Fine with me.

To be clear, I don't have commit rights to p2 so someone else will have to do it for me ;-)
Comment 23 Daniel Le Berre CLA 2010-04-22 16:14:26 EDT
oups, sorry.

Done!
Comment 24 Pascal Rapicault CLA 2010-04-23 15:12:53 EDT
This has been released. Why is this still open? Is there more work to be done?
Btw, do we have a test case for this?
Comment 25 Thomas Watson CLA 2010-04-25 15:38:06 EDT
(In reply to comment #24)
> This has been released. Why is this still open? Is there more work to be done?
> Btw, do we have a test case for this?

You can close, I will work on a testcase during the testpass.  I had started one already.
Comment 26 Pascal Rapicault CLA 2010-04-25 16:17:51 EDT
Thx for the patch Tom.
Comment 27 Thomas Watson CLA 2010-04-28 11:05:40 EDT
While working on a testcase I found a behavior that I am not sure of.  If I am trying to install multiple IUs that have a requirement on A.PDE.Target.Platform namespace then I only see one of the IUs in the explanation set as failing.  Should I expect to see both IUs or does the director only pick a single IU to include in the explanation set?

I have verified that installing RAP into the IDE gives the expected behavior.
Comment 28 Daniel Le Berre CLA 2010-04-28 11:15:20 EDT
You get a minimal explanation, i.e. one of the reason why the request could not be fulfilled.

In the specific case of missing requirements, we could maybe arrange something to get all of them at once.
Comment 29 Thomas Watson CLA 2010-04-28 11:32:54 EDT
(In reply to comment #28)
> In the specific case of missing requirements, we could maybe arrange something
> to get all of them at once.

I would only be for something like that if it was generally useful, correct and relatively easy to do.  I don't want to add any more hackery just for this specific case.