Bug 117517 - add support for commit comment templates
Summary: add support for commit comment templates
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: 0.4   Edit
Hardware: PC Windows XP
: P1 normal with 2 votes (vote)
Target Milestone: 0.8   Edit
Assignee: Mik Kersten CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
: 143673 (view as bug list)
Depends on: 145214
Blocks: 154368
  Show dependency tree
 
Reported: 2005-11-22 11:18 EST by Mik Kersten CLA
Modified: 2006-10-20 14:19 EDT (History)
8 users (show)

See Also:


Attachments
CommitTemplatesForMylar Patch (25.96 KB, patch)
2006-08-30 13:32 EDT, Eike Stepper CLA
no flags Details | Diff
Reworked patch (now with dynamic extensions and content assist) (24.74 KB, text/plain)
2006-09-04 10:25 EDT, Eike Stepper CLA
no flags Details
mylar/context/zip (53.92 KB, application/octet-stream)
2006-09-04 10:25 EDT, Eike Stepper CLA
no flags Details
Reworked patch (now with dynamic extensions and content assist) (62.38 KB, patch)
2006-09-04 10:38 EDT, Eike Stepper CLA
no flags Details | Diff
CommitTemplatesForMylar.patch (fixed an NPE and layout) (65.73 KB, patch)
2006-09-05 01:29 EDT, Eike Stepper CLA
no flags Details | Diff
CommitTemplatesForMylar.patch (now with regex ID parser) (128.05 KB, patch)
2006-09-05 03:56 EDT, Eike Stepper CLA
no flags Details | Diff
CommitTemplatesPatch.txt (Now with RegexGuesser) (127.82 KB, patch)
2006-09-15 03:42 EDT, Eike Stepper CLA
no flags Details | Diff
mylar/context/zip (98.27 KB, application/octet-stream)
2006-10-16 00:49 EDT, Mik Kersten CLA
no flags Details
mylar/context/zip (106.82 KB, application/octet-stream)
2006-10-20 13:49 EDT, Mik Kersten CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mik Kersten CLA 2005-11-22 11:18:24 EST
From Eugene:

"Report URL" prefix is quite redundant. URL is speaking for itself...
Comment 1 Mik Kersten CLA 2005-11-24 23:41:34 EST
So the format now will be:

<prefix>: <description>, <url>

