Commit Graph

26 Commits (mike/prizebot)

Author SHA1 Message Date
Mike Lang d83ac78f74 Import prizebot
Mike Lang 4cd0ef1327 schedulebot: Take creds as a file
Avoids needing to put the creds in docker-compose.jsonnet.
The existing "import" trick didn't work due to the way we run jsonnet in docker.
Mike Lang 3fb6676fbe pubbot: Add more detail to logging
Wrap raw pubnub messages in a metadata object containing:
- time
- our hostname
- our pid
- any inferred information

Plus make a message-less log write on startup so we know where there might be gaps.

Also do more error handling so that we don't completely lose messages on error.
Mike Lang 9b19c12a53 Add pubnub-watching zulip bot
Which also records all pubnub messages for archival to a file SEGMENTS/pubnub-log.json.
We ran this for most of last year, but not as part of wubloader.
ZeldaZach e7a839c6cd Remove need to download twice on startup
ZeldaZach 07fc84e85e Relabel Comment to show new config values
ZeldaZach 8bbc72184c Support hot reload of Zulip Schedule
- Move sheets API into common dir, since multi use
- Live download from Google Sheets using Config
- Falls back on old schedule if new one can't be downloaded for some reason
Mike Lang 3606fadaa8 Pin gevent version to work around build issues
Seeing the following error on latest versions of gevent:

 Traceback (most recent call last):
   File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
     return _run_code(code, main_globals, None,
   File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
     exec(code, run_globals)
   File "/usr/lib/python3.9/site-packages/zulip_bots/schedulebot.py", line 2, in <module>
     import gevent.monkey
   File "/usr/lib/python3.9/site-packages/gevent/__init__.py", line 72, in <module>
     from gevent._hub_local import get_hub
   File "/usr/lib/python3.9/site-packages/gevent/_hub_local.py", line 150, in <module>
     import_c_accel(globals(), 'gevent.__hub_local')
   File "/usr/lib/python3.9/site-packages/gevent/_util.py", line 148, in import_c_accel
     mod = importlib.import_module(cname)
   File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
     return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named 'gevent._gevent_c_hub_local'
Mike Lang 859852fc50 memes
Mike Lang b9b7a6ca27 more schedulebot formatting
Mike Lang 4786154bca One more schedulebot format tweak
Mike Lang 7637633936 fix typo
Mike Lang d338c785ff schedulebot: formatting changes
Mike Lang f63e68f609 schedulebot: List all currently active people by role (except shift sup)
Mike Lang 78c053000e Upgrade pip in order to make wheels work
Mike Lang e7c402c5e2 schedulebot: Make user ids case-insensitive
Mike Lang 0164f9def8 schedulebot: Don't set groups before the run starts
This is mainly a problem with groups_by_shift which will be set
even for negative hours that aren't on the schedule.

This causes notification spam as people move in and out of groups.
Mike Lang 51a2ef35cc schedulebot: Extend group-by-shift to allow multiple group members
Mike Lang d13a014bab schedulebot: Accept start timestamp with a trailing Z
Mike Lang 044dfb8084 Pin argh to avoid stupid breaking changes
Mike Lang 5a8bf99d12 schedulebot: Add ability to hard-code a group membership by shift
This feature is intended for implementing a "current wub wrangler" group, which:
a) Isn't on the schedule
b) Can't be put on the schedule as it would overlap with other duties
c) We don't want to announce in "starting/ending shift" messages.
Mike Lang 8220c87258 Fix zulip_bots bugs to get them working in package
Mike Lang de521c4da9 schedulebot: Take timestamp string instead of epoch
Mike Lang 627eda5e74 schedulebot: Remove memes
Mike Lang 05d5a190fc Allow conf_file to be the JSON data directly
Easier for containers
Mike Lang 8813068c9d Make zulip bots an actual package