New Codebase IP addresses

We have recently completed the migration of all users onto our new v4 platform and have updated our DNS records to ensure all customers are routed to this new infrastructure in most efficient and fastest manner available.

This change should not affect most customers but if anyone has specific firewall rules or haspointed services directly to our old IP addresses, you should note the new details provided below.

  • Our main load balancer which accepts all web & SSH traffic is now 109.104.109.67
  • If you use SSH on port 443, you should connect on 109.104.109.68
  • If you are still using our old legacy, *.svn.codebasehq.com domains for accessing subversion repositories, this service is now located at 109.104.109.77

Codebase v4 migration is now complete

Over the last 3-4 months we have been slowly migrating all our customers from our v3 platform in Manchester to our v4 platform hosted in Bournemouth. Due to the size of our customer base and the amount of data stored on our infrastructure, the migration has been performed on an account by account basis allowing us to move individual customers with the minimum amount of downtime possible.

On Sunday, we finished the migration of the last set of accounts and the v3 infrastructure will be shut down later this week. This marks a key milestone for us and with this migration out of the way, we can continue to focus on further developing the service and working through the hundreds of feature requests & suggestions our users have been submitting.

Codebase v4 is ready!

We are pleased to announce that after 12 months of development and testing, Codebase v4 is ready! We are sorry that this announcement comes 3 months later than planned, but we hope it will be worth the wait.

Codebase v4 adds a number of new features that we frequently get requests for, along with a lot of changes to both the interface and the infrastructure to make things faster, more stable and easier to use. Here are a few of the major updates:

  • Discussion area – a message board to post discussions within a project
  • File upload area – a place to store files, including versioning and image gallery
  • Notebook – a git-backed notebook with wiki functionality
  • Git and Mercurial access by HTTP and HTTPS
  • Repository search – quickly search within files in repositories
  • Bazaar hosting – in addition to Git, Mercurial and SVN we now support Bazaar repositories
  • Image diffs – easily compare versions of images
  • SVN and Git import – you can now easily import any existing Git or SVN repository from an existing server
  • Account search – find tickets, notebook pages, files and repositories quickly from anywhere in your account
  • aTech Identity – our new single-signin system allows you to quickly switch between multiple Codebase accounts as well as other aTech Media services.

We plan to migrate all users to the new service over the next couple of weeks, however if any of these features appeal to you, feel free to drop us an email and we will move you to the top of the list.

We hope you enjoy the new version of Codebase. Please let us know if there is anything you feel we could improve on.

Codebase v4 Progress

As many of you will already know, we are now a good way through development of the next major update to Codebase. A number of people have asked about the progress of Codebase v4 so we thought it was time we posted some information about the product so far. We know that nobody likes vapourware!

After 9 months of heavy re-development, Codebase V4 is almost complete. In addition to major performance and stability improvements to the backend, we have completed work on an array of new features.

  • Versioned file and image upload area
  • Notebook for improved organisation of documentation
  • Code tasks for all repository types of any size
  • Full text search of repositories
  • Open and update tickets by email
  • Fresh and improved UI design
  • Export options for all data
  • Internationalisation support for translations
  • Unified atech identity to ease signing into different applications and accounts

We are currently in the process of fully testing and polishing the user interface to ensure it meets the high standards we aim for with all our applications.

More screenshots can be found on Flickr

We will be deploying the updates to all users in Q1 of this year, and will begin beta testing in the coming weeks. We would like to thank all our users for their feedback which has helped us to make Codebase a better product.

Important Codebase API Changes

In preparation for Codebase v4 we need to make a few changes to the Codebase API. Codebase v4 includes a completely new API (including OAuth2 authentication as well as a completely new versioned URL structure) and because of this we need to make a minor change to the way the current API works in order to preserve backwards compatibility. We strongly suggest that any developers using the API upgrade their implementations as outlined below to ensure applications continue to operate once v4 has been deployed.

