Modify bot detection so that the initial SQL query also stores information about whether the user is a former bot in the local database and includes it in the bot check. Add separate former bot detection to tests as well.
SQL query which loads the data can be found here
User former groups table information
You can test SQL queries using Quarry and Superset:
- https://quarry.wmcloud.org/query/97759
- https://superset.wmcloud.org/sqllab/?savedQueryId=209 ( database for fiwiki = S2 and schema = fiwiki_p )
Bot detection is located in autoreview.py.
Tests