Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 355179

Summary: support hyperlinking Gerrit reviews from a Change-Id
Product: z_Archived Reporter: Kevin Sawicki <kevin>
Component: MylynAssignee: Kevin Sawicki <kevin>
Status: RESOLVED FIXED QA Contact: Steffen Pingel <steffen.pingel>
Severity: enhancement    
Priority: P3 Keywords: contributed, noteworthy
Version: unspecified   
Target Milestone: 0.9   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch to open Change-Id links
none
Hyperlink patch
none
patch
none
screenshot
none
screenshot none

Description Kevin Sawicki CLA 2011-08-18 19:56:17 EDT
Support opening a Gerrit review task editor 'Change-Id: XXX' lines

This would allow a Gerrit task editor to be easily opened from the
EGit commit viewer
Comment 1 Kevin Sawicki CLA 2011-08-18 19:57:15 EDT
Created attachment 201762 [details]
Patch to open Change-Id links
Comment 2 Steffen Pingel CLA 2011-08-19 08:42:35 EDT
Thanks for the patch! With the changes for bug 350679 we should be able to simplify the implementation. TaskHyperlink should now work out of the box with change-id hashes. Can you update the patch accordingly and add a test case for the parsing? You can take a look at TracHyperlinkUtilTest for an example.

I am not sure that this will work for the EGit commit editor though. I think we will need to provide a way to associate the commit editor (i.e. the git repository) with the gerrit task repository first.
Comment 3 Kevin Sawicki CLA 2011-08-19 12:45:31 EDT
Thanks for the pointers Steffen, can the unit test go in the org.eclipse.mylyn.gerrit.tests ? It looks like it currently is a fragment on top of gerrit core.
Comment 4 Steffen Pingel CLA 2011-08-19 13:40:56 EDT
Good question. I assume we will need separate test bundles for UI and core in this case. I have pushed a org.eclipse.mylyn.gerrit.ui.tests bundle. Can you try if that works for you?
Comment 5 Kevin Sawicki CLA 2011-08-19 14:04:26 EDT
Works for me, attaching an updated patch with unit tests.
Comment 6 Kevin Sawicki CLA 2011-08-19 14:04:46 EDT
Created attachment 201825 [details]
Hyperlink patch

Patch with unit tests
Comment 7 Kevin Sawicki CLA 2011-08-19 14:07:03 EDT
Created attachment 201826 [details]
patch
Comment 8 Steffen Pingel CLA 2011-08-19 15:18:42 EDT
Great! I have pushed the patch in ac3cfb505c2045f8a6b2ea22c0344c8fe573cf1b.
Comment 9 Steffen Pingel CLA 2011-09-10 14:30:15 EDT
Created attachment 203112 [details]
screenshot
Comment 10 Steffen Pingel CLA 2011-09-11 05:13:39 EDT
I have changed the hyperlink detector to recognize any short and long Gerrit id in text. That enables linking to other changes in comments, e.g. "see I0123abcd". Kevin, I don't know if this breaks the commit viewer. If it does we can also split the original hyperlink detector logic into a separate class or revert the change if does not make sense. I pushed it here: http://review.mylyn.org/#change,32
Comment 11 Steffen Pingel CLA 2011-09-12 11:44:02 EDT
Created attachment 203171 [details]
screenshot