Help with Trac Commit Ticket Updater

595 views
Skip to first unread message

Patty Cottrill

unread,
Oct 25, 2011, 7:50:19 PM10/25/11
to Trac Users
Hi Guys,
 
I need some help with this new component that is supposed to be included with Trac v.12.
I have tried to implement, but its not working for me at all.
The documentation refers to a script called commit_updater.py, but I can't find it anywhere on our server.
Am I supposed to download this to the server and if so, where am I supposed to place it?
The documentation is not very clear, at least not to me:
 
I have read the document reference above, plus http://trac.edgewall.org/wiki/TracRepositoryAdmin#ExplicitSync.
I followed the instructions, but no luck.
 
I enabled the compoments on trac.ini
I enabled & edited the post-commit under the svn/hooks directory as instructed
I added the configuration from the second document.
 
What am I missing?
Please advise.
 
-Patty
 

Cooke, Mark

unread,
Oct 26, 2011, 3:49:15 AM10/26/11
to trac-...@googlegroups.com
I followed that advice and got it working on windows, I'm guessing you are on *nix? It would help if you could provide a bit more information, e.g. platform, trac version etc. Can you post the relevant bits of your trac.ini and your hook script?

~ mark c

Patty Cottrill

unread,
Oct 26, 2011, 12:11:10 PM10/26/11
to trac-...@googlegroups.com
oops sorry about that.

Kubuntu 10.04
Trac 0.12.2
Python 2.6.5 (r265:79063, Apr 16 2010, 13:28:26) [GCC 4.4.3]
Subversion 1.6.6 (r40053)

Per the instructions on
http://trac.edgewall.org/wiki/TracRepositoryAdmin#ExplicitSync
I added the following to the post-commit under the svn/project/hooks
directory:

export PYTHON_EGG_CACHE="/home/trac/project"
/usr/bin/trac-admin /home/trac/project changeset added "$1" "$2"

also commented out the following line that was included in the
post-commit template:

#"$REPOS"/hooks/mailer.py commit "$REPOS" $REV "$REPOS"/mailer.conf

Made sure it was executable by owner, users & groups.


Per the instructions on
http://trac.edgewall.org/wiki/CommitTicketUpdater
I added the following to trac.ini:

Under [Components]
tracopt.ticket.commit_updater.* = enabled

Under [Ticket]
commit_ticket_update_envelope =
commit_ticket_update_commands.close = close closed closes fix fixed
fixes
commit_ticket_update_commands.refs = <ALL>
commit_ticket_update_check_perms = true
commit_ticket_update_notify = true

As I stated in my email, I can not find anywhere on the server the
script commit_updater.py.
Shouldn't I be able to see that script somewhere on the server?

-Patty

~ mark c

--
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.
For more options, visit this group at
http://groups.google.com/group/trac-users?hl=en.

Cooke, Mark

unread,
Oct 27, 2011, 2:49:52 AM10/27/11
to trac-...@googlegroups.com
[Please reply in-line, it makes it easier to read...]

> I followed that advice and got it working on windows, I'm guessing
> you are on *nix? It would help if you could provide a bit more
> information, e.g. platform, trac version etc. Can you post the
> relevant bits of your trac.ini and your hook script?
>
> ~ mark c
>

> -----Original Message-----
> From: trac-...@googlegroups.com On Behalf Of Patty Cottrill
> Sent: 26 October 2011 17:11
> To: trac-...@googlegroups.com
> Subject: RE: [Trac] RE: Help with Trac Commit Ticket Updater
>
> oops sorry about that.
>
> Kubuntu 10.04
> Trac 0.12.2
> Python 2.6.5 (r265:79063, Apr 16 2010, 13:28:26) [GCC 4.4.3]
> Subversion 1.6.6 (r40053)

Hmm, OK, I have limited *nix experience but here goes...

> Per the instructions on
> http://trac.edgewall.org/wiki/TracRepositoryAdmin#ExplicitSync
> I added the following to the post-commit under the svn/project/hooks
> directory:
>
> export PYTHON_EGG_CACHE="/home/trac/project"
> /usr/bin/trac-admin /home/trac/project changeset added "$1" "$2"
>
> also commented out the following line that was included in the
> post-commit template:
>
> #"$REPOS"/hooks/mailer.py commit "$REPOS" $REV "$REPOS"/mailer.conf
>
> Made sure it was executable by owner, users & groups.

...and that includes the user that runs trac? How are you serving trac/svn, via apache or standalone? You need to make sure that the apache user is included (or better the owner, AFAI...understand).

