Add a new primary class for handling evolutions.
Review Request #10338 — Created Nov. 29, 2018 and submitted
This introduces a new
Evolver
class, which is responsible for managing
the evolution process. Previously, the logic for managing this existed
only in theevolve
management command, which was hard to extend and
use in other projects.
Evolver
uses a task-based system, where evolution-related tasks are
first queued up and then, when the caller is ready, either executed or
used for information gathering purposes (such as evolution hinting).
Callers can queue up general project-wide evolutions/purges or can queue
up the evolutions or purges of individual apps. They can also queue up
specialized tasks, if they have a need to create them.Going forward, additional tasks may be created to help with creating
model baselines, call into Django's migrations, or perform other
operations we may need.The
evolve
command itself has been rewritten to wrap theEvolver
.
This massively simplifies the code of the command, taking the logic from
years of spaghetti code to something straightforward and maintainable.
Unit tests pass on all databases.
Manually tested the various evolution operations against several
generations of Review Board schema evolutions. There may be
regressions still, but functionality appears to work as expected.
- Change Summary:
-
Fixed Review Bot complaints.
- Commit:
-
e78dd7f898f8667f6928f5ff9b8d299d8e8ffcfccd464efcee77361a81128a2d3abc5fea5906a631
- Diff:
-
Revision 2 (+2132 -400)
Checks run (2 succeeded)
- Change Summary:
-
Added a missing
cursor
argument toBaseEvolutionTask.execute
and missing arg docs to otherexecute
methods. - Commit:
-
cd464efcee77361a81128a2d3abc5fea5906a631a06d6b41be377b90bc8c57dc872864761dde1255
- Diff:
-
Revision 3 (+2144 -400)