Posts tagged “collaboration”.

Code Review + Google Wave = Code Wave !

Doing some exploratory thinking about the possibilities opened by Google Wave, I came up with this very early idea of something that could turn out to be pretty interesting. In explaining it, I’ll assume you’ve watched that huge 1h20min video they have about it (it’s worth every minute, but there’s an abridged — 10min — version).

Motivation

People have been doing code review through email for ages. It’s the easiest, dead-simple way of doing it. Just add a post-receive-hook to your repository and make it email a diff of every new commit to a mailing list. People answer to that email, inlining comments where needed. Great, you say. But… It’s not 2.0. Bummer.

You know what is 2.0? Review Board. Very pretty web interface, AJAX, all that goodness (seriously, it’s awesome, I’m even working on it myself). But… It’s not Email.

You know what is Email and 2.0? You’re absolutely right! Google Wave*! :)

So how do we tie it to the code?

Code Wave

The idea so far includes developing four separate pieces of software — one wave robot, two gadgets and one stand-alone web application which will use the embed API — , but the basic idea is to map every commit and every file to its own wave. Think of it as a code browser on steroids.

The Robot

The robot handles creating, linking and updating the repository content, access control and custom markup.

It creates one “absolute” wave for each version of each file and directory, plus one “relative” (HEAD) wave for each, which gets updated with every new commit. This way, one can look at a particular version of a file using the absolute wave, but also use the Playback functionality on the relative wave to watch it evolve as new changes are committed. Since waves can be linked to one another, besides being able to make directory listings, we can also have a header on each wave, linking to the usual previous/next/head commits. This is the “code browser” part.

When new commits arrive, they each also get their own wave, with the commit message, diff content and a link to each file changed. As with any wave, people can comment inline on any part they want, even chat about it, effectively doing (possibly live!) code review. The conversation history will be kept (and “playbackable”) in the wave, and people who are participants will be notified of the changes and can also come and chip in.

The robot also handles access control. Apparently waves, at least so far, don’t allow one to say “nobody can edit the content, only add comments.” If I’m right about that, the robot will need to watch and overwrite any changes to the content itself (the content must always reflect the repository), leaving only comments. On the web interface (which we’ll talk about in a sec), people can decide to “watch” certain (or all) files or directories, being notified about changes in them (much like in Review Board). The robot accomplishes this by adding these people to the commit waves where these files/directories are changed, so the wave pops up in their inboxes. The original committer always gets added, so she gets notified about any comments on her changes.

Another cool thing to have is special markup, so the robot watches for stuff like revision numbers/sha1s and turns them into links to the appropriate wave. It can also be configured through the web interface to turn ticket numbers and the like into links.

The Web Interface

It serves two main purposes: store settings and provide a way to browse the repository and comments.

Settings to be stored are repository path, privacy levels, groups of users, change watchers, robot behavior, etc.

Since waves can be embedded into normal web pages, this is also a nice way to make all that content (files, diffs and reviews) available online without needing a wave client. We could even think about indexing everything and making it searchable.

Gadget Number One

Syntax highlighting, plain and simple. Highlight code, skip (wave) comments, allow raw copying, etc. Could also be used to fold and unfold comment threads, so you could have a look at the diffs without the cruft. Maybe we could borrow some things from Bespin?

Gadget Number Two

Link helper. Like the Google button, that lets you search for something and drag results into the wave, this helper would allow you to refer to other files in the repository, searching them by name/path and dragging them in. Not sure how useful this really is, just thought it was a nifty idea.

The Future

Emacs Client

Imagine this: you’re there, nurturing your code on emacs (you are using emacs right?), and you spot something funky. It shouldn’t be there, or there’s a better way to do it, or you have a question about it. You put your cursor over the funky line, hit Control+Meta+Shift+whatever and what happens? Your trusty emacs takes the “git blame” for that line (or the equivalent in your SCM of choice), asks the web app for the wave URL associated with the commit sha1, splits your window in half and shows you said wave (do you have any doubt there will be an emacs wave client?) with the cursor right on the corresponding line in the diff, ready for you to hit M-x add-wave-reply and send your comments the committer’s way. It also might just be that someone already had the same issue, and you’ll see a threaded conversation there with the answer.