I recall you flaming about multiline entries, and feel the same way.  But I'm still wondering whether the URL is different enough that we put it on a new line, or simply put a comma in as above.  I'd like the URL to remain non-optional in order for Mylar to encourage linking commit messages to reports.
Comment 2 Eugene Kuleshov CLA 2005-11-24 23:45:47 EST
That is exactly why I asked for templates. :-(

Personally I'd prefer something like this (using an empty prefix for completed tsks):

----
${prefix}${description}
${url}
----

There is not much use to show url in the comment shown in the table and it would look nicer on a new line when shown in comment text panel. 
Comment 3 Mik Kersten CLA 2005-11-25 16:02:36 EST
I've removed the URL prefix, and the URL is on a new line.  However, I agree that the templates would be valuable so I'm leaving this open, but need to mark it helpwanted for now.
Comment 4 Mik Kersten CLA 2006-05-25 17:45:42 EDT
*** Bug 143673 has been marked as a duplicate of this bug. ***
Comment 5 Mik Kersten CLA 2006-05-25 17:46:32 EDT
Bumping up priority since there has been additional interest (bug 143673).
Comment 6 Roland Tepp CLA 2006-05-26 06:43:32 EDT
Multiline comments being good or bad aside (personally, I feel the convention should be left to be decided per project/organization managers), the question should rather be the choice of variables and allowing the users to specify their preferred format.

I suggest following set of template variables for starters:
${task_title} - would expand to task title
${task_url} - would expand to task url
${last_comment} - for bugzilla tasks (see my explanation in bug 143673)


I'd leave out prefix variable, as this is something that each template should define on their own...

The default template would then probably look something like this:
----
<prefix>${task_title}
${task_url}
----
Comment 7 Mik Kersten CLA 2006-05-29 17:33:06 EDT
That looks good to me Roland.

I hope that we can get to this for 0.6 because the current thing feels like a bit of a hack.  But still keeping this helpwanted since this would be a nice self-contained contribution and there are a lot of high priority items on the table for 0.6.
Comment 8 Eike Stepper CLA 2006-08-17 12:12:04 EDT
I'm also very interested in this feature.
It would be very helpful for EMFT projects to configure templates like:

  [${bug_id}] ${bug_summary} ...

The EMFT build scripts can generate the release notes for me if commit comments contain lines that start with the bugzilla id in *square brackets*, but currently Mylar is not able to insert the closing bracket.
Comment 9 Mik Kersten CLA 2006-08-21 18:31:20 EDT
Is anyone interested in contributing this?  It's a nicely decoupled feature and may be faciliated by Eclipse's templating mechanisms (although implementing the simple templating proposed here may be easier than figuring out those APIs).
Comment 10 Eugene Kuleshov CLA 2006-08-21 18:40:31 EDT
Please make templates configurable per-repository. That probably going to need links to the projects too...
Comment 11 Roland Tepp CLA 2006-08-22 04:27:17 EDT
I'd give it a try, but unfortunately I've had trouble with setting up the developement environment for Mylar (Eating my own dogfood?)

If anybody on the Mylar team could help me out, please drop me an email and maybe we'd be able to discuss the setting up of the Mylar dev environment in an online interactive fashion...
Comment 12 Mik Kersten CLA 2006-08-23 00:04:23 EDT
I'm very happy to help, and in general please don't be shy about posting questions like this to mylar-dev@eclipse.org.  Any trouble that anyone has setting up the dev environment usually indicates that we need to simplify it or improve the docs.  For now please try to follow these instructions: http://wiki.eclipse.org/index.php/Mylar_Contributor_Reference#Workspace_setup

Post any trouble that you have either to this report or to mylar-dev, and if have trouble identifying the problem we can find a more interactive medium.
Comment 13 Eike Stepper CLA 2006-08-30 13:32:17 EDT
Created attachment 49080 [details]
CommitTemplatesForMylar Patch

Since always changing the commit comment drives me crazy I tried to develop a configurable templating mechanism. A patch for org.eclipse.mylar.team is attached.

My approach is rather simple. Instead of specifying prefixes in the preferences, you can specify templates like the following:

Completed task template: "[${task.id}] ${task.description} (COMPLETED)"
Progress task template:  "[${task.id}] ${task.description}"

The template keywords are recognized by ITemplateHandler instances that are contributed to a simple new extension point like this:

    <extension
          point="org.eclipse.mylar.team.templateHandlers">
       <templateHandler
             class="org.eclipse.mylar.internal.team.template.TaskCompletionDateTemplateHandler"
             description="Provides the completion date of a Mylar task."
             recognizedKeyword="task.completion.date"/>
             [...]

There is currently no special UI for inserting the keyword tags into the templates on the preference page, because I'm not sure if you like this basic approach.

What do you think?
Comment 14 Mik Kersten CLA 2006-09-03 01:37:03 EDT
Good stuff Eike.  While it's more verbose, I like the "task.mumble" format because it is clear and will allow us flexibility (e.g. to use templates such as "repository.url" and "user.email").

I haven't applied the patch yet because there are conflicts on ..mylar.team/plugin.xml and ContextChangeSet, please try to recreate the patch.  Also, there are a bunch of template handler classes that need to be created, but have very little functionality.  What if you took your extension-point based approach a bit further and implemented this entirely as extension points.  Rather than having the multiple handler classes you could have a single TaskPropertyMapper class that would take a string-based property and return the corresponding property from the task?  The extension point could look something like the following, and TaskPropertyMapper would map the string-based property to the corresponding method on ITask. 

       <taskCommentTemplate
             description="Provides the completion date of a Mylar task."
             property="task.completion.date"/>

Also, CommitMessageTest should needs to be updated in order to ensure that our functionality of parsing commit messages to identify tasks should work.  Otherwise we will not be able to map commit messages back to tasks (e.g. from Change Sets or the History view).  The easiest way to ensure this works may be to require that task.id is in the comment after some identifiable string.  Also, for any classes that you add please include a @author tag with your name so that credit goes where it is due.
Comment 15 Eike Stepper CLA 2006-09-03 03:14:38 EDT
Personally I'm not a fan of the idea to let the contribution do the parsing of the property keyword,
only to reduce the amount of handler classes. It was my intent to enable the mylar.team plugin
to decide which handler to use only with the information of the extension markup, so that the contributing
plugins need only be loaded for really needed handlers. This is currently not implemented as such,
but it could be done easily with the current approach. I've heard that nowadays inner classes can be 
used to instantiate contributions. This would reduce the amount of java source files (although the number
of class files would even be increased by one). Shall I try that?

When I synchronize my workspace right now there are no incoming changes at all. So I wonder where 
the conflicts you speak of do come from.

Next I tend to have problems to use "Commit Context..." because it randomly complains that there are no
interesting resources in the context. This occurs in my development workbench from time to time, but
in my runtime workbench I can't get it to work at all, although there are changes in the Synchronize view.
Can you help me with this issue?
Comment 16 Mik Kersten CLA 2006-09-03 03:31:30 EDT
Yes, we use inner classes to read contributions in a few places (e.g. see ContextCorePlugin).  My main reason for suggesting not creating classes for each handler is not the bloat in the number of classes, but simplicity in creating new handlers.  If they're entirely extension point based they're easier for others to make, and currently there doesn't seem to be a compelling reason for a custom handler class since each only has the effect of retrieving a property from ITask.  Or did you have other handlers in mind?

Regarding troubleshooting the context change sets, could you please take a look at the following, and then let me know if that does not resolve your problem so that we can diagnose further? http://wiki.eclipse.org/index.php/Mylar_FAQ#Change_Set_and_Synchronize_view_troubleshooting 
Comment 17 Eike Stepper CLA 2006-09-03 04:02:09 EDT
I'm not sure what you mean by "entirely extension point based". Would you suggest to completely get rid of
user contributed handler code? What would that extension point then be good for? I believe it's not the question
of what I have in mind for additional handlers but *if* anybody would ever want to be able to tweak his or her
own template logic. I can very well imagine such use cases where, for example by repository providers, special 
task information should be made available. Or one could use it to connect to organizational data via username, or...
With the current approach this is easily feasible by only implementing a single method and providing markup for it.
I'm currently refactoring the handler implementations into a single class. I'll post a new patch when some other 
changes a ready.
Comment 18 Mik Kersten CLA 2006-09-03 04:22:58 EDT
Yes, what I mean is to get rid of the handler classes, at least *until* there is a handler that needs them.  Then we simply add the class attribute that you have for custom handling if there is a driver and use case for it.  However, there has been a bit of a trend in Eclipse to make some functionality of this sort entirely extension point based since this can be more simple for cases where a lot of procedural logic is not needed, and so for this seems like such a case.  But go ahead and submit your single handler class patch when that's done, and then we can take a closer look at what the better tradeoff is.  I'm not opposed to the class-based approach.
Comment 19 Eike Stepper CLA 2006-09-04 10:25:04 EDT
Created attachment 49343 [details]
Reworked patch (now with dynamic extensions and content assist)
Comment 20 Eike Stepper CLA 2006-09-04 10:25:07 EDT
Created attachment 49344 [details]
mylar/context/zip
Comment 21 Eike Stepper CLA 2006-09-04 10:31:35 EDT
I have attached a reworked version of the commit templates. This version needs only one handler source file
but can easily be extended with new handlers. The extension markup is not cached anymore, so that the 
TemplateHandlerManager is now aware of dynamic bundles and bundles are not activated unless really needed.

To configure the templates on the preference page the user can now use content assist.
Comment 22 Eike Stepper CLA 2006-09-04 10:35:35 EDT
Comment on attachment 49343 [details]
Reworked patch (now with dynamic extensions and content assist)

incomplete
Comment 23 Eike Stepper CLA 2006-09-04 10:36:01 EDT
Comment on attachment 49344 [details]
mylar/context/zip

accidental
Comment 24 Eike Stepper CLA 2006-09-04 10:38:05 EDT
Created attachment 49347 [details]
Reworked patch (now with dynamic extensions and content assist)

This one should be complete. Sorry for inconveniences.
Comment 25 Eike Stepper CLA 2006-09-05 01:29:31 EDT
Created attachment 49369 [details]
CommitTemplatesForMylar.patch (fixed an NPE and layout)
Comment 26 Eike Stepper CLA 2006-09-05 03:56:24 EDT
Created attachment 49380 [details]
CommitTemplatesForMylar.patch (now with regex ID parser)


I've tried to make the CommitMessageTest pass again.
For this purpose I've modified ContextChangeSet.getTaskIdFromCommentOrLabel()
so that it first tries to parse a template based comment (uses configurable
regex)and in case of failure to parse a label-style value "id: ...". I think 
that all calls to getTaskIdFromCommentOrLabel() should be replaced by either
getTaskIdFromComment() or getTaskIdFromLabel() to remove ambiguities. I leave
this to you.

While digging through your sources I was wondering why ITask has no getId()
method. I have the feeling that the handling of task ids is rather fragile
because it is spread over many places and heavily depends on varying contexts.
I hope that my changes don't interfere with existing expactations.

To have a nice content assist for the regex preference (id parser) I was forced
to copy code from org.eclipse.ui.texteditor because it is not public. Please
refer to org.eclipse.mylar.internal.team.ui.preferences.workaround.README.java
for details.
Comment 27 Mik Kersten CLA 2006-09-11 20:34:19 EDT
Patch reviewed, not yet applied.  Very nice work Eike, especially the content assist on the templates which will make it easy to use this.  We should be on track on getting this contribution into 0.6.3, but will need the following:
* Patches need to be formatted with our standard formatter, because currently it is impossible for me to tell which code changed in key classes like TeamPlugin (see http://wiki.eclipse.org/index.php/Mylar_Contributor_Reference#Contributing_patches for setting the formatter).
* We'll need a test case or two for the new functionality, e.g. some tests that mock up a task (via new Task(..)), then create a comment from it given a predefined String that exercises the entire template, and then verifies that against the correct expansion of that template.  This will ensure that future changes to the templates are covered. Additional coverage of parsing comments with different template formats would also be beneficial.
* This may sound odd, but I'm concerned about the "regex to prase task id" being too complicated for all but advanced users.  I think that you should still keep the regex support that you have underneath, but wonder if we could do a better job at hiding it from the user.  How hard would it be to generate the regex from the  template specifications?
Comment 28 Mik Kersten CLA 2006-09-11 20:47:41 EDT
Now that Eike has provided this flexibility, we need to come up with a good default.  A similar topic came up on the platform-ui-dev@eclipse.org mailing list so I'll point them at this bug in case they have input.  Eike, note that the frequent use of "[..]" for tagging descriptions on eclipse.org bugs makes that syntax a problematic choice for use in the template.
   
How about this: ${task.status}: task ${task.id}\n${task.url}

  RESOLVED: bug 138666: [EditorMgmt] provide mechanism for restoring editors
  https://bugs.eclipse.org/bugs/show_bug.cgi?id=138666
  
This uses no special syntax other than ":", and puts the thing that changes the most first (i.e. the status), which is important because very little comment text fits onto a change set node in the Synchronize view.  We need to think twice about the newline.  I think that having the task URL in there is helpful for tools that render comments in the web browser, but noisy for reading.  I've found that having the URL on a separate line makes it visually easier to ignore.  Note that this template would allow us to merge the two templates into one.  
Comment 29 Mik Kersten CLA 2006-09-11 20:56:24 EDT
One more decision point, we need to decide on one of the following for prefixing ${task.id}:
1) "bug 123: ": benefit is that this is consistent the Bugzilla web UI's and our task editor's hyperlinking of comments
2) "task 123: ": consistent with our naming and more generic for non-Bugzilla connectors
3) "123: ": most concise, doesn't impose naming but hyperlinking is less obvious
Comment 30 Eugene Kuleshov CLA 2006-09-11 21:23:17 EDT
(In reply to comment #29)
> One more decision point, we need to decide on one of the following for
> prefixing ${task.id}:
> 1) "bug 123: ": benefit is that this is consistent the Bugzilla web UI's and
> our task editor's hyperlinking of comments
> 2) "task 123: ": consistent with our naming and more generic for non-Bugzilla
> connectors
> 3) "123: ": most concise, doesn't impose naming but hyperlinking is less
> obvious

