Add a new, centralized reviewboard.wsgi module.

Review Request #11473 — Created Feb. 16, 2021 and submitted

Information

Review Board
release-3.0.x

Reviewers

Historically, we've shipped a reviewboard.wsgi file in the generated
site directory, which could be passed to some WSGI implementations. This
wasn't suitable for all, though, as some servers (like gunicorn) want an
actual module path and not a standalone file on the filesystem.

It was also bad for maintenance. We've already had to write patching
logic in rb-site to update parts of this for Django 1.11 in
release-4.0.x. Making more invasive changes down the road is even more
work.

Now we ship an actual importable reviewboard.wsgi module that contains
all the setup. It only needs a REVIEWBOARD_SITEDIR environment
variable to work, which can be set by a server.

The generated htdocs/reviewboard.wsgi file is now simpler, just
setting this variable and importing from the new reviewboard.wsgi.

Since this is landing on release-3.0.x, no existing configurations
will be updated. Things will continue working as-is. The plan is to
update release-4.0.x to move existing configurations over to this
module.

Tested an Apache install with the old reviewboard.wsgi file forwarding
to the reviewboard.wsgi module.

Tested a Gunicorn install with the new reviewboard.wsgi module.

Summary ID
Add a new, centralized reviewboard.wsgi module.
Historically, we've shipped a `reviewboard.wsgi` file in the generated site directory, which could be passed to some WSGI implementations. This wasn't suitable for all, though, as some servers (like gunicorn) want an actual module path and not a standalone file on the filesystem. It was also bad for maintenance. We've already had to write patching logic in `rb-site` to update parts of this for Django 1.11 in `release-4.0.x`. Making more invasive changes down the road is even more work. Now we ship an actual importable `reviewboard.wsgi` module that contains all the setup. It only needs a `REVIEWBOARD_SITEDIR` environment variable to work, which can be set by a server. The generated `htdocs/reviewboard.wsgi` file is now simpler, just setting this variable and importing from the new `reviewboard.wsgi`. Since this is landing on `release-3.0.x`, no existing configurations will be updated. Things will continue working as-is. The plan is to update `release-4.0.x` to move existing configurations over to this module.
935cd204f7975bd886df67d66da98271104c8938
Description From Last Updated

Can you add a module docstring?

daviddavid

E402 module level import not at top of file

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

flake8

david
  1. 
      
  2. reviewboard/wsgi.py (Diff revision 1)
     
     

    Can you add a module docstring?

  3. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (8f136fe)
Loading...