main-config.xml / transformation-pattern

I'm attempting to run multiple replaces for different patterns.  The DTD states that you can have multiple transformation-patterns.  But the behavior I am seeing is that only the first is being executed.

Is this a bug?

Comment actions Permalink

Here is my XML:

<?xml version="1.0" encoding="UTF-8"?>
<server rootURL="">
    <scheduler hour="3" minute="0" />
    <login-module />
    <login-description />
    <guest-login allowed="false" guest-username="guest" />
    <free-registration allowed="true" />
  <artifacts maxArtifactSize="300000000" />
    <transformation-pattern search="(.+)#([0-9]+)(.?+)" replace="$1&lt;a title=&quot;Click to open this issue&quot;
href=&quot;/trac/ticket/$2&quot;&gt;#$2&lt;/a&gt;$3" description="Trac link" />
<transformation-pattern search="(.+)r([0-9]+)(.?+)" replace="$1&lt;a title=&quot;Click to open this changeset&quot;
description="Subversion link" />
  <report-tab title="Code Coverage" basePath="" />
  <report-tab title="JavaDoc" basePath="" />

Comment actions Permalink

What version of TeamCity do you use?

Comment actions Permalink

Version 4.5 (build 8944)

Comment actions Permalink


It's not a bug, you can have several patterns, but in each situation the first matched pattern will be used. Patterns are matched according to their order in XML file.


Comment actions Permalink

Ok, that makes sense.  But in my case if the first regex matches, I still want the others to run.

For instance.  I have the following text:

"Made updates to fix bugs caused by r1494, this is resolves issue #239"

I want "r1494" to become a link to the SVN changeset and "#239" to become a link to our bug tracking system.

Is this possible?

Comment actions Permalink

Probably not. I guess we can add an option to allow multiple pattern matching to support it. Can you please file a bug about this feature?

Comment actions Permalink

I saw that Joe opened an issue for this, TW-8125. From reading the issue it looks like it was supposed to have been fixed in 4.5.2. I am running 8.0.5 (build 27692) and still seeing this - only the first matching pattern seems to be applied. Am I misreading that it was supposed to be fixed already, or was there perhaps a regression?


Please sign in to leave a comment.