I've roughed in a UI for sending board reminders (previously sent by
Marvin). At the moment, this support is structured in a way that it
assists with sending reminders manually, as opposed to doing everything
in an automated fashion. The basic flow is that somebody (typically the
Chairman or Vice Chairman) would:
1) visit "https://whimsy.apache.org/board/agenda/missing" (either
through that link, or by using the link at the bottom of the agenda
index, or by typing 'M' on an agenda page).
2) scroll through the list of missing reports, unchecking ones that
don't need a reminder (perhaps the PMC has asked to report the next
month, or perhaps a report has been posted to board@ but not yet to the
agenda).
3) click on either the 'initial' or 'final' buttons at the bottom of the
page to bring up a form.
4) review and optionally tweak the message to be sent. Note that
project independent variables have already been replaced, but project
dependent variables are left to later in the process.
5) click submit
Once debugged, a cron job could be set up to do this (minus the
unchecking and tweaking parts) automatically, or simply to send a
reminder to the chairman and/or vice chairman, or perhaps a cron job
isn't necessary at all (I'll leave this to Brett to decide).
Note this is UI only, the actual send function is stubbed out.
- - -
For those that wish to contribute to this effort, instructions are
provided for running the board agenda tool and tests either natively on
Linux or Mac OSX, or via a Docker container, or via a Vagrant VM:
https://github.com/rubys/whimsy-agenda#readme
An overview of the key source files related to this function:
The "missing reports" page:
https://github.com/rubys/whimsy-agenda/blob/master/views/pages/missing.js.rb
The "reminders" buttons and pop up form:
https://github.com/rubys/whimsy-agenda/blob/master/views/buttons/reminders.js.rb
The code that performs the initial variable substitution:
https://github.com/rubys/whimsy-agenda/blob/master/views/actions/reminder-text.json.rb
The data templates for the reminders:
https://github.com/rubys/whimsy-agenda/blob/master/data/
The stubbed out logic that will eventually perform the sending of email:
https://github.com/rubys/whimsy-agenda/blob/master/views/actions/send-reminders.json.rb
Tests for the "missing reports" page:
https://github.com/rubys/whimsy-agenda/blob/master/views/spec/other_views_spec.rb
Tests for the initial template variable substitution:
https://github.com/rubys/whimsy-agenda/blob/master/views/spec/actions_spec.rb
I don't currently have tests for the form or the sending logic. In
general, I would be disinclined to write tests for these two as:
1) in the case of the form, the amount of overhead and time it takes to
launch and tear down a headless browser is only warranted if there is
significant client side logic. In this case, the only significant logic
is to identify which reports were checked.
2) in the case of the send function, the sending of email can be mocked
out, but given that all of the decisions are made elsewhere, this mostly
would be a test to see if the mocking was performing correctly, and not
of the actual sending.
Finally, in both cases, the logic in question is isolated enough that it
is less likely to be affected by changes to other parts of the tool. Of
course, if experience proves otherwise, or if somebody is inclined to
contribute a test, the tests will be added.
- - -
Patches welcome!
- Sam Ruby