Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355179 - support hyperlinking Gerrit reviews from a Change-Id
Summary: support hyperlinking Gerrit reviews from a Change-Id
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 0.9   Edit
Assignee: Kevin Sawicki CLA
QA Contact: Steffen Pingel CLA
URL:
Whiteboard:
Keywords: contributed, noteworthy
Depends on:
Blocks:
 
Reported: 2011-08-18 19:56 EDT by Kevin Sawicki CLA
Modified: 2012-03-21 11:36 EDT (History)
0 users

See Also:


Attachments
Patch to open Change-Id links (7.59 KB, patch)
2011-08-18 19:57 EDT, Kevin Sawicki CLA
no flags Details | Diff
Hyperlink patch (8.44 KB, patch)
2011-08-19 14:04 EDT, Kevin Sawicki CLA
no flags Details | Diff
patch (6.57 KB, patch)
2011-08-19 14:07 EDT, Kevin Sawicki CLA
no flags Details | Diff
screenshot (26.01 KB, image/png)
2011-09-10 14:30 EDT, Steffen Pingel CLA
no flags Details
screenshot (27.18 KB, image/png)
2011-09-12 11:44 EDT, Steffen Pingel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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