Add type hints for reviewboard.upgrade.

Review Request #12771 — Created Jan. 6, 2023 and submitted

Information

Review Board
release-5.0.x

Reviewers

reviewboard.upgrade was written just before we began introducing type
hints. Given how important these steps are, and in preparation for
upcoming work on this module, this change adds type hints so that we
won't have any bad assumptions on data in our pre-upgrade state
dictionary.

Along with type hints, an UpgradeStateError exception class has been
added. This is raised when we fail to find a key we expect to find.

These apply to both ./reviewboard.manage.py upgrade and
rb-site upgrade.

mypy and pyright were happy.

Tested upgrading a Review Board 4 database to 5, using both
./reviewboard/manage.py upgrade and rb-site upgrade.

Summary ID
Add type hints for reviewboard.upgrade.
`reviewboard.upgrade` was written just before we began introducing type hints. Given how important these steps are, and in preparation for upcoming work on this module, this change adds type hints so that we won't have any bad assumptions on data in our pre-upgrade state dictionary. Along with type hints, an `UpgradeStateError` exception class has been added. This is raised when we fail to find a key we expect to find. These apply to both `./reviewboard.manage.py upgrade` and `rb-site upgrade`.
3e77642974c67f6fa2ca1e525fd6e1466ee864fd
maubin
  1. Ship It!
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-5.0.x (053b5c1)