Entries Tagged as Trac
Updating the Status of a Trac ticket via a SVN commit
February 03, 2008 · 9 Comment s
One of the really nice things about the SVN/Trac combo is that when you commit changes to SVN, you can have the changeset update the status of a Trac ticket.
So, say the changes you have been working on, have tested, and are now committing back to SVN fix a specific ticket within Trac, and once you've made your commit, you would then log into Trac and close the ticket there.
You could also do this via the superb Mylyn integration if you're using Eclipse - which you should be :)
Well, how about updating the actual status when you do your commit? One action to rule them all, so to speak.
Well, this is possible, and here's how to do it.
The main reason for posting this, is that I've recently upgraded our Trac environment from 0.10 to 0.11 and I noticed the trac-post-commit was now broken.
The following is for Linux, so you'll need to Google for Windows.
Grab the trac-post-commit script
You need to pull the latest working version of the script from the Trac SVN repository.
svn export http://svn.edgewall.com/repos/trac/trunk/contrib/trac-post-commit-hook /my/svn/repo/hooks
Next rename the file you've just exported by sticking a ".py" on the end - it's a Python script.
Next make sure your post-commit script file is named appropriately (post-commit funnily enough) and make sure that execute permissions are set on the file. You know, chmod ugo+x post-commit
Edit the post-commit script
Next, edit your post-commit file and add the following line - this is the reason ours was broken.
TRAC_ENV=<span class='cc_value'>"/path/to/your/trac/env"</span>
Now add the following line, and this is the one that calls the trac-post-commit script
/usr/bin/python /path/to/hooks/trac-post-commit-hook.py -p <span class='cc_value'>"$TRAC_ENV"</span> -r "$REV
Just to be on the safe side of everything, just Apache a restart.
Commit Your Change
Now, from within Eclipse, when you want to commit your changes, you can now put the following in your comments (and you are filling in comments aren't you?????!!!???"
command #1
command #1,#2
command #1 & #2
command #1 and #2
The following commands are supported:
- close
- closed
- closes
- fix
- fixed
- fixes
The above will close the specified ticket number, in addition to adding the message you have specified.
Also, you can use the following commands:
- references
- refs
- addresses
- re
- see
The ticket numbers specific here are left as is, but the contents of the commit messages are added to their notes.
A quick example would be something like:
The changes made here fix #100, #102 and refs #85
This commit message will close tickets 100 and 102, and add the commit message to ticket 85.
→ 9 Comment s Tags: Trac · Subversion
Bug Tracking: If You Aren't Using Doing It, Then Your Software Will Be Poor
August 29, 2007 · 6 Comment s
I blogged around a month ago stating "Version Control: You're a Fool If You Don't Use It".
Whilst the comments to that posting were pretty much all in agreement, I got some emails/IMs that weren't as enthusiastic, and thought I was being quite bold and abrasive in my claim, well....
...I'm about to make another...
If you aren't using bug tracking software you will continuously, and consistently release poor software.
The simple fact is that you need a proper way to organise all the things currently wrong with your code. It also gives you a way to record enhancements you or your customers would like to see. NO, a list of emails doesn't cut it.
Companies I have worked for in the past didn't maintain any formalised record of bugs - again, NO a list of emails doesn't cut it. Looking back, we simply were nowhere near as productive as we could have been, and yes, as far as I'm concerned, we released crap software. Fact.
The last company I worked for, before founding Fuzzy Orange, I put in place both Subversion and Trac. I put them in place before I did anything else, much to the annoyance of management. Given time though, management discovered that by doing so we ended up with a much more stable, maintainable and performant product. Don't get me wrong, they still complained about new features not being developed fast enough - what's new - but the product had regained credibility whereas before there was countless server restarts per day because the software was. Crap.
By using Trac, I had given the development team a centralised and searchable system whereby, we could all see:
- All the (reported) outstanding bugs
- Progress of each bug
- What milestones we were working to, and how many bugs/enhancements we still had to squash
For management, who had read-only access, they could see reports that told them:
- What our milestones were
- An estimation of when these milestones would be reached
- A count of just how many bugs were in the system
- How many bugs we had closed, and how many were closed in a given timescale
Again, a list of emails doesn't count. It doesn't give you the information you, or your fellow staffers need. You need a way to record bugs, prioritise them, assign them to developers, assign them to milestones, and you need a way to search them. So once again I will state, If you aren't using bug tracking software you will continuously, and consistently release poor software.
So, there is a question that needs to be asked. Why do software development teams operate without a bug tracker? And believe me, there are a lot who don't.
1) I'm a single developer, so I don't need one
This argument is given often, not just for bug tracking, but also when discussing version control. However, you're 100% wrong. Nope, no argument. You're plain wrong.
Even if you are the sole developer at a company, think of yourself as a development team that currently has a single person. This team may grow, and if you don't act now you'll just make life harder for yourself down the line. Additionally, using a bug tracker can allow you to track and prioritise your time and this will lead to you becoming more productive.
2) Don't have time to put one in place
Complete cop-out. You can have bug tracking software up and running in an hour.
3) All the bug trackers out there are way too complex
Then write your own. Create a single database table with the following fields.
- Short Description
- Date Created
- Steps to Reproduce
- What Should Happen
- What Does Happen
- Bug Owner
- Who is it Assigned to
- Is it fixed
Now just throw together a simple interface for this.
4) They cost too much
Absolute rubbish.
5) We don't have the expertise, environment, resources to put this in place
Then use a hosted solution such as CVS Dude to do it all for you.
There is no excuse for not having bug tracking software in place.
→ 6 Comment s Tags: Trac · Business · Development · Community
Configuring the WebAdmin plugin for Trac
July 25, 2007 · 3 Comment s
One of the biggest complaints I hear about Trac, is the fact it's administrative interface is command line based.
There is a WebAdmin plugin for Trac, and I thought I would write a quick article about how to install and configure it.
Enjoy.
Configuring the WebAdmin plugin for Trac→ 3 Comment s Tags: Trac
Installing and Configuring SVN and Trac on Windows
July 19, 2007 · No Comments
At the risk of doing my company (Fuzzy Orange) out of business, I thought I would blog about how to set up SVN and Trac on Windows.
There has been a lot of discussion on this at the ScottishCFUG Google Group, and as much as I'd love to just say "Use Linux, it's easier", some folks aren't in that position.
So here it is:
Installing and Configuring SVN and Trac on Windows
Please leave comments, suggestions, questions, problems, etc here and I'll do my best to answer you.
→ No Comments Tags: Trac · Subversion
Trac - Multiple Projects
August 25, 2006 · 3 Comment s
#Alias /trac <span class='cc_value'>"d:/appservers/Python23/share/trac/htdocs"</span>
ScriptAlias /trac <span class='cc_value'>"D:/appservers/Apache Group/Apache2/cgi-bin/trac.cgi"</span>
I then commented out the following block and replaced it
#<Location /cgi-bin/trac.cgi>
#SetEnv TRAC_ENV <span class='cc_value'>"d:/svn/la.db"</span>
#SetEnv PYTHONPATH <span class='cc_value'>"d:/Subversion/bin"</span>
# if you are running Apache as a user other than System, the TMP variable
# needs to be set to a place where that user can write scratch files. Make
# sure that this directory is created and writable by that user.
#SetEnv TMP <span class='cc_value'>"c:/svn/trac.db/tmp"</span>
#</Location>
<Location <span class='cc_value'>"/trac"</span>>
SetEnv TRAC_ENV_PARENT_DIR <span class='cc_value'>"d:/svn/"</span>
SetEnv PYTHONPATH <span class='cc_value'>"d:/Subversion/bin"</span>
</Location>
I then updated the authentication block by doing ... and this allows us to share the same password file across all our projects.
#<Location /cgi-bin/trac.cgi/login>
# AuthType Basic
# AuthName <span class='cc_value'>"LA"</span>
# AuthUserFile passwd
# C:/svn/.htaccess
# AuthGroupFile svngroup
# Require valid-user
#</Location>
<LocationMatch <span class='cc_value'>"/trac/[^/]+/login"</span>>
AuthType Basic
AuthName <span class='cc_value'>"Trac"</span>
AuthUserFile passwd
AuthGroupFile svngroup
Require valid-user
</LocationMatch>
Restart Apache and you're off...
http://mysite/trac/
Doing this will get you a list of projects you can choose from, or you can just do
http://mysite/trac/<projectname>
I should point out that there are other ways of running Trac, and different ways of supporting multiple projects. Also as I'm still learning all this stuff myself, I may not be getting everything "right", so feel free to shout in if you have suggestions.
I think I'll follow this up by talking about users and permissions ... though I believe I need to write the next entry for my AdminAPI series.
→ 3 Comment s Tags: Trac
Woot - Trac up and running
August 23, 2006 · 21 Comment s
- Install Python - You must use Python 2.3.x - the Subversion bindings are not available for Python 2.4
- Copy the libsvn and svn folders in the Python Bindings to <python>\lib\site-packages
- Install PySQLite
- Extract neo_cgi.pyd from your Clearsilver download to <python>\lib\site-packages
- Install Trac
- Copy <python>\share\trac\cgi-bin\trac.cgi to <apache>\cgi-bin
- Edit the trac.cgi file so that the first line points to your python.exe file
d:\python23>python scripts\trac-admin d:/svn/trac.db
Initialise DB
Trac [d:/svn/trac.db]> initenv
Trac will now ask you for a Project Name, Database Connection String, Subversion Repository, and the Path to Templates
So as an example:
Project Name: Creative
Connection String: (just hit enter to accept default)
Subversion Repository: d:\svn\creative
Path to Templates: (just hit return)
Add Administrative Permissions
Trac [d:/svn/trac.db]> permission add admin TRAC_ADMIN
Add Trac to Apache
Edit httpd.conf:
# TRAC
Alias /trac <span class='cc_value'>"d:/Python23/share/trac/htdocs"</span>
<Location /cgi-bin/trac.cgi>
SetEnv TRAC_ENV <span class='cc_value'>"d:/svn/trac.db"</span>
SetEnv PYTHONPATH <span class='cc_value'>"d:/Subversion/bin"</span>
# if you are running Apache as a user other than System, the TMP variable
# needs to be set to a place where that user can write scratch files. Make
# sure that this directory is created and writable by that user.
# SetEnv TMP <span class='cc_value'>"d:/svn/trac.db/tmp
</Location>
<Location /cgi-bin/trac.cgi/login>
AuthType Basic
AuthName "</span>Creative<span class='cc_value'>"
AuthUserFile passwd
Require valid-user
</Location>
<Directory "</span>d:/Python23/share/trac/htdocs">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Now you want to restart Apache.
Finally, hit http://yourdomain/cgi-bin/trac.cgi and log in via the username/password combinations you have set up in "passwd" for accessing Subversion.
Final Words
I know I've not covered everything, and I've certainly not mentioned any error messages you may potentially come across, but if you do have any issues, leave a comment here and I'll try and help out.
→ 21 Comment s Tags: Trac · Subversion