Bug 18500 - [import] Plugin import wizard does not allow plugins of different versions
Summary: [import] Plugin import wizard does not allow plugins of different versions
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.6 M4   Edit
Assignee: Ankur Sharma CLA Friend
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
: 18522 190909 (view as bug list)
Depends on:
Blocks: 282708 296956
  Show dependency tree
 
Reported: 2002-05-31 14:55 EDT by Jed Anderson CLA Friend
Modified: 2009-12-10 03:20 EST (History)
9 users (show)

See Also:
curtis.windatt.public: review+


Attachments
Xerces_3.2.1.zip (674.21 KB, application/octet-stream)
2002-05-31 14:56 EDT, Jed Anderson CLA Friend
no flags Details
mylyn/context/zip (822 bytes, application/octet-stream)
2007-11-11 21:22 EST, Chris Aniszczyk CLA Friend
no flags Details
very simple patch (2.30 KB, patch)
2008-02-01 07:53 EST, bartosz michalik CLA Friend
no flags Details | Diff
mylyn/context/zip (7.14 KB, application/octet-stream)
2008-02-01 07:53 EST, bartosz michalik CLA Friend
no flags Details
UI first cut (29.56 KB, image/jpeg)
2009-11-30 14:54 EST, Ankur Sharma CLA Friend
no flags Details
WIP Patch (24.65 KB, patch)
2009-12-02 15:57 EST, Ankur Sharma CLA Friend
no flags Details | Diff
Updated dialog (24.39 KB, image/jpeg)
2009-12-03 12:00 EST, Ankur Sharma CLA Friend
no flags Details
Patch (24.06 KB, patch)
2009-12-03 14:15 EST, Ankur Sharma CLA Friend
ankur_sharma: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jed Anderson CLA Friend 2002-05-31 14:55:41 EDT
Build: 20020530

The plugin import wizard prompts the user with the following question when two 
versions of org.apache.xerces exist in the plugins directory.

Project "org.apache.xerces" already exists.  Is it OK to replace it?

If you click Yes and let the import finish, you get only one version of xerces.

Perhaps the plugin import tool should make project names like 
org.apache.xerces_4.0.3 for the plugins.

As a test, unzip the attached zip (3.2.1 version of xerces) into your plugins 
directory, and run the plugin import wizard.
Comment 1 Jed Anderson CLA Friend 2002-05-31 14:56:22 EDT
Created attachment 1148 [details]
Xerces_3.2.1.zip
Comment 2 Dejan Glozic CLA Friend 2002-06-25 16:05:54 EDT
*** Bug 18522 has been marked as a duplicate of this bug. ***
Comment 3 Dejan Glozic CLA Friend 2003-01-24 11:09:39 EST
Will not be addressed in 2.1
Comment 4 Markus Keller CLA Friend 2007-05-29 06:45:30 EDT
This problem will become more prominent when we start shipping multiple versions of the same plug-in in the SDK, e.g. org.junit (not yet for 3.3). I also ran into this problem with plug-ins that I updated via update manager (which leaves the old version around).
Comment 5 Wassim Melhem CLA Friend 2007-05-29 15:24:48 EDT
This is a good one to reopen.
Comment 6 Wassim Melhem CLA Friend 2007-05-29 15:25:16 EDT
This one is certainly doable now that we support multiple versions of the same plug-in.

We could do the WinZip behavior: offer to overwrite or create a project by a different name and let the user input the new name.
Comment 7 Brian Bauman CLA Friend 2007-05-29 15:32:38 EDT
post 3.3, right?  

Note: we already have this as a documented limitation in the readme.
Comment 8 Wassim Melhem CLA Friend 2007-05-29 15:41:37 EDT
yes, post-3.3.  Now is not time to address a bug numbered "18500" ;)
Comment 9 Brian Bauman CLA Friend 2007-06-04 18:04:52 EDT
*** Bug 190909 has been marked as a duplicate of this bug. ***
Comment 10 Chris Aniszczyk CLA Friend 2007-11-11 21:22:48 EST
marking bugday for the brave... attaching a context for the brave...

