bugflow / auto-gnome

GitHub Ticket Gnome
https://auto-gnome.readthedocs.org/
0 stars 1 forks source link

remove CallbackEvent from Config initalisation #24

Open ltankey opened 6 years ago

ltankey commented 6 years ago

We currently initialise our Config object with a CallbackEvent object, which makes sense in the context of webhook callbacks, but not for automated/scheduled events.

The only real dependency on Config is a Repo, which could be passed in as an object or by full name.

monkeypants commented 6 years ago

right, so the scheduled jobs need to know "which repos have bugflow", so that they can fetch up-to-date config about them...

There really doesn't seem to be any way round maintaining state somewhere. https://github.com/Miserlou/NoDB is probably good enough for now (we can swap it to dynamo when we have many megabytes of repos in the list...)

The scheduled job might load the nodb and scan through it, looking at some kind of "next schedule time" attribute on each repos, and then dispatch an async job (https://github.com/Miserlou/Zappa#asynchronous-task-execution) for each repo where it is likely warranted. This would be cheaper than dispatching many useless/do-nothing lambdas. We could use events/callbacks to maintain the "next schedule time" attribute in the nodb.