Can you confirm that your value for "PYTHON_EGG_CACHE" matches your web server config? This is only needed "if you changed it from its default location".

Also, how is your svn configured, via trac.ini or via the admin repository command? If the former, you may need to add `[Trac]` `repository_sync_per_request = false`, see
http://trac.edgewall.org/wiki/TracRepositoryAdmin#PerRequestSync

> Per the instructions on
> http://trac.edgewall.org/wiki/CommitTicketUpdater
> I added the following to trac.ini:
>
> Under [Components]
> tracopt.ticket.commit_updater.* = enabled
>
> Under [Ticket]
> commit_ticket_update_envelope =
> commit_ticket_update_commands.close = close closed closes fix fixed fixes
> commit_ticket_update_commands.refs = <ALL>
> commit_ticket_update_check_perms = true
> commit_ticket_update_notify = true

...that all looks ok. What did you use for a commit message and what (if anything) happened in your trac?

> As I stated in my email, I can not find anywhere on the server the
> script commit_updater.py.
> Shouldn't I be able to see that script somewhere on the server?
>
> -Patty
>

More digging leads me to http://trac.edgewall.org/wiki/CommitTicketUpdater#Location which says that the script is part of the trunk source tree, so it will be in the trac install or egg (if you use an egg).

I suspect a permissions issue, can you check that again?

Otherwise, do you have logging enabled to DEBUG in your Trac? Can you try a commit and see if anything appears in the log?

~ mark c

Patty Cottrill

unread,
Oct 27, 2011, 11:40:20 AM10/27/11
to trac-...@googlegroups.com
Hi Mark,

Many thanks for your help with this.
Below are my comments, preceded by [Patty]


-Patty

[Patty] We use apache2. The apache user is www-data, who owns both the
trac and svn directories. So www-data does have execute permissions to
the post-commit script.

Can you confirm that your value for "PYTHON_EGG_CACHE" matches your web
server config? This is only needed "if you changed it from its default
location".

[Patty] Yes, it matches the web server config.

Also, how is your svn configured, via trac.ini or via the admin
repository command? If the former, you may need to add `[Trac]`
`repository_sync_per_request = false`, see
http://trac.edgewall.org/wiki/TracRepositoryAdmin#PerRequestSync

[Patty] The trac.ini is set to the following:
repository_sync_per_request = (default)


> Per the instructions on
> http://trac.edgewall.org/wiki/CommitTicketUpdater
> I added the following to trac.ini:
>
> Under [Components]
> tracopt.ticket.commit_updater.* = enabled
>
> Under [Ticket]
> commit_ticket_update_envelope =
> commit_ticket_update_commands.close = close closed closes fix fixed
> fixes commit_ticket_update_commands.refs = <ALL>
> commit_ticket_update_check_perms = true commit_ticket_update_notify =
> true

...that all looks ok. What did you use for a commit message and what
(if anything) happened in your trac?

[Patty] I used: svn ci -m "closes #1"
Nothing happened to the ticket; no comments, nothing. The svn commit
however was successful.

> As I stated in my email, I can not find anywhere on the server the
> script commit_updater.py.
> Shouldn't I be able to see that script somewhere on the server?
>
> -Patty
>
More digging leads me to
http://trac.edgewall.org/wiki/CommitTicketUpdater#Location which says
that the script is part of the trunk source tree, so it will be in the
trac install or egg (if you use an egg).

[Patty] I have the following .egg file: (Trac-0.12.2-py2.6.egg is a
file, not a directory)
/usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg

I suspect a permissions issue, can you check that again?

[Patty] You mean the permissions on the post-commit script? If so, then
the apache user www-data is the owner & has execute, as well as the
www-data group and others.

Otherwise, do you have logging enabled to DEBUG in your Trac? Can you
try a commit and see if anything appears in the log?


~ mark c

--

Patty Cottrill

unread,
Oct 27, 2011, 5:29:47 PM10/27/11
to trac-...@googlegroups.com
Mark,

I got it to work!!
Apparently I was using the path to the old version of trac-admin (from
Trac 11.7).
I ran which trac-admin and got the path of the current version.
Once I updated the path, it worked!!

Thanks for your help!!


-Patty

-----Original Message-----
From: trac-...@googlegroups.com [mailto:trac-...@googlegroups.com]
On Behalf Of Cooke, Mark

Sent: Thursday, October 27, 2011 2:50 AM

~ mark c

--

Reply all
Reply to author
Forward
0 new messages