2823: Hosting account information doesn't stick

peter.kje*********@gmai***** (Google Code) (Is this you? Claim this profile.)
Sept. 25, 2013
What version are you running?
1.6.14

What's the URL of the page containing the problem?
admin/db/scmtools/repository/add/

What steps will reproduce the problem?
1. Click Admin
2. Click Repositories
3. Click Add repository
4. Fill out the form, choosing a hosting service other than GitHub
5. Choose <Link a new account> for Account (if it is not already selected) and enter an appropriate Account username for the hosting service.
5. Save
6. Click on the newly created repository.

What is the expected output? What do you see instead?
I would expect to see the hosting account information to be remembered. Instead I see the Hosting service defaulting to (None - Custom repository).

What operating system are you using? What browser?
Firefox 17.0 on Fedora Core 17

Please provide any additional information below.
I have attached a patch that seems to fix the problem for me. I have very little Python experience so I do not guarantee that it is correct, and I have only tested it with one internal hosting service (a local Gitorious installation as I am behind a corporate firewall). However, with this patch the hosting account information is created as expected and remembered.
From f33a8d200957e16cd152f0e90bb26d90c9d7084f Mon Sep 17 00:00:00 2001
From: Peter Kjellerstedt <pkj@axis.com>
Date: Tue, 11 Dec 2012 14:53:28 +0100
Subject: [PATCH] Make hosting accounts actually save for other services than
 GitHub
---
 reviewboard/hostingsvcs/service.py | 2 +-
 reviewboard/scmtools/forms.py      | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/reviewboard/hostingsvcs/service.py b/reviewboard/hostingsvcs/service.py
index 9009609..e7bd993 100644
--- a/reviewboard/hostingsvcs/service.py
+++ b/reviewboard/hostingsvcs/service.py
@@ -49,7 +49,7 @@ class HostingService(object):
         records. This function will determine whether the account is still
         considered authorized.
         """
-        return False
+        return True
 
     def authorize(self, username, password, local_site_name=None,
                   *args, **kwargs):
diff --git a/reviewboard/scmtools/forms.py b/reviewboard/scmtools/forms.py
index 2efd5a4..57810e3 100644
---
david
#1 david
You say this is for an internal Gitorious. Did you create a new HostingService subclass for this?
  • +NeedInfo
#2 peter.kje*********@gmai***** (Google Code) (Is this you? Claim this profile.)
Yes. It is just a copy of reviewboard/hostingsvcs/gitorious.py with the URLs changed to match our internal Gitorious installation (and some variables renamed). We use a similar setup with version 1.6.3 of Review Board that we use in production. Now I am looking at upgrading to the latest release of RB, which is when I stumbled on this problem.
david
#3 david
  • +Component-HostingServices
david
#4 david
The attached patch may fix it but it's also not quite correct. Given that this is only an issue in your custom hosting service implementation, I think that it's more likely some problem with your changes.
  • -NeedInfo
    +ThirdParty