User:AGreen (WMF)/Draft:Dev setup for centralnotice changes monitor

Overview
checks the CentralNotice API and consumes Kafka topics to listen for changes in campaign settings, banners and transcluded pages. Basic requirements are: Python 3, MariaDB, a MediaWiki installation with the CentralNotice and EventBus extensions installed, and Kafka.

The way I've found to achieve this setup is to start with Vagrant on the eventbus role enabled, then install CentralNotice manually there. I've then tweaked vagrant to be able to access Kafka events from the host machine, which is where I've run  itself. Other setups, including running the script from within Vagrant, are possible, too.

For development, run this command (from the repository root directory):

Database
Create a database and a database user, grant the user rights on the database, then run the following command (substituting database, user and password as appropriate):

For development purposes, the SQL to drop all tables is also provided. To use it, copy   as   and uncomment the last two lines.

Then, you can reset the database like this:

(Do not deploy an uncommented version of the drop tables file to production. Using the filename  for the uncommented version will prevent it from being added to the Git repository.)