Supporting multiple projects in Trac plugin

Hi there

I am currently in the process of updating the Trac issue provider plugin to support the latest version of Teamcity (2017.1.2).

In order for it to be useful for my case, it needs to support a multi-project setup (multiple trac projects on different urls of the same server referring to different vcs urls). In order to do this I have added a property to the `editIssueProvider.jsp` form called 'svn_root'. In this text box I enter the start url of the SVN root for each trac project. In your documentation you note that

When the server is going to render the user comment (VCS commit, or build comment), it invokes all registered providers to parse the comment. This operation is performed by theIssueProvider.getRelatedIssues() method, which analyzes the comment and returns the list of the issue mentions

Noting that IssueProvider interface contains the following two methods:

  • Collection<IssueMention> getRelatedIssues(@NotNull VcsModification modification);
  • boolean isHasRelatedIssues(@NotNull VcsModification modification);

I had assumed that I could override these two methods and use the svn_root property I define above to ensure that issue providers only return related issues if the Vcs changes took place on the relevant root.

Trying to do this however, it would appear that the above quote from your documentation is not completely accurate. On the main page, next to a build there is a 'changes' link, with a down arrow indicating a dropdown. If I hover over that down arrow, comments are rendered, but the above methods are *not* called, leaving me with no way of filtering 'related issues' by vcs root.

Please could you advise:

  • Is this intended behaviour?
  • If so, what other approach can you recommend to achieve the required result?

Please sign in to leave a comment.