Update Django Evolution and add a dependency to fix new installs.

Review Request #11262 — Created Nov. 3, 2020 and submitted

Information

Review Board
release-4.0.x

Reviewers

Review Board 4.0 is the first release to use a version of Django with
the built-in migrations framework, which was incompatible with
evolutions. Django Evolution 2.0 was released to orchestrate new
database installs and upgrades that incorporated both evolutions and
migrations, but it had a flaw that broke new installs on Review Board.

Basically, Django Evolution attempted to install initial migrations
first, then evolutions, and then any remaining migrations. However, the
oauth2_provider app was a bit of a special case in that its initial
migration looks up a model that must be configured in settings by the
project to store project-specific information, and adds a ForeignKey
to it. They require an initial migration for the project's model with a
reverse-dependency, set to run before oauth2_provider's initial
migration.

Django Evolution 2.1 further works around this by allowing evolutions to
specify dependencies and reverse-dependencies at both the app and
evolution levels, and generating the correct order of dependencies based
on that.

We now depend on 2.1 for this functionality, and set the necessary
dependencies in reviewboard.oauth to ensure that our model is created
before oauth2_provider's migration is run, and to ensure that
reviewboard.site is created before reviewboard.oauth (since the
model points to a LocalSite, and reviewboard.site would otherwise be
installed sometime after oauth2_provider in a different transaction.

With this, it's now possible to install or upgrade a Review Board
database on all supported databases.

Successfully created a database on SQLite, MySQL, and Postgres.

Successfully upgraded a Review Board 3.0.19 database to 4.0 on
SQLite, MySQL, and Postgres.

Unit tests pass (aside from a couple that were already failing).

Summary ID
Update Django Evolution and add a dependency to fix new installs.
Review Board 4.0 is the first release to use a version of Django with the built-in migrations framework, which was incompatible with evolutions. Django Evolution 2.0 was released to orchestrate new database installs and upgrades that incorporated both evolutions and migrations, but it had a flaw that broke new installs on Review Board. Basically, Django Evolution attempted to install initial migrations first, then evolutions, and then any remaining migrations. However, the `oauth2_provider` app was a bit of a special case in that its initial migration looks up a model that must be configured in settings by the project to store project-specific information, and adds a `ForeignKey` to it. They require an initial migration for the project's model with a reverse-dependency, set to run before `oauth2_provider`'s initial migration. Django Evolution 2.1 further works around this by allowing evolutions to specify dependencies and reverse-dependencies at both the app and evolution levels, and generating the correct order of dependencies based on that. We now depend on 2.1 for this functionality, and set the necessary dependencies in `reviewboard.oauth` to ensure that our model is created before `oauth2_provider`'s migration is run, and to ensure that `reviewboard.site` is created before `reviewboard.oauth` (since the model points to a `LocalSite`, and `reviewboard.site` would otherwise be installed sometime after `oauth2_provider` in a different transaction. With this, it's now possible to install or upgrade a Review Board database on all supported databases.
dd82c53b445fc5e5a9250b278738b37cf7ff27bf
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-4.0.x (41bd585)
Loading...