Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328260 - [api] make supported versions discoverable in connector
Summary: [api] make supported versions discoverable in connector
Status: RESOLVED WONTFIX
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 425593
Blocks:
  Show dependency tree
 
Reported: 2010-10-20 11:28 EDT by Thomas Ehrnhoefer CLA
Modified: 2016-08-18 17:56 EDT (History)
5 users (show)

See Also:


Attachments
patch v1 (4.63 KB, patch)
2010-10-20 12:12 EDT, Thomas Ehrnhoefer CLA
thomas.ehrnhoefer: review?
Details | Diff
mylyn/context/zip (30.38 KB, application/octet-stream)
2010-10-20 12:12 EDT, Thomas Ehrnhoefer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Ehrnhoefer CLA 2010-10-20 11:28:30 EDT
Most connectors rely on an API which is supported only from a certain server version up. Some connectors add this restriction to the connector label shown in the add taskrepository wizard.
I think this could be something the framework does though. The connector setting a minimum version, and the framework adding this to the label (and maybe also to the description in the repositorySettingsPage as well).
Comment 1 Thomas Ehrnhoefer CLA 2010-10-20 12:12:01 EDT
Created attachment 181309 [details]
patch v1

Here is a first stab. I am a bit worried about regressions / messing up existing connector's labels.
The getShortLabel method however already seems to assume there could be an additional message in brackets, so by leveraging this method we should be ok.

What are other people's thoughts?
Comment 2 Thomas Ehrnhoefer CLA 2010-10-20 12:12:03 EDT
Created attachment 181310 [details]
mylyn/context/zip
Comment 3 Steffen Pingel CLA 2010-10-20 18:25:41 EDT
I like the underlying idea of this patch. Most connectors limit support to certain versions and it would be nice to make that available in the API. I would like prefer something other than string though to make that easier to process.
Comment 4 Benjamin Muskalla CLA 2010-10-21 12:35:36 EDT
Maybe we could even use org.osgi.framework.Version to represent the version we're dealing with. I'd just be a little careful as we cannot expect that the repositories we're dealing with have concrete versions (current example is version "2010" with internal version 3.x.y). Not sure if we should restrict this to a specific version format as connector developers may want to state "XY (Summer 2010 and later supported)"
Comment 5 Thomas Ehrnhoefer CLA 2010-11-04 13:48:17 EDT
Good point Benjamin. I was just lazy but your argument is very compelling. The version displayed is for the user to consume, so we shouldn't assume concrete versions. Steffen, your thoughts?
I think if we actually want the framework to support version constraints on a deeper level (getVersion() plus setMin/Max versions) we will need a separate API (and could probably tie a displayName into those version objects for using them in the AddTaskRepository wizard). But I feel that's a bit out of scope and a bigger problem.
Comment 6 Thomas Ehrnhoefer CLA 2010-12-10 13:10:09 EST
Steffen, what are your thoughts on those points raised by Ben?
Comment 7 Steffen Pingel CLA 2010-12-10 13:25:17 EST
I'd be great to use OSGi versions but most repositories use custom formats. I am not sure if it's reasonable to expect that these can always be normalized to the OSGi format. Maybe an extensible version class that supports comparison and is adaptable to org.osgi.framework.Version would do the trick. Not sure if it's worth investigating at this point unless there is a concrete driver.
Comment 8 Benjamin Muskalla CLA 2012-10-02 08:05:24 EDT
Wonder if, besides API for supported versions, there should also be API that find out the specific version of a given repository. While some connectors will not be able to provide this information, I know about many who could provide this.
Comment 9 Steffen Pingel CLA 2012-10-02 18:35:55 EDT
(In reply to comment #8)
> Wonder if, besides API for supported versions, there should also be API that
> find out the specific version of a given repository. While some connectors will
> not be able to provide this information, I know about many who could provide
> this.

Makes sense to me. That information should be part of the repository configuration.
Comment 10 Benjamin Muskalla CLA 2012-12-23 11:47:23 EST
I pushed a draft implementation for this to https://git.eclipse.org/r/#/c/9371/

Steffen, Frank, would love to hear your comments on the idea.
Comment 11 Robert Munteanu CLA 2012-12-26 14:52:02 EST
This looks like a nice improvement to me and I'd certainly consume it in the Mantis connector.

What I'd add here is that matching rules may be more complicated than a single min/max range. For instance you can have a two separate branches - 1.1.x and 1.2.x which are supported by the Mylyn connector for [1.1.4,1.2.0) and [1.2.2,1.3.0), or you get a version range that is excluded outright because of some bug.

One additional feature is that you might want to warn the user of a problem, not block validation altogether.

Some of these are implemented in the Mantis connector, should you want to take a look

https://github.com/Mylyn-Mantis/mylyn-mantis/blob/master/com.itsolut.mantis.core/src/com/itsolut/mantis/core/RepositoryVersion.java
Comment 12 Sam Davis CLA 2016-08-18 17:56:51 EDT
Marking WONTFIX because we have no current driver for this.