]> git.cworth.org Git - turbot/log
turbot
3 years agoReject puzzle edit if "solved" and "solution" are inconsistent
Carl Worth [Sat, 9 Jan 2021 06:19:29 +0000 (22:19 -0800)]
Reject puzzle edit if "solved" and "solution" are inconsistent

There's an argument here that we really shouldn't be giving the user
two different fields if we're forcing them to be edited together, but
that's what we have right now.

3 years agoUpdate TODO file now that puzzle edit dialog has been edited
Carl Worth [Sat, 9 Jan 2021 06:18:26 +0000 (22:18 -0800)]
Update TODO file now that puzzle edit dialog has been edited

And just as the TODO file predicted, right now it's only possible to
get at this functionality through the pencil icon.

3 years agoImplement update of puzzle when edit_puzzle dialog is submitted
Carl Worth [Sat, 9 Jan 2021 02:44:29 +0000 (18:44 -0800)]
Implement update of puzzle when edit_puzzle dialog is submitted

Processing all user input and updating the database with the changes.

This isn't _quite_ updating everything in the channel and the sheet
that should be changed. To do that we simply need to refactor the code
that's currently doing that in various places to do it all in one
place.

3 years agoImplement a dialog box to edit a puzzle
Carl Worth [Sat, 9 Jan 2021 01:23:32 +0000 (17:23 -0800)]
Implement a dialog box to edit a puzzle

This is connected to the "pencil" buttons that were recently added to
the /hunt output as well as the Turbot home view.

So far, this brings up an editable dialog with the puzzle state but
doesn't actually do anything with any of the edits made when the user
saves the dialog.

3 years agoModify multi_select_block to use accessory_block, section_block, and text_block
Carl Worth [Fri, 8 Jan 2021 20:37:40 +0000 (12:37 -0800)]
Modify multi_select_block to use accessory_block, section_block, and text_block

Where this content was previously open-coded and redundant.

The commit removes more lines of code than it adds.

3 years agoRevamp the TODO list
Carl Worth [Fri, 8 Jan 2021 01:51:22 +0000 (17:51 -0800)]
Revamp the TODO list

The primary thing here is a sorted list of everything we want to
complete before a feature freeze, (which we're doing one weekend
before MH 2021 and will be followed by some test hunt over the weekend
both to flush out bugs and to get more of the team comfortable with
Turbot).

3 years agoWire up a function to handle the edit_puzzle button
Carl Worth [Thu, 7 Jan 2021 17:05:34 +0000 (09:05 -0800)]
Wire up a function to handle the edit_puzzle button

It doesn't actually _do_ anything yet, but should at least prevent the
warning sign which was appearing before.

And this should let us see if the action_id field is a good way of
plumbing the hunt_id and puzzle_id through to the handler for the
press of the edit_puzzle button.

3 years agoAdd an edit button next to each puzzle
Carl Worth [Thu, 7 Jan 2021 04:42:21 +0000 (20:42 -0800)]
Add an edit button next to each puzzle

This will appear in both the Turbot home screen as well as in the
output from the /hunt command.

3 years agoFix indentation
Carl Worth [Wed, 6 Jan 2021 16:54:56 +0000 (08:54 -0800)]
Fix indentation

To keep the flake8 check passing.

3 years agoPut -SOLVED as a suffix on sheet names and not a prefix to preserve
justin melvin [Wed, 6 Jan 2021 05:18:17 +0000 (21:18 -0800)]
Put -SOLVED as a suffix on sheet names and not a prefix to preserve
alphabetical ordering.

3 years agoModify a sheet-related TODO item after clarifying it with Nathan
Carl Worth [Tue, 5 Jan 2021 22:25:41 +0000 (14:25 -0800)]
Modify a sheet-related TODO item after clarifying it with Nathan

This is regarding making a hunt-specific folder for sheets to live in.

Also, while thinking about this, add another item about possible
changing the way sheets are renamed.

3 years agoUpdate TODO now that /hunt accepts a search term
Carl Worth [Tue, 5 Jan 2021 18:57:23 +0000 (10:57 -0800)]
Update TODO now that /hunt accepts a search term

Given the way the original TODO item was written, (as adding support
to both /home and to the Turbot home screen), this recent feature
addition doesn't delete an entire item from the TODO list, but it does
deserve to.

3 years agoFix error with missing search terems
Carl Worth [Tue, 5 Jan 2021 18:49:23 +0000 (10:49 -0800)]
Fix error with missing search terems

