No useful email notifications for workflows
While it's possible to set up email notifications in Debusine today, we don't have it in a very useful way. Most of this was written before we added workflows; you can pass event reactions to debusine create-work-request
, but there's no way to configure them for a workflow (and to some extent not a very clear definition of what that would mean). It also relies on the administrator having set up a notification channel in advance; that's OK for use cases like "email this particular address about all failures", but less so for notifying people about the results of workflows they've asked Debusine to run.
Let's rethink this a bit, from the top down rather than from the bottom up. I can think of the following use cases:
- Users who start workflows should normally be told when they fail.
- Users who start workflows should normally be told when the workflow needs input from them in order to continue.
- Users who start workflows may ask to be told when they succeed.
Perhaps we can have a specialized kind of email notification channel that notifies the creator of the workflow? That would allow it to be attached by default more reasonably. We could create an instance of it by default.
Should WorkflowTemplate
have event reactions, and create_workflow
copy them? That would allow workflow templates to be set up with default event reactions, such as something like:
on_failure:
send-notification:
channel: email-creator
But it's a little hard to see how we could neatly silence that if somebody explicitly asks to not be told about failures. Alternatively, perhaps we could have some well-known notification channel names and rules for who may use them, and then it could be the client's responsibility to pick reasonable defaults. I'm not sure what's best here.
There's no event for "workflow needs input". Should we add one?