This would earn extra bonus points as it's a very low bug number :)
Comment 11 Chris Aniszczyk CLA Friend 2007-11-11 21:22:56 EST
Created attachment 82628 [details]
mylyn/context/zip
Comment 12 Chris Aniszczyk CLA Friend 2008-01-29 15:14:27 EST
we should get this one done for 3.4
Comment 13 bartosz michalik CLA Friend 2008-01-30 07:01:58 EST
By now there are 5 options in override dialog. We can change meaning of the No and No for all, to show change name dialog for the plugins but it may confuse users. Adding two more ... well this will be way to much for such a simple task.

And I've newer work on so old bug :) If you don't have a better candidate I can solve it :D
Comment 14 Chris Aniszczyk CLA Friend 2008-01-30 09:14:05 EST
The solution I think is really simple and deals with creating projects for plugins in a special way if they have multiples... ie., org.apache.commons.collections_3.1.0, org.apache.commons.collections_3.2.0, versus just org.apache.commons.collections...

ie., id_version

I'll have to look into this a bit more but I think that should be sufficient.
Comment 15 bartosz michalik CLA Friend 2008-02-01 07:53:30 EST
Created attachment 88541 [details]
very simple patch

new format for imported plug-ins projects' names *id_version*
Comment 16 bartosz michalik CLA Friend 2008-02-01 07:53:35 EST
Created attachment 88542 [details]
mylyn/context/zip
Comment 17 Chris Aniszczyk CLA Friend 2008-02-01 10:48:08 EST
I'll look at this soon, thanks for looking into it Bartek.
Comment 18 Brian Bauman CLA Friend 2008-02-01 13:46:10 EST
Thanks for the patch Bartosz.  You just fixed the oldest PDE bug on record!

I added just a little bit of logic to look for an existing plug-in in the workspace with the same id and version.  If such a plug-in project exists, we then return that name instead of the <id>_<version> so we prevent having two plug-ins with the same id and version.

It might have taken 5 and a half years, but some things are worth the wait ;-)  

Thanks Bartosz!
Comment 19 bartosz michalik CLA Friend 2008-02-01 21:15:36 EST
it was a great "adventure" for me to ;) especially the patch was the oldest one I ever had :D

Comment 20 bartosz michalik CLA Friend 2008-02-01 21:16:07 EST
anyway I am working for top contributor for this year ;D
Comment 21 Brian Bauman CLA Friend 2008-02-04 01:17:58 EST
Just for the record, this modification required changes to our JUnit tests.  The tests verify the plug-in was imported correctly by checking to see if a project exists with the plug-in id.  I changed up the test cases to check to <id>_<version>.  I didn't think about this until all the import test cases were broke :)
Comment 22 Dani Megert CLA Friend 2008-02-05 08:12:20 EST
>very simple patch
Unfortunately a bit too simple, see bug 217820 and bug 217824. This causes big trouble.

