Migrating from Trac to GitHub

Vincent Bernat

I was host­ing my projects on sev­eral Trac in­stances on a ded­i­cated server. How­ever, for sev­eral months, spam was pouring.

Trac & spam#

How to fight spam with Trac#

There is no built-in mech­a­nism in Trac to fight spam. How­ever, plug­ins en­able you to set up sev­eral ways to stop spam (or at least, re­duce it).

One of them is Ak­ismet, a web ser­vice that can tell you if some mes­sage is spam or not. It can catch most of the spam. A bayesian fil­ter com­ple­ments this ser­vice. A learn­ing step is manda­tory and can be­come cum­ber­some when the vast ma­jor­ity of the tick­ets you re­ceive are just spam. I used these two mech­a­nisms on my Trac in­stances.

An­other path is to re­quire an ac­count to post a ticket. Cre­at­ing an ac­count each time you want to cre­ate a ticket for some soft­ware is bur­den­some. I did not want to do this to the poor souls that have found a bug in one of my projects. An al­ter­na­tive is to set up a pub­lic ac­count and add some­where on the page some in­struc­tions on how to use it when you want to open a ticket but don’t want to open an account.

Removing spam#

De­spite Ak­ismet and the bayesian fil­ter, I still got two or three spams a day. I caught them in my RSS flow or my email if they were not clas­si­fied as spam.

There are two steps to re­move the spam:

  • tell the bayesian fil­ter by us­ing the ad­min­is­tra­tion panel in the web in­ter­face; and
  • re­move the spam from the data­base us­ing some SQLite com­mands di­rectly on the server host­ing the Trac instance.

In­deed, Trac does not pro­pose the pos­si­bil­ity to re­move a ticket. There are plug­ins, but you must find them, in­stall them, find how to con­fig­ure them, etc.

Cum­bersome.

GitHub#

GitHub is a pop­u­lar source code host­ing ser­vice us­ing Git as a back­end. This is a pro­pri­etary plat­form but a lot of open source projects have mi­grated to it, thanks to its fea­tures and good per­formance.

Ev­ery­body is on GitHub. This was the ideal op­portunity.

Up­date (2011-05)

Pe­ter Pentchev did point me to Gi­to­ri­ous which is a free al­ter­na­tive to GitHub. Its source code is li­censed un­der the AGPL. Un­for­tu­nately, I did not con­sider it be­cause it was lack­ing an is­sue tracker.

Features#

First, GitHub al­lows you to host Git repos­i­to­ries. You push your Git repos­i­to­ries. There is a nice and fast web in­ter­face to browse them. How­ever, I still keep an in­stance of cgit.

Then, GitHub is very pop­u­lar be­cause they drive peo­ple to fork projects. With one sin­gle click, you can fork your fa­vorite project. You get a copy that is syn­chro­nized with the forked project.

There is also a wiki (ac­cept­ing many markup syn­taxes). This wiki is also avail­able through Git.

At last, GitHub of­fers a min­i­mal­is­tic ticket sys­tem. You open a ticket, you make some com­ments, you can add a tag or two and you can close it. That’s all. Quite light. But enough for small projects like mine.

How­ever, there is more! Do not open a ticket to send a patch. There is no way to at­tach files to tick­ets. You need to fork the project, cre­ate a branch with your patch and re­quest a “pull” for your branch. This will ap­pear as a ticket but your com­mits will be linked to it. The au­thor can then re­view and com­ment on your branch, ask for some changes and if they want to in­te­grate it, a sim­ple merge is suf­fi­cient. They can even do it us­ing the web in­ter­face. Con­venient.

So­cially, you can com­ment on com­mits, tick­ets, projects and sub­scribe to a lot of events. You can re­ceive and an­swer tick­ets by mail.

How­ever, an ac­count is manda­tory to open a ticket. Since there are a lot of projects on GitHub, this ac­count should be use­ful for a lot of software.

To cut a long story short, even if GitHub is a pro­pri­etary plat­form, it of­fers nice and in­ter­est­ing fea­tures. More and more projects mi­grate from Google Code to GitHub even if there are fewer fea­tures on the latter.

Migration#

I have searched for tools to mi­grate au­to­mat­i­cally tick­ets from Trac to GitHub. For ex­am­ple, there is SD.

Up­date (2011-05)

Olivier Berger is in­volved in ForgePlucker, a project aimed to pro­vide tools to im­port and ex­port data for var­i­ous forges.

At last, I have done it man­u­ally. The GitHub API is well doc­u­mented and there ex­ist bind­ings in var­i­ous lan­guages in­clud­ing Python but it is a very lim­ited API. You can’t choose the num­ber of the ticket nor its date.

I have also rewrit­ten README files to use the mark­down markup and avoid the use of wiki pages when possible.

I have also put some URL redi­rec­tions with the help of nginx.

In con­clu­sion, even if main­tain­ing Trac in­stances was not a lot of work, it is one thing that I do not have to do any­more. And no spam on GitHub, I assume.