Editing

Right now we’ve only mentioned writing on commit waves (code review), but file waves were read-only. I haven’t thought out the details for this yet, but maybe there can be something like embedding Bespin on Google Wave, or the other way around, so that people can do real-time collaborative code editing (while also chatting through inline comments) and then mutually decide to commit. The file wave could wrap the file’s content in a header with a commit command.

The Present

So, how far are we into this project? Well, nowhere, really. It’s just a recent idea I had, and I don’t even have a Google Wave Sandbox account yet (hint, hint if you’re a googler). So if you liked it, feel free to go ahead and implement it. Many of the parts I described can be done independently (like the emacs wave client), so you don’t have to take on everything at once. And if you ever get around to building this (under a free license, of course) and making tons of money, please send me a couple beers :)

Also, this is a very rough draft, so suggestions or any kind of feedback is appreciated.

* For a non-ludicrous version of this comparison, take a look at: http://smartbear.com/white-paper.php?content=docs/articles%2FFour-Kinds-Of-Review.html

  • Share/Bookmark

Untangling licensing options to achieve better collaboration on free web software

The ‘loophole’

Lots of people write frameworks and plugins and libraries intended for use on the Web. A lot of that is FOSS. But, as everybody knows, free software licenses like the GPL lose their “virality” when used for the web, since you’re not giving away any software (which would then force you to make the code available), you’re just providing a service. As long as you don’t give away the software, you can keep your modifications nice and cozy inside your server, without anybody knowing about it, and it’s still all legal.

Less Sharing

Occasionally I’ve made small contributions to such software projects and I might eventually release some of my own. But you know, I like Linus’ tit-for-tat attitude, and I’d like to get back improvements from people who are using my web-related stuff.

Sure, a lot of people contribute back, as you can see on GitHub, even if they don’t have to. Some folks are just that nice. But, and I’m taking a wild guess here, there’s a large hidden part of users who make modifications and don’t give them back simply because it’s extra work making it look nice, maybe conforming to the project’s coding standards, removing private, company-specific stuff, etc., and the employer only cares that it works, not that it’s shared back. So a lot of potential hacking freedom mojo is lost due to time/budget constraints or just pure laziness.

A solution?

Apparently I’m not alone in thinking this, as the FSF wrote the Afferos General Public License (AGPL) specifically to cover this area, which was previously overlooked. Now you have to give back modifications on AGPLed code, whether you give away the code or just provide a service with it over a network. Great! Now I can make a Rails plugin and get back some contributions!

Small problem though: like the GPL, the AGPL is viral, and so the installation of a mere plugin would require the whole app to be open-sourced as well. Fat chance.

The same problem existed in the desktop world, so they came up with the LGPL, which lets you use the library in proprietary software, but forces you to give back changes you made to the library itself. Sadly, there’s no “ALGPL” equivalent for us web folks. So what now? Are we doomed to have our FOSS mojo drained forever into the gutters of licensing loopholes?!

No!

The solution!

While not as good as making an ALGPL, the clever FSF guys put a nice little linking exception in both GPLv3 and AGPLv3, allowing you to use software licensed under any of them together. What does that mean?

It means that now you, application developer, can take my AGPL plugin/library and use it on your app, which is GPL, and give me back only changes you make to my stuff.

Wait a minute! So you’re saying I have to license my code as GPL?! Kind of, yes. But since you don’t give out your code anyway, to the outside world it’s completely unknowable if it is indeed GPL or not. You just stick a LICENSE file in there with the GPL text and that’s it. Nobody has to know about it, and you don’t have to do a thing (and I won’t even check if the file is actually there). For the web, GPL == proprietary.

Sounds convoluted? Nah. It’s actually quite simple. Summarizing:

  1. Put the GPL text in a hidden file in your web app;
  2. Install my plugin/library;
  3. Change it around, make it better;
  4. Give me the changes.

That’s it. Since other people will also be giving me their improvements, you will also benefit, all of that while keeping your application nice and proprietary. Good, eh?

  • Share/Bookmark