Archive for July, 2008

Bazaar with Master Branch 0

Problem statement

I have a bit svnish view of writing software: there should be one master branch for project just not to confuse users of your code where to get the most recent code from.

I’m writing a little app (I’ve posted about it earlier) with my girlfriend and we wanted to share and control code with possibly the best DVCS in the world. Bazaar promises an easy way for svn people to support central/master branch workflow. Or so I thought.

Early attempt

I was to confident with bazaar easiness. So I made bzr push over sftp to some directory on hauru.eu and told my girlfriend it’s ready. But it wasn’t: all files had my user permissions (uid/gid) and she couldn’t check anything in. So… It’s not so easy. I could change initial group for both of us, but this is not general solution (it wouldn’t work on WebFaction shared hosting where you can’t change initial group).

Heaving previous experience with setting svn central repository I tried to bzr serve the code. But this is simplistic mechanism with no read-write authentication support.

SGID to the rescue

With an advice from Paweł I tried setting SGID on repository directory. It sounded as a good idea, but it didn’t work. I was desperate, but I took another shot and browsed the web for solutions with SGID.

It seems there is bug in OpenSSH or python-paramiko or in bazaar sftp support and it doesn’t honor SGID properly. But with smart-server, that is bzr+ssh it does. Moreover it works much faster than sftp. So it’s double win.

Complete solution

In four steps:

  1. on server create empty repo folder
  2. change group to some common (users or bzr or your-project)
  3. set SGID on the folder
  4. now you can push your branch with
    bzr push bzr+ssh://server/repo-path
    

Every one in group can check code in and out.

Of course this should not stop you from having as many side branches as you want, but it's good to have a single code branch you can always refer to.

Failed with Google App Engine 0

I’m writing a little app for my English course at Jagiellonian University in Django. Right now I’m hosting it here, on hauru.eu, but soon we’ll release a book we were producing whole year and thus I have to finish the app and make it public. I thought about putting it on Google App Engine  (think: free hosting in Python), but after two days of trying I must say I don’t see any point any more.

I wrote my app using many of convenience methods/classes provided by Django, but very few of them are supported by GAE. I’d have to rewrite half of code! No way. It’s right time to use some servers in KSI: Students’ Computer Science Club, which I’m proud member of.

I’m sure Google App Engine is powerful and convenient platform, but I don’t think Django fits there well. While reading about GAE I thought the best solution would be using some external libraries like Werkzeug, as GAE is based on WSGI interface.

Update (Dec 13, 2008): The little app is live and indeed running on KSIs server. Check it out, it’s called English++: English for Computer Science Students