Fix Review Bot when running against Review Board 3.0.8+

Review Request #10080 — Created July 13, 2018 and submitted

Information

ReviewBot
release-1.0.x
f2c6f9f...

Reviewers

In Review Board 3.0.8, we split all the auth backends into their own
modules. This works in most cases, but Review Bot manually assigns a
backend path when creating the session key. This failed because that
path is used to index into a dict of loaded backends within the django
auth middleware.

This fix adds a manual version check to ensure we set the correct auth
backend path for each version.

Was able to properly detect the worker nodes.

Description From Last Updated

While this works, I wonder if we should just not hard-code a path and instead do: from reviewboard.accounts.backends import auth_backends …

chipx86chipx86

E501 line too long (87 > 79 characters)

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

david
david
david
brennie
  1. Ship It!
  2. 
      
chipx86
  1. 
      
  2. Show all issues

    While this works, I wonder if we should just not hard-code a path and instead do:

    from reviewboard.accounts.backends import auth_backends
    
    ...
    
    backend_cls = auth_backends.get_auth_backend('builtin')
    user.backend = '%s.%s' % (backend_cls.__module__, backend_cls.__name__)
    
  3. 
      
david
chipx86
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-1.0.x (78bc200)