Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 278208 - Collect features in identical categories from different sites
Summary: Collect features in identical categories from different sites
Status: RESOLVED DUPLICATE of bug 261104
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.5   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-28 09:25 EDT by Achim Demelt CLA
Modified: 2009-05-29 02:43 EDT (History)
4 users (show)

See Also:


Attachments
Screenshots (146.81 KB, application/zip)
2009-05-28 09:25 EDT, Achim Demelt CLA
no flags Details
jarred content.xml of first site (4.49 KB, application/zip)
2009-05-28 10:07 EDT, Achim Demelt CLA
no flags Details
jarred content.xml of second site (9.45 KB, application/zip)
2009-05-28 10:09 EDT, Achim Demelt CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Achim Demelt CLA 2009-05-28 09:25:18 EDT
Created attachment 137479 [details]
Screenshots

Tested with 3.5RC2:

Consider two update sites that look like this:

* Site 1
 ** Category FOO
   *** Feature a
   *** Feature b
 ** Category X
   *** Feature c

* Site 2
 ** Category FOO
   *** Feature d
   *** Feature e
 ** Category Y
   *** Feature f

Using the "Install New Software..." UI and selecting one individual site, you see the structure as outlined above. Selecting "--All Available Sites--", however, shows the following:

** Category FOO
  *** Feature a
  *** Feature b
** Category X
  *** Feature c
** Category Y
  *** Feature f

Category FOO should show four features instead of two.

Find attached a ZIP file with three screenshots showing the problem. I can also attach artifact and content XMLs if it helps.
Comment 1 Pascal Rapicault CLA 2009-05-28 09:57:02 EDT
Attaching the content.xml of each site would really help (or create a simpler example)
Comment 2 Achim Demelt CLA 2009-05-28 10:07:43 EDT
Created attachment 137488 [details]
jarred content.xml of first site

No problem :-)

Here's the first site.
Comment 3 Achim Demelt CLA 2009-05-28 10:09:01 EDT
Created attachment 137489 [details]
jarred content.xml of second site

...and here's the second site
Comment 4 Susan McCourt CLA 2009-05-28 11:36:02 EDT
This sounds like the categories might have been generated before bug 261104 was fixed.  This would cause the same-named categories to be treated as equals in the query, so we wouldn't properly merge them.

Ian, can you take a look at the metadata?  I haven't looked (yet), but I suspect this metadata could have been generated before we solved that problem?
Comment 5 Ian Bull CLA 2009-05-28 11:40:05 EDT
The categories don't have unique versions, they just have 0.0.0.  So yes, this is a duplicate of bug 261104.  Achim, if you use a recent version of p2 to generate your metadata this problem should go away. 
Comment 6 Susan McCourt CLA 2009-05-28 11:43:41 EDT
I'll mark this as a duplicate of 261104.
Achim, please reopen if you still see a problem after regenerating metadata.

*** This bug has been marked as a duplicate of bug 261104 ***
Comment 7 Achim Demelt CLA 2009-05-28 11:55:02 EDT
I'm using Buckminster to generate the site. So I guess I'll just wait until the
Buckminster folks pick up the new p2 version and I'll be fine.

Thanks for the quick replies!
Comment 8 Thomas Hallgren CLA 2009-05-28 12:15:34 EDT
The categories are using the same id although they reside in different repositories. Is that really allowed?

What happens if the categories are versioned? I thought it was like this:

1. If they have the same version, they are considered to be the same IU and therefore only one is used. Which one is probably dependent on how the repositories are queried.
2. If they have different versions, only the latest version will be displayed.
3. If they have different id but the same name, both will be used and they will be aggregated in the UI.

Or have I misunderstood?
Comment 9 Achim Demelt CLA 2009-05-28 12:39:02 EDT
That makes sense to me. I'll try regenerating the sites with different IDs (but same name) first thing tomorrow morning.
Comment 10 Susan McCourt CLA 2009-05-28 13:07:16 EDT
different ids/same name should work.
However, we expected same ids/different versions to also work.  The publisher (post-bug 261104) will generate a version based on timestamp, and this will ensure the IU's are viewed as "not equal" at query time, and then the content will be merged based on name.
Comment 11 Thomas Hallgren CLA 2009-05-28 13:13:47 EDT
Let me see if I get this correctly. You're saying that if I publish a new version of a category, the old one will still be considered?
Comment 12 Susan McCourt CLA 2009-05-28 13:35:03 EDT
(In reply to comment #11)
> Let me see if I get this correctly. You're saying that if I publish a new
> version of a category, the old one will still be considered?
> 
On the UI side, all categories are collected in the queryable using a set.  So non-equal IU's (those IU's with distinct id/version) will be collected.  The UI then post-processes this set and merges all same-named IUs in one UI node.  

So AFAIK, multiple versions of a category in the same repo would be considered, unless the publisher does something at publish time to get rid of the old versions.

At one time, I think we discussed the possibility that the UI could query the latest version of each category from each queryable, but we'd have to get the semantics of the query right, so that the latest version from each repo (not the latest in all of them) would be considered.  I don't think we knew at that time how the publisher would handle this situation and whether this was needed on the UI side.

All of this has been rather late-breaking, so I'm not sure where we ended up with that issue.

Ian?
Comment 13 Achim Demelt CLA 2009-05-29 02:43:12 EDT
> 3. If they have different id but the same name, both will be used and they 
> will be aggregated in the UI.

I tried that, and it works fine. Thomas, thanks for the hint.