Bug 426531 - [category] Specify repository references (additional repositories) in category.xml editor
Summary: [category] Specify repository references (additional repositories) in categor...
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 4.5 M1   Edit
Assignee: Susan McCourt CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed, noteworthy
Depends on: 436318
Blocks: 459581
  Show dependency tree
 
Reported: 2014-01-23 21:48 EST by Pascal Rapicault CLA
Modified: 2015-02-10 11:53 EST (History)
7 users (show)

See Also:


Attachments
screenshot of new functionality (110.74 KB, image/png)
2014-06-09 12:08 EDT, Susan McCourt CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Rapicault CLA 2014-01-23 21:48:52 EST
The category editor should allow for references to be specified.
Comment 1 Mickael Istria CLA 2014-01-24 02:42:55 EST
I believe bug 391033 is a DUP of this one (or vice-versa).
Comment 2 Susan McCourt CLA 2014-06-01 17:33:38 EDT
(In reply to Mickael Istria from comment #1)
> I believe bug 391033 is a DUP of this one (or vice-versa).

Yes, I think this is the same bug, but there was some detailed discussion of Tycho issues in the other bug, so I don't want to make it a duplicate.
Comment 3 Susan McCourt CLA 2014-06-01 17:53:21 EDT
Pushed a first pass at
  https://git.eclipse.org/r/27678
  https://git.eclipse.org/r/27679

(I apologize, there was a forced merge here and I should have squashed my commit or used the same gerrit id). Pulling the second change should get both, I think.

This is not ready for PDE review, but is placed here for testing and feedback for anyone interested in the problem.

Some issues I see:

- I am using "Repository Reference" language in the UI to distinguish it from associated sites in the old site model. However, I'm not sure this is the terminology we want to use or not.

- I made the "add repo" UI work very similarly to the Product Editor UI for adding repository references. That UI did expose enable/disable but did not expose repository nicknames. I also am not exposing metadata/artifact, but instead assuming colocation as is done in associate sites.

In theory, we could decide to expose the repository nickname and/or let the user specify the repository type (artifact/metadata).
Comment 4 Mickael Istria CLA 2014-06-02 05:55:50 EDT
Thanks Susan for looking at it.
Sorry, I don't have time to give a try to the patch right now, so I'll ask here:

How does the UI behave if the given repository doesn't exist ? Does it freeze UI, hang on a progress monitor or anything else that can be a bit annoying?

As for our (JBoss Tools/JBoss Developer Studio) use-case, I don't think the nickname concept adds value for us. Plain URL would be sufficient.
Comment 5 Pascal Rapicault CLA 2014-06-02 07:05:35 EDT
It is the same UI than what is already available in the product editor.
It simply allows the user to enter a URL. The URL is not contacted.
Comment 6 Susan McCourt CLA 2014-06-02 12:55:16 EDT
This is ready for PDE review. I've kept the language "referenced repositories" with a definition and explanation for enabled/disabled similar to what we did in product editor.

After reviewing with Pascal, we want the UI to be as close as possible to the already-released repository UI in the product editor.

The UI side can be tested by examining the generated category.xml. Note that the p2 code in bug 436318 must be released in order for this new info in the category.xml to be published by publisher. With that code loaded, you can test that the references are published by doing the following:

1) Create a project containing a feature
2) Specify categories in a category.xml
3) Choose File > export > Deployable features and specify the category.xml in the "options" tab of the wizard.

This will generate a repository and you can see that the repository references specified in the category.xml are in the repository metadata.
Comment 7 Susan McCourt CLA 2014-06-09 12:08:02 EDT
Created attachment 244094 [details]
screenshot of new functionality

An additional page is added to the category editor, "Repository Properties." In this bug we add repository references, and in bug 426532 we add more information for download stats collection.
Comment 8 Pascal Rapicault CLA 2014-06-27 23:34:35 EDT
The p2 code has been merged in master.
Comment 9 Curtis Windatt CLA 2014-07-08 17:01:05 EDT
The UI works exactly the same as the product editor, so I have no issues with it.

The code changes are also acceptable.  It would be nice to have javadoc on the model interfaces describing what they represent.

My only issue is with the text:
1) Repository References
Is this a p2 vocabulary?  I would have expected "Referenced Repositories" or "Additional Repositories".

2) "This repository"
The user is editing a category.xml, not a repository, but the text says 'this one' or 'this repository'. The category definition page says 'to be published in the repository'.  Shouldn't we therefore be using language like 'The list of referenced repositories will be published in the repository where they will be contacted when repository content is requested.'
Here is what I came up with, could still use some improving
"Specify additional repositories that can be searched for content. The list of repository references will be published into the repository and searched when content from this repository is requested."

