autolinking to bugs?

Hi all,

We use scmbug to tie subversion to bugzilla and so use svn comments like "bug 1234:Fix the problem with the thingy". Is there any way to configure TeamCity to autolink these to our bugzilla install? If not, any reason I shouldn't raise an enhancement request?

cheers,
dim

12 comments

Dmitri Colebatch wrote:

Hi all,

We use scmbug to tie subversion to bugzilla and so use svn comments like "bug 1234:Fix the problem with the thingy". Is there any way to configure TeamCity to autolink these to our bugzilla install? If not, any reason I shouldn't raise an enhancement request?

cheers,
dim

Check out
http://www.jetbrains.net/confluence/display/TCD/MappingExternalLinksinComments

--
Alexey Gopachenko
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Please see this document:
http://www.jetbrains.net/confluence/display/TCD/MappingExternalLinksinComments

--
Pavel Sher

"Dmitri Colebatch" <no_reply@jetbrains.com> wrote in message
news:26542633.1176968516220.JavaMail.itn@is.intellij.net...

Hi all,

>

We use scmbug to tie subversion to bugzilla and so use svn comments like
"bug 1234:Fix the problem with the thingy". Is there any way to configure
TeamCity to autolink these to our bugzilla install? If not, any reason I
shouldn't raise an enhancement request?

>

cheers,
dim



0

Thanks guys - I really do need to go through the wiki... my apologies for not finding that myself.

Keep up the good work.

cheers,
dim

0

Please see this document:
http://www.jetbrains.net/confluence/display/TCD/MappingExternalLinksinComments


I'm not entirely clear on how to do this.

Typically, the comments of our bugs contain a first line like this: Defect ID: <name-of-filer><3-digit #>.
e.g. Defect ID: dleskovac123
or
Defect ID: dleskovac123, dleskovac124, dleskovac125

I would like to capture the defect id and append it to the following URL:
http://<bug-tracker>/cgi-bin/bug_redir.cgi?defect_id=
So, that the link would be something like this for example:
http://<bug-tracker>/cgi-bin/bug_redir.cgi?defect_id=dleskovac123

Can someone describe how to do this?

Thanks,
-Dave

0

Dave Leskovac wrote:
>> Please see this document:
>> http://www.jetbrains.net/confluence/display/TCD/MappingExternalLinksinComments


I'm not entirely clear on how to do this.

Typically, the comments of our bugs contain a first line like this: Defect ID: <name-of-filer><3-digit #>.
e.g. Defect ID: dleskovac123
or
Defect ID: dleskovac123, dleskovac124, dleskovac125

I would like to capture the defect id and append it to the following URL:
http://<bug-tracker>/cgi-bin/bug_redir.cgi?defect_id=
So, that the link would be something like this for example:
http://<bug-tracker>/cgi-bin/bug_redir.cgi?defect_id=dleskovac123

Can someone describe how to do this?

Thanks,
-Dave


Search & replace patterns have java.util.regex.Pattern syntax.

Try this settings

search="(^)(\w\d)(\b|$)"

replace="$1&lt;a target=&quot;_blank&quot; title=&quot;Click to open
this issue a new window&quot;
href=&quot;http://<bug-tracker>/cgi-bin/bug_redir.cgi?defect_id=$2&quot;&gt;$2&lt;/a&gt;$3"

--
Alexey Gopachenko
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Alexey,


Thanks for the suggestion. But it didn't work.

Search & replace patterns have
java.util.regex.Pattern syntax.

Try this settings

search="(^)(\w\d)(\b|$)"

replace="$1<a target="_blank"
title="Click to open
this issue a new window"
href="http://<bug-tracker>/cgi-bin/bug_redir.cgi?
defect_id=$2">$2</a>$3"


I added what you suggested and the result was that I could no longer login.
It appears that LDAP was no longer recognized as my method of authentication.

This is what I did:
- Edited: /config/main-config.xml - Before editing, it looked like this: NextFire Build Server - I added the lines you wrote. So, the file now looks like this: NextFire Build Server ]]>
<transformation-pattern
search="(^)(\w\d)(\b|$)"
replace="$1/cgi-bin/bug_redir.cgi?defect_id=$2">$2$3" description="NextFire Defect Tracking link" /> I also tried adding the lines like this: ]]>
<transformation-pattern
search="(^)(\w\d)(\b|$)"
replace="$1/cgi-bin/bug_redir.cgi?defect_id=$2">$2$3" description="NextFire Defect Tracking link" /> ]]>

In both cases, after restarting the TeamCity server I could no longer login.
Am I doing this right?

Thanks,
-Dave

0

Sorry. I don't know what happened to my comment above.

-Dave

0

I have tried to reformat the comment above so it is more readable:

Basically, I added this to "main-config.xml" and now I can't login via LDAP:

<comment-transformation>
<transformation-pattern
search="(^)(\w\d)(\b|$)"
replace="$1&lt;a target=&quot;_blank&quot; title=&quot;Click to open this issue a new window&quot;
href=&quot;http://bug-tracker.orange.us/cgi-bin/bug_redir.cgi\?defect_id=$2&quot;&gt;$2&lt;/a&gt;$3"
description="NextFire Defect Tracking link" />
</comment-transformation>

0

Dave Leskovac wrote:

I have tried to reformat the comment above so it is more readable:

Basically, I added this to "main-config.xml" and now I can't login via LDAP:

<comment-transformation>
<transformation-pattern
search="(^)(\w\d)(\b|$)"
replace="$1&lt;a target=&quot;_blank&quot; title=&quot;Click to open this issue a new window&quot;
href=&quot;http://bug-tracker.orange.us/cgi-bin/bug_redir.cgi\?defect_id=$2&quot;&gt;$2&lt;/a&gt;$3"
description="NextFire Defect Tracking link" />
</comment-transformation>


Basically now you have invalid XML (no single root element).
Try to adding this section INSIDE of root ]]> tag, just before
closing tag. Refer to main-config.dtd

--
Alexey Gopachenko
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Alexey,

Try to adding this section INSIDE of root <server>
tag, just before closing tag. Refer to main-config.dtd


Okay. I see. Now that I moved the comment-transformation inside
of server, I can login as before. But, I don't see autolinking happening.
I expected that the bugs in the build change lists would become links
to the bugs in the bug tracking system. But, I don't see any changes
to the display. Perhaps I don't understand what the result of this change
should be. What changes should I see?

Thanks,
-Dave

0

Dave Leskovac wrote:

Alexey,

>> Try to adding this section INSIDE of root >>]]> tag, just before closing tag. Refer to main-config.dtd


Okay. I see. Now that I moved the comment-transformation inside
of server, I can login as before. But, I don't see autolinking happening.
I expected that the bugs in the build change lists would become links
to the bugs in the bug tracking system. But, I don't see any changes
to the display. Perhaps I don't understand what the result of this change
should be. What changes should I see?

Thanks,
-Dave


Try following pattern

search="(:|,| )(\w{2,}\d{2,})()"

Bear in mind that you can edit main-config.xml on the fly - it will be
reloaded automatically.

Also I can recommend you to use some visual regex program such as "The
Regex Coach" to experiment with regular expressions.

--
Alexey Gopachenko
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Alexey,

Try following pattern

search="(:|,| )(\w{2,}\d{2,})()"

Bear in mind that you can edit main-config.xml on the
fly - it will be reloaded automatically.

Also I can recommend you to use some visual regex
program such as "The
Regex Coach" to experiment with regular expressions.


This worked perfectly. Thanks very much for your help.

Thanks also for the tip about regex coach.

-Dave

0

Please sign in to leave a comment.