Bug 296760 - prepend bug prefix to text that is generated by copy details
Summary: prepend bug prefix to text that is generated by copy details
Status: RESOLVED WONTFIX
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 trivial (vote)
Target Milestone: ---   Edit
Assignee: Leo Ufimtsev CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-02 18:35 EST by Steffen Pingel CLA
Modified: 2016-10-06 16:28 EDT (History)
3 users (show)

See Also:


Attachments
mylyn/context/zip (9.32 KB, application/octet-stream)
2009-12-02 18:56 EST, Steffen Pingel CLA
no flags Details
reverted change (995 bytes, patch)
2009-12-11 19:20 EST, Steffen Pingel CLA
no flags Details | Diff
reverted change (995 bytes, patch)
2009-12-11 19:20 EST, Steffen Pingel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Pingel CLA 2009-12-02 18:35:59 EST
From bug 165359#c48:

How come we don't prefix the task label when we copy bug refs?  Right
now we have:

    295273: consider move of Mylyn Connector Discovery UI into P2
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=295273

And it seems that it would be more consistent (eg, with our hyperlink
detection) and more useful to have:

    bug 295273: consider move of Mylyn Connector Discovery UI into P2
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=295273
Comment 1 Steffen Pingel CLA 2009-12-02 18:56:48 EST
I have implemented this. It looks a bit weird for JIRA, e.g.:

 issue DEMO-1: hello Mylyn
 http://mylyn.eclipse.org/jira-enterprise-3.13.5/browse/DEMO-1

Web tasks now look this this:

 task 721: Show file history as revision graph
 http://subclipse.tigris.org/issues/show_bug.cgi?id=721

Shawn, can you check how this change affects other connectors? We may need to add a new method to AbstractRepositoryConnectorCore for this.
Comment 2 Steffen Pingel CLA 2009-12-02 18:56:51 EST
Created attachment 153682 [details]
mylyn/context/zip
Comment 3 Shawn Minto CLA 2009-12-02 19:16:35 EST
Issue does look a bit odd for JIRA.  I wonder if it would look better if we could actually use the issue type here from JIRA (i.e. Story DEMO-1).  The odd thing is that for JIRA (and other repositories that use the key instead of just a number id), there is no need for this extra information to make the hyperlinking work.  Also, for something like the web task you posted, I now get a false positive with the hyperlink detector (which is a bit unfortunate).