3) Enablement
Should be more like the product page, keeping (2) in mind
"Enabled repositories are always contacted when searching for content. Disabled repositories must be explicitly enabled by the user in order to be contacted."
Comment 10 Susan McCourt CLA 2014-07-08 22:58:22 EDT
(In reply to Curtis Windatt from comment #9)
Your terminology points are all well taken. I used "Additional Repositories" and changed the references to be "the repository" as you suggest. I started with your verbage and tweaked it just a little bit.

New change posted to Gerrit.
Thanks.
Comment 11 Curtis Windatt CLA 2014-07-09 11:49:59 EDT
http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=c987b864313a8ca6e97def60345a9dcaf5a06ca6

Approved the change, merged with master.
Comment 12 Konstantin Komissarchik CLA 2014-08-11 16:17:40 EDT
I am having trouble getting this to work. Used the editor to modify the category file then used Mars M1 publisher to generate the repo. What should I look for in the repo metadata to know that the referenced repositories are indeed referenced?
Comment 13 Susan McCourt CLA 2014-08-11 19:30:41 EDT
(In reply to Konstantin Komissarchik from comment #12)
> I am having trouble getting this to work. Used the editor to modify the
> category file then used Mars M1 publisher to generate the repo. What should
> I look for in the repo metadata to know that the referenced repositories are
> indeed referenced?

Two things to check. First make sure that the references were indeed saved to the category file. You should see some repository-reference elements:

   <repository-reference location="http://download.eclipse.org/eclipse/updates/4.5milestones" enabled="true" />
   <repository-reference location="http://download.eclipse.org/eclipse/updates/4.4-M-builds" enabled="true" />


And in the generated metadata (content.xml) you should see a <references> element with repository elements underneath. You'll see two entries for each repository specified in the category editor, because we add both a metadata and an artifact repository reference when we generate the metadata.

<?xml version='1.0' encoding='UTF-8'?>
<?metadataRepository version='1.1.0'?>
<repository name='Exported Repository' type='org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository' version='1.0.0'>
  <properties size='2'>
    <property name='p2.timestamp' value='1404060876554'/>
    <property name='p2.compressed' value='true'/>
  </properties>
  <references size=‘4’>
    <repository uri='http://download.eclipse.org/eclipse/updates/4.5milestones' url='http://download.eclipse.org/eclipse/updates/4.5milestones' type='0' options='1'/>
    <repository uri='http://download.eclipse.org/eclipse/updates/4.4-M-builds' url='http://download.eclipse.org/eclipse/updates/4.4-M-builds' type='1' options='1'/>
    <repository uri='http://download.eclipse.org/eclipse/updates/4.5milestones' url='http://download.eclipse.org/eclipse/updates/4.5milestones' type='1' options='1'/>
    <repository uri='http://download.eclipse.org/eclipse/updates/4.4-M-builds' url='http://download.eclipse.org/eclipse/updates/4.4-M-builds' type='0' options='1'/>
  </references>
Comment 14 Konstantin Komissarchik CLA 2014-08-12 23:49:35 EDT
I have the "repository-reference" elements in my site.xml, but I get no "references" element in content.xml when its generated. The old associateSites method does produce the "references" element. 

Could the issue be in the p2 tool that I use to generate the metadata? I am calling this one...

org.eclipse.equinox.p2.publisher.UpdateSitePublisher
Comment 15 Susan McCourt CLA 2014-08-13 01:23:02 EDT
(In reply to Konstantin Komissarchik from comment #14)
> I have the "repository-reference" elements in my site.xml, but I get no
> "references" element in content.xml when its generated. The old
> associateSites method does produce the "references" element. 
> 
> Could the issue be in the p2 tool that I use to generate the metadata? I am
> calling this one...
> 
> org.eclipse.equinox.p2.publisher.UpdateSitePublisher

Sorry for not being more specific!

You want to use the PDE export:
File > export > Deployable features and specify the category.xml in the "options" tab of the wizard.
Comment 16 Konstantin Komissarchik CLA 2014-08-13 11:20:06 EDT
> You want to use the PDE export:
> File > export > Deployable features and specify the category.xml
> in the "options" tab of the wizard.

So, is this not implemented yet in p2 command-line tools? Is there a bug tracking that work?
Comment 17 Pascal Rapicault CLA 2014-08-13 14:43:07 EDT
AFAIK everything is committed and working both on the p2 and PDE side. Please provide a standalone example that we can use to reproduce the issue.
Comment 18 Konstantin Komissarchik CLA 2014-08-13 14:45:08 EDT
Here is the ant macro that I use to generate the repository metadata.

  <macrodef name="p2.publish.UpdateSite">
    <attribute name="location"/>
    <attribute name="name" default="repository"/>
    <sequential>
      <java classname="org.eclipse.core.launcher.Main" fork="true" failonerror="true">
        <classpath>
          <fileset dir="${bootstrap.platform}/plugins">
            <include name="**/org.eclipse.equinox.launcher_*.jar"/>
          </fileset>
        </classpath>
        <arg line="-application org.eclipse.equinox.p2.publisher.UpdateSitePublisher"/>
        <arg line="-metadataRepository file:@{location}"/>
        <arg line="-artifactRepository file:@{location}"/>
        <arg line="-metadataRepositoryName &quot;@{name}&quot;"/>
        <arg line="-artifactRepositoryName &quot;@{name}&quot;"/>
        <arg line="-source @{location}"/>
        <arg line="-compress"/>
        <arg line="-publishArtifacts"/>
      </java>
    </sequential>
  </macrodef>
Comment 19 Tobias Oberlies CLA 2014-09-08 03:31:33 EDT
*** Bug 391033 has been marked as a duplicate of this bug. ***
Comment 20 Vikas Chandra CLA 2014-09-17 05:44:10 EDT
Verified on
Version: Mars (4.5)
Build id: N20140901-2000