ctron / package-drone

An OSGI first software artifact repository – Moved to the Eclipse Foundation
https://github.com/eclipse/packagedrone
Eclipse Public License 1.0
39 stars 13 forks source link

Cleanup should ignore artifacts which don't match the aggregator property list #143

Open SvenEwald opened 8 years ago

SvenEwald commented 8 years ago

Version 0.11.6 After generating a P2 feature or category or uploading a category.xml, there is no feature or category shown in channel content. Accessing the channel via eclipse does not show category or feature. No erro shown in log.

ctron commented 8 years ago

I just tried to reproduce this. But for me this works.

So I do need a bit more information. Or if possible a sample channel.

Do you have the P2 Metadata aspect active in this channel?

SvenEwald commented 8 years ago

It works in a new created channel, so I removed aspects until it worked in my update site channel. Reason was the cleanup aspect. I use the core information aspect to exctract osgi:name and osgi:version The cleanup is aggregating over osgi:name and sorting by osgi:version, number of entries is one. This setup seems to delete the category.xml Can I use the cleanup, keeping only the last version of a bundle and use a category.xml ?

ctron commented 8 years ago

Actually the core information aspect should provide core:name and the OSGi aspect will provide osgi:name. Of course any artifact that is not an OSGi bundle will not have osgi:name set. So these will get aggregated into a "empty string" group and only one of those "empty string" artifacts will survive.

Can you make a test of the cleanup with the "Test" button, this should give a pretty good overview of what will happen during the clean up.

SvenEwald commented 8 years ago

I understand the reason for the effect. But this means we can have either a category in the update site, or having automatic cleanup. Right? I smell a missing feature ;-)

ctron commented 8 years ago

It always smells like missing features ... and I really hope they small like :hamburger:

So if your are bound to using osgi:name I fear "yes". If you can use core:name is should be possible, since they are different.

Without having tested it, there may be a way to use an additional property, assign it to the category and include this in the list of aggregating fields. Since this should collapse to an empty string for OSGi bundles and would not make a difference then.

SvenEwald commented 8 years ago

For OSGI bundles, the core:name is the filename. So this can not be used for aggregation, because it contains the version. I'm not bound to the osgi:name, but the maven group id and artifact id don't work for osgi bundles.

ctron commented 8 years ago

So in the end, if the artifacts does not have the property osgi:name you want to ignore it? Right?

So I could add a feature that an artifact is only considered for cleanup if "all aggregation properties are present".

ctron commented 8 years ago

Just as a side note ... I am currently working on a feature to actually trigger the clean up in different instances (per channel) at different times (timer, artifact upload, …) However, this will take a bit longer to implement and will not make it into 0.11.x and 0.12.x.

SvenEwald commented 8 years ago

This could solve my requirement. In the mean time I will disable the cleanup and manually delete old snapshot bundles. (Every commit adds a new bundle with new qualifier) Alternative could be a whitelist of artifacts not to be cleaned. Whatever is easier.