Respond to API requests with 503 when read-only mode

Review Request #8657 - Created Jan. 21, 2017 and updated

Kanghee Park
Review Board
master
8648
8810, 8677, 8812, 8811
e04ec08...
reviewboard, students

Read-only mode is a setting an admin can enable to prevent writes to
the database. This can be used when the site is under maintenence or
being upgraded. The previous commit added the siteconfig attribute and
a checkbox to toggle the mode. This commit adds a new 503 error to
Review Board's webapi. Furthermore, all requests that hit RB's API
using PUT, POST, DELETE methods while read-only mode is on, and
the user is not a superuser, will return the new 503 error. A utility
file read_only.py has been added which deals with the logic and
caching of determining when a user should be affected by read-only
mode.

Added new Python unit tests that send API requests as superuser and
non-superuser
Ran the Python unit test suite
Check that modifying/deleting review requests and comments works
properly

  • 0
  • 19
  • 0
  • 19
Description From Last Updated
Review Bot
Barret Rennie
Kanghee Park
Review Bot
Kanghee Park
Review Bot
Barret Rennie
Kanghee Park
Review Bot
Kanghee Park
Review Bot
Barret Rennie
Christian Hammond
Christian Hammond
Kanghee Park
Review Bot
Kanghee Park
Review Bot
Kanghee Park
Review request changed

Description:

   

Read-only mode is a setting an admin can enable to prevent writes to

    the database. This can be used when the site is under maintenence or
    being upgraded. The previous commit added the siteconfig attribute and
    a checkbox to toggle the mode. This commit adds a new 503 error to
    Review Board's webapi. Furthermore, all requests that hit RB's API
    using PUT, POST, DELETE methods while read-only mode is on, and
~   the user is not a superuser, will return the new 503 error.

  ~ the user is not a superuser, will return the new 503 error. A utility
  + file read_only.py has been added which deals with the logic and
  + caching of determining when a user should be affected by read-only
  + mode.

Loading...