Bug 501868 - In "copy details" please add "ID and Summary"
Summary: In "copy details" please add "ID and Summary"
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: 3.22   Edit
Assignee: Leo Ufimtsev CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed, noteworthy
Depends on:
Blocks:
 
Reported: 2016-09-20 16:38 EDT by Leo Ufimtsev CLA
Modified: 2016-10-25 14:16 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leo Ufimtsev CLA 2016-09-20 16:38:31 EDT
When you open a bug in Mylyn, you can right click and copy details:
- ID
- URL
- Summary and URL

However, most of the time I want "ID + Summary"

If anyone with mylyn knowledge has time, would you be able to add this context menu?

Thank you for your time.
Comment 1 Sam Davis CLA 2016-09-21 17:07:39 EDT
Summary and URL actually includes the ID, e.g.

501868: In "copy details" please add "ID and Summary"
https://bugs.eclipse.org/bugs/show_bug.cgi?id=501868

So I guess what you're asking for is just the first line of that? I agree it would be useful.

It should be straightforward to add this. The code is in org.eclipse.mylyn.internal.builds.ui.commands.CopyDetailsHandler if you want to contribute.
Comment 2 Leo Ufimtsev CLA 2016-09-22 09:56:36 EDT
Yes, just the first line of code.

Thanks for pointing to the location, I'll look into writing a patch.
Comment 3 Eclipse Genie CLA 2016-09-22 14:49:52 EDT
New Gerrit change created: https://git.eclipse.org/r/81726
Comment 4 Leo Ufimtsev CLA 2016-09-22 14:53:00 EDT
(In reply to Eclipse Genie from comment #3)
> New Gerrit change created: https://git.eclipse.org/r/81726

Could someone review?

Someone turned on save actions but didn't take the time to format all of the source code, which resulted in somewhat tedious editing.

After this patch I'll submit another patch to do a bit of re-formatting and refactoring of a few variable names.
Comment 5 Sam Davis CLA 2016-09-22 19:05:01 EDT
Save actions have always been on, but unfortunately the Eclipse formatter changed its behaviour over time so code that hasn't been touched in a while is no longer correctly formatted.
Comment 6 Leo Ufimtsev CLA 2016-09-23 10:18:30 EDT
(In reply to comment #5)
> Save actions have always been on, but unfortunately the Eclipse formatter
> changed its behaviour over time so code that hasn't been touched in a while is
> no longer correctly formatted.

Oh, I see. That makes sense. Thanks for info.
Comment 7 Leo Ufimtsev CLA 2016-09-28 16:12:17 EDT
In regards to this bug and related:
Bug 296760 – prepend bug prefix to text that is generated by copy details https://bugs.eclipse.org/bugs/show_bug.cgi?id=296760

There seems to be confusion/ambiguity with the patch I've submitted:
https://git.eclipse.org/r/#/c/81726/
Let's clarify to stay focused and productive :-).

# 1) Refactoring
There was a suggestion to rename SUMMARY_URL to ID_SUMMARY_URL.
I had the same line of thought. I suggest I'll submit a second followup patch with bunch of refactored changes. This is to make it more clear as to what new features are introduced and what is only re factored. Also when I save some files, the formatter changes many lines. It would be easier for me to submit a separate re factoring patch for me.


# 2) Divisor between ID and SUMMARY.
By default, the standard divisor is ": ". So currently copy details for ID_SUMMARY, for bugzilla looks like:
Bug 501868: In "copy details" please add "ID and Summary"

There is no technical issue with ": ", but usually bugzilla's summary is separated by a ' - ', ex:
Bug 501868 - In "copy details" please add "ID and Summary" 

The patch in 501868 doesn't break backwards compatibility by introducing support for overriding separator and makes the exported clipboard content look more similar to what it would look like if you'd manually copy the title.
It's a relatively small change (+- 5 lines of code) and follows the convention used by "getTaskPrefix()" already present in the code.
Is there a reason 'not' to include support for overriding separator ' - '? If not, can we go ahead and introduce it with the patch?


# 3) Prefix before ID.
The ID_SUMMARY requires a prefix so that it becomes linkable.
ex this becomes linkable in bugzilla:
Bug 123 <Summary>
This does not:
123 <Summary>

Since there is no URL as with SUMMARY_URL, there is no alternative link one can follow.
I would suggest to keep the prefix in ID_SUMMARY for proper linking to work.

Now with SUMMARY_URL, there is a link included, ex:
296760 - <SUMMARY>
https://bugs.eclipse.org/bugs/show_bug.cgi?id=296760

So strictly speaking the prefix there is not needed. Further, if you copy something between different bugzilla instances (ex from Eclipse Bugzilla to Gnome bugzilla), having the prefix causes incorrect linking as the "Bug 123" links to the local bugzilla and the URL links to the foreign bugzilla.
I would suggest that we have the prefix only in ID_SUMMARY and not in SUMMARY_URL.

Further, there is a commented line of code in SUMMARY_URL
//sb.append(TasksUiInternal.getTaskPrefix(task.getConnectorKind()))
Jaxsun asked me to remove it.
I would be happy to remove it, however I would suggest that I do so in a separate patch just to keep things tidy.


So moving forward, if there are objections or concerns about the above, please let me/us know.
If there are no objections/concerns, I suggest (one of you guys?) merges the patch:
https://git.eclipse.org/r/#/c/81726/
(Btw, I updated typo so that ": " is used as default instead of " ")

And I will subsequently submit a follow-up patch where I do some code refactoring.
Comment 8 Sam Davis CLA 2016-09-30 17:13:21 EDT
I would prefer to keep connectors consistent and not support overriding the separator. I don't think it provides enough value to justify the inconsistency for people who use multiple connectors, or the extra API for connector developers to understand.

I agree we should have a prefix for the ID and summary option.

It's not worthing pushing a review just to remove one line of commented code. We like to do that kind of maintenance as part of our regular work instead of triggering a build and having people spend time approving the change.
Comment 9 Leo Ufimtsev CLA 2016-10-03 09:18:56 EDT
(In reply to Sam Davis from comment #8)
> I would prefer to keep connectors consistent and not support overriding the
> separator. I don't think it provides enough value to justify the
> inconsistency for people who use multiple connectors, or the extra API for
> connector developers to understand.
> 
> I agree we should have a prefix for the ID and summary option.
> 
> It's not worthing pushing a review just to remove one line of commented
> code. We like to do that kind of maintenance as part of our regular work
> instead of triggering a build and having people spend time approving the
> change.

Thank you for your feedback, I'll adjust patch accordingly.
Comment 10 Leo Ufimtsev CLA 2016-10-05 16:37:32 EDT
(In reply to Leo Ufimtsev from comment #9)
> Thank you for your feedback, I'll adjust patch accordingly.

I've updated the patch (patch set 3).

To my knowledge, I implemented all the suggested changes. (removal of task-id-summary-separator, refactoring of enum/variables etc...).

Please review.

Let me know if I missed something or if there is further improvement to be made. 

Thank you for your time and feedback.
Comment 12 Eclipse Genie CLA 2016-10-21 16:55:54 EDT
New Gerrit change created: https://git.eclipse.org/r/83729