Mik, I'd say it should be connector-specific. So, use "bug 123" for Bugzilla, but other connector may choose not to att prefix. 

On the other hand if those templates are set per repository user could just make "bug" part of the template...
Comment 31 Eike Stepper CLA 2006-09-12 04:22:33 EDT
(In reply to comment #29)
Now we see why it's important to have the "class" attribute in the extension
point. If you decide to generate anything else than "123" for ${task.id} I will
have to write my own handler that does so ;-) I did all the work only to see
"[123]" at the beginning of the line because the EMFT releng scripts need this
format to produce automatic release notes.

I haven't tried this so far, but doesn't ${repository.type}-${task.id} produce
something like "bugzilla-123"?
Comment 32 Eike Stepper CLA 2006-09-12 05:20:13 EDT
(In reply to comment #27)
[...]
> * Patches need to be formatted with our standard formatter, because currently
> it is impossible for me to tell which code changed in key classes like
> TeamPlugin (see
> http://wiki.eclipse.org/index.php/Mylar_Contributor_Reference#Contributing_patches

I can't find the file org.eclipse.mylar/developer/javaFormatterSettings.xml
as refered to by the wiki. Oh, I juast realized, that Mylar has hidden it due to an empty task context and ctrl+shift+r didn't reveal it because the name has a typo. The folder "developer" contains a file named "javaFromatterSettings.xml".
Comment 33 Eike Stepper CLA 2006-09-12 05:25:35 EDT
... and in addition the misspelled file does not contain java code style formatter definitions. 
Seems to be more of a code template definition.
Comment 34 Steffen Pingel CLA 2006-09-12 05:45:19 EDT
> Mik, I'd say it should be connector-specific. So, use "bug 123" for Bugzilla,
> but other connector may choose not to att prefix. 

I agree. It may be a good idea to have a global default template that can be overridden per repository. For Trac we'll need to support:

${task.status}: ${task.description} (refs #${task.id})
Comment 35 Mik Kersten CLA 2006-09-14 12:22:37 EDT
Agreed the comments should be per-repository, created bug 157342 for that.

Eike: apologies, for our formatter settings were overwritten.  I've updated the wiki and they're now checked in as mylar-settings-formatter.xml.  Because they're based on the Eclipse one and checked into the project settings you may just get the formatting automatically when you update.  Are you willing to wrap up the points on comment#27?  I appreciate if you  can only dedicate enough time to this to get the format into that needed by EMFT, and am willing take the patch from here if needed, but it will take me a bit of time to get it integrated.  What would be very helpful is if you could contribute the last point on comment#27.

Considering Eike's suggestion on comment#31, I think that we should add a ${connector.task.prefix} variable, and have that expand to "bug" for Bugzilla and "refs #" for Trac.  The slick thing about that is that we'll make it a part of the connector extension point so that they hyperlink detectors can use it.  That would make the default:

   ${task.status}: ${connector.task.prefix} ${task.id} 
Comment 36 Eike Stepper CLA 2006-09-15 03:42:58 EDT
Created attachment 50234 [details]
CommitTemplatesPatch.txt (Now with RegexGuesser)

Ok, I've tried to add a button that automatically guesses a regex to parse the
task id. Seems to work. There's an autoGuess checkbox as well.

Can't get the tests built since org.eclipse.mylar.core.tests is no longer in repo ;-(

I'd suggest that we remove the possibility to enter 2 templates for progress 
and completed since this information can now be given by the template itself.
Comment 37 Mik Kersten CLA 2006-09-15 13:42:32 EDT
Excellent on the auto-regexp. Agreed on the suggestion to use one, less is more.  

The org.eclipse.mylar.core.tests project was renamed to org.eclipse.mylar.context.tests, so you just need to delete the old project and check that out.  We maintain the up-to-date listing of the projects (via .psf files) here: http://wiki.eclipse.org/index.php/Mylar_Contributor_Reference#Workspace_setup 

I will plan to review and try to integrate this or an updated patch this afternoon/evening.

Comment 38 Mik Kersten CLA 2006-09-22 22:25:36 EDT
This is currently waiting on bug 145214, which is nearing completion, in order for us to avoid adding the full URL hyperlink into the default template.  I would still like to aim for getting it into the next release (next Fridays' 0.7.0).

Eike, should I assume you won't get a chance to provide a unit test?
Comment 39 Eike Stepper CLA 2006-09-23 01:28:00 EDT
Mik, I'm sorry but you're right. I'm the owner of the Net4j and CDO components
of the EMFT project and I'm also quite busy with the preparations to align with
Callisto 3.2.1. I'm managing a rather large code base and I'm my only project
member ;-( This issue has already consumed much more time than I originally
planned and even more than was necessary to fulfil my own functional requirements.

Once I had at least your existing tests up and running (see attached patches) but
unfortunately you decided to rename projects in the meantime.

Please forgive me that I leave you without providing QA for my contribution and
don't hesitate to contact me in the future if you have questions or concerns
regarding my code.
Comment 40 Mik Kersten CLA 2006-09-23 15:38:31 EDT
Eike: please do not worry, it's great that in trying to make Mylar work for your process you made a contribution, and many others will benefit from this contribution.  We systematically push people to contribute tests with patches, but we still take patches that come without test coverage because like you many others just need a couple of changes  or improvements to get something working for them.  I'm just a lot slower to apply those patches because we the fall into our regular prioritization, instead of just getting done when I'm doing bug triage.  Btw, if you think they're at all reusable you could attach your tests as text to this bug report and I'll take it from there next week.
Comment 41 Mik Kersten CLA 2006-09-29 22:43:57 EDT
Unfortunately we ran out of time for getting this into 0.7.0.  It should make it into the dev build week after next.
Comment 42 Mik Kersten CLA 2006-10-16 00:49:48 EDT
Done (finally!).  

Eike: I retained all of your contribution, but note that I modified it a fair amount in order to simplify the UI.  I also did a revision on the naming, so it would be good if you could take a look over the changes.  The most notable ones are:
* There is only a single template instead of separate progress/completed templates.  While communicating status is useful, this approach was problematic because it did not use connector-specific terms to indicate status.  So instead I made the default template the following.  In the case of Bugzilla ${connector.task.prefix} is "bug".
      ${task.status} - ${connector.task.prefix} ${task.id}: ${task.description}
* The regexp used to match comments formatted in this way is always automatically determined based on this template in order to hide this implementation detail from the user.  
* URLs are not part of the default template and instead the association between a project and a task repository is used too look up the corresponding repository.

Steffen: please check whether this is sufficient for you to get the format right for Trac.  If the Trac format is sufficiently different you may also want to create a new bug for supporting different templates per-project.

I'll cut a dev build with this functionality on Monday so that others can try it out before the 0.8 release planned for Friday.
Comment 43 Mik Kersten CLA 2006-10-16 00:49:52 EDT
Created attachment 52014 [details]
mylar/context/zip
Comment 44 Steffen Pingel CLA 2006-10-16 11:20:32 EDT
Mik, this is a really cool feature. It works perfectly for Trac. I think all that is needed now is the implementation of TracRepositoryUi.openRemoteTask() for opening tasks that are associated with commit sets from the synchronize view.
Comment 45 Mik Kersten CLA 2006-10-16 11:27:16 EDT
Great to hear.  So are you going to need to implement AbstractRepositoryConnector.getTaskPrefix() for Trac?  The default returns "task" and Bugzilla's returns "bug".  There's an interesting thing about this prefix idea because the hyperlink detector should probably use it too.  But we may want to support more than one prefix per-connector, and have the commit messages use the one considered to be default.  If we go down that road we should probably declare the prefixes via extension point.

Rob: CC'ing you since this is related to hyperlink detection.

Steffen: regarding openRemoteTask(), yes, Trac should have because any time that some UI requests that a task be opened that is not in the task list that method is used.  Create a bug for it and let us know if you need anything from the API to make it easier.  Fyi, you'll know a task has been opened that way because it's editor icon only has the blue server overlay and no task icon.
Comment 46 Steffen Pingel CLA 2006-10-16 11:55:32 EDT
Trac uses a hash sign '#' as the task prefix. I'll override the method and check if that works.
Comment 47 Eugene Kuleshov CLA 2006-10-16 12:21:16 EDT
Mik, can you make bugzilla default like this?

  ${connector.task.prefix} ${task.id}: ${task.status} - ${task.description}

It would look nicer in Sync view in changesets mode.

I also wonder how can you handle task prefix for jira? It would be nice if empty prefix would work, but then Bugizlla's prefix frould include a trailing space...
Comment 48 Mik Kersten CLA 2006-10-16 20:25:32 EDT
Eugene: do you mean
	${connector.task.prefix} ${task.id}: ${task.description} - ${task.status} 
?  If not, I worry that not having description after ID would look weird since that's such a common presentation.  Also, the reason I proposed the status to be first is that it makes it easy to see the status changes of tasks (e.g. resolved) when scanning through incoming change sets.  But I did have it in the last spot to start as you suggest.  If you and others could try this out and comment more on the default that would be great.  A dev build with this support is now available.

Eugene: note that the connectors just specify "task#" or "bug", and the space comes from the template. Let's discuss Jira-specific requirements further on bug 150957.
Comment 49 Roland Tepp CLA 2006-10-17 03:18:15 EDT
I would prefer, if the task prefix would have the decision to include space character or not, since the specific connector should be aware of the exact prefix format (including or excluding space and all).

As I understand, Trac uses hash symbol (#) as task prefix and although I have not used Trac myself I assume the full bug/task id looks something like "#1234" (not like "# 1234" - sans quotes). Thus it would make more sense to have the 

Also looking at how Bugzilla displays tooltips for bug links, I'd vote for having default template look like this:

  ${connector.task.prefix}${task.id}: ${task.status} - ${task.description}

Comment 50 Eugene Kuleshov CLA 2006-10-17 04:35:44 EDT
(In reply to comment #48)
> Eugene: do you mean
> ${connector.task.prefix} ${task.id}: ${task.description} - ${task.status} 
> ?  If not, I worry that not having description after ID would look weird since
> that's such a common presentation.  

Because comment can be quite long and already look ugly in Sync view, putting status to the end does not make sense. I did meant to put it after the id, so sorting by comment text will bring issues nearby.

> Eugene: note that the connectors just specify "task#" or "bug", and the space
> comes from the template. Let's discuss Jira-specific requirements further on
> bug 150957.

As I said, if Jira would use empty prefix, that space in template will be somehow annoying. On the other hand, I've seen that some projects are using Jira pattern like [SPR-123], so it seems like we need a task suffix too... Though Jira issue ids are patternish on their own.

That makes me wonder if there should be something like ${task.pattern} instead of ${connector.task.prefix} ${task.id}, so space would be inserted automatically where needed.
Comment 51 Mik Kersten CLA 2006-10-18 16:48:44 EDT
Reopening to address above comments.
Comment 52 Willian Mitsuda CLA 2006-10-19 17:25:47 EDT
I was playing with the latest dev-build, and I don't know why, the task.status variable was not substituted:

${task.status} - bug... blablabla

I canceled the commit and noticed that in task list the bug was marked as unread. Then I double-clicked it, closed, commit again, and them the variable was substituted.

I think there is a bug around here yet.
Comment 53 Mik Kersten CLA 2006-10-20 13:49:31 EDT
I've addressed most of these comments, including the bug, adding the space to the prefix, and making the text area multi-line.  Key things to note:
* I don't think we should put the status between the ID and the description.  I tried and it looks weird and is inconsistent with the rest of the UI.  If it's not suitable for the first position I think we either get rid of it or put it last (which is effectively getting rid of it).  Thoughts?
* For now Jira users will have to make that [..] pattern part of the template pattern.  We'll probably need per-project templates before too long, i.e. bug 157342.

A dev build with the fixes will be available soon, and I'll post to mylar-dev.  Please try it out.
Comment 54 Mik Kersten CLA 2006-10-20 13:49:48 EDT
Created attachment 52413 [details]
mylar/context/zip
Comment 55 Mik Kersten CLA 2006-10-20 14:19:50 EDT
One more thing: I pub back the ${task.url} by default on the newline.  We don't require it anymore, but there has been people still rely on this (e.g. with email based commit messages), so the cost of the extra noise seems woth being 'backwards compatible' with tools that rely on URLs.