This introduces a new Evolver
class, which is responsible for managing
the evolution process. Previously, the logic for managing this existed
only in the evolve
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 the Evolver
.
This massively simplifies the code of the command, taking the logic from
years of spaghetti code to something straightforward and maintainable.