•  
      request #13671 Enable use of tuleap tracker fields in Mylyn commit template variables
    Infos
    #13671
    Vincent Hémery (vhemery)
    2019-11-22 17:34
    2019-07-25 09:42
    14865
    Details
    Enable use of tuleap tracker fields in Mylyn commit template variables
    In the commit template from Mylyn (Preferences > Mylyn > Team), the number of accessible variables is very limited.
    It could be usefull to access any field value in a tracker with a dedicated variable, taking the field name as an argument.
    E.g. using "${tuleap.field("reference")}" to access the value of the field named "reference" in the tracker.

    This is technically made possible by bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=415013 which allows arguments in template variables, though it is not explicit to the end user when using the autocompletion right now.
    Hence, the documentation of such a "tuleap.field" template variable should be explicit to indicate the end user how to add the field name as an attribute.

    The name "tuleap.field" is naturally not definitive and I am opened to better suggestions.
    The variable could also take additional arguments for formatting (for example the date format) or for simple value-label mapping when working on a enumerated field.

    I am currently working on an implementation using the "org.eclipse.mylyn.team.ui.commitTemplates" extension point and the tuleap connector. If that's OK with the team, I could contribute that in a separate plugin (due to the additional dependencies to org.eclipse.mulyn.team.ui and dependencies to other eclipse or tueleap tasks plugins).
    Mylyn
    All
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Thomas Gerbet (tgerbet)
    Closed
    2019-11-22
    Attachments
    References
    Referenced by request #13671

    Artifact Tracker v5

    rel #13877 11.9

    Follow-ups

    User avatar
    Thomas Gerbet (tgerbet)2019-11-22 17:34
    2.5.0 has been tagged and released in the update site.

    • Status changed from Under implementation to Closed
    • Close date set to 2019-11-22
    User avatar
    Thomas Gerbet (tgerbet)2019-11-22 16:24
    Hi,

    I just merged gerrit #16408 and the documentation PR.


    Sorry for the delay before the review/merge and thanks for your work!

    We will release the plugin as 2.5.0 and then close the request.

    • Status changed from Under review to Under implementation
    • Assigned to changed from None to Thomas Gerbet (tgerbet)
    • Connected artifacts
    User avatar

    Just to let you know, we didn't forget you !

    The people that are able to review your code are in vacation, they should have a look at it hopefully next week.

    User avatar
    last edited by: Vincent Hémery (vhemery) 2019-10-10 08:17
    For the documentation update, I'd like to add a new chapter just after "Link with the context" on https://docs.tuleap.org/mylyn/usage.html :

    Use Tuleap artifact fields in commit template

    When a task is active, you can use Mylyn to pre-format commit messages, including values from the Tuleap artifact's fields.
    Open the "Window -> Preferences" menu, then the "Mylyn -> Team" Page. Check the option to let Mylyn manage the commit message, then enter your commit message template.
    [Image previewTuleapVariables.png]
    You have access to Tuleap artifact's field values with ${tuleap.fieldXXX("key")} placeholders, available on auto-completion.
    The field's label is easy to find as it is the one you see on the artifact page.
    The field's name is available from the tracker's administration page
    [Image Name.png]
    The field's integer id can be retrieved from the same administration page, by hovering the field's edition button. You then see the field's id at the end of the pointed URL after "formElement=".
    [Image Id.png]

    User avatar
    Just pushed to Gerrit. I also added a preview image as attachment.

    Finally, I added not 1,but 4 variables, allowing to choose a field value from its id, name, label or any of them if you don't want to bother...
    There is also the possibility to use a 2nd format argument for dates (only dates at the moment, but may evolve in the future if needed).

    With all this, it could be usefull to update the connector documentation page on https://docs.tuleap.org/mylyn/usage.html especially to let the end user know where to find the field's id, name or label.
    How is this documentation page managed ? Is it on another GIT repository ? a static web page?

    User avatar
    The Tuleap Mylyn plugin names follows the same convention as the Eclipse Mylyn plugin names. So I think it's best to keep it that way.
    For the moment, all there is in the Tuleap Mylyn is about "tasks". There is nothing about the "team" part. So that really makes sense to make a different plugin here, otherwise, we would have to rename the plugin where we add it, and possibly break everything.

    The common practice in Eclipse community is one plugin = one concern. And the template variable really is another layer.

    On the other hand, I think it's not worth adding a new feature. So I would update one of the existing features to add the new plugin to it and its dependencies. So I agree with you, but only at feature level (which is what the end user sees at installation).
    User avatar

    That sounds find to me.

    For the plugin thing, to be honest I don't know. What's the practice in Eclipse community for this kind of things ?

    I tend to think that if the new dep is not that big, it's not worth a dedicated plugin that people will likely to miss. What do you think ?