excellent_migrations icon indicating copy to clipboard operation
excellent_migrations copied to clipboard

Architecture of detectors

Open Artur-Sulej opened this issue 2 years ago • 0 comments

It's a good idea to tackle complexity of finding unsafe operations – to make them easier to read, understand, maintain and develop. There two aspects:

  • there are many checks
  • some checks are compound – they need to check conditions on multiple lines (e.g. index added concurrently and lock disabled)

Possible approach is to make AstParser return relevant parts of code (not yet detected unsafe operations). Then add another step to the process that would decide about dangers (based on that data from AstParser). I like this approach, because it would decompose the logic into separate, independent steps with different responsibilities.

The question is: will this approach be suitable for all cases, including detecting irreversible migrations.

We've already had some discussion about it with @hiagomeels here.

Artur-Sulej avatar Aug 05 '22 07:08 Artur-Sulej