Some recent change made a command like "/hunt solved" result in an error.
This commit fixes that.

3 years agoUse Slack back-tick quoting for search terms
Carl Worth [Tue, 5 Jan 2021 18:43:44 +0000 (10:43 -0800)]
Use Slack back-tick quoting for search terms

This is cleaner both for preventing misinterpreting asterisks and also
more clear than re-inserting quotation marks for search terms that
include spaces.

3 years agoTweak bolding of hunt lead-in line from search results
Carl Worth [Tue, 5 Jan 2021 18:39:49 +0000 (10:39 -0800)]
Tweak bolding of hunt lead-in line from search results

Using bold just for the puzzle status word. (This is an attempt to
avoid Slack seeing a '*' in a regular expression of a search term and
think that it means to make something bold.)

3 years agoAdd state string to list of puzzle attributes matched in searching
Carl Worth [Tue, 5 Jan 2021 18:34:26 +0000 (10:34 -0800)]
Add state string to list of puzzle attributes matched in searching

This is a really important one so that people can use state strings
for things like "logic" and others who want to solve a logic puzzle
can find them.

3 years agoAdd search terms to the /hunt command
Carl Worth [Tue, 5 Jan 2021 16:31:34 +0000 (08:31 -0800)]
Add search terms to the /hunt command

Now, `/hunt <search-term>` can be used to list puzzles matching
<search-term>. As before, it will display only unsolved puzzles by
default, but `/hunt all <search-term>` or `/hunt solved <search-term>`
can be used to display other puzzles as well.

3 years agoDrop two items from the TODO list (which we just completed)
Carl Worth [Tue, 5 Jan 2021 04:44:28 +0000 (20:44 -0800)]
Drop two items from the TODO list (which we just completed)

A commit just a couple back in the series added these features.

3 years agoCorrect typo in hunt description verbiage
Carl Worth [Tue, 5 Jan 2021 04:43:15 +0000 (20:43 -0800)]
Correct typo in hunt description verbiage

Thanks to Ken for pointing out this misspelling.

3 years agoAdd support for an argument to the /hunt command
Carl Worth [Tue, 5 Jan 2021 03:49:35 +0000 (19:49 -0800)]
Add support for an argument to the /hunt command

This will work with three options:

/hunt all: Show all puzzles
        /hunt unsolved: Show unsolved puzzles
        /hunt solved: Show solved puzzles

3 years agoAdd a /hunt command
Carl Worth [Tue, 5 Jan 2021 03:20:27 +0000 (19:20 -0800)]
Add a /hunt command

Which spits out details of the current hunt, (in a format very similar
to what appears in the Turbot home view).

3 years agoFarm blocks-creation code out to various supporting files
Carl Worth [Tue, 5 Jan 2021 02:41:07 +0000 (18:41 -0800)]
Farm blocks-creation code out to various supporting files

The code will be easier to manage with separate hunt, round, puzzle,
and channel.py files each responsible for maintaining their own
functionality. We don't yet have any classes in any of these files,
(just functions that look things up in the database and that generate
Slack blocks), but we may end up doing classes later, (particularly if
we start wanting methods to update a single attribute in the database
for a given item, etc.).

3 years agoRevert "Turbot home: Disable the 'Hunts you can join' section"
Carl Worth [Tue, 5 Jan 2021 02:10:33 +0000 (18:10 -0800)]
Revert "Turbot home: Disable the 'Hunts you can join' section"

This reverts commit e3385b6a7da4583ab7c0729ac6776a32aa2818a0
which disabled some code to prevent a bug that was causing the
turbot Home view to fail to work.

The previous commit fixes the underyling bug so this code can now be
safely re-enabled.

3 years agohunt_link_block: Remove inadvertent trailing comma
Carl Worth [Tue, 5 Jan 2021 02:05:37 +0000 (18:05 -0800)]
hunt_link_block: Remove inadvertent trailing comma

This was creating a tuple where not intended, so causing invalid
blocks structure to be sent to Slack.

This was the cause of the recent bug preventing the Turbot Home view
from working (unless the user already belonged to every available
hunt).

3 years agoTODO: Capture some recent suggestions
Carl Worth [Tue, 5 Jan 2021 01:33:17 +0000 (17:33 -0800)]
TODO: Capture some recent suggestions

Ideas from various people mentioned in Slack

