Add support for hosting services.
Review Request #3073 — Created April 23, 2012 and submitted — Latest diff uploaded
Add support for hosting services. This introduces top-level support for hosting services. Previously, Review Board had a basic concept of hosting services when configuring a repository. They were nothing more than some pattern matches that provided helpful fields for configuring a repository's information. Now, we have a top-level concept of a hosting service. Subclasses of HostingService are used to provide specific configuration forms for repositories, provide an ability to request an authorization token from the hosting service, and provide basic file access. The various fields (such as a GitHub repository name or whether it's a public personal account or a private organization) are now stored along with the Repository in its new extra_data field. This is used later for both repository access and configuration. When setting up a repository for a hosting service, the user is expected to link an account or use an existing linked account for that service. When linking an account on hosting services that require authorization, Review Board will perform the authorization request and, if successful, store any service-specific tokens or data in the HostingServiceAccount model. All the existing hosting services have been moved into HostingService subclasses. Existing configurations will no longer show a hosting service tied to the account. Instead, they will just appear as custom repositories. Users are always free to reconfigure their accounts. GitHub is the first hosting service we support in an extended way. We get an authorization token, store it, and use it for file requests with their v3 API. TODO for future changes: * Fix bug trackers. Right now, the code is temporarily disabled. I will be moving to custom forms for configuring this, just like we have with repository configuration now. * Auto-generate an SSH key when needed, and upload to the account. What I have currently is unlikely to change much (aside from comments in reviews), so look through it and see if things look sane.
Lots of manual testing with GitHub accounts and with different configurations of options. Triggered most of the validations that could naturally be triggered in the web UI.