I suggest to reopen and revert for M5 and make a better fix for M6.
Comment 23 Dani Megert CLA Friend 2008-02-05 08:29:14 EST
Before adding this PDE has to test and if needed update all its tooling like the launcher, hyperlinking to go to required plug-ins, pde container etc.
Comment 24 bartosz michalik CLA Friend 2008-02-05 09:56:18 EST
(In reply to comment #22)
> >very simple patch
> Unfortunately a bit too simple,
yes :| anyway besides of checking the tooling we should think about the import logic (should we leave override behaviour as default ? ) and how to support handling different versions. 

My idea is to add checkbox like "Allow multiversions" (but it will complicate the ui) which is disabled by default.

Let's assume we have plug-in A in two versions 1.0.0 and 1.0.1

When option is enabled in and we import both plug-ins there will be create two project A (v1.0.1) and A_1.0.0

but there is a question what to do when we have A(v1.0.0) in workspace and import again both:
should we add A_1.0.1 or update A to 1.0.1 and add new project 1.0.0 ?

alternatively we can consider changes in override dialog but I don't think this is good idea

Comment 25 Dani Megert CLA Friend 2008-02-05 10:07:32 EST
>My idea is to add checkbox like "Allow multiversions" 
Better: 'Append version to project name'. Out of the box it should import as before.

But as long as PDE doesn't support it it shouldn't be offered. For example hyperlinking: if I import A and B from two versions (e.g. 3.2 and 3.3) and B requires A then clicking a required plug-in in B's manifest always goes to the same version of A instead of the correct one. Also, in some scenarios both B's can  fit the version constaints and hence PDE would have to show a selection dialog to which B I want to go. And of course there's the launching issue.
Comment 26 Chris Aniszczyk CLA Friend 2008-02-05 10:28:04 EST
pulled out the change, Brian and I are discussing what to do about this in M6. We have a possible solution.
Comment 27 Dani Megert CLA Friend 2008-02-05 10:44:10 EST
Thanks!
Comment 28 bartosz michalik CLA Friend 2008-04-01 09:54:26 EDT
is there anything I can participate in ?
Comment 29 Curtis Windatt CLA Friend 2008-11-17 14:19:01 EST
(In reply to comment #26)
> pulled out the change, Brian and I are discussing what to do about this in M6.
> We have a possible solution.
> 

Pinging zx, sometime we should discuss what could be done here.
Comment 30 Markus Keller CLA Friend 2009-11-18 12:42:47 EST
This could become more of an issue when we ship version 3 and 4 of org.junit.
Comment 31 Dani Megert CLA Friend 2009-11-19 07:41:54 EST
I don't think we need another option: it is already possible to select two versions of the same bundle if 'Show latest version of plug-ins only' is unchecked and if I do so, the last one wins (overwrites the first one).

The following small change to the initially proposed solution might do the trick:

When importing plug-in 'P' check if that bundle is already in the workspace with the same version (without qualifier)
- if yes import with same name as in workspace (overwrite existing)
- if no import as "P (x.y.z)"
Comment 32 Curtis Windatt CLA Friend 2009-11-19 11:28:28 EST
Darin and I came up with an alternate proposal:

1) Remove the current yes/yes to all/no/no to all/cancel prompting.
2) Before starting to import individual bundles, scan the workspace models for bundles with the same symbolic name as a bundle being imported.
3) If there are any bundle name conflicts, open a dialog with a checkbox table.  List all bundles with the same name along with their version and project name.
4) The user can deselect bundles they do not want overwritten (a single import could overwrite multiple projects).
5) Delete the selected projects.
6) Import the plug-ins, if there is still a project with the same default name, append the version (without qualifier).  If that project exists, make the project name be "<symbolic name> (<version>) #" with increasing values of #.

This solution makes the import depend on bundle names rather than project names, which feels more natural as project can be called anything.  The user also has a fair amount of control over what they delete.
Comment 33 Curtis Windatt CLA Friend 2009-11-19 11:31:50 EST
Ankur, if we go forward with the proposal in comment #32 would you have time to work on this?

Though I'm considering finding time to work on it, because it is < 20,000 and over 7 years old!
Comment 34 Ankur Sharma CLA Friend 2009-11-19 12:04:20 EST
(In reply to comment #33)
> Ankur, if we go forward with the proposal in comment #32 would you have time to
> work on this?
> 
> Though I'm considering finding time to work on it, because it is < 20,000 and
> over 7 years old!

It'll be an honor to fix one of the oldest open PDE bug :-)
If Dani is also OK with the proposal, I'll target it for M4.
Comment 35 Dani Megert CLA Friend 2009-11-20 05:03:18 EST
>4) The user can deselect bundles they do not want overwritten (a single import
>could overwrite multiple projects).
I always import > 100 bundles. You don't expect me to check each of them manually, do you? ;-) Currently I have to click exactly once. This must stay as is as this the common workflow when importing the binary bundles from a new drop.