3 years agoTurbot home: Disable the "Hunts you can join" section
Carl Worth [Sat, 2 Jan 2021 18:27:40 +0000 (10:27 -0800)]
Turbot home: Disable the "Hunts you can join" section

Which is buggy and causing problems right now.

3 years agoPrevent failure of /solved command if /state had never been run
Carl Worth [Sat, 2 Jan 2021 17:24:53 +0000 (09:24 -0800)]
Prevent failure of /solved command if /state had never been run

The recent code to make /solved clear the /state field was buggy in
that it would result in a dispatch_failed error in Slack if /state had
never been invoked previously.

3 years agoTODO: Add a low-priority item for using a URL shortener
Carl Worth [Sat, 2 Jan 2021 07:20:01 +0000 (23:20 -0800)]
TODO: Add a low-priority item for using a URL shortener

One downside of doing something like this is that it would introduce a
dependence on another third-party service, so I'm not really all that
keen on pursuing this.

3 years agoAdd display of rounds in the Turbot home view
Carl Worth [Sat, 2 Jan 2021 06:29:07 +0000 (22:29 -0800)]
Add display of rounds in the Turbot home view

Grouping puzzles that belong to each round (and also a list of puzzles
that belong to no round).

This drops another item from the TODO list.

3 years agoDrop leading/trailing spaces and empty strings when parsing rounds
Carl Worth [Sat, 2 Jan 2021 05:31:20 +0000 (21:31 -0800)]
Drop leading/trailing spaces and empty strings when parsing rounds

Since we're dealing with user input here, it's easy for their to be
leading and trailing space (which we don't want as part of the round
name), or even an accidentally emty round (from two consecutive
commas). Drop any of those spaces and ignore any empty round strings.

3 years agoFix storage of rounds for new puzzle creation
Carl Worth [Sat, 2 Jan 2021 05:22:21 +0000 (21:22 -0800)]
Fix storage of rounds for new puzzle creation

To store an array of strings rather than storing each character from
the round string as an individual round (oops!).

That is, before this fix, if the user typed a round name of "Colors" the
database would store a rounds array for the puzzle with values of "C",
"o", "l", "o", "r", and "s".

3 years agoDrop TODO item regarding audio/video calls
Carl Worth [Fri, 1 Jan 2021 19:13:28 +0000 (11:13 -0800)]
Drop TODO item regarding audio/video calls

Nathan is planning on signing up for a paid plan with Slack
temporarily (over the period of Mystery Hunt) specifically to get
access to Slack video calls. These are already fully integrated
(allowing a call to everyone who belongs to a channel) which means
that that will allow for a call to everyone working on a given
puzzle. So I don't think we'll need any specific work to integrate
Turbot with this approach.

3 years agoRestrict a Slack channel topic to 250 characters
Carl Worth [Fri, 1 Jan 2021 19:06:26 +0000 (11:06 -0800)]
Restrict a Slack channel topic to 250 characters

And terminate it with an ellipsis if the user-provided state string is
too long. (It's a bit annoying that Slack returns an error rather than
just doing this same thing itself, but whatever.)

This satisfies a TODO item since users had encountered this error
during our last hunt.

3 years agoAdd list of available hunts to the Turbot home view
Carl Worth [Fri, 1 Jan 2021 18:55:35 +0000 (10:55 -0800)]
Add list of available hunts to the Turbot home view

So that people can easily find active, public hunts.

3 years agoMake /solved clear the state string for a puzzle
Carl Worth [Fri, 1 Jan 2021 18:42:14 +0000 (10:42 -0800)]
Make /solved clear the state string for a puzzle

In the last test we run, we often saw stale state messages about a
puzzle being half-solve, etc. when it was actually already completely
solved. Instead of putting another chore onto solvers to have them
manually clear the state string after solving a puzzle, here we do
that automatically.

This completes another low-hanging fruit item from the TODO list.

3 years agoRefuse to create a new puzzle with the same URL as an existing puzzle
Carl Worth [Fri, 1 Jan 2021 18:17:35 +0000 (10:17 -0800)]
Refuse to create a new puzzle with the same URL as an existing puzzle

Just a simple safety check when multiple people might be creating the
same puzzle at roughly the same time.

And one less item left on the TODO list.

3 years agoUpdate TODO now that initial round selection is available
Carl Worth [Fri, 1 Jan 2021 06:04:57 +0000 (22:04 -0800)]
Update TODO now that initial round selection is available

One TODO item is clearly complete here: The new multi-select field in
the modal form when creating a puzzle. That's working well enough that
I don't think we need the separate /round command so I'm dropping that
from the TODO.

Two little things are needed to really make round support complete:

  * Display/grouping of rounds in the Turbot home view

  * Select same rounds (by default) when creating a new puzzle in the
    same channel of an existing channel

3 years agoMake /solved reject a missing solution string
Carl Worth [Fri, 1 Jan 2021 06:01:00 +0000 (22:01 -0800)]
Make /solved reject a missing solution string

And instead give an error to the user explaining the usage of the
/solved command.

3 years agoAdd a multi-select round field to puzzle creation
Carl Worth [Fri, 1 Jan 2021 01:00:33 +0000 (17:00 -0800)]
Add a multi-select round field to puzzle creation

Actually, there are two round fields. The first is a free-form text
field for a comma-separated list of rounds. Each of these rounds will
be added to the database as an item with only two attributes:

hunt_id: <HUNT_ID>
        SK: round-<ROUND>

The other field is a multi-select field populated with the names of
all rounds that already exist in the hunt. This makes for easy
selection without having to worry about typing in names identical with
what others typed previously.

3 years agoAdd a handler for multi_static_select input
Carl Worth [Fri, 1 Jan 2021 01:53:29 +0000 (17:53 -0800)]
Add a handler for multi_static_select input

The documentation of the multi_static_select input block wasn't clear
that it would trigger a call to an event handler, but apparently it does.

We don't currently impose any restrictions on what a user selects,
(any combination of rounds is valid), so we simply return a lamba_ok
value for any selection. This prevents the user from seeing a warning
sign in the dialog (where hovering over it would say that the callback
returned 502).

3 years agoMake the error message from /state a little more explicit
Carl Worth [Thu, 31 Dec 2020 23:12:59 +0000 (15:12 -0800)]
Make the error message from /state a little more explicit

Specifically, make it clear that it was /state that caused the error.

(This is useful because the /state command doesn't get insterted into
the channel history but the error response does. So repeating this in
the error message can make things more clear if the conversation is
referred to by the user later.)

3 years agoRework code to map channel IDs to hunt or puzzle objects from the database
Carl Worth [Thu, 31 Dec 2020 22:43:07 +0000 (14:43 -0800)]
Rework code to map channel IDs to hunt or puzzle objects from the database

The old functions were named things like channel_is_puzzle,
channel_is_hunt, and fund_hunt_for_channel. These were still expecting
the old multi-table database schema so they were broken, (as was all
functionality built on top of them such as the /state and /solved
commands).

The new functions are built on the all-one-table database schema, so
should actually work again. They also have a cleaner interface in that
they only rely only on channel ID (and never put any special stock in
the channel name). Instead of doing magic with the channel name, the
code looks up the hunt_id from the database entry for a puzzle as
needed.

The new functions are named puzzle_for_channel and hunt_for_channel
and are implemented on top of a common, internal function:
db_entry_for_channel.

3 years agoUpdate TODO for removed auto-invitation of users to puzzle channels
Carl Worth [Thu, 31 Dec 2020 22:02:36 +0000 (14:02 -0800)]
Update TODO for removed auto-invitation of users to puzzle channels

In recent commits we changed from auto-inviting all users to all new
puzzle channels to instead notify the main hunt channel whenever a new
puzzle channel becomes available.

3 years agoRemove code (previously disabled) to invite users to new puzzle channel
Carl Worth [Thu, 31 Dec 2020 21:53:27 +0000 (13:53 -0800)]
Remove code (previously disabled) to invite users to new puzzle channel

Instead, add a message to the hunt channel with a link to the new
puzzle channel whenever a new puzzle is created.

3 years agoRename local variable from item to puzzle
Carl Worth [Thu, 31 Dec 2020 21:51:33 +0000 (13:51 -0800)]
Rename local variable from item to puzzle

The overly-generic name here was not at at useful.

With this specific name, the code will be much more clear when it says
things like hunt['channel_id'] vs. puzzle['channel_id'].

3 years agoRename primary-key attribute from PK to hunt_id
Carl Worth [Thu, 31 Dec 2020 20:05:13 +0000 (12:05 -0800)]
Rename primary-key attribute from PK to hunt_id

I was just about to add a separate attribut to every item in the
database named hunt_id when I realized that that was totally redundant
with our existing PK attribute (whose values were simply the hunt_id
prefixed by "hunt-" in all cases).

