Fix creating new Review Board databases via rb-site.

Review Request #12444 — Created July 8, 2022 and submitted

Information

Review Board
release-5.0.x

Reviewers

When creating a new site and a new database, we run through the
pre/post-upgrade steps in order to ensure that we have all the state set
the way we need it. These attempted to handle the case where a table
didn't yet exist, but the exception it was using was too specific. Some
database backends may raise an OperationalError in this case, while
others may raise a ProgrammingError.

We now catch the top-level exception, DatabaseError, in order to
handle this case for all databases.

We also handle unexpected errors raised from the pre/post-upgrade
functions. If any errors are raised in the pre step, we will immediately
fail the install/upgrade, along with showing a useful error. If any
errors are raised in the post step, we will continue on, but log a
similar error.

Tested creating a new production database on MySQL, where the error
was initially hit. Saw the log information and the traceback.

Tested that the fix to using DatabaseError let the install proceed.

Simulated a failure in the post steps, and saw the logged error there.

Summary ID
Fix creating new Review Board databases via rb-site.
When creating a new site and a new database, we run through the pre/post-upgrade steps in order to ensure that we have all the state set the way we need it. These attempted to handle the case where a table didn't yet exist, but the exception it was using was too specific. Some database backends may raise an `OperationalError` in this case, while others may raise a `ProgrammingError`. We now catch the top-level exception, `DatabaseError`, in order to handle this case for all databases. We also handle unexpected errors raised from the pre/post-upgrade functions. If any errors are raised in the pre step, we will immediately fail the install/upgrade, along with showing a useful error. If any errors are raised in the post step, we will continue on, but log a similar error.
ce260fdf14e4e2988f129cc21fd4b7a2735ba8be
Description From Last Updated

Typo "Pleaase" -> "Please"

maubinmaubin

Typo "Pleaase" -> "Please"

maubinmaubin
david
  1. Ship It!
  2. 
      
maubin
  1. 
      
  2. reviewboard/cmdline/rbsite.py (Diff revision 1)
     
     
    Show all issues

    Typo "Pleaase" -> "Please"

  3. reviewboard/cmdline/rbsite.py (Diff revision 1)
     
     
    Show all issues

    Typo "Pleaase" -> "Please"

  4. 
      
chipx86
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-5.0.x (ceed1ba)