Everything aside, a separate method for getting the prefix to make hyperlinking work would probably be the best option to make sure that this is a concise as possible while still having all of the support that we want.
Comment 4 Steffen Pingel CLA 2009-12-02 19:40:35 EST
If possible I would like to avoid additional API. It is probably already confusing how to correctly implement the existing getTaskIdPrefix() method. What if we changed it for JIRA and web tasks to return "" (I would like to make that the default but I am afraid we can't without breaking the API contract)?
Comment 5 Steffen Pingel CLA 2009-12-11 19:17:34 EST
I am not convinced that this change was a good idea. I usually use Copy Details to link accross repositories and in this case the bug xyz link link in the first line is actually confusing because it links to the wrong bug.

Shawn suggested to add another action Copy Details > Summary that could include the prefix. I think we should consider that instead of including the prefix in when copying summary and URL to avoid confusion.
Comment 6 Steffen Pingel CLA 2009-12-11 19:20:53 EST
Created attachment 154349 [details]
reverted change
Comment 7 Steffen Pingel CLA 2009-12-11 19:20:57 EST
Created attachment 154350 [details]
reverted change
Comment 8 Steffen Pingel CLA 2010-01-09 16:37:08 EST
We have discussed this on the Mylyn call and considered the following ideas:
* Add another item to the Copy Details menu to only copy the summary which would include the bug prefix.
* Make the menu extensible to allow 3rd part contributions, e.g. for copying wiki links.

I'll move this to the backlog until the discussions has converged.
Comment 9 Leo Ufimtsev CLA 2016-09-22 12:43:33 EDT
Hello, 

I'm working on related bug:
Bug 501868 - In "copy details" please add "ID and Summary" 


In my humble, limited experience and opinion:

I don't think AbstractRepositoryConnector should hard-code a prefix. It should be up to the implementing classes to define their own connectors.

The default should be an empty String "".

I can submit a patch if someone would review it?
Comment 10 Sam Davis CLA 2016-09-22 19:03:28 EDT
I don't think we should change the behaviour of the existing copy commands. For the new one you're working on, would it make sense to add the getTaskIdPrefix() if the the task key is not a number?
Comment 11 Leo Ufimtsev CLA 2016-09-23 10:30:56 EDT
(In reply to comment #10)
> I don't think we should change the behaviour of the existing copy commands. For
> the new one you're working on,

> would it make sense to add the getTaskIdPrefix()
> if the the task key is not a number?
Huh, What's the logic here?

The Bugzilla ID is a a number and should ideally have the 'Bug' preapended to it, because when you paste "Bug 1234" it bugzilla creates a click able link to that bug, where as '1234' doesn't.
Do you mean the other way around, add the prefix when the id "is" a number?

Maybe we should let each provider decide if they want a prefix or not. Ex "Bug 1234" for bugzilla, "# 1234" for Jira,  "task 1234" as default... 
But again, I don't know the other task tracking systems very well, so ~limited experience.

Thoughts?
Comment 12 Sam Davis CLA 2016-09-23 15:56:14 EDT
Sorry, I meant the other way around. I would like to avoid introducing behaviour that connectors can customize because it adds complexity (and confusion) to the API and it's not clear that it's needed.
Comment 13 Leo Ufimtsev CLA 2016-09-26 10:22:31 EDT
(In reply to comment #12)
> Sorry, I meant the other way around. I would like to avoid introducing behaviour
> that connectors can customize because it adds complexity (and confusion) to the
> API and it's not clear that it's needed.

Well, we can have 'task' as default, but allow special purpose customization for specific things. 
Having prefix 'Bug 124' would be very convenient for pasting things into bugzilla, and complexity wise it's relatively small. Just an extra override method.

Thoughts?

Once this guy has been reviewed and merge, I'd be happy to contribute a patch for this bug also, and then we can evaluate based on the patch?
Bug 501868 – In "copy details" please add "ID and Summary"
https://bugs.eclipse.org/bugs/show_bug.cgi?id=501868

Thank you
Comment 14 Sam Davis CLA 2016-09-26 17:17:05 EDT
We already have a way for connectors to customize the "task" string. They can override getTaskIdPrefix, as the Bugzilla connector does. So we would just need a bit of logic to decide whether to include that, which I suggested be based on whether the id is a number.
Comment 15 Leo Ufimtsev CLA 2016-09-26 17:39:24 EDT
(In reply to Sam Davis from comment #14)
> We already have a way for connectors to customize the "task" string. They
> can override getTaskIdPrefix, as the Bugzilla connector does. So we would
> just need a bit of logic to decide whether to include that, which I
> suggested be based on whether the id is a number.

Ok, let's wait till this guy is merged and I could write some of that logic:
Bug 501868 – In "copy details" please add "ID and Summary" https://bugs.eclipse.org/bugs/show_bug.cgi?id=501868

I'll come back to this task later.
Comment 16 Sam Davis CLA 2016-09-30 17:13:31 EDT
Please see my comment on the bug.
Comment 17 Leo Ufimtsev CLA 2016-10-06 16:28:08 EDT
We disscussed in the related bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=501868

Having a prefix would lead to a subtle problem.

If you copy from one Bugzilla into another (e.g from Eclipse bugzilla into Gnome bugzilla), then the bug 123 will link to a different place than the URL.

However, the prefix was made available for the new "copy summary", which looks like this:
Bug 123: summay_be_here 

Hopefully this solves the problem for everyone. 

If this is not satisfactory or someone has concerns, please feel free to re-open this bug and leave feedback.

Thank you.