Since we're not using the PK field in any generalized sense, (that is,
it's _always_ populated with the hunt_id value), it's much simpler and
more efficient to just name it "hunt_id" and store the hunt_id valeu
ther directly (without any prefix).

3 years agoRename hunt_id_index to is_hunt_index
Carl Worth [Thu, 31 Dec 2020 19:52:43 +0000 (11:52 -0800)]
Rename hunt_id_index to is_hunt_index

Backed, of course, by a new is_hunt attribute.

The rationale here is that the whole point of this index is to be a
sparse attribute so that the code can efficiently query all existing
hunts. But meanwhile, it's useful for puzzles to have a "hunt_id"
attribute, which would confict with the goal of having "hunt_id" be
sparse and populated only for hunts and not puzzles.

So the fix here is to make hunt_id universal, and instead have a
separate "is_hunt" attribute which is the sparse one, (and will
clearly never be populated for a puzzle).

3 years agoDon't put an attribute into the database for 'url' that is left blank
Carl Worth [Thu, 31 Dec 2020 18:29:54 +0000 (11:29 -0700)]
Don't put an attribute into the database for 'url' that is left blank

The URL field, (for either a hunt or a puzzle), is an optional
parameter, (the user creating the hunt or puzzle may or may not
provide a URL). Immediately prior to this commit, if a user left the
URL field blank, the submission handler was receiving a value of None
and inserting that as an attribute in the database.

This was problematic as subsequent code, (such as sheet creation),
would be prepared for an item to have no url key at all, but was not
prepared for the key to be present but for the value to be empty.

We fix this in this commit by explicitly _not_ inserting a None value
for url as an attribute in the database item, (instead, not supplying
a url attribute at all).

3 years agoConvert /puzzle puzzle creation to all-one-table database schema
Carl Worth [Thu, 31 Dec 2020 17:31:24 +0000 (10:31 -0700)]
Convert /puzzle puzzle creation to all-one-table database schema

So we put the hunt ID into the PK field and the puzzle ID into the SK field,
(allowing puzzle items to be distinguished from hunt items in the table).

While doing this, we also disable the feature of inviting all hunt
users to the new puzzle. This is both because that code hasn't been
ported to the new schema, and also because that feature is planned to
be eliminated anyway.

3 years agoHome: Update query for finding puzzles to new all-one-table schema
Carl Worth [Thu, 31 Dec 2020 17:22:04 +0000 (10:22 -0700)]
Home: Update query for finding puzzles to new all-one-table schema

Previously, we looked in a separate per-hunt table to find the puzzles
for a hunt. Now, instead, we look in the single "turbot" table and
find puzzles for a hunt by looking for items whose PK is
"hunt-<HUNT_ID>" and whose SK starts with "puzzle-".

3 years agoRework message given when bootstrapping the turbot table
Carl Worth [Thu, 31 Dec 2020 17:16:27 +0000 (10:16 -0700)]
Rework message given when bootstrapping the turbot table

This provides a little more information, (such as that a user should
wait a minute before retrying), and is a little more polite, (saying
"please").

3 years agoTurbot home: Use recently added hunt_id_index to find existing hunts
Carl Worth [Thu, 31 Dec 2020 17:14:17 +0000 (10:14 -0700)]
Turbot home: Use recently added hunt_id_index to find existing hunts

This fixes the home view to correctly use the new single-table schema to
find the list of available hunts. This view is now working to display
the names of active hunts a user belongs to.

(No puzzles are listed yet. That part of the home view still needs to be
brought up to date with the latest schema.)

3 years agoTurbot home: Report "you do not belong to any hunts" if that is the case
Carl Worth [Thu, 31 Dec 2020 16:41:45 +0000 (09:41 -0700)]
Turbot home: Report "you do not belong to any hunts" if that is the case

Instead of having the header "Hunts you belong to" followed by nothing.

3 years agoAdd a hunt_id attribute and index to the database for hunts
Carl Worth [Wed, 30 Dec 2020 20:31:12 +0000 (13:31 -0700)]
Add a hunt_id attribute and index to the database for hunts

This will allow the Turbot home view to scan the hunt_id_index to find
all existing hunts, (without having to scan non-hunt items from the
database).

3 years agoFix stale usage of "puzzle_table"
Carl Worth [Wed, 30 Dec 2020 20:21:55 +0000 (13:21 -0700)]
Fix stale usage of "puzzle_table"

We no longer haave a separate table for puzzles, but instead the single
"turb.table" holds all of our data.

