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
If real time equivalents for the time slots are provided, add
a link to timeanddate.com corresponding to the time, and display
browser local time equivalent for the time displayed.
Also make sure that the day tab corresponds to the UTC day (until
01 UTC the next day) whatever your timezone is.
Change-Id: I7847e0ac68fc6fcd176d40cc94d4e21c3c6e03e0
Allow to associate a URL to a room, for example a link to a video
conference room. Tracks assigned to this room will automatically inherit
the link. The link for a given track can be overridden using the "url"
command.
This allows organizers to provide video links for each room, while still
enabling teams to link to whatever they end up really using.
Change-Id: I633eb83c579e4093ae769bcd053e4d2ec2fe4bc3
PTGbot needs to be bootstrapped using base data, but it was unclear
what that base data should contain. Rather than just providing a
pastebin link, add an example base data file.
Change-Id: I675717fee4f5c1eb48dc94aeb26d63a85c004fb1
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
Fix problems found.
Change-Id: I5d2ab99725e97437b8dc3dc805c79b4a14610d6c
Now that we have a page for etherpads, navigation between the various
page is a bit awkward. This change introduces a common navbar across
all pages, and makes sure the MOTD displays on all of them.
This makes some of the links redundant, so we remove them.
Change-Id: I57d02c505ced355d53bc79e0d8240ea63737eae3
It is unclear that the etherpads page is driven by the ptgbot.
Add instructions on the page pointing to the ptgbot doc.
Change-Id: I42eee55d01da20a6e6bdc17081b99473ceb44c41
With this change, the ptgbot will generate links for each track
etherpad, display them on a specific page (etherpads.html) and
allow track moderators to override the autogenerated link using
the #track etherpad command.
It requires the database to contain an 'eventid' key which serves
as a unique etherpads prefix.
Change-Id: Iaa524530e9f2506369f180588a2b6f98f4cad3d1
It is sometimes useful to mark certain rooms as having specific
capabilities like videoprojection. This change adds the possibility
to assign a glyphicon (cap_icon) and a mouseover description
(cap_desc) for the rooms in the schedule dictionary.
Change-Id: I343c28acc3ad6015d3382d526511f153bf38a0e6
This is a mechanically generated patch to ensure unit testing is in place
for all of the Tested Runtimes for Train.
See the Train python3-updates goal document for details:
https://governance.openstack.org/tc/goals/train/python3-updates.html
Change-Id: Ie5535c3b8b6526f2ed8a8c99c62e5a770dd5a31e
Data presence was not reset on a new day cleanup, while it
is almost certainly stale at this point. Hopefully.
Change-Id: Ifc4cdedf6c365f92e5ff001d1485c8fee21b396f
While originally created as an OrderedDict, some data tables
were reset to a basic dictionary on a #newday command.
Change-Id: I62539a8c7130eac5eb666af019b7c94078666656
Currently it's not obvious that you can see who's checked into a room
by hovering the mouse over one of the room badges. This in turn makes
it less likely for people to check in, since they either won't be
aware of the feature, or will forget about it.
So game-ify check-ins by adding a new column to the "Current
discussion topics" table which displays the number of check-ins within
that room.
Story: 2005657
Task: 30945
Change-Id: I8d2bc716d39c70ff096f17b4da9ccf0a26bfc34f
The #unsubscribe command was setting the person's subscription to None
which obviously can't be compiled to a regex. This caused a crash on
the first now/next update after someone did #unsubscribe. Fix this
simply by skipping any subscription where the regex is set to None.
Change-Id: I11d42bcb1a0e3bc2e4105d6c2afa39f3a37af278
If a topic contains a URL, the URL gets auto-hyperlinked in ptg.html.
However this code forgot to add a trailing space, so if there was a
word after the URL, the space in between them got swallowed.
So add a space after each word, and do it outside the if/else
conditional to avoid any else clauses which might be added in the
future making the same mistake.
Change-Id: I3b5789387ead52945ae599aa0b80768642388269
Add the attendees tooltip to the now/next track badges, not just the
ones in the schedule timetable lower down.
Change-Id: Ibb92b1c520c6eebf78dabc0a052dd52fc5a40855
Previously we blindly accepted any string as a regex, but then
it could fail to compile at search-time when a track topic got
updated, which would cause the bot to crash.
So do a precautionary compile of the regex in order to ensure
we only accept valid regexen.
Change-Id: Id347b88adfc7150ff26550cf9170071e7ac33227