This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 171081 - Autodetect JIRA repository for Open Corresponding Task
Summary: Autodetect JIRA repository for Open Corresponding Task
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Eugene Kuleshov CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-19 13:30 EST by Eugene Kuleshov CLA
Modified: 2007-01-20 22:41 EST (History)
0 users

See Also:


Attachments
path for Open Corresponding Task action (2.10 KB, patch)
2007-01-19 16:01 EST, Eugene Kuleshov CLA
no flags Details | Diff
mylar/context/zip (3.03 KB, application/octet-stream)
2007-01-19 16:01 EST, Eugene Kuleshov 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 2007-01-19 13:30:07 EST
JIRA project keys are unique enough to be able to autodetect repository from the issue id.
Comment 1 Eugene Kuleshov CLA 2007-01-19 16:01:54 EST
Created attachment 57176 [details]
path for Open Corresponding Task action

This patch iterates trough all connectors for all repositories to check if there is matching task id. That works very nice for JIRA ids.
Comment 2 Eugene Kuleshov CLA 2007-01-19 16:01:56 EST
Created attachment 57177 [details]
mylar/context/zip
Comment 3 Mik Kersten CLA 2007-01-20 18:13:53 EST
Patch applied and looks good, but I leave the verification to you.

Note that while it's not currently our convention, I've been avoiding using labels and breaks because I find that they often make code harder to read (e.g. if the body of the loop grows or other labels are added) and because I find that they take a small step away from structured programming.  I realize that sometimes it's the most concise way of stating something, but even in cases like this I find it more obvious to have a boolean flag of foundRepository.  I realize that this convention is not in the Java Code Conventions that we adhere to, so I'm thinking of adding it.  Thoughts?
Comment 4 Eugene Kuleshov CLA 2007-01-20 20:25:00 EST
(In reply to comment #3)
> Patch applied and looks good, but I leave the verification to you.

Can we have another dev build then?

> Note that while it's not currently our convention, I've been avoiding using
> labels and breaks because I find that they often make code harder to read (e.g.
> if the body of the loop grows or other labels are added) and because I find
> that they take a small step away from structured programming.  I realize that
> sometimes it's the most concise way of stating something, but even in cases
> like this I find it more obvious to have a boolean flag of foundRepository.  I
> realize that this convention is not in the Java Code Conventions that we adhere
> to, so I'm thinking of adding it.  Thoughts?

I thought that you would be more concerned with blind iterating trough all possible repositories. :-)

As of "break" use, I found for myself that there is no nice way to quickly exit from two nested foreach loops. So, "break" was a tradeoff to avoid using for loop.
Comment 5 Mik Kersten CLA 2007-01-20 22:31:24 EST
Yes, I do think we should consider the implementation strategy here, and added an item to the meeting agenda.  Since the iteration over all repositories only happens when the user executes this action, it's not currently bad.  But it could trigger a slow lookup on some repository, and is related to hyperlinking, so let's chat about this on the next call.
Comment 6 Eugene Kuleshov CLA 2007-01-20 22:41:47 EST
BTW, initially I was thinking to iterate only trough JIRa repositories and only do that in the getTaskIdsFromComment(), but that way it didn't allowed to find matching connector and repository that is needed for the Open Correspond Task action. So, I ended up iterating trough all repositories.

We also have bug 170690 that should deal with these slow cases.

170690: OpenCorrespondingTaskAction should not run in the UI thread
https://bugs.eclipse.org/bugs/show_bug.cgi?id=170690