This doesn't fully convert this code to the new single-table schema,
but it should at least let things pass the flake8 test and deployment.

3 years agoRequire flake8 to pass before performing deployment
Carl Worth [Wed, 30 Dec 2020 20:19:19 +0000 (13:19 -0700)]
Require flake8 to pass before performing deployment

Trying to speed up debug cycles by catching errors without having to
wait for them to show up in CloudWatch logs.

3 years agoAdd a "make flake" recipe and clean up some style bugs flake8 noticed
Carl Worth [Wed, 30 Dec 2020 20:17:43 +0000 (13:17 -0700)]
Add a "make flake" recipe and clean up some style bugs flake8 noticed

We also ignore some rules about whether or not there's a space on
either side of some operators, since I fundmanetally disagree with
flake8 on some of these.

3 years agoBeginning of transition to single-table database schema
Carl Worth [Tue, 29 Dec 2020 23:33:37 +0000 (16:33 -0700)]
Beginning of transition to single-table database schema

This is aiming for a one-big-table approach, (which is the DynamoDB
best practice), instead of having one table for hunts and then a
separate per-hunt table for puzzles.

This new approach will be more flexible as we start adding database
items for rounds, etc. In the old approach, rounds would likely have
become yet another hunt-specific table, and the number of per-hunt
tables would have started to become rather messy.

With this new schema, rounds can instead be just another item, where
hunts, rounds, and puzzles can all be intermingled as items in the
same table.

To get this all to work, we are creating secondary indexes for
querying items from the database via attributes other than the primary
key, (for example a "channel_id" index).

As of this commit, the "New Hunt" button works in that it:

  * Creates the turbot DynamoDB table if it doesn't exist

  * Inserts a new item into the table for the hunt itself (active=False)

  * Marks the sheet_url of the item as "pending"

  * Creates a new channel for the hunt

  * Responds to the channel_created event

  * Creates a Google sheet for the hunt

  * Stores the sheet_url in the database

  * Marks the hunt as active=True in the database

  * Reports to the Slack channel that things are working

So that much is working, but everything else has yet to be converted
to the new schema. So things that don't yet work include at least:

  * The turbot "Home" view doesn't yet display anything

  * The /puzzle command doesn't work yet

3 years agoRework the TODO list to capture recent-discussed priorities
Carl Worth [Mon, 28 Dec 2020 16:49:20 +0000 (09:49 -0700)]
Rework the TODO list to capture recent-discussed priorities

Thanks, Nathan!

3 years agoAdd TODO item for displaying who has current roles
Carl Worth [Mon, 28 Dec 2020 16:28:13 +0000 (09:28 -0700)]
Add TODO item for displaying who has current roles

This was an idea proposed during the recent hunt kickoff meeting.

3 years agoDrop quotation marks from around puzzle name
Carl Worth [Sun, 27 Dec 2020 20:40:56 +0000 (12:40 -0800)]
Drop quotation marks from around puzzle name

This is already being formatted as a link, so we don't need quoation
marks as well.

3 years agoAdd (and use) a new function find_hunt_for_hunt_id
Carl Worth [Sun, 27 Dec 2020 20:34:58 +0000 (12:34 -0800)]
Add (and use) a new function find_hunt_for_hunt_id

The code to call get_table_item with a hunt_id was broken, (since in
the schema, hunt_id is not the key, only channel_id is), so instead we
need to scan the table looking for a matching hunt_id. We already had
code to do this is find_hunt_for_channel, so here we factor that out
into a new function, find_hunt_for_hunt_id and call it instead of
get_table_item.

3 years agoAdd hunt_id to the puzzle table (instead of orig_channel_name)
Carl Worth [Sun, 27 Dec 2020 20:11:59 +0000 (12:11 -0800)]
Add hunt_id to the puzzle table (instead of orig_channel_name)

A recent commit (to announce /solved in the main hunt channel)
expected to find hunt_id in this table, but it wasn't there. So we add
it in this commit. And while adding it, we drop the orig_channel_name
field, (which embedded both hunt_id and channel_id into a single field
in the database so would have made renaming of the hunt_id rather
awkward).

3 years agoFix Makefile to not hard-code python3.8
Carl Worth [Sun, 27 Dec 2020 19:42:07 +0000 (11:42 -0800)]
Fix Makefile to not hard-code python3.8

Apparently I'm using python 3.9 now. Fix the Makefile so that the
deploy recipe should work with any version of python.

