There were several issues with generating the ptg.ics.
Errors causing python tracebacks:
1. teams = slots = {}
This was a gotcha for me. This essentially makes teams and slots
aliases for the *same* empty dictionary. Not as I thought creating
creating 2 empty dictionaries. Upon reflection it is obvious.
This meant that I was treating a "slot code" [MonA1] as a track/team
2. datetime.timedelta()'s keyword is "minutes" not "mins"
Functional errors:
1. If a team/track sets a VC url, it goes into db["urls"].
Look there first and if not there look for a URL from the slot/room
location.
2. Use a reasonable isn't a team/track key in db["etherpads"].
Non-functional changes:
1. There were a couple of FIXMEs which were addressed.
e["key"] = "value" is the same as e.add("key", "value")
2. An empty url (""), is fine to add into the location, just strange.
Change-Id: I458924bfc26c47f4e062cc16f48e2d72da361918
Add a handler that converts the existing slot data into an ICS file.
This .ics file can be global ".../ptg.ics" or per track ".../ironic.ics"
Right now each block deafults to 60 minutes if there isn't a 'duration'
field in the slot entry.
Change-Id: I7a67ba777c004e57206976aca377fe3f41956db0
We update python testing from python3.8 to python3.11 to match the
deployment setup in the Docker image. We then update the docker image
from python3.9 + bullseye to python3.11 + bookworm. This is future
proofing, but also OpenDev would like to clean up old docker container
image builds for bullseye and older python.
Change-Id: Ifbb7dcf2bf5f0b7ea4f53e26dd4bf4911c9b8d37
This reverts commit 260f6f3624.
This is a partial revert as test fixups are not reverted.
OpenDev is moving back to docker.io to preserve speculative container
image testing functionality.
Change-Id: I5a1404c27f09f2cf2c1d7dd9b74c300052658559
This migrates publication of ptgbot container images to quay.io. We also
update the source of the opendev python base images to quay.io.
Depends-On: https://review.opendev.org/c/opendev/system-config/+/881932
Change-Id: Ia23aa05e770d0f002ce74effdae08dacb6edc18a
Multiple people have been mistaking the ~add and ~del syntax to
include a keyword "TRACK" which results in creating an actual track
by that name. Add chevrons around required parameters in the syntax
documentation in order to make it clear those are parameter names
and not literal keywords.
Change-Id: I69d5b79d8d894f94919724c0f94225dbf959b20e
Bullseye has been out for a bit now and buster has a shelf life. Update
to bullseye to keep up with debian's releases.
Change-Id: I5845a8cf5c7a0c6383e9c2863146df28c7e40a4f
PTGBot was relying on a number of Freenode things and requires a
few changes to run on OFTC:
- Manually identify to NickServ instead of using SASL
- No longer use identify-msg capability
- Messages received are no longer prefixed by '+'
Change-Id: Ib014f58475c1eee89d34e718ee5988800602586b
Recent change to introduce a "clear" alias for the "clean" commands
missed one case (~clear TRACK).
Change-Id: I60334ce80fee07edca335c1a75a295d90d6c39c5
To make it friendlier to non-openstack projects, use the opendev
instance of etherpad instead of the openstack one.
Change-Id: I30385d0ca0145994d21832769510a3a9b627e40d
PTGbot airbag deploys on empty messages (messages containing only
spaces, or /me actions). Fix this crash to avoid airbag deployment.
Change-Id: I4def945894419536fd3d340e3850007210adf17f
The first parameter would be ignored when running ~add, ~del or
~clean commands. Fix the issue and add a test to make sure we
do not regress again.
Change-Id: If2c239e8d04ca2ea86283861617c89d77d3917ee
Channel for PTG discussion was moved to #openinfra-events, and
the bot was renames "openinfraptg" to match the extended scope
of the event.
Depends-On: https://review.opendev.org/c/opendev/system-config/+/774862
Change-Id: I5f1cc7867273c82a836ab238e5c2b2352bbf02ff
Separate the processing of track commands and admin commands
into separate files, and normalize handling of messages.
Adjust test cases so that they match the new normalized messages.
Change-Id: I26e3683bbf3b7daab68407cd9928ee3d7f5c50dc
User commands in PTGbot can be called from privmsg or pubmsg.
Create a usercommands.py file to separate their processing.
This introduces a new '+' prefix for user commands, while preserving
the old '#' calls (which should really only be used for track
commands) for people that got used to them.
Change-Id: Ifab12fa27c6147ba9e9ff51f2b7f9e30a8ed0076
Add tests for most commands in PTGbot, checking that they result in
the desired outcome.
With this patch all track commands are tested, as well as most admin
commands.
Change-Id: I0a9907da6946db224a9efd2c740f275dfad0f00e
In order to be able to easily mock voice and oper checks, create
specific functions that implement those checks.
Change-Id: I6250c0d181085ff39d6ff0dae95c700dbeb931a3
The base.json file was missing some entries, preventing us from
using it as a valid base for tests.
Change-Id: Iee9d1ea8052d8faaf1a2056b9769ed2a816c92d7
A long-wanted feature! Since the MOTD can only be controlled by an
admin, the risk of abuse is very limited.
Change-Id: Iff6263059d76c9b75ae26e029e3063992ab7cb76
Revamp the ~motd command so that it supports the following subcommands
on the newly-introduced array of MOTD messages:
~motd add... (equivalent to old ~motd): adds a message
~motd clean (equivalent to old ~cleanmotd
~motd del n (to suppress message #n)
~motd reorder x y z (to reorder/remove messages)
Change-Id: I2f98c724c716ca4fd2e8fef34d4ca5af457b39e8
The message of the day used to be a single message with an importance
level. It's actually useful to be able to have several distinct
messages and add/remove them separately.
In preparation for that change, turn the motd entry in the json DB into
an array of messages. Gracefully migrate previous format DB into the
new one. Commands stay unchanged for now and just manipulate the first
entry.
Change-Id: Id98281dba0c6b3cffe1a359d6e0c250b99084bb1
Catch all previously-uncaught exceptions from on_pubmsg() and
on_privmsg() calls, to prevent the bot from crashing when people
start getting creative in their commands.
This should of course never happen, but if it does, better continue
running than crash.
Change-Id: Ic5eeec23652170061cbd2ce3606a3aee22463529
The code handling the "etherpad" command had the same issue as the
code handling the "url" command: if "auto" was passed to reset an
etherpad to default BUT no etherpad was set, the bot would crash.
This fixes it by doing nothing in that corner case.
Change-Id: I7a63c0b5ce95cf795964e637313a7b19e238964d
If a "none" URL is passed for a track but that track did not
have a customized URL in the first place, the bot would crash.
This fixes it by not doing anything in that case.
Change-Id: I9ab45ad7d07700efe5af208eb4c5b1285fd9deeb
The location code was created to allow for emergency relocation of
meetings, however in a virtual setting that is tracked using the "url"
feature. When location and urls differ it can create a lot of confusion.
It's better to stop displaying location for virtual PTGs. As an
emergency fix, let's stop displaying the location.
Change-Id: Ibb9d96e1fa7f686e31cc8d9b51e3826af8c4b015
Using the "location" command to point to an unknown location
would cause the Javascript displaying the schedule to crash.
It's a bit useless to use that command in a virtual PTG with
meeting URLs, however the page should handle that case and fail
more gracefully.
Change-Id: I271e2ead0094d407274cbb22e499d7b2c49631b4
When a meeting URL is provided, use the tooltip to explain that you
can click to join the meeting, rather than confusingly mention that
no one is checked in.
Change-Id: Id0dacd065ce28ed817fd142105cb728392d0efe4
Add a grey background on cells matching the current time, to make
it clearer where we are in the day.
Change-Id: Id2d13ae59f63c7059bba8abdf762b25e6339720e
Make it clearer that certain badges are meant to be clicked on.
Also replace the darkblue badge color that was too close to the
hover color.
Change-Id: I84617dbd442cfd557155400a65bd87679fe2825a
There is a corner case (/dcc chat) where a privmsg can have no content.
Ignore such corner cases instead of crashing.
Change-Id: Ia07c76c4a2342bb4e7bc9c37a4944d4b9f18efd8
The new track badge logic (which builds in a link to the
videoconference room if one is specified) is failing in case
the track is not scheduled in any location today.
Fix it so that we do not display any link in this precise case.
Change-Id: Ib6d93336e7c5d7c3494d442f95295442a8169a4d