Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 149509 - AbstractQueryHit.id should be a String
Summary: AbstractQueryHit.id should be a String
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Mik Kersten CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-03 22:27 EDT by Eugene Kuleshov CLA
Modified: 2007-06-08 11:01 EDT (History)
0 users

See Also:


Attachments
mylar/context/zip (15.80 KB, application/octet-stream)
2006-07-03 22:59 EDT, Eugene Kuleshov CLA
no flags Details
patch changing type of id to String (52.00 KB, patch)
2006-07-03 22:59 EDT, Eugene Kuleshov CLA
no flags Details | Diff
patch changing type of id to String (updated) (51.63 KB, patch)
2006-07-05 16:49 EDT, Eugene Kuleshov CLA
no flags Details | Diff
mylar/context/zip (25.04 KB, application/octet-stream)
2006-07-05 20:43 EDT, Mik Kersten CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Kuleshov CLA 2006-07-03 22:27:10 EDT
AbstractQueryHit.id should be a String because there are many cases when task identifier can't re represented as integer value.
This is actually needed for the web repository provider.
Comment 1 Eugene Kuleshov CLA 2006-07-03 22:59:05 EDT
Created attachment 45686 [details]
mylar/context/zip

Context for this issue.

PS: note 39 opened editors that isn't look right to me
Comment 2 Eugene Kuleshov CLA 2006-07-03 22:59:25 EDT
Created attachment 45687 [details]
patch changing type of id to String
Comment 3 Eugene Kuleshov CLA 2006-07-05 16:49:56 EDT
Created attachment 45794 [details]
patch changing type of id to String (updated)
Comment 4 Mik Kersten CLA 2006-07-05 17:38:02 EDT
I reviewed the patch and can not apply as is because a single malformed handle would cause Mylar to blow up in all sorts of wierd ways.  First, AbstractRepositoryTask.getTaskId() relies on the '-' delimiter denoting the start of the ID, so an ID with a dash in it would break handles.  Also, if any of trhe numerous Interger.parseInt() calls failed there would be a flurry of exceptions thrown on the numerous refreshes.  And we really need a test for such a change.  I'm going to take a stab at making this change and report back.
Comment 5 Eugene Kuleshov CLA 2006-07-05 17:48:08 EDT
Damn it! I knew you'd say that. 

Well, I guess it would require to resolve Bug 149624 first...
Comment 6 Mik Kersten CLA 2006-07-05 17:59:59 EDT
Not necessarily.  What I'm in the process of doing now is making ids with a '-' in them illegal.  Down the road if we want to remove that restriction we will need to migrate all the handles of contexts to a new format.  The minimal information needed to define the identity of a task is a repository URL and an ID for that task so the current handle approach makes sense, but it will now be better hidden by AbstractRepositoryTask.
Comment 7 Eugene Kuleshov CLA 2006-07-05 18:05:24 EDT
(In reply to comment #6)
> Not necessarily.  What I'm in the process of doing now is making ids with a '-'
> in them illegal.  

Is your intention to brak Jira? E.g.

MNGECLIPSE-150: Repository Search results in error
http://jira.codehaus.org/browse/MNGECLIPSE-150

> Down the road if we want to remove that restriction we will
> need to migrate all the handles of contexts to a new format.  The minimal
> information needed to define the identity of a task is a repository URL and an
> ID for that task so the current handle approach makes sense, but it will now be
> better hidden by AbstractRepositoryTask.

I'd drop that relation between id and repository URL. SourceForge is not using unique id's (each project has its own namespace) and probably some others too. So, I think the best is to save task url and repository url independently and keep separate id as well to avoid recovering it from the task url.
Comment 8 Mik Kersten CLA 2006-07-05 18:47:43 EDT
MNGECLIPSE-150 is the key of that issue, not the ID.  JIRA provides unique int IDs for every issue, and if an issue moves between projects it maintains IDs but gets two separate keys.  

Now that we will have String IDs they will be able to contain namespace information, which is in part why I gave this change priority (for you and others).  However, it will be recommended that repository connector implementations use the most basic and stable form of ID in order to preserve the identity of tasks.
Comment 9 Eugene Kuleshov CLA 2006-07-05 18:53:50 EDT
(In reply to comment #8)
> MNGECLIPSE-150 is the key of that issue, not the ID.  JIRA provides unique int
> IDs for every issue, and if an issue moves between projects it maintains IDs
> but gets two separate keys.  

Well, if I fetch this task using web connector it will be id.
Comment 10 Mik Kersten CLA 2006-07-05 18:59:00 EDT
Right, and that ID will break if that task moves.  That's a fine limitation for the generic web connector, but not for the proper Jira Connector.
Comment 11 Eugene Kuleshov CLA 2006-07-05 19:49:39 EDT
Can you maybe use a '?' as a separator?
Comment 12 Mik Kersten CLA 2006-07-05 20:29:58 EDT
We can consider changing the separator once there is a compelling driver to do that, and encoding the other dashes turns out not to be a good option.  However, that would involve a major migration of all the data in the .mylar folder.

As expected this task turned out to be quite involved, including all that was in your patch and then some (e.g. task editors).  I think I'm close to finishing now.
Comment 13 Mik Kersten CLA 2006-07-05 20:42:56 EDT
Done.
Comment 14 Mik Kersten CLA 2006-07-05 20:43:14 EDT
Created attachment 45810 [details]
mylar/context/zip
Comment 15 Eugene Kuleshov CLA 2006-07-05 21:00:49 EDT
Thanks Mik. I resubmitted patch for Bug 145123
Comment 16 Mik Kersten CLA 2006-07-05 21:19:52 EDT
Glad that we got it in there.  For changes that tangled it's probably best to just specify how you want it done since there are bound to be non obvious and untested problems.  For everything else patches are best ;)