3 years agoMake the /solved command report to the hunt's channel
Carl Worth [Sun, 27 Dec 2020 19:35:15 +0000 (11:35 -0800)]
Make the /solved command report to the hunt's channel

So that there's a log in the main hunt channel for when each puzzle
gets solved.

3 years agoRework find_hunt_for_channel to return a hunt dictionary
Carl Worth [Sun, 27 Dec 2020 19:25:03 +0000 (11:25 -0800)]
Rework find_hunt_for_channel to return a hunt dictionary

It's going to be most convenient to return hunt and puzzle dictionaries
that contain all entries from the database, (rather than a hard-coded
tuple which is likely to not contain every piece of data we'll eventually
want to have).

3 years agoUse consistent formatting for channel name and spreadsheet name
Carl Worth [Sun, 27 Dec 2020 18:48:23 +0000 (10:48 -0800)]
Use consistent formatting for channel name and spreadsheet name

Specifically, using a prefix of "SOLVED: " when a puzzle is solved.

3 years agoSimply typo fix
Carl Worth [Sun, 27 Dec 2020 18:47:54 +0000 (10:47 -0800)]
Simply typo fix

It's AWS, not AW.

3 years agoUpdate TODO
justin melvin [Sat, 28 Nov 2020 06:59:01 +0000 (22:59 -0800)]
Update TODO

3 years agoAppend "-solved" to puzzle channel names when /solved
justin melvin [Sat, 28 Nov 2020 06:49:59 +0000 (22:49 -0800)]
Append "-solved" to puzzle channel names when /solved

3 years agoUpdate TODO
justin melvin [Sat, 28 Nov 2020 06:27:51 +0000 (22:27 -0800)]
Update TODO

3 years agoTypo
justin melvin [Sat, 28 Nov 2020 06:22:26 +0000 (22:22 -0800)]
Typo

3 years agoFinally I found out how to make the stupid batch API work
justin melvin [Sat, 28 Nov 2020 06:16:48 +0000 (22:16 -0800)]
Finally I found out how to make the stupid batch API work

3 years agoI am not a fan of this api's documentation
justin melvin [Sat, 28 Nov 2020 04:59:24 +0000 (20:59 -0800)]
I am not a fan of this api's documentation

3 years agoFix function arguments
justin melvin [Sat, 28 Nov 2020 04:51:52 +0000 (20:51 -0800)]
Fix function arguments

3 years agoFix typo
justin melvin [Sat, 28 Nov 2020 04:42:56 +0000 (20:42 -0800)]
Fix typo

3 years agoRename sheets with 'SOLVED - ' prefix when /solved
justin melvin [Sat, 28 Nov 2020 04:34:20 +0000 (20:34 -0800)]
Rename sheets with 'SOLVED - ' prefix when /solved

3 years agoUpdate TODO list
justin melvin [Sat, 28 Nov 2020 00:23:41 +0000 (16:23 -0800)]
Update TODO list

3 years agoQuote parameters to HYPERLINK
justin melvin [Sat, 28 Nov 2020 00:18:10 +0000 (16:18 -0800)]
Quote parameters to HYPERLINK

3 years agoFix arguments to HYPERLINK
justin melvin [Sat, 28 Nov 2020 00:03:33 +0000 (16:03 -0800)]
Fix arguments to HYPERLINK

3 years agoFix typo and make hyperlinks in the sheets work
justin melvin [Thu, 26 Nov 2020 05:22:47 +0000 (21:22 -0800)]
Fix typo and make hyperlinks in the sheets work

3 years agoAdd some additional todo items from Justin Melvin
Carl Worth [Sun, 1 Nov 2020 18:00:56 +0000 (10:00 -0800)]
Add some additional todo items from Justin Melvin

Thanks for these additional ideas!

3 years agoAdd a TODO file
Carl Worth [Sun, 1 Nov 2020 17:55:32 +0000 (09:55 -0800)]
Add a TODO file

With all the ideas gathered during the recent Teammate Hunt.

3 years agoUse blocks to send the welcome message
Carl Worth [Fri, 23 Oct 2020 21:29:06 +0000 (14:29 -0700)]
Use blocks to send the welcome message

This approach has the benefit of allowing separate sections, (I tried
doing this with newlines in the 'text' parameter but they were getting
swallowed by Slack).

3 years agoAdd a welcome message to any new puzzle channel that is created.
Carl Worth [Fri, 23 Oct 2020 18:16:20 +0000 (11:16 -0700)]
Add a welcome message to any new puzzle channel that is created.

This gives links to the original puzzle's URL and also explains how to
use the /state and /solved commands.

3 years agoLimit Turbot home display to hunts a user belongs to
Carl Worth [Fri, 23 Oct 2020 14:48:55 +0000 (07:48 -0700)]
Limit Turbot home display to hunts a user belongs to

Membership is determined by membership in a hunt's primary slack channel.

3 years agoAdd some links to the puzzle sheet when originally creating it
Carl Worth [Fri, 23 Oct 2020 14:18:31 +0000 (07:18 -0700)]
Add some links to the puzzle sheet when originally creating it

Linking both to the original puzzle as well as to the slack channel.

3 years agoUse a clean name for the hunt's sheet as well
Carl Worth [Fri, 23 Oct 2020 13:49:02 +0000 (06:49 -0700)]
Use a clean name for the hunt's sheet as well

Just as we did for the puzzle's sheet in the previous commit.

3 years agoName sheet based on puzzle name, not puzzle channel ID
Carl Worth [Fri, 23 Oct 2020 13:47:38 +0000 (06:47 -0700)]
Name sheet based on puzzle name, not puzzle channel ID

We don't have the same restrictions on the sheet name that we have on
the channel name, so let the original name go through.

3 years agoDrop the puzzle ID field from the /puzzle dialog
Carl Worth [Fri, 23 Oct 2020 13:41:41 +0000 (06:41 -0700)]
Drop the puzzle ID field from the /puzzle dialog

Much easier to just have the bot generate this instead.

3 years agoAdd some feedback to the puzzle's channel when a puzzle is solved
Carl Worth [Fri, 23 Oct 2020 13:18:54 +0000 (06:18 -0700)]
Add some feedback to the puzzle's channel when a puzzle is solved

Without this, the '/solved' command felt rather anti-climactic.

3 years agoAdd a slack_send_message function
Carl Worth [Fri, 23 Oct 2020 13:07:36 +0000 (06:07 -0700)]
Add a slack_send_message function

Just to replace the ugliness of turb.slack_client.chat_postMessage

3 years agoCache SSM parameter values into environment variables
Carl Worth [Fri, 23 Oct 2020 12:54:27 +0000 (05:54 -0700)]
Cache SSM parameter values into environment variables

The goal here is to reduce SSM parameter reads/writes. Hopefully, as
AWS reuses a container for multiple calls to our Lambda function,
these values can be read from the environment instead of needing to
reach out to AWS.

The reason we want to reduce calls to SSM functions in that AWS Free
Tier gives us only 20,000 KMS requests compared to 1,000,000 AWS
Lambda requests.

3 years agoAfter creating spreadsheets, make them writable by anyone with a link
Carl Worth [Fri, 23 Oct 2020 04:40:36 +0000 (21:40 -0700)]
After creating spreadsheets, make them writable by anyone with a link

This requires a new scope for our credentials, and a new service. But
with those in place, it's just a single API call.

3 years agoFix bug that was causing a dispatch_failed on /puzzle in a non-puzzle channel
Carl Worth [Fri, 23 Oct 2020 00:47:21 +0000 (17:47 -0700)]
Fix bug that was causing a dispatch_failed on /puzzle in a non-puzzle channel

This was some return-type mismatch and other breakage from recent
reworking of channel_is_hunt.

3 years agoAdd an implementation of the /solved command
Carl Worth [Fri, 23 Oct 2020 00:40:43 +0000 (17:40 -0700)]
Add an implementation of the /solved command

For marking a known solution to a puzzle.

3 years agoAdd display of state string to turbot view of each puzzle
Carl Worth [Fri, 23 Oct 2020 00:34:01 +0000 (17:34 -0700)]
Add display of state string to turbot view of each puzzle

This will be helpful in getting an overview of things.

3 years agoAdd missing return value for /state command
Carl Worth [Fri, 23 Oct 2020 00:31:20 +0000 (17:31 -0700)]
Add missing return value for /state command

So that it can be happy now.

3 years agoActually wire up the state command
Carl Worth [Fri, 23 Oct 2020 00:28:27 +0000 (17:28 -0700)]
Actually wire up the state command

Or else it won't do anything.

3 years agoDon't allow capital letters in a hunt or puzzle ID
Carl Worth [Fri, 23 Oct 2020 00:25:48 +0000 (17:25 -0700)]
Don't allow capital letters in a hunt or puzzle ID

Since Slack won't allow them in a channel name.