Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 338495 - [ui] composite children prevent explicit repo addition ("Duplicate location" when adding update site)
Summary: [ui] composite children prevent explicit repo addition ("Duplicate location" ...
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 blocker with 1 vote (vote)
Target Milestone: Juno M7   Edit
Assignee: Pascal Rapicault CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 330532 342879 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-02-28 20:19 EST by Eric Jain CLA
Modified: 2012-06-05 13:24 EDT (History)
13 users (show)

See Also:
pascal: review? (susan)
pascal: review? (matthew)


Attachments
Patch for the issue (10.50 KB, patch)
2011-05-17 19:08 EDT, Pascal Rapicault CLA
no flags Details | Diff
patch for admin ui (2.01 KB, application/octet-stream)
2011-05-17 19:09 EDT, Pascal Rapicault CLA
no flags Details
Screenshot of duplicate location *error* (42.10 KB, image/png)
2011-08-30 03:02 EDT, Eike Stepper CLA
no flags Details
Screenshot of Available Software Sites missing the duplicate (28.86 KB, image/png)
2011-08-30 03:02 EDT, Eike Stepper CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Jain CLA 2011-02-28 20:19:46 EST
Build Identifier: 20110218-0911

Upon pasting "http://download.eclipse.org/modeling/emf/updates/releases/" into the "Work with" field in the Install dialog, there is a "Duplicate location" error (indicated via a tooltip on a small error icon). However, no such repository (not even a similar one) appears in the dropdown list.

Reproducible: Always
Comment 1 DJ Houghton CLA 2011-03-02 14:46:51 EST
I thought we had a similar bug report about this but I can't find it right now. 

I believe we get this message because the URL you are adding is already a hidden child repo of the Helios composite repo. We should look at improving the message or promoting the repo to be "top level", etc.
Comment 2 DJ Houghton CLA 2011-04-14 14:51:47 EDT
*** Bug 342879 has been marked as a duplicate of this bug. ***
Comment 3 Pascal Rapicault CLA 2011-04-15 08:12:24 EDT
one possibility is a tweak to the UI such that when a user goes to add a repo and it is already there but "system" then simply "add" it by making it non-system.  Care would need to be taken such that if the users subsequently removed the repo it would be "re-added" as a system repo in its role as a child of some composite.

We will need to be careful to see what happens when the composite repo is removed to see if we are not also removing the child.
Comment 4 Ian Bull CLA 2011-04-21 13:35:52 EDT
This is not a show stopper (it's been around for a while). I'm moving it out. Feel free to put it back on the plan, but make sure you is someone in the assigned to field ;).
Comment 5 Pascal Rapicault CLA 2011-05-17 19:08:46 EDT
Created attachment 195920 [details]
Patch for the issue

There were two problems:
- The contains check in the validateRepositoryLocation is not useful since even if the repo is indeed contained, then asking for its addition is not going to cause any problem.
- By default children repos are marked as system. However adding them to the repo manager does not change this system setting (and this is good), so we need to unset the system flag on the children repos.

I have also added additional tests in and around this case.

Finally there is a second patch that deals with the same case in the admin UI.
Comment 6 Pascal Rapicault CLA 2011-05-17 19:09:14 EDT
Created attachment 195921 [details]
patch for admin ui
Comment 7 Pascal Rapicault CLA 2011-05-18 14:18:49 EDT
Differing to 3.7.x or maybe even 3.8.
Comment 8 Pascal Rapicault CLA 2011-05-18 14:26:02 EDT
See also #346315
Comment 9 Susan McCourt CLA 2011-05-18 14:44:16 EDT
I think that if something's too risky for RC1, it's too risky for maintenance release.  marking 3.8.

The basic issue I have with the patch is that it eliminates the "duplicate location" checking entirely from the UI, not just for the broken scenario.  Today's behavior:

- user opens available site prefs
- user types in a location that is a duplicate
- UI tells the user that it's a duplicate, user knows to look for it, or whatever.

With the patch:
- open available site prefs
- type in a duplicate location
- UI accepts it, nothing gets added, no indication that I already had it
- if the user enters a different name than what was already there, the name of the existing repo is updated.  

So in effect, the patch makes "add..." behave like an "add" if the repo is not there, or like an "edit" if the repo exists.

This may in fact be more usable behavior.  Perhaps we are too strict in not letting the user add something that's already there.  For long lists, the user may not care what's there, they just want to make sure it gets added and don't mind if it was there already.  but I don't really want to make that change in RC1 without going back to see why we added the duplicate checking in the first place.  My first searches on bugs in this area didn't find anything, but I know we had a different bug bucket when p2 started....
Comment 10 Thomas Watson CLA 2011-06-08 11:28:59 EDT
Move all 3.8 bugs to Juno.
Comment 11 Pascal Rapicault CLA 2011-06-12 00:07:54 EDT
*** Bug 330532 has been marked as a duplicate of this bug. ***
Comment 12 Stephan Herrmann CLA 2011-06-12 03:40:32 EDT
The initial requests in bug 330532 and here were about "work with",
but the subsequent discussion focuses on "add".

I don't know about the inner workings but for a user it looks *very*
broken if you can't "work with" a repository due to a "duplicate 
location" error. "Well, if it is duplicate, choose either of the
identical duplicates". Duplication should *never* prevent me from
using any location, no?
Comment 13 Eike Stepper CLA 2011-06-27 04:41:55 EDT
(In reply to comment #12)

+1 

Please consider a maintenance fix.
Comment 14 Gabriele Garuglieri CLA 2011-08-08 09:48:17 EDT
(In reply to comment #12)

+1

The current behavior is very misleading.
As a matter of fact with indigo there is no way to add some repos, as for instance, http://download.eclipse.org/tools/ajdt/37/dev/update/, as they are silently discarded.

Only if i paste the url's in the "Work with" text box there is a yellow balloon that says "Duplicate location", but duplicate of what?
Comment 15 Carsten Reckord CLA 2011-08-18 06:18:15 EDT
+1

Please consider moving this again from 3.8 to 3.7.1 or at least 3.7.2.

The "Work with" text box should never be blocked by a duplicate location. While it might implicitly add the location, its purpose is to select the repository. And as Stephan said, it doesn't matter in that case if it already is in the list. In fact it often would be much easier to just type or paste the location instead of 

- hunting it down in the list
- not finding it there
- checking the 'Available Software Sites'
- enabling it there
- coming back to the Install wizard
- hunting it down again

(In reply to comment #14)
> Only if i paste the url's in the "Work with" text box there is a yellow balloon that says "Duplicate location", but duplicate of what?
That's interesting. Because instead of a yellow balloon, I get a red error marker preventing me from using the pasted URL at all.
Comment 16 Eike Stepper CLA 2011-08-30 03:01:09 EDT
May I ask what's the status here? This is really the most annoying bug in my day to day usage of Eclipse and I have no easy workaround. In my case duplicate locations are detected that I even can't  find in the Available Software Sites. That makes it *impossible* to work with certain repositories, a blocker.
Comment 17 Eike Stepper CLA 2011-08-30 03:02:01 EDT
Created attachment 202384 [details]
Screenshot of duplicate location *error*
Comment 18 Eike Stepper CLA 2011-08-30 03:02:38 EDT
Created attachment 202385 [details]
Screenshot of Available Software Sites missing the duplicate
Comment 19 Pascal Rapicault CLA 2012-04-30 19:57:25 EDT
After reviewing the situation of the preference page (available software sites), and some more testing of the patch, Tom, Ian and I have decided to release the patch that is attached here since holding on to the patch in the event that someone would provide a better one is just not going to happen.
Comment 20 Heiko Böttger CLA 2012-05-03 03:38:45 EDT
I'm happy to see (#c19) that this will be fixed. Since we added some third party updatesites to our composite updatesite. This is realy bad for users if they want to add one of these third updatesite later. It's just impossible and how should one know which composite updatesite to search or that selecting all sites and searching for the feature would allow them to install what tehey want.
Thanks for releasing the patch.
Comment 21 Thomas Watson CLA 2012-06-05 10:01:02 EDT
Should this be marked as fixed?
Comment 22 Stephan Herrmann CLA 2012-06-05 12:08:32 EDT
(In reply to comment #21)
> Should this be marked as fixed?

Using build I20120531-1500 I'm happy to say that it works for me now!
Comment 23 Thomas Watson CLA 2012-06-05 13:24:14 EDT
Thanks, closing as fixed.  Please open a new bug if more work is needed to improve the solution that got released.