Monday, August 20, 2007

Wikis and SCM Tools Can Contain Many Hidden "Treasures"

One thing that all the wikis and SCM (Source Code Management) tools have in common is that they keep change revisions (at least they should!). This feature makes it possible to go back in time and see events that happened in the repository even 4 years ago.

While working on some features for wikis.sun.com I stumbled upon an interesting discovery in the Atlassian's Seraph Subversion repository.



Well :), I know that a job in software development can be frustrating at times, and sometimes it is hard to overcome that sudden urge to express exactly what one feels. :-D

This is a good showcase of why the controlled ability to delete revisions in an SCM as well as in wikis is a really important feature.

Imagine that your wiki gets vandalized by a malicious user (or you accidentally publish confidential or private information). You can superficially fix the issue by reverting the page(s) to the last good state, but the vandalized revision will stay with you forever (visible for users willing to dig in the page history as well as to web crawlers and search bots, blindly crawling all links that they find). At least that's how it is in Confluence, which we use for wikis.sun.com. Someone foresaw this issue 3 years ago and created a JIRA issue requesting this feature (CONF-1573). Unfortunately Atlassian never got around to delivering it.

Maybe after today's lesson when forums.atlassian.com got vandalized by users who found a way to hijack forum visitors and send them to their web site, Atlassian will start to appreciate the ability to fully recover from these kinds of incidents. Atlassian?

For those of you who get into trouble with the inability to delete revisions, there is a workaround that is not pretty and requires some sacrifices:
  1. Get the wiki markup code of the latest good revision (go to the edit view and copy the contents of the text area)
  2. Delete the page
  3. Create new page with exactly the same name as the page you just deleted
  4. Paste the contents of the clip board into the editor and save the page

There are a few things to watch out for and understand:
  • By doing this procedure you'll lose the page history, page level permissions, and most likely also watches that you and other users set for this page
  • Make sure you don't accidentally lose content of the clip board between the copy and paste :)
  • The name of the page should be exactly the same as the name of the old page, otherwise URL links within the wiki or from external sources will be broken

No comments: