flake8
-
reviewboard/__init__.py (Diff revision 1)
Review Request #11339 — Created Dec. 17, 2020 and submitted
We have a few tasks that must be completed during an install or upgrade.
One is to register new SCMTools, and the other is to update the version
stored in the siteconfig.With Django 1.6 times, we'd accomplish these by registering
post_syncdb
signal handlers that would execute the necessary database
code, which made sense initially, but it meant that we had little
control over the order of operations. It also wasn't future-proof.Given how installs/upgrades work now, we'd never get the equivalent
modern signals if we didn't need to perform a database upgrade. We'd
determine that no changes were made to the database, and simply skip the
process that would ultimately emit the signal.Now, we have a dedicated function and signal for post-install/upgrade
steps. This registers SCMTools, updates the version in the database,
and emits a signal for any further tasks.This is called both by
rb-site
andmanage.py upgrade
. It will not
be called with a simpleevolve --execute
.A new
manage.py createdb
command has been added to help with the
installation side of this for development servers.
Tested creating and upgrading sites using
rb-site
. Verified the
resulting database entries.Tested creating using
manage.py createdb
. Verified the database
entries.Tested upgrading using
manage.py upgrade
. Verified the database
entries.Unit tests passed.
Added an explicit import. Apparently, the
signals
import was coming in from somewhere (initialize()
perhaps), though I don't understand how.
Commits: |
|
|||||||
---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+150 -162) |
Changed the "Upgrading to ..." message to "Upgraded to ...", and localized it.
Commits: |
|
|||||||
---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+166 -166) |
reviewboard/admin/management/sites.py (Diff revision 3) |
---|
E126 continuation line over-indented for hanging indent
Fixed a Review Bot complaint.
Commits: |
|
|||||||
---|---|---|---|---|---|---|---|---|
Diff: |
Revision 4 (+168 -166) |
reviewboard/cmdline/rbsite.py (Diff revision 4) |
---|
Finalizing is super programmer-speak. Maybe "Finishing"?