The suggestion from comment 32 only unnecessarily complicates things. My suggestion would not cause any disruption to the known (and (90%) workflow but would only come into play in case there are >1 version of the same bundle implemented.

If I can choose, then better do nothing than what's proposed in comment 32.
Comment 36 Curtis Windatt CLA Friend 2009-11-20 11:05:52 EST
The dialog I am proposing would have checkbox selection, (de)select all buttons, and would have everything selected by default.  For your case Dani, the only difference would be you pressing OK instead of Yes to All.

The dialog would be an improvement on the current system, where you get a dialog with 5 buttons and if you want to avoid overwriting one or more projects you have to go through a series of dialogs until you happen to get the one for the project you care about.  This has become more annoying on linux as the Yes button, selected by default, shows up on the far right making the buton order look jumbled.

The current system also only works on project name, so to support your proposal we would have to do the same kind of changes that I'm proposing.  I'm also concerned that as bundles increase their versions you'll end up with multiple projects for the same singleton bundle.
Comment 37 Markus Keller CLA Friend 2009-11-20 12:11:47 EST
Comment 32 sounds great! Just 1 caveat and 1 change request:

In steps 5 & 6, the implementation should make sure that plug-ins which replace existing plug-ins stay in the same working set as the original plug-ins (steps in bug 256592).

I don't like spaces in project names. Could the projects be named as proposed in comment 0, e.g. like this (stuff in [] only to disambiguate):

<symbolic name>[_<version without qualifier>[_<unique number>]]
Comment 38 Dani Megert CLA Friend 2009-11-23 03:24:39 EST
>The dialog I am proposing would have checkbox selection, (de)select all
>buttons, and would have everything selected by default.  For your case Dani,
>the only difference would be you pressing OK instead of Yes to All.
If it has '(De-)Select All' and the default is that all are checked then that looks good to me. Given the SDK already has around 200 bundles we should also use a filtered checkbox list.

We want to proceed with bug 153429 so I hoped to quickly get a working importer again with what I suggested in comment 31 but if you have resources to provide a new UI then that's also OK, but I don't want to wait too long for that ;-)


>I don't like spaces in project names. Could the projects be named as proposed
>in comment 0, e.g. like this (stuff in [] only to disambiguate):
And I don't like underscores in the name ;-) but I agree that unless there are ambiguities we only want the symbolic name like I proposed in my solution. In case of dis-ambiguities we should simply use the same rendering as PDE uses in the import and target pref page:
    symblicName (x.y.z.qualifier)
where the "(...)" is rendered using qualifier color (see also bug 295827).
Comment 39 Markus Keller CLA Friend 2009-11-23 06:16:35 EST
There's a difference between rendering on the Target Platform page and choice of project name.

For rendering, the gray (x.y.z.qualifier) is a good way to add more information to bundle names. But the project name should be as close as possible to the original bundle name (after all, it is still an *import* operation), so the most obvious choice is the format used in the original jar names (where the version is also appended with an underscore).
Comment 40 Dani Megert CLA Friend 2009-11-23 09:22:30 EST
>so the
>most obvious choice is the format used in the original jar names (where the
>version is also appended with an underscore).
I disagree that the JAR name is the obvious choice for a project name but I agree that we can't use gray decoration here i.e. the created project name should contain the additional qualifications and should be rendered in normal color.
Comment 41 Curtis Windatt CLA Friend 2009-11-23 12:12:32 EST
Alright, space vs underscore aside, it looks like we'll move forward with the new UI.  Ankur, maybe you and I can discuss this for a few minutes this week so it gets done sooner rather than later.
Comment 42 Ankur Sharma CLA Friend 2009-11-30 14:54:16 EST
Created attachment 153389 [details]
UI first cut
Comment 43 Markus Keller CLA Friend 2009-12-01 09:29:08 EST
The JAR name also has the advantage that it is not translated and hence the behavior is the same on all locales. The UI notation with " (<version>)" is NLS'd (or at least should be, I didn't check).
Comment 44 Dani Megert CLA Friend 2009-12-01 10:43:15 EST
>The JAR name
I can live if we go with the the JAR name but MINUS the ".jar" and as previously said we must only append this if there are conflicts.
Comment 45 Ankur Sharma CLA Friend 2009-12-02 15:40:43 EST
I am dropping a check for Execution Environment. Presently, if a plugin (getting imported) has a BREE which is not supported by any of the installed JREs then user is prompted for confirmation (for importing that particular plugin or not).

