1 [[meta title="Integrated issue tracking with Ikiwiki"]]
3 By Joey Hess, LinuxWorld.com
5 [[template id=note text="""
6 [First published](http://www.linuxworld.com/news/2007/040607-integrated-issue-tracking-ikiwiki.html)
7 on [LinuxWorld.com](http://www.linuxworld.com/), a publication of Network
8 World Inc., 118 Turnpike Rd., Southboro, MA 01772.
11 Wikis are not just for encyclopedias and websites anymore. You can use
12 Ikiwiki in combination with your revision control system to handle issue
13 tracking, news feeds, and other needs of a software project. The wiki can
14 make your bug reports as much a part of your software project as its code,
15 with interesting results.
17 Ikiwiki is a wiki engine with a twist. It's best
18 described by the term "wiki compiler". Just as a
19 typical software project consists of source code
20 that is stored in revision control and compiled with
21 `make` and `gcc`, an ikiwiki-based wiki is stored as
22 human-editable source in a revision control system,
23 and built into HTML using ikiwiki.
25 Ikiwiki uses your revision control system to track
26 changes and handle tasks such as rolling back changes and
27 merging edits. Because it takes advantage of revision
28 control, there are no annoying warnings about other
29 people editing a file, or finding yourself locked
30 out of a file because someone else started editing it
31 and left. Instead, the other person's changes will
32 be automatically merged with yours when you commit.
34 In the rare cases where automatic merging fails
35 because of concurrent edits to the same part of a
36 page, regular commit conflict markers are shown in
37 the file to let you resolve the conflict, as you
38 would for conflicting edits in source code.
40 Ikiwiki is a full-featured wiki that you can use
41 for a variety of purposes, from traditional wikis
42 to weblogs, podcasting, or even aggregating other
43 sites' RSS feeds into a Planet page. While people
44 are [[using|ikiwikiusers]]
45 Ikiwiki for purposes ranging from genealogy research
46 to shoe accessory sales, one thing it's especially
47 well suited for is collaborative software development,
48 including announcements, documentation, managing a
49 software project's web site, and even acting as an
50 issue tracking system.
52 ## Building a project wiki with ikiwiki
54 The simplest way to use ikiwiki is to build static
55 HTML files from source wiki files. This example builds
56 a wiki for an imaginary software project. The wiki
57 source files used in this example are available in the
58 [[examples/softwaresite|examples/softwaresite]] section
59 of ikiwiki's documentation.
62 Makefile bugs.mdwn doc/ download.mdwn news/
63 bugs/ contact.mdwn doc.mdwn index.mdwn news.mdwn
65 ikiwiki `pwd` html --wikiname FooBar --plugin=goodstuff \
66 --exclude=html --exclude=Makefile
67 wiki$ w3m -dump html/doc/faq.html
70 FooBar frequently asked questions.
72 1. Is this a real program?
75 _Is this a real program?_
77 No, it's just an example.
84 Last edited Wed Nov 22 09:58:35 2006
86 If all you need is a simple static set of pages
87 that can be put up on a web site, or shipped with
88 a software package, this is a good starting point.
89 The examples included with ikiwiki include pages for
90 a news feed for the project (with RSS), an issue
91 tracker, and other pages users expect to see on a
92 project's website. You can check the wiki-format text
93 into revision control as part of the software project,
94 and tie it into the build system using the Makefile.
96 Ikiwiki can also be tied into the [[post-commit]] hook of your revision
97 control system, so that whenever a developer commits a change to a wiki
98 page in revision control, the project's web site is automatically updated.
99 The [[ikiwiki_tutorial|setup]] explains in
100 detail how to set this up using the Subversion, Git, TLA, and Mercurial
101 revision control systems.
103 The tutorial also explains how to configure ikiwiki so that users can edit
104 pages using a web interface, with their changes committed back into revision
105 control. After all, one of the benefits of keeping a project's docs in a wiki
106 is to make it easy for users to improve them, so that busy software developers
107 don't have to. And if the wiki is being used for issue tracking, this will
108 let users post and follow up on bug reports.
110 ## Using a wiki for issue tracking?
112 You might be wondering exactly how a wiki can be used as an issue tracking
113 system. Three key parts of ikiwiki come together to create an issue tracker:
114 pages, tags, and inlining.
116 Each issue is described on a separate page in the
117 wiki. There can also be an associated Discussion page,
118 as well as other related subpages that can be used
119 to hold files used to reproduce the bug, or patches,
120 or other related files. Since each issue is a page,
121 standard wiki links can be used to link related
122 issues, or link issues with other pages in the wiki.
123 Each issue has its own unique URL. Since ikiwiki
124 supports subdirectories, it's usual to keep all the
125 bugs in a `bugs/` subdirectory. You might prefer
126 to separate bugs and todo items, with todo items in
127 their own 'todo/' subdirectory.
129 While directories are useful for broad hierarchical
130 grouping, tags are better for categorizing issues
131 as bugs, wishlist items, security issues, patches,
132 or whatever other categories are useful. Bugs can
133 be tagged "moreinfo", "done", "unreproducible",
134 etc, to document different stages of
135 their lifecycle. A developer can take ownership of a
136 bug by tagging it with something like "owner/Joey".
138 To tag a wiki page, edit it and add text such as "\[[tag done]]". Note that
139 adding a wiki link to "\[[done]]" will have the same categorisation effect
140 as a tag, but the link will show up in the body of the page, which is a
141 nice effect if used in a sentence such as "This was \[[done]] in version
142 1.1.". Another way to close a bug is to move it out of the `bugs/`
143 subdirectory, though this would prevent it from showing up in a list of
146 Inlining is how ikiwiki pulls individual issue pages together into
147 something larger, be it a page listing recently opened bugs (with a form to
148 let a user easily post a new bug), or a page listing recently closed bugs,
149 or an index of all bugs, or all wishlist items, or RSS feeds for any of
150 these. A flexible syntax is used for specifying what kind of pages should
151 be inlined into a given page. A few examples:
153 * A typical list of all open bugs, with their full text, and a form to post new
156 \[[inline pages="bugs/* and !link(done) and !*/Discussion" actions=yes postform=yes show=0]]
158 * Index of the 30 most recently fixed bugs.
160 \[[inline pages="bugs/* and link(done) and !*/Discussion" sort=mtime show=30 archive=yes]]
162 * Index of the 10 most recently active bugs.
164 \[[inline pages="bugs/* and !link(done) and !*/Discussion" sort=mtime show=10]]
166 * Open security issues.
168 \[[inline pages="bugs/* and link(security) and !link(done) and !*/Discussion"]]
170 * Full text of bugs assigned to Joey.
172 \[[inline pages="bugs/* and link(owner/Joey) and !link(done) and !*/Discussion" show=0]]
174 It may seem strange to consider using a wiki for issue tracking when there
175 are several dedicated bug tracking systems, like Bugzilla, that handle all
176 aspects of it already. The weakest part of using ikiwiki for issue
177 tracking, and certainly the place where a dedicated bug tracker like
178 Bugzilla shines in comparison, is storing and querying structured data
179 about bugs. Ikiwiki has little structured data except for page filenames
180 and tags, so if you need lots of queryable data such as what versions a bug
181 affects and what version it was fixed in, ikiwiki may not be a good fit for
184 On the other hand, by using a wiki for issue
185 tracking, there is one less system for users and
186 developers to learn, and all the flexibility of a
187 wiki to take advantage of. Ikiwiki even supports
188 [OpenID](http://openid.net/), so it's easy for users
189 to use it for filing bugs without going through an
190 annoying registration process.
192 Developers who work offline, or at the other end of a
193 slow connection, might appreciate having a full copy
194 of the project bug tracking system, too.
199 Realistically, there are plusses and minuses to letting users edit a
200 software project's documentation in a wiki. Like any wiki, to be
201 successful, some review is needed of the changes users make. In some cases
202 it will be easiest to limit the pages that users are allowed to edit.
203 Still, keeping the wiki open for user edits will probably turn up some
204 passionate users who prove very useful at filling in holes in the
205 documentation and cleaning up the site.
207 Programmers are supposed to be bad at writing documentation, and putting a
208 project's docs into a wiki might not solve that. But it can make it a
209 little bit easier. Consider a programmer who's just coded up a new feature.
210 He can commit that to a development branch in revision control, and then go
211 update the docs on the web site to document it. But the feature isn't
212 available in a released version yet, so it's probably easier to skip
213 updating the website. Maybe once it's released, the web site will be
214 updated to mention the feature, but maybe (probably) not.
216 Now consider what happens if instead the web site is a wiki that has its
217 source included in the project's revision control system. The programmer
218 codes up the feature, and can easily update the docs in the wiki to match.
219 When he commits his changes to a development branch, the docs are committed
220 too. Later, when that change is merged to the release branch, the doc
221 changes are also merged, and automatically go live on the web site.
222 Updating the documentation to reflect each change made and publishing it on
223 the website has become a standard part of the programmer's workflow.
225 But this still requires programmers to write documentation, so maybe it
226 still won't work. Let's go back a step. Before the programmer wrote that
227 feature, he probably got some requests for it, and maybe he developed those
228 into a specification for how the feature should work. Since ikiwiki can be
229 used as an issue tracker, the requests were made using it, and were
230 collaboratively edited on the wiki, to develop the specification. Once the
231 feature is implemented, that issue can be closed. What better way to close
232 it than to move it out of the issue tracking system, and into the project's
233 documentation? In Subversion:
235 svn mv wiki/bugs/new_feature.mdwn wiki/doc/
237 If the spec is written well enough to be useful for end user documentation,
238 the programmer doesn't have to write a lot of docs after all; that was done
239 when the feature was designed. By using ikiwiki for issue tracking, plus
240 editing the spec, plus documentation, plus the website, each of these steps
241 has built on the other and the programmer has had to do less busywork.
243 A different example of how ikiwiki can tie
244 things together is how a security hole might be
245 handled. First it's discovered, and a bug filed about
246 it. When it's fixed, the commit that fixes the bug
247 can include a change to the bug's page, marking it
248 as done. Since it's a security hole, the project
249 needs to make an announcement right away so users
250 will know they need to upgrade. This announcement
251 can be added to the wiki's news feed, and committed
252 along with the fix, and the announcement can use a
253 regular wiki link to link to the bug that describes
254 the security hole in detail. If the security hole
255 also affects an older version of the software, the
256 fix, along with the wiki documentation for that fix,
257 can be merged into the branch for the older version.
259 Another benefit of keeping the bug tracking system in revision control with
260 the wiki is that it allows for disconnected development. So there's no need
261 to be online to review the project's bug list, and there's no need to
262 remember to close fixed bugs once you're back online.
264 For fans of distributed revision control, ikiwiki opens even more
265 possibilities. With a project's website and issue tracker kept in
266 distributed revision control with the project, these become distributed as
267 well, rather than centralized appendixes to the project. Developers can
268 pass around changesets that not only fix bugs, but mark them as done. If
269 large changes are being made in someone's branch, they can choose to put up
270 their own version of the website, use it to track bugs for that branch, and
271 when the branch is ready, all these changes can be merged back into the
272 mainline of the project.
274 Ikiwiki powers its own bug tracking system. To see how wiki bug tracking
275 works in practice, visit the [[bugs]] or [[TODO]] pages.