Currently, a request can be made to the Codebase v3 API using the following format:

curl  -H 'Content-type: application/xml' -H 'Accept: application/xml' \
      -u '{username}:{apikey}' https://{account}.codebasehq.com/
 All scripts which wish to continue using the v3 API need to change the URL endpoint as well as the format of the username in the request before we deploy v4 (scheduled for mid-February). In short:
  • All requests should be made to api3.codebasehq.com.
  • The username should be sent as account/username, so for example if you wish to access the potatoes account as the user dave you should send potatoes/dave.
curl -H 'Content-type: application/xml' -H 'Accept: application/xml' \
-u '{account}/{username}:{apikey}' https://api3.codebasehq.com/

The rest of your URL should remain the same as before (for example, if you wish to access tickets you should just send api3.codebasehq.com/project-name/tickets as before but with the new URL and username string.Once v4 has been deployed the API structure detailed above will continue to function for at least 6 months to allow developers to migrate their applications to the new much improved API.

We apologise for any inconvenience this may cause and if you have any questions, feel free to contact support

Codebase: The technical story (part 1)

I thought I’d write a post about how things work here at Codebase. I’m going to start by detailing a bit about what we had before and how it worked, not only from a hardware perspective but from a technology/software one. Before we begin, Codebase is a Ruby on Rails application with a number of smaller Ruby modules thrown in – everything else is pretty much outlined below…

Why was Codebase made?

The inspiration for the application came from our own requirements. When we started moving from Subversion to Git in March 2008, we had a private GitHub account, however due to the large number of projects we have, both past and present, it would not have been economical to import everything into their system (Codebase does not limit the number of repositories per project on paid plans). Not only that, we were also looking for a ticketing system and a way to work more closely with our clients, meaning we’d need to sign up for another application for ticketing and yet another for collaboration.

The testing phase

Before we even started working with an interface, we wanted to make sure we could do everything we needed to, so we mocked up some basic tests using Rails and Grit and you wouldn’t believe how happy we were with very basic outputs!

The screenshot above was, effectively, Codebase v0 although it did rather suck.

Version 1 – April 2008 until August 2008

We launched Codebase into beta back in April 2008 and hosted everything on a single virtual machine with an external MySQL server. This was all located on our own in-house Rails hosting cluster which was powered by another of our products, Radar. This worked nicely because we didn’t have any large numbers of users and traffic was low.

  • We used Tom Preston-Werner’s Grit library for all our Git access.
  • We used the same in-house task runner we’d written for Radar for processing all background jobs.
  • The application ran on a collection of Mongrels with an nginx front-end server.
  • The SSH connections were handled by Gitosis and we simply exported a gitosis config file & authorized_keys file whenever was appropriate.
  • All our views were written in ERB.
  • We used the Prototype/Scriptaculous javascript frameworks
This is what version 1 (and 2) looked like for those of you who can’t remember:Version 2 – September 2008 – January 2009

As we came out of beta, we continued to host on our virtual infrastructure however we needed to make a significant change to the way we served out Git repositories.

  • We pulled away from Gitosis. This was never going to be an acceptable long-term solution for hosting any number of repositories or even supporting more than one directory level’s worth of repos. Replacing Gitosis was our own connector which would process all incoming SSH git requests and execute the appropriate git-receive|upload-packcommand. This removed the need for us to generate a gitosis config file and we could call our database directly – a massive performance boost for the application and users could assign permissions in real time rather than having to wait for the file to be generated by a background task.

This was pretty much it for this version. The reason we made the jump from 1 to 2 was simply because this marked us removing our beta flag and starting to accept any signups. At the time, we had plans to launch another of our web applications, so our entire signup process was handled through our main aTech Media website which managed all user data and simply used API calls to create actual accounts in Codebase.

Version 3 – February 2009 – present

Version 3 saw a complete rewrite of the entire application – from the ground up we re-wrote every view, controller, model and internal library. The only thing which remained the same from v2 was our SSH git connector (which, incidentally, has now gone too). With almost a years experience of running the app we’d found a number of things which we could have done better and the interface left much to be desired. The principle changes between v2 and v3 included:

  • A completely new interface
  • Multiple repositories per project
  • Complete account separation – the early days saw user accounts shared between accounts but this was confusing and we had many enquiries from users who didn’t understand this.
  • Ability to take payments from clients and start charging for the service
  • Signups happened directly in the application rather than being farmed out to the aTech Media website

Hosting wise when we released version 3 we migrated everything onto its own dedicated hardware which included a single application server (which also doubled up as the background task runner) and another box for storage. Never underestimate the power of a single bare-metal server – they are extremely powerful and you can run a lot of traffic through just one and it’s often preferable than adding another and dealing with clustering them (which will always add extra network latency to your file system requests).

  • Removed our own task runner and replaced it with delayed job
  • Moved from an Nginx/Mongrel stack to an Apache/Passenger one
  • Removed much of the Grit usage in favour of our own internal library
  • Removed all view logic and moved into specific presenters which offer a simple class to a view
  • Added a number of “containers” to provide inherited functionality to controllers.
  • Added a gravatar cache
  • All views are written in HAML
  • We use the jQuery & jQuery-UI javascript frameworks

Since this version went live, we’ve been adding new features all the time including the wiki, time tracking, commit comments and much much more – you can see by looking back in the blog or using the application itself.

Version 3.3 – Summer 2009

Version 3.3 saw a major milestone in Codebase’s history – adding support for two extra repository types in the form of Subversion & Mercurial. It saw the final demise of Grit – which, although Grit is awesome, was a great feeling for us.

Since we launched in April 2008, we always thought I’d be cool to support Subversion in our application but ruled this out early on as “too much” and we didn’t want to overburden ourselves + our infrastructure would never have supported it. In July 2009, we finally bit the bullet and started planning how we’d add support for Subversion & Mercurial.

Tripod – our repository library

Tripod is our library which supports unified access to any git, subversion or mercurial repository. As an example example:

repo = Tripod.initialize_repository('path/to/my/repo') repo.scm_type #=> 'Git' repo.commits #=> [<Tripod::Git::Commit: be71f1>, <Tripod::Git::Commit: 3e910e] repo.commit('f368ef') #=> <Tripod::Git::Commit: f368ef> repo = Tripod.initialize_repository('path/to/my/svn_repo') repo.scm_type #=> 'Subversion' repo.commits #=> [<Tripod::Subversion::Commit: 4>, <Tripod::Subversion::Commit: 3] repo.commit(2) #=> <Tripod::Subversion::Commit: 2> 

That only gives a tiny taste of what we can run with Tripod and, because the API is exactly the same for any repository type, it makes our lives so much easier when making our presenters & controllers.

Tripod is completely separate to Codebase’s application so can easily be re-used in any other system. I’m sure we’ll be posting more about Tripod in the future.

SCAM – Source Control Access Manager

SCAM is another of our libraries which works with the Codebase database to establish whether or not users have access to a specific requested repository. We use for authenticating all Git & Mercurial requests over SSH as well as when authenticating Subversion requests over HTTP. Git & Mercurial support was easy because it was much the same as what we were already doing, however Subversion posed a slight issue. For Subversion support, we’d already decided to support HTTP as the official protocol because we wanted a low barrier to entry for SVN users – no public key nonsense etc… We ended up writing an Apache module which accepted the user’s normal Codebase username & password and used SCAM to establish whether or not the connection should be accepted – it works very well (if I do say so myself) – kudos to Charlie for getting this working so well.

Next time on “Codebase: the technical story”…

  • What we did when we upgraded to our new multi-server cluster
  • Details about our new partnership with VPS.NET
  • Information about our new background runner: WorkHorse
  • Our new SSH key server