Dropping this check also makes sense because if the BREE is not supported then 
a) user will get the warning anyway 
b) next logical step would be to install that EE.
Comment 46 Ankur Sharma CLA Friend 2009-12-02 15:57:48 EST
Created attachment 153662 [details]
WIP Patch

It needs some comments, cleaning and fine tuning. However, play with it and let me know if its not behaving properly.
Comment 47 Curtis Windatt CLA Friend 2009-12-02 16:32:58 EST
Here's a quick list of things to fix, I can probably work on some of them if it means getting this in for M4.

1) The dialog opens even when there are no conflicts
2) The check box should be part of the plug-in name column (see Installed JREs pref page)
3) There should be an icon on the first column (you can use the general PDE label provider just like the plugin import detailed page does)
4) The first column should be "Name" or "Plug-in" not symbolic name
5) The first column is too small, you can probably have the columns take equal sizes
6) Select all and deselect all buttons should be underneath, not beside the table.  (see the dialog that offers to save multiple dirty editors when closing Eclipse).
7) When people see columns with headers, they generally expect to be able to click on them to sort by that column.
8) All entries in the dialog should be checked by default
9) Filter box should search anywhere in the name (see the plugin import detail page)

The filtering/select all behaviour could be an issue.  The buttons don't change enablement when everything/nothing is selected.  The select all only affects what is visible.  I'm not sure if this is actually a problem as it is useful to only change what is visible and other selection dialogs don't worry about disabling select all.

We could try moving away from columns which would avoid some of the above issues.  That just might make it hard to see the project name.
Comment 48 Curtis Windatt CLA Friend 2009-12-02 16:50:01 EST
I think we also need to look at how this dialog handles some unusual cases.  Specifically I am concerned that we need to do more of the project clean-up ahead of time rather than just setting overwriteProject to true when importing each plug-in.

If we are importing org.eclipse.foo v1.0 and two other copies of org.eclipse.foo exist in the workspace, should we delete both of the existing projects?  Darin and I had discussed this a bit when we first talked about having the new dialog, but I don't remember what the conclusion was.

In any case the dialog already feels like an improvement over the 5 button prompt.
Comment 49 Ankur Sharma CLA Friend 2009-12-03 00:50:26 EST
I know dialog needs a lot of UI correction. I was more concerned about the importing and creating new projects. Since that did not get a mention, I believe its working fine.
Comment 50 Dani Megert CLA Friend 2009-12-03 02:01:32 EST
>Here's a quick list of things to fix, I can probably work on some of them if it
>means getting this in for M4.
We need a way in M4 to import two versions of the same bundle.
Comment 51 Ankur Sharma CLA Friend 2009-12-03 12:00:32 EST
Created attachment 153741 [details]
Updated dialog

Patch will follow soon.

The projects are now (style) displayed as ProjectName (id - version)
Comment 52 Ankur Sharma CLA Friend 2009-12-03 14:15:46 EST
Created attachment 153766 [details]
Patch

Curtis, let me know your comments.
Comment 53 Curtis Windatt CLA Friend 2009-12-04 15:16:51 EST
Fixed up the dialog (altered label provider, composite sizing, message text) and fixed a few bugs in the code (possible NPEs, incorrect project naming).  Committed the code to HEAD.

There is a change in behaviour with this fix.  When the user imports a plug-in with a conflict and chooses not to delete the project, previously we would skip importing that plug-in.  After this fix, instead of ignoring, we import the plug-in and give it a different name.
Comment 54 Curtis Windatt CLA Friend 2009-12-08 15:38:06 EST
Verified in I20091208-0100
Comment 55 Dani Megert CLA Friend 2009-12-10 03:20:36 EST
Good work. Thanks!