2 Trac Servers, 1 SVN Server... Hook Script Madness

6 views
Skip to first unread message

marc.swingler

unread,
Apr 8, 2010, 12:01:19 PM4/8/10
to Trac Users
I have SVN setup with the post-commit hook script from Trac (as well
as to my Hudson servers). Works beautifully. But today someone pointed
out that some of our tickets are getting comments from developers
working on unrelated projects. Turns out another team points to my SVN
server for code shared with mine. So when they go and commit changes
to our SVN server and specify a ticket# meant for their Trac instance
in the comment, it goes to the my Trac server, not theirs. I can huff
and puff all day about the fact that the devs on this other team
shouldn't do that, but the fact is they do. Does anyone know of a
modified post-commit hook script that could specify which Trac server
to send the ticket update to?

Noah Kantrowitz

unread,
Apr 8, 2010, 2:08:59 PM4/8/10
to trac-...@googlegroups.com
You would need to either come up with new syntax, or make something that
checks what path the commit is touching. Either should be pretty easy if you
read the code of the hook script.

--Noah

> --
> You received this message because you are subscribed to the Google
> Groups "Trac Users" group.
> To post to this group, send email to trac-...@googlegroups.com.
> To unsubscribe from this group, send email to trac-
> users+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/trac-users?hl=en.


Olemis Lang

unread,
Apr 8, 2010, 3:09:38 PM4/8/10
to trac-...@googlegroups.com
On Thu, Apr 8, 2010 at 2:08 PM, Noah Kantrowitz <no...@coderanger.net> wrote:
>> -----Original Message-----
>> From: trac-...@googlegroups.com [mailto:trac-...@googlegroups.com]
>> On Behalf Of marc.swingler
>> Sent: Thursday, April 08, 2010 9:01 AM
>> To: Trac Users
>> Subject: [Trac] 2 Trac Servers, 1 SVN Server... Hook Script Madness
>>
>> I have SVN setup with the post-commit hook script from Trac (as well
>> as to my Hudson servers). Works beautifully. But today someone pointed
>> out that some of our tickets are getting comments from developers
>> working on unrelated projects. Turns out another team points to my SVN
>> server for code shared with mine. So when they go and commit changes
>> to our SVN server and specify a ticket# meant for their Trac instance
>> in the comment, it goes to the my Trac server, not theirs. I can huff
>> and puff all day about the fact that the devs on this other team
>> shouldn't do that, but the fact is they do. Does anyone know of a
>> modified post-commit hook script that could specify which Trac server
>> to send the ticket update to?
>
> You would need to either come up with new syntax, or make something that
> checks what path the commit is touching. Either should be pretty easy if you
> read the code of the hook script.
>

I suppose you'll have more chances considering another approach :
Filter in your hook the changesets performed by members of the other
team (and, if needed, viceversa ;o) so that your Trac be immune to
external noise

;o)

--
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
On adding Hessian (RPC) support for Trac -
http://feedproxy.google.com/~r/simelo-en/~3/Vit6dRudChU/on-adding-hessian-rpc-support-for-trac.html

Olemis Lang

unread,
Apr 8, 2010, 3:56:54 PM4/8/10
to trac-...@googlegroups.com

That's a nice feature to enhance RepositoryHookSystemPlugin . Added to
my TODO list [1]_ , further discussion & ideas will be much
appreciated .
;o)

.. [1] Allow filtering changesets in ticket changer
(http://trac-hacks.org/ticket/6956)

Olemis Lang

unread,
May 1, 2010, 8:54:42 PM5/1/10
to trac-...@googlegroups.com
On 4/8/10, Olemis Lang <ole...@gmail.com> wrote:
> On Thu, Apr 8, 2010 at 2:08 PM, Noah Kantrowitz <no...@coderanger.net>
> wrote:
>>> -----Original Message-----
>>> From: trac-...@googlegroups.com [mailto:trac-...@googlegroups.com]
>>> On Behalf Of marc.swingler
>>> Sent: Thursday, April 08, 2010 9:01 AM
>>> To: Trac Users
>>> Subject: [Trac] 2 Trac Servers, 1 SVN Server... Hook Script Madness
>>>
>>> I have SVN setup with the post-commit hook script from Trac (as well
>>> as to my Hudson servers). Works beautifully. But today someone pointed
>>> out that some of our tickets are getting comments from developers
>>> working on unrelated projects. Turns out another team points to my SVN
>>> server for code shared with mine. So when they go and commit changes
>>> to our SVN server and specify a ticket# meant for their Trac instance
>>> in the comment, it goes to the my Trac server, not theirs. I can huff
>>> and puff all day about the fact that the devs on this other team
>>> shouldn't do that, but the fact is they do. Does anyone know of a
>>> modified post-commit hook script that could specify which Trac server
>>> to send the ticket update to?
>>
>> You would need to either come up with new syntax, or make something that
>> checks what path the commit is touching. Either should be pretty easy if
>> you
>> read the code of the hook script.
>>
>

JFTR , I forgot to mention that it's possible to do something like
this by using RepositoryHookSystem plugin and specifying -p |
--project | --projects argument in to the hook script (multiple
projects are supported)
--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-...@googlegroups.com.
To unsubscribe from this group, send email to trac-users+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages