Changes between Initial Version and Version 1 of HackingTrac


Ignore:
Timestamp:
Feb 6, 2007, 9:55:03 AM (18 years ago)
Author:
Jacob
Comment:

Added notes about how I hacked trac so that next time I won't forget.

Legend:

Unmodified
Added
Removed
Modified
  • HackingTrac

    v1 v1  
     1= Hacking Trac for code.djangoproject.com =
     2
     3For posterity -- and for when we upgrade! -- this page contains a list of all the things I've done to modify Trac for code.djangoproject.com.
     4
     5== Plugins ==
     6
     7Most of the work comes from a set of plugins from [http://trac-hacks.org/ Trac Hacks]. This installation is using the following plugins:
     8
     9  * [http://trac-hacks.org/wiki/NavAddPlugin NavAdd]
     10  * [http://trac-hacks.org/wiki/NavHiderPlugin NavHider]
     11  * [http://trac-hacks.org/wiki/SimpleTicketPlugin SimpleTicket]
     12  * [http://trac.edgewall.org/wiki/SpamFilter TracSpamFilter]
     13  * [http://trac.edgewall.org/wiki/WebAdmin WebAdmin]
     14  * [http://trac-hacks.org/wiki/TocMacro TocMacro]
     15 
     16Most of them are easy to install -- just check out the source, {{{python setup.py bdist_egg}}}, and copy the egg to plugins.
     17
     18I did have to make one trivial bug fix for Python 2.3 to the !NavHider plugin:
     19
     20{{{
     21Index: navhider/filter.py
     22===================================================================
     23--- navhider/filter.py  (revision 1926)
     24+++ navhider/filter.py  (working copy)
     25@@ -4,7 +4,7 @@
     26 
     27 try:
     28     set = set
     29-except ImportError:
     30+except NameError:
     31     from sets import Set as set
     32 
     33 __all__ = ['NavHiderModule']
     34}}}
     35
     36== Custom fields ==
     37
     38Most of the fields used by out [http://www.djangoproject.com/documentation/contributing/#ticket-triage ticket workflow] are added using Trac's [http://trac.edgewall.org/wiki/TracTicketsCustomFields custom field feature].  See the {{{[ticket-custom]}}} section in the ini below.
     39
     40== Configuration ==
     41
     42There's a lot of config stuff in trac.ini, much of which is just there by default.  These are the important bits:
     43
     44{{{
     45[browser]
     46downloadable_paths = /django/trunk, /django/branches/*, /django/tags/*, /django_website
     47hide_properties = svk:merge, svn:ignore
     48
     49[navadd]
     50add_items = reports, simpleticket
     51reports.target = mainnav
     52reports.title = Reports
     53reports.url = /wiki/Reports
     54simpleticket.target = mainnav
     55simpleticket.title = New Ticket
     56simpleticket.url = /simpleticket
     57
     58[notification]
     59always_notify_owner = true
     60always_notify_reporter = true
     61always_notify_updater = true
     62
     63[simpleticket]
     64hide = stage, needs_tests, needs_docs, needs_better_patch
     65
     66[ticket-custom]
     67has_patch = checkbox
     68has_patch.label = Has patch
     69has_patch.order = 20
     70needs_better_patch = checkbox
     71needs_better_patch.label = Patch needs improvement
     72needs_better_patch.order = 50
     73needs_docs = checkbox
     74needs_docs.label = Needs documentation
     75needs_docs.order = 30
     76needs_tests = checkbox
     77needs_tests.label = Needs tests
     78needs_tests.order = 40
     79stage = select
     80stage.label = Triage Stage
     81stage.options = Unreviewed|Design decision needed|Accepted|Ready for checkin
     82stage.order = 10
     83stage.value = 0
     84
     85[trac]
     86mainnav = wiki,timeline,browser,reports,tickets,-newticket,simpleticket,search
     87metanav = -about,login,logout,settings,-help
     88}}}
     89
     90== Hooks ==
     91
     92We use a couple of SVN post-commit hooks to send the checkin notifications to django-updates and to update Trac from "Fixed #XXX" messages.  Our post-commit hook:
     93
     94{{{
     95#!/bin/sh
     96
     97export PYTHONPATH=/home/trac/
     98
     99REPOS="$1"
     100REV="$2"
     101LOG=`/usr/bin/svnlook log -r $REV $REPOS`
     102AUTHOR=`/usr/bin/svnlook author -r $REV $REPOS`
     103TRAC_ENV='/home/trac/django.tracenv/'
     104TRAC_URL='http://code.djangoproject.com/'
     105
     106/usr/bin/python2.3 /home/trac/trac-0.10.3/contrib/trac-post-commit-hook \
     107    -p "$TRAC_ENV"  \
     108    -r "$REV"       \
     109    -u "$AUTHOR"    \
     110    -m "$LOG"       \
     111    -s "$TRAC_URL"
     112
     113/home/svn/django/hooks/commit-email.pl \   
     114    "$REPOS" \
     115    "$REV" \
     116    -s "[Changeset]" \
     117    --from noreply@djangoproject.com \
     118    django-updates@googlegroups.com
     119}}}
     120
     121== Templates ==
     122
     123I've deliberately avoided hacking any built-in trac templates so that upgrades aren't quite so painful.  I've thus only edited {{{site_css.cs}}} {{{site_footer.cs}}}}, {{{site_header.cs}}}, and {{{site_newticket.cs}}}.
Back to Top