Links added by Trac plugin

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Links added by Trac plugin

Kianwin Ong
Hi Kohsuke,

I have been using the Trac plugin for awhile, and I have two small feature requests:

1. Is it possible to disable automatic linking of CamelCase words to the Trac wiki? Commit messages routinely contain class names, therefore these links end up pointing to non-existent wiki pages and cluttering the description. If there are other use cases that require auto-linking, a configuration option that turns it off will also be nice.

2. In addition to linking [123] changeset numbers under the "Changes" label , is it possible to also link the revision number under the "Revision" label?

Thanks!

- Kian Win
Reply | Threaded
Open this post in threaded view
|

Re: Links added by Trac plugin

Kohsuke Kawaguchi
Administrator
Thanks for the feedback. If you can file issues for those, that would be great.

Personally, I don't use Trac, so if other Trac users can comment on
how they think about these requests, that would be helpful, too.

Also, if you can give more details and relevant pointers wrt your 2nd
point when you file an issue, that would be great.

2007/7/1, Kianwin Ong <[hidden email]>:

>
> Hi Kohsuke,
>
> I have been using the Trac plugin for awhile, and I have two small feature
> requests:
>
> 1. Is it possible to disable automatic linking of CamelCase words to the
> Trac wiki? Commit messages routinely contain class names, therefore these
> links end up pointing to non-existent wiki pages and cluttering the
> description. If there are other use cases that require auto-linking, a
> configuration option that turns it off will also be nice.
>
> 2. In addition to linking [123] changeset numbers under the "Changes" label
> , is it possible to also link the revision number under the "Revision"
> label?
>
> Thanks!
>
> - Kian Win
> --
> View this message in context: http://www.nabble.com/Links-added-by-Trac-plugin-tf4006607.html#a11378588
> Sent from the Hudson users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Kohsuke Kawaguchi

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Links added by Trac plugin

Brad Fritz-5
In reply to this post by Kianwin Ong

Kianwin,

On Sat, Jun 30, 2007 at 06:49:25PM -0700, Kianwin Ong wrote:

> 1. Is it possible to disable automatic linking of CamelCase words to the
> Trac wiki? Commit messages routinely contain class names, therefore these
> links end up pointing to non-existent wiki pages and cluttering the
> description. If there are other use cases that require auto-linking, a
> configuration option that turns it off will also be nice.

This should be possible after I finish implementing the fix for # 592:
  https://hudson.dev.java.net/issues/show_bug.cgi?id=592

My plan is to make it possible to enable/disable each type of
annotation added by TracLinkAnnotator:
  https://hudson.dev.java.net/source/browse/hudson/hudson/plugins/trac/src/main/java/hudson/plugins/trac/TracLinkAnnotator.java?view=markup

Unfortunately, it's taking a longer than I'd like.  (There are still a
few Hudson concepts I'm trying to wrap my head around and I haven't
had much time to work on it.)

I think the regex for wiki annotations probably also needs some work.
I've noticed that TracLinkAnnotator is pretty aggressive about which
words it links, e.g. in the change log:

  Remove whitespace.  (Actually just testing Trac.)

"Remove", "Actually", and "Trac" get linked.  I think Trac itself only
automatically links words with a second capital letter, e.g. "FooBar"
but not "Foo".

 
> 2. In addition to linking [123] changeset numbers under the "Changes" label
> , is it possible to also link the revision number under the "Revision"
> label?

I don't understand #2 yet.  The current form of the Hudson "changes"
page with the Trac plugin enabled is:

  Revision <a href="http://host/trac/changeset/123">123</a> by ...

  [SVN log message, possibly with links to Trac instance, here]

  <a href="http://host/trac/browser/trunk/foo.txt#L1">/trunk/foo.txt</a>
  <a href="http://host/trac/changeset/123/trunk/foo.txt#file0">(diff)</a>

Given the example above, can you tell me what the requested anchor for
"Revision" would point to?

Thanks for your feedback, Kianwin.

--Brad


signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Links added by Trac plugin

Kohsuke Kawaguchi
Administrator
Brad Fritz wrote:
> Unfortunately, it's taking a longer than I'd like.  (There are still a
> few Hudson concepts I'm trying to wrap my head around and I haven't
> had much time to work on it.)

Just shoot me some e-mails and I'd be happy to help. This kind of
feedback is very useful for me, too.

> I think the regex for wiki annotations probably also needs some work.
> I've noticed that TracLinkAnnotator is pretty aggressive about which
> words it links, e.g. in the change log:
>
>   Remove whitespace.  (Actually just testing Trac.)
>
> "Remove", "Actually", and "Trac" get linked.  I think Trac itself only
> automatically links words with a second capital letter, e.g. "FooBar"
> but not "Foo".

I wouldn't be surprised if I was the one who wrote that code and it was
done that way just because I didn't test it :-(

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Links added by Trac plugin

Kianwin Ong
In reply to this post by Brad Fritz-5
Hi Brad and Kohsuke,

Brad Fritz-5 wrote
This should be possible after I finish implementing the fix for # 592:
  https://hudson.dev.java.net/issues/show_bug.cgi?id=592

My plan is to make it possible to enable/disable each type of
annotation added by TracLinkAnnotator:
  https://hudson.dev.java.net/source/browse/hudson/hudson/plugins/trac/src/main/java/hudson/plugins/trac/TracLinkAnnotator.java?view=markup

[snip]

I think the regex for wiki annotations probably also needs some work.
I've noticed that TracLinkAnnotator is pretty aggressive about which
words it links, e.g. in the change log:

[snip]
The aggressive regex for the wiki annotations does indeed exacerbate the issue, but the ability to enable / disable each type of annotation will definitely work.

Shall I file an issue for this still considering that it's already in the works?
 
Brad Fritz-5 wrote
  Revision <a href="http://host/trac/changeset/123">123</a> by ...

  [SVN log message, possibly with links to Trac instance, here]

  <a href="http://host/trac/browser/trunk/foo.txt#L1">/trunk/foo.txt</a>
  <a href="http://host/trac/changeset/123/trunk/foo.txt#file0">(diff)</a>
There are two pages on which the link should occur:
1. JOB_NAME/BUILD_NUMBER/changes
2. JOB_NAME/BUILD_NUMBER/

For 1, the page format appears as Brad described, except that there is no anchor for the revision, nor are there anchors for the source file and diffs. I am currently using plugin version 1.4 - perhaps the changes are in a later version?

For 2, the page format comprises "Revision:" and "Changes:". There are anchors on "Changes:", but not on "Revision:". Again, perhaps this is fixed in a later version?

So long as the anchor appears, the target of the anchor would be exactly as Brad described.

- Kian Win
Reply | Threaded
Open this post in threaded view
|

Re: Links added by Trac plugin

Brad Fritz-5
Kian Win,

On Thu, Jul 05, 2007 at 02:31:26PM -0700, Kianwin Ong wrote:

[..]

> Brad Fritz-5 wrote:
>
> The aggressive regex for the wiki annotations does indeed exacerbate the
> issue, but the ability to enable / disable each type of annotation will
> definitely work.
>
> Shall I file an issue for this still considering that it's already in the
> works?

Probably no need for a new issue.  I think #592 [1] covers it pretty
well.  I am going to work on that issue this morning and see if I can
make some more progress.

--Brad

[1] https://hudson.dev.java.net/issues/show_bug.cgi?id=592

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]