Clean up the hosting service registry

Review Request #8217 — Created June 3, 2016 and submitted

Information

Review Board
release-3.0.x
edb692d...

Reviewers

The hosting services registry was not ported to
djblets.registries.Registry as cleanly as it should have been. As a
result, the "Add repository" form broke, due to missing information on
hosting services. In addition, Review Board 2.0.x introduced a
hosting_service_id attribute which mirrored the id attribute that
3.0.x introduced. We now only use the hosting_service_id attribute.

The "Add repository" form now works correctly and no more errors are
triggered in the log.

  • Ran unit tests.
  • Successfully added a repository in the "Add repository" form.
Description From Last Updated

Col: 31 E128 continuation line under-indented for visual indent

reviewbotreviewbot

Col: 80 E501 line too long (80 > 79 characters)

reviewbotreviewbot

The things in the regexes there are safe, but we should escape the hosting service ID (which we weren't doing …

chipx86chipx86

Looks like a blank line was added.

chipx86chipx86

undefined name 're'

reviewbotreviewbot

Just to make the tuple super obvious, how about putting the closing paren on the next line? hosting_service_choices.append( (hosting_service.hosting_service_id, hosting_service.name) …

daviddavid

Same here.

daviddavid

It was this way before, but we should pass in hosting_service.hosting_service_id and e as arguments rather than doing the format …

daviddavid
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/hosting_service.py
        reviewboard/webapi/tests/test_hosting_service_account.py
        reviewboard/scmtools/forms.py
        reviewboard/webapi/tests/test_hosting_service.py
        reviewboard/webapi/tests/urls.py
        reviewboard/hostingsvcs/service.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/hosting_service.py
        reviewboard/webapi/tests/test_hosting_service_account.py
        reviewboard/scmtools/forms.py
        reviewboard/webapi/tests/test_hosting_service.py
        reviewboard/webapi/tests/urls.py
        reviewboard/hostingsvcs/service.py
    
    
  2. reviewboard/scmtools/forms.py (Diff revision 1)
     
     
    Col: 31
     E128 continuation line under-indented for visual indent
    
  3. Col: 80
     E501 line too long (80 > 79 characters)
    
  4. 
      
brennie
chipx86
  1. Awesome, it'll be nice to have this fixed :)

  2. reviewboard/hostingsvcs/service.py (Diff revision 2)
     
     
     
     

    The things in the regexes there are safe, but we should escape the hosting service ID (which we weren't doing before), so we can do:

    url('^(P<hosting_service_id>%s)/'
        % re.escape(service.hosting_service_id))
    
  3. reviewboard/scmtools/forms.py (Diff revision 2)
     
     
     
     

    Looks like a blank line was added.

  4. 
      
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/hosting_service.py
        reviewboard/webapi/tests/test_hosting_service_account.py
        reviewboard/scmtools/forms.py
        reviewboard/webapi/tests/test_hosting_service.py
        reviewboard/webapi/tests/urls.py
        reviewboard/hostingsvcs/service.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/hosting_service.py
        reviewboard/webapi/tests/test_hosting_service_account.py
        reviewboard/scmtools/forms.py
        reviewboard/webapi/tests/test_hosting_service.py
        reviewboard/webapi/tests/urls.py
        reviewboard/hostingsvcs/service.py
    
    
  2. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/hosting_service.py
        reviewboard/webapi/tests/test_hosting_service_account.py
        reviewboard/scmtools/forms.py
        reviewboard/webapi/tests/test_hosting_service.py
        reviewboard/webapi/tests/urls.py
        reviewboard/hostingsvcs/service.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/hosting_service.py
        reviewboard/webapi/tests/test_hosting_service_account.py
        reviewboard/scmtools/forms.py
        reviewboard/webapi/tests/test_hosting_service.py
        reviewboard/webapi/tests/urls.py
        reviewboard/hostingsvcs/service.py
    
    
  2. reviewboard/hostingsvcs/service.py (Diff revision 3)
     
     
     undefined name 're'
    
  3. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/hosting_service.py
        reviewboard/webapi/tests/test_hosting_service_account.py
        reviewboard/scmtools/forms.py
        reviewboard/webapi/tests/test_hosting_service.py
        reviewboard/webapi/tests/urls.py
        reviewboard/hostingsvcs/service.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/hosting_service.py
        reviewboard/webapi/tests/test_hosting_service_account.py
        reviewboard/scmtools/forms.py
        reviewboard/webapi/tests/test_hosting_service.py
        reviewboard/webapi/tests/urls.py
        reviewboard/hostingsvcs/service.py
    
    
  2. 
      
david
  1. 
      
  2. reviewboard/scmtools/forms.py (Diff revision 4)
     
     
     

    Just to make the tuple super obvious, how about putting the closing paren on the next line?

    hosting_service_choices.append(
        (hosting_service.hosting_service_id, hosting_service.name)
    )
    
  3. reviewboard/scmtools/forms.py (Diff revision 4)
     
     
     

    Same here.

  4. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/hosting_service.py
        reviewboard/webapi/tests/test_hosting_service_account.py
        reviewboard/scmtools/forms.py
        reviewboard/webapi/tests/test_hosting_service.py
        reviewboard/webapi/tests/urls.py
        reviewboard/hostingsvcs/service.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/hosting_service.py
        reviewboard/webapi/tests/test_hosting_service_account.py
        reviewboard/scmtools/forms.py
        reviewboard/webapi/tests/test_hosting_service.py
        reviewboard/webapi/tests/urls.py
        reviewboard/hostingsvcs/service.py
    
    
  2. 
      
david
  1. 
      
  2. reviewboard/scmtools/forms.py (Diff revision 5)
     
     
     

    It was this way before, but we should pass in hosting_service.hosting_service_id and e as arguments rather than doing the format ourselves.

  3. 
      
brennie
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (1b9e6e4)
Loading...