Modernize and enhance settings upgrades for upcoming postgresql changes.

Review Request #11373 — Created Jan. 12, 2021 and submitted

Information

Review Board
release-4.0.x

Reviewers

Our settings upgrade code is pretty old, and a bit crufty. While most of
it is unlikely to ever need to be run again, it's worth keeping it here
and maintainable than not. Particularly as we iterate on it.

Part of this change fixes improves how we output upgraded settings for
databases and cache backends.

The other part upgrades the postgresql_psycopg2 backend to
postgresql. A little history here: Originally, ages ago, Django had
two backends, and recommended moving postgresql to
postgresql_psycopg2, and we had upgrade code handling this. Then they
flipped this, and in Django 1.9 the psycopg2 variant became an alias,
which was then formally deprecated in 2.0, and removed in 3.0.

Review Board 4.0 doesn't particularly care which is used, but in order
to future-proof, we're handling the upgrades now, moving to the plain
postgresql backend.

Unit tests were added to check the settings upgrade machinery.

Unit tests pass on all supported versions of Python.

Summary ID
Modernize and enhance settings upgrades for upcoming postgresql changes.
Our settings upgrade code is pretty old, and a bit crufty. While most of it is unlikely to ever need to be run again, it's worth keeping it here and maintainable than not. Particularly as we iterate on it. Part of this change fixes improves how we output upgraded settings for databases and cache backends. The other part upgrades the `postgresql_psycopg2` backend to `postgresql`. A little history here: Originally, ages ago, Django had two backends, and recommended moving `postgresql` to `postgresql_psycopg2`, and we had upgrade code handling this. Then they flipped this, and in Django 1.9 the `psycopg2` variant became an alias, which was then formally deprecated in 2.0, and removed in 3.0. Review Board 4.0 doesn't particularly care which is used, but in order to future-proof, we're handling the upgrades now, moving to the plain `postgresql` backend. Unit tests were added to check the settings upgrade machinery.
889bb103513e830fb445d43a696e1ebf534b2475
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-4